import{d as M,t as O,r as m,J as P,o as i,c as l,b as e,a as o,u as s,G as n,M as v,N as y,H as p,e as q,g as f,P as z}from"./index.DXvi0yH9.js";import{u as E}from"./settings-store.BEthvEFu.js";import{s as R}from"./pinia.D9yoqqEz.js";import{_ as $}from"./SectionArea.vue_vue_type_script_setup_true_lang.m2ot_k_n.js";const A={class:"stwlite-tw-max-w-7xl stwlite-tw-mx-auto stwlite-tw-px-4 sm:stwlite-tw-px-6 lg:stwlite-tw-px-8 stwlite-tw-pb-8 stwlite-tw-pt-0"},G={class:"stwlite-tw-flex stwlite-tw-gap-8"},I={class:"stwlite-tw-w-64 stwlite-tw-flex-shrink-0"},J={class:"stwlite-tw-bg-white stwlite-tw-rounded-lg stwlite-tw-shadow-sm stwlite-tw-border stwlite-tw-border-gray-200 stwlite-tw-overflow-hidden stwlite-tw-border-solid"},K={class:"stwlite-tw-p-4 stwlite-tw-bg-gray-50 stwlite-tw-border-0 stwlite-tw-border-b stwlite-tw-border-gray-200 stwlite-tw-border-solid"},Y={class:"stwlite-tw-font-medium stwlite-tw-text-gray-900 stwlite-tw-m-0"},Q={class:"stwlite-tw-p-2"},U=["onClick"],W=["innerHTML"],X={class:"stwlite-tw-align-middle stwlite-tw-text-sm"},Z={class:"stwlite-tw-flex-1"},tt={key:0},et={key:1,class:"stwlite-tw-space-y-8"},st={class:"stwlite-tw-capitalize stwlite-tw-text-xl stwlite-tw-font-semibold stwlite-tw-text-gray-900 stwlite-tw-mb-1 stwlite-tw-mt-0"},it=["disabled"],lt={key:0},wt={key:1},ct=M({__name:"ChildTabs",props:{parentData:{type:Object,required:!0},parentTab:{type:String,required:!0}},emits:["fieldData"],setup(x,{emit:k}){var b,g,h;const T=x,{parentData:S,parentTab:C}=O(T),D=E(),{isLoading:r,externalLinks:L,inputValues:_}=R(D),V=S,d=m(window.lodash.sortBy(V.value,w=>w.sort)),B=C,c=P("tab-child"),N=m((g=(b=Object.values(d.value))==null?void 0:b[0])!=null?g:""),u=m((h=c!=null?c:N.value.key)!=null?h:""),j=k,F=w=>{Object.entries(w).forEach(([a,t])=>{_.value[a]=t}),j("fieldData",_.value)},H=w=>{w in L.value||(z("tab-child",w),u.value=w)};return(w,a)=>(i(),l("div",A,[e("div",G,[e("div",I,[e("div",J,[e("div",K,[e("h3",Y,o(s(n)("settings",s(wp.i18n.__)("Settings","saveto-wishlist-lite-for-woocommerce"))),1)]),e("nav",Q,[(i(!0),l(v,null,y(d.value,t=>(i(),l("button",{key:t.key,onClick:ot=>H(t.key),class:p(["stwlite-tw-w-full stwlite-tw-flex stwlite-tw-items-center stwlite-tw-px-3 stwlite-tw-py-2 stwlite-tw-text-sm stwlite-tw-font-medium stwlite-tw-rounded-md stwlite-tw-transition-colors stwlite-tw-border-0 stwlite-tw-cursor-pointer stwlite-tw-align-middle",u.value===t.key?"stwlite-tw-bg-blue-50 stwlite-tw-text-blue-700 stwlite-tw-border-r-2 stwlite-tw-border-blue-700":"stwlite-tw-bg-transparent stwlite-tw-text-gray-700 hover:stwlite-tw-bg-gray-50"]),type:"button"},[e("span",{innerHTML:t.icon,class:"stwlite-tw-mr-3 stwlite-tw-align-middle"},null,8,W),e("span",X,o(t.label),1)],10,U))),128))])])]),e("div",Z,[(i(!0),l(v,null,y(d.value,t=>(i(),l("div",{key:t.key},[u.value===t.key?(i(),l("div",{key:0,class:p(t.key)},[(t==null?void 0:t.link)!=null?(i(),l("div",tt,[e("h3",null,o(s(n)("redirectLoading",s(wp.i18n.__)("You are redirecting to a page. Please wait...","saveto-wishlist-lite-for-woocommerce"))),1)])):(i(),l("div",et,[e("div",null,[e("h2",st,o(t.label),1)]),q($,{"parent-tab":s(B),"child-tab":t.key,"section-data":t.sections,onFieldData:F},null,8,["parent-tab","child-tab","section-data"]),a[0]||(a[0]=e("br",null,null,-1)),t.no_save!==!0?(i(),l("button",{key:0,type:"submit",class:p(["stwlite-tw-bg-blue-600 stwlite-tw-text-white stwlite-tw-px-4 stwlite-tw-py-2 stwlite-tw-rounded-md stwlite-tw-font-medium stwlite-tw-text-sm hover:stwlite-tw-bg-blue-700 stwlite-tw-transition-colors stwlite-tw-border-0 stwlite-tw-cursor-pointer stwlite-tw-mb-3",s(r)?"stwlite-tw-bg-gray-400 stwlite-tw-cursor-not-allowed hover:stwlite-tw-bg-gray-400":"stwlite-tw-bg-blue-600 hover:stwlite-tw-bg-blue-700"]),disabled:s(r)},[s(r)?(i(),l("span",lt,o(s(n)("saving",s(wp.i18n.__)("Saving...","saveto-wishlist-lite-for-woocommerce"))),1)):(i(),l("span",wt,o(s(n)("submitText",s(wp.i18n.__)("Save Changes","saveto-wishlist-lite-for-woocommerce"))),1))],10,it)):f("",!0)]))],2)):f("",!0)]))),128))])])]))}});export{ct as _};
