@billgangcom/theme-lib 1.37.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder/constants/block-icons.d.ts +2 -1
- package/dist/builder/store/index.d.ts +1 -0
- package/dist/builder/store/useModalStore.d.ts +6 -0
- package/dist/builder/ui/Modal/index.d.ts +1 -0
- package/dist/builder.cjs.js +5 -5
- package/dist/builder.es.js +1654 -1613
- package/dist/{index-BHI15yI7.cjs → index-q8zCWetF.cjs} +32 -32
- package/dist/{index-CncZkk5o.js → index-rUpOzmAy.js} +4876 -4864
- package/dist/ui/HeaderButtons/index.d.ts +15 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1257 -1149
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { Product } from '../../abstractions';
|
|
|
3
3
|
interface Props {
|
|
4
4
|
shopping: boolean;
|
|
5
5
|
signUp: boolean;
|
|
6
|
+
isShowUserInfo?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const HeaderButtons: React.FC<Props>;
|
|
8
9
|
export declare const ShoppingButton: React.FC;
|
|
@@ -18,6 +19,19 @@ interface ShoppingModalCartProps {
|
|
|
18
19
|
export declare const ShoppingModalCart: React.FC<ShoppingModalCartProps>;
|
|
19
20
|
export declare const EmptyCart: React.FC;
|
|
20
21
|
export declare const UserInfo: React.FC<{
|
|
21
|
-
|
|
22
|
+
signUp: boolean;
|
|
22
23
|
}>;
|
|
24
|
+
interface PagesMobileModalProps extends PagesMobileMenuProps {
|
|
25
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const PagesMobileModal: React.FC<React.PropsWithChildren<PagesMobileModalProps>>;
|
|
28
|
+
interface PagesMobileMenuProps {
|
|
29
|
+
logo: JSX.Element;
|
|
30
|
+
signUp: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const PagesMobileMenu: React.FC<React.PropsWithChildren<PagesMobileMenuProps>>;
|
|
33
|
+
interface BurgerMenuButtonProps {
|
|
34
|
+
setIsOpenModal: React.Dispatch<React.SetStateAction<boolean>>;
|
|
35
|
+
}
|
|
36
|
+
export declare const BurgerMenuButton: React.FC<BurgerMenuButtonProps>;
|
|
23
37
|
export {};
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BHI15yI7.cjs"),h=require("react");require("@phosphor-icons/react");const It="_wrapper_1ibay_2",kt="_alignmentBlock_1ibay_8",Nt="_title_1ibay_15",$t="_subtitle_1ibay_22",wt="_alignmentContent_1ibay_29",St="_alignments_1ibay_37",Ct="_alignment_1ibay_8",Bt="_circle_1ibay_60",Tt="_paddings_1ibay_67",Pt="_padding_1ibay_67",At="_active_1ibay_91",Ot="_input_1ibay_98",G={wrapper:It,alignmentBlock:kt,title:Nt,subtitle:$t,alignmentContent:wt,alignments:St,alignment:Ct,circle:Bt,paddings:Tt,padding:Pt,active:At,input:Ot},qt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Lt=["left","top","right","bottom"],Dt=l=>{const{alignment:r,padding:e,setPadding:s,setAlignment:o}=l;function i(j){switch(j){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function a(j){switch(j){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[u,n]=h.useState(null),[c,f]=h.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:G.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:G.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:G.alignments,children:qt.map(j=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{o(j)},className:G.alignment,onMouseEnter:()=>{n(j)},onMouseLeave:()=>{n(null)},children:[j!==r&&u!==j&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),j!==r&&u===j&&t.jsxRuntimeExports.jsx(t.Icon,{name:i(u),fill:"#c2c2c2",width:22,height:22}),j===r&&t.jsxRuntimeExports.jsx(t.Icon,{name:i(r),fill:"#FF3F19",width:22,height:22})]},j))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:Lt.map(j=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(G.padding,{[G.active]:c===j}),onFocus:()=>{f(j)},onBlur:()=>{f(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:a(j),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[j]),onChange:p=>s({...e,[j]:Number(p)}),paddingless:!0,borderless:!0})]},j))})]})]})]})},Mt="_title_1jkiw_1",Ht="_subtitle_1jkiw_5",zt="_header_1jkiw_12",Ft="_text_1jkiw_13",Vt="_top_1jkiw_20",Ut="_itemsBlock_1jkiw_29",rt={title:Mt,subtitle:Ht,header:zt,text:Ft,top:Vt,itemsBlock:Ut},Yt="_typeTexts_167ez_1",Gt="_block_167ez_8",Wt="_active_167ez_25",pt={typeTexts:Yt,block:Gt,active:Wt},Xt=["bold","italic","underline","strike-through","code"],_t=l=>{const{typesText:r,setTypesText:e}=l;function s(o){switch(o){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:pt.typeTexts,children:Xt.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(pt.block,{[pt.active]:r.includes(o)}),onClick:()=>{const i=[...r];if(i.includes(o)){const a=i.filter(u=>u!==o);e(a)}else i.push(o),e(i)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(o),fill:r.includes(o)?"#252525":"#757575",width:20,height:20})},String(o)))})},jt=l=>{const{typesText:r,isActiveText:e,setIsActiveText:s,text:o,setText:i,setTypesText:a,title:u,subtitle:n="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:rt.text,children:[(u||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:rt.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:rt.title,children:u}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:c=>s(c)})]}),t.jsxRuntimeExports.jsxs("div",{className:rt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:rt.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:c=>i(c),value:o,maxLength:150}),t.jsxRuntimeExports.jsx(_t,{typesText:r,setTypesText:a})]})]})},Jt="_title_v8pu8_1",Qt="_subtitle_v8pu8_5",Kt="_header_v8pu8_12",Zt="_text_v8pu8_13",te="_productsBlock_v8pu8_14",ee="_top_v8pu8_26",se="_itemsBlock_v8pu8_35",ne="_typeTexts_v8pu8_41",oe="_block_v8pu8_48",ie="_active_v8pu8_61",re="_products_v8pu8_14",ce="_product_v8pu8_14",ae="_button_v8pu8_80",le="_disabled_v8pu8_91",ue="_image_v8pu8_95",de="_info_v8pu8_102",xe="_name_v8pu8_114",me="_buttons_v8pu8_118",pe="_modal_v8pu8_125",he="_link_v8pu8_145",_e="_modalOptions_v8pu8_151",je="_addButton_v8pu8_164",ge="_deleteButton_v8pu8_179",fe="_closeIcon_v8pu8_191",D={title:Jt,subtitle:Qt,header:Kt,text:Zt,productsBlock:te,top:ee,itemsBlock:se,typeTexts:ne,block:oe,active:ie,products:re,product:ce,button:ae,disabled:le,image:ue,info:de,name:xe,buttons:me,modal:pe,link:he,modalOptions:_e,addButton:je,deleteButton:ge,closeIcon:fe},ve=h.forwardRef((l,r)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:i,setIsOpenModal:a}=l;function u(n,c){return n.length>c?`${n.slice(0,c)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:r,className:D.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:D.top,children:[t.jsxRuntimeExports.jsx("h3",{className:D.title,children:u(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:D.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{s(null),a(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:D.modalOptions,children:i.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:c=>{const f={...e,[n.field]:c};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:c=>{const f={...e,[n.field.type]:c};s(f)},text:e[n.field.text]||"",setText:c=>{const f={...e,[n.field.text]:c};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const f={...e,[n.field]:c};s(f)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:D.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const f={...e,[n.field.text]:c};s(f)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:c=>{const f={...e,[n.field.switch]:c};s(f)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(gt,{items:e[n.field]||[],setItems:c=>{const f={...e,[n.field]:c};s(f)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:!1,subtitle:n.label,addableOptions:n.addableOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:c=>{const f={...e,[n.field]:c};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),be="_other_g74jx_1",Ee="_subtitle_g74jx_7",Re="_items_g74jx_14",ht={other:be,subtitle:Ee,items:Re},xt=l=>{const{items:r,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:ht.other,children:[t.jsxRuntimeExports.jsx("h5",{className:ht.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:ht.items,children:r.map((s,o)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:i=>s.setIsItem(i),label:s.label,hasBackground:!0,paddingless:!1},o))})]})};function ye({product:l,children:r}){const{attributes:e,listeners:s,setNodeRef:o,transform:i,transition:a,isDragging:u}=t.useSortable({id:l.id}),n={transform:t.CSS.Transform.toString(i),transition:a};return t.jsxRuntimeExports.jsx("div",{ref:o,style:n,className:`${D.product} ${u?D.dragging:""}`,...e,...s,children:r})}const gt=l=>{const{isActiveItems:r,setIsActiveItems:e,items:s,setItems:o,other:i,title:a,subtitle:u,editable:n=!0,draggable:c=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsPlaceholder:_="",itemsOptions:d,hasRangeSelector:k=!1,rangeSelectorOptions:P,modalOptions:E,addableOptions:q={},limit:$,autoScrollInterval:w}=l,[g,O]=h.useState(null),[Y,J]=h.useState({top:0,left:0}),[b,y]=h.useState(null),A=h.useRef(null),[U,B]=h.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const x=()=>{O(null),B(!1)};return document.body.addEventListener("click",x),O(null),B(!1),()=>{O(null),B(!1),document.body.removeEventListener("click",x)}},[]),h.useEffect(()=>{if(g){const x=[...s].map(R=>R.id===g.id?g:R);o(x)}},[g]),h.useEffect(()=>{if(A.current&&b){const x=A.current.getBoundingClientRect().height,R=window.innerHeight;let S=b.top;S+x>R+window.scrollY-200&&(S=R+window.scrollY-x-200),S<0&&(S=10),J({top:S,left:b.left})}},[A.current,b]);const X=(x,R)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();y({top:S.top+window.scrollY,left:S.left-30}),O(R),B(!0)};function st(x){if(f)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const v=x=>{const{active:R,over:S}=x;if(S&&R.id!==S.id){const L=s.findIndex(C=>C.id===R.id),F=s.findIndex(C=>C.id===S.id);if(L!==-1&&F!==-1){const C=[...s],[nt]=C.splice(L,1);C.splice(F,0,nt),o(C)}}},T=(x,R)=>{var L,F;const S=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[c&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&d&&t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const nt=[...s],it=d.find(lt=>lt.name===C);if(!it)return;const ot=nt.map(lt=>lt.id===x.id?{...it,name:C}:lt);O({...x,name:C}),o([...ot])},value:x.name,options:d.filter(C=>!s.find(nt=>nt.name===C.name)).map(C=>C.name),leftAddon:st(x.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:C=>{const it=[...s].map(ot=>ot.id===x.id?{...x,name:C}:ot);o([...it])},value:x.name,placeholder:_}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:C=>{const it=[...s].map(ot=>ot.id===x.id?{...x,images:C}:ot);o([...it])},activeImage:(L=s.find(C=>C.id===x.id))!=null&&L.images?(F=s.find(C=>C.id===x.id))==null?void 0:F.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:D.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:C=>X(C,x)})}),j&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(C=>C.id!==x.id))})})]})]});return c?t.jsxRuntimeExports.jsx(ye,{product:x,index:R,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:D.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:D.productsBlock,children:[(a||r!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:D.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:D.title,children:a}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:x=>e==null?void 0:e(x)})]}),g&&n&&E&&U&&t.jsxRuntimeExports.jsx(ve,{ref:A,activeItem:g,setActiveItem:O,popupPosition:Y,modalOptions:E,setIsOpenModal:B}),k&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:D.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:D.subtitle,children:u}),c?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:v,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,R)=>T(x,R))})}):s.map((x,R)=>T(x,R)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(D.button,{[D.disabled]:!!($&&$<=s.length||s.length===(d==null?void 0:d.length))}),size:"s",disabled:!!($&&$<=s.length||s.length===(d==null?void 0:d.length)),onClick:()=>{const x=[...s];let R=null;if(d){for(let S=0;S<d.length;S++)if(!s.find(L=>L.id===d[S].id)){R=d[S];break}}m==="select"&&d?x.push({name:R?R.name:d[0].name,id:(R==null?void 0:R.id)||d[0].id,...q}):m==="input"?x.push({name:"",id:t.v4(),...q}):x.push({name:`Image ${s.length+1}`,id:t.v4(),...q}),o(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:D.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),i!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:i}),w!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(w.scrollInterval),onChange:x=>w.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Ie="_title_82zux_1",ke="_subtitle_82zux_5",Ne="_header_82zux_12",$e="_text_82zux_13",we="_productsBlock_82zux_14",Se="_top_82zux_26",Ce="_itemsBlock_82zux_35",Be="_typeTexts_82zux_41",Te="_block_82zux_48",Pe="_active_82zux_61",Ae="_products_82zux_14",Oe="_product_82zux_14",qe="_button_82zux_80",Le="_disabled_82zux_91",De="_image_82zux_95",Me="_info_82zux_102",He="_name_82zux_114",ze="_buttons_82zux_118",Fe="_modal_82zux_125",Ve="_link_82zux_145",Ue="_modalOptions_82zux_151",Ye="_addButton_82zux_157",Ge="_deleteButton_82zux_179",W={title:Ie,subtitle:ke,header:Ne,text:$e,productsBlock:we,top:Se,itemsBlock:Ce,typeTexts:Be,block:Te,active:Pe,products:Ae,product:Oe,button:qe,disabled:Le,image:De,info:Me,name:He,buttons:ze,modal:Fe,link:Ve,modalOptions:Ue,addButton:Ye,deleteButton:Ge},We=l=>{const{isActiveItems:r,setIsActiveItems:e,items:s,setItems:o,other:i,title:a,subtitle:u,draggable:n=!1,withImage:c=!1,addable:f=!0,itemsOptions:j,hasRangeSelector:p=!1,rangeSelectorOptions:m,limit:_,autoScrollInterval:d}=l;function k(E){if(c)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=E=>{const q=j.find(w=>w.id===E);if(!q)return;const $=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:w=>{const g=[...s],O=j.find(b=>b.name===w);if(!O)return;const Y=O.id,J=g.map(b=>b===E?Y:b);o([...J])},value:q.name,options:j.filter(w=>!s.find(g=>g===w.id)).map(w=>w.name),leftAddon:k(q.images)}),t.jsxRuntimeExports.jsx("div",{className:W.buttons,children:t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(w=>w!==E))})})})]});return t.jsxRuntimeExports.jsx("div",{className:W.product,children:$},E)};return t.jsxRuntimeExports.jsxs("div",{className:W.productsBlock,children:[(a||r!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:a}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:E=>e==null?void 0:e(E)})]}),p&&m&&t.jsxRuntimeExports.jsx(mt,{...m}),t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:u}),s.map(E=>P(E)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(W.button,{[W.disabled]:!!(_&&_<=s.length||s.length===j.length)}),size:"s",disabled:!!(_&&_<=s.length||s.length===j.length),onClick:()=>{const E=[...s];let q=null;if(j){for(let $=0;$<j.length;$++)if(!s.find(w=>w===j[$].id)){q=j[$];break}}E.push((q==null?void 0:q.id)||j[0].id),o(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),i!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:i}),d!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(d.scrollInterval),onChange:E=>d.setScrollInterval(Number(E)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Xe="_title_1lgwl_1",Je="_subtitle_1lgwl_5",Qe="_header_1lgwl_12",Ke="_text_1lgwl_13",Ze="_productsBlock_1lgwl_14",ts="_top_1lgwl_26",es="_itemsBlock_1lgwl_35",ss="_typeTexts_1lgwl_41",ns="_block_1lgwl_48",os="_active_1lgwl_61",is="_products_1lgwl_14",rs="_product_1lgwl_14",cs="_button_1lgwl_80",as="_disabled_1lgwl_91",ls="_image_1lgwl_95",us="_info_1lgwl_102",ds="_name_1lgwl_114",xs="_buttons_1lgwl_118",ms="_modal_1lgwl_125",ps="_link_1lgwl_146",hs="_modalOptions_1lgwl_152",_s="_addButton_1lgwl_164",js="_deleteButton_1lgwl_179",gs="_closeIcon_1lgwl_191",H={title:Xe,subtitle:Je,header:Qe,text:Ke,productsBlock:Ze,top:ts,itemsBlock:es,typeTexts:ss,block:ns,active:os,products:is,product:rs,button:cs,disabled:as,image:ls,info:us,name:ds,buttons:xs,modal:ms,link:ps,modalOptions:hs,addButton:_s,deleteButton:js,closeIcon:gs},fs=h.forwardRef((l,r)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:i,setIsOpenModal:a}=l;function u(n,c){return n.length>c?`${n.slice(0,c)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:r,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:u(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),a(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:i.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:c=>{const f={...e,[n.field]:c};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:c=>{const f={...e,[n.field.type]:c};s(f)},text:e[n.field.text]||"",setText:c=>{const f={...e,[n.field.text]:c};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const f={...e,[n.field]:c};s(f)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const f={...e,[n.field.text]:c};s(f)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:c=>{const f={...e,[n.field.switch]:c};s(f)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:c=>{const f={...e,[n.field]:c};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})});function vs(l){const{product:r,children:e}=l,{attributes:s,listeners:o,setNodeRef:i,transform:a,transition:u,isDragging:n}=t.useSortable({id:r.id}),c={transform:t.CSS.Transform.toString(a),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:i,style:c,className:`${H.product} ${n?H.dragging:""}`,...s,...o,children:e})}const bs=l=>{const{isActiveItems:r,setIsActiveItems:e,items:s,setItems:o,other:i,title:a,subtitle:u,editable:n=!0,draggable:c=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsPlaceholder:_="",itemsOptions:d,hasRangeSelector:k=!1,rangeSelectorOptions:P,modalOptions:E,addableOptions:q={}}=l,[$,w]=h.useState(null),[g,O]=h.useState({top:0,left:0}),[Y,J]=h.useState(null),b=h.useRef(null),[y,A]=h.useState(!1),U=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const v=()=>{w(null),A(!1)};return document.body.addEventListener("click",v),w(null),A(!1),()=>{w(null),A(!1),document.body.removeEventListener("click",v)}},[]),h.useEffect(()=>{if($){const v=[...s].map(T=>T.id===$.id?$:T);o(v)}},[$]),h.useEffect(()=>{if(b.current&&Y){const v=b.current.getBoundingClientRect().height,T=window.innerHeight;let x=Y.top;x+v>T+window.scrollY-200&&(x=T+window.scrollY-v-200),x<0&&(x=10),O({top:x,left:Y.left})}},[b.current,Y]);const B=(v,T)=>{v.stopPropagation();const x=v.target.getBoundingClientRect();J({top:x.top+window.scrollY,left:x.left-30}),w(T),A(!0)};function M(v){if(f)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=v=>{const{active:T,over:x}=v;if(x&&T.id!==x.id){const R=s.findIndex(L=>L.id===T.id),S=s.findIndex(L=>L.id===x.id);if(R!==-1&&S!==-1){const L=[...s],[F]=L.splice(R,1);L.splice(S,0,F),o(L)}}},st=v=>{var x;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[c&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&d&&t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const L=[...s].map(F=>F.id===v.id?{...v,name:R}:F);w({...v,name:R}),o([...L])},value:v.name,options:d.filter(R=>!s.find(S=>S.name===R)),leftAddon:M(v.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>{const L=[...s].map(F=>F.id===v.id?{...v,name:R}:F);o([...L])},value:v.name,placeholder:_}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:R=>{const L=[...s].map(F=>F.id===v.id?{...v,images:R}:F);o([...L])},activeImage:(x=s.find(R=>R.id===v.id))==null?void 0:x.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>B(R,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(R=>R.id!==v.id))})})]})]});return c?t.jsxRuntimeExports.jsx(vs,{product:v,children:T},v.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:T},v.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(a||r!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:a}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:v=>e==null?void 0:e(v)})]}),$&&n&&E&&y&&t.jsxRuntimeExports.jsx(fs,{ref:b,activeItem:$,setActiveItem:w,popupPosition:g,modalOptions:E,setIsOpenModal:A}),k&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:u}),c?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:U,onDragEnd:X,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>v.id),strategy:t.verticalListSortingStrategy,children:s.map(v=>st(v))})}):s.map(v=>st(v)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:H.button,size:"s",onClick:()=>{const v=[...s];let T=null;if(d){for(let x=0;x<d.length;x++)if(!s.find(R=>R.name===d[x])){T=d[x];break}}m==="select"&&d?v.push({name:T||d[0],id:t.v4(),...q,maxSymbols:100}):m==="input"?v.push({name:"",id:t.v4(),...q,maxSymbols:100}):v.push({name:`Image ${s.length+1}`,id:t.v4(),...q,maxSymbols:100}),o(v)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),i!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:i})]})},Es="_title_bn7sv_1",Rs="_subtitle_bn7sv_5",ys="_header_bn7sv_12",Is="_text_bn7sv_13",ks="_productsBlock_bn7sv_14",Ns="_buttonsBlock_bn7sv_15",$s="_top_bn7sv_26",ws="_itemsBlock_bn7sv_35",Ss="_typeTexts_bn7sv_41",Cs="_block_bn7sv_48",Bs="_active_bn7sv_60",Ts="_products_bn7sv_14",Ps="_product_bn7sv_14",As="_button_bn7sv_15",Os="_image_bn7sv_90",qs="_info_bn7sv_97",Ls="_name_bn7sv_109",Ds="_buttons_bn7sv_15",Ms="_modal_bn7sv_120",Hs="_other_bn7sv_139",zs="_options_bn7sv_145",Fs="_closeIcon_bn7sv_153",et={title:Es,subtitle:Rs,header:ys,text:Is,productsBlock:ks,buttonsBlock:Ns,top:$s,itemsBlock:ws,typeTexts:Ss,block:Cs,active:Bs,products:Ts,product:Ps,button:As,image:Os,info:qs,name:Ls,buttons:Ds,modal:Ms,other:Hs,options:zs,closeIcon:Fs},Vs=h.forwardRef((l,r)=>{const{activeButton:e,setActiveButton:s,popupPosition:o}=l,[i,a]=h.useState(e.typesText),[u,n]=h.useState(e.destination),[c,f]=h.useState(e.page),[j,p]=h.useState(e.link||""),[m,_]=h.useState(e.text||""),[d,k]=h.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:m,link:j,destination:u,typesText:i,page:c,openInNewTab:d}})},[i,u,j,m,c,d]),t.jsxRuntimeExports.jsxs("div",{className:et.modal,onClick:E=>{E.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},ref:r,children:[t.jsxRuntimeExports.jsxs("div",{className:et.top,children:[t.jsxRuntimeExports.jsx("h3",{className:et.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:et.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:et.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:E=>n(E),options:["Go to Page","Open Link"].filter(E=>E!==u),value:u}),u==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:E=>f(E),options:P?Object.values(P).filter(E=>E.name!==c).map(E=>E.name):[],value:c}):t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>p(E),value:j,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:E=>k(E)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:E=>_(E),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(_t,{typesText:i,setTypesText:a})]})]})}),Us="_subtitle_jql1y_1",Ys="_header_jql1y_8",Gs="_text_jql1y_9",Ws="_productsBlock_jql1y_10",Xs="_buttonsBlock_jql1y_11",Js="_top_jql1y_23",Qs="_itemsBlock_jql1y_32",Ks="_typeTexts_jql1y_38",Zs="_block_jql1y_45",tn="_active_jql1y_58",en="_products_jql1y_10",sn="_product_jql1y_10",nn="_button_jql1y_11",on="_image_jql1y_88",rn="_info_jql1y_95",cn="_name_jql1y_107",an="_buttons_jql1y_11",ln="_modal_jql1y_118",un="_other_jql1y_138",dn="_options_jql1y_144",xn="_addButton_jql1y_150",mn="_deleteButton_jql1y_165",K={subtitle:Us,header:Ys,text:Gs,productsBlock:Ws,buttonsBlock:Xs,top:Js,itemsBlock:Qs,typeTexts:Ks,block:Zs,active:tn,products:en,product:sn,button:nn,image:on,info:rn,name:cn,buttons:an,modal:ln,other:un,options:dn,addButton:xn,deleteButton:mn},ft=l=>{const{buttons:r,setButtons:e,deletable:s=!0,addable:o=!0}=l,[i,a]=h.useState(null),[u,n]=h.useState({top:0,left:0}),[c,f]=h.useState(null),j=h.useRef(null);h.useEffect(()=>{const m=()=>{a(null)};return document.body.addEventListener("click",m),a(null),()=>{a(null),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(i){const m=[...r].map(_=>_.id===i.id?i:_);e(m)}},[i]),h.useEffect(()=>{if(j.current&&c){const m=j.current.getBoundingClientRect().height,_=window.innerHeight;let d=c.top;d+m>_+window.scrollY-200&&(d=_+window.scrollY-m-200),d<0&&(d=10),n({top:d,left:c.left})}},[j.current,c]);const p=(m,_)=>{m.stopPropagation();const d=m.target.getBoundingClientRect();f({top:d.top+window.scrollY,left:d.left-30}),a(_)};return t.jsxRuntimeExports.jsxs("div",{className:K.products,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:"Button Type"}),r.map(m=>t.jsxRuntimeExports.jsxs("div",{className:K.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:_=>{const k=[...r].map(P=>P.id===m.id?{...m,type:_}:P);e(k)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:K.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:_=>{p(_,m)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const _=r.filter(d=>d.id!==m.id);e(_)},width:20,height:20,fill:"#C12A2A"})})]})]},m.id)),i&&t.jsxRuntimeExports.jsx(Vs,{ref:j,activeButton:i,setActiveButton:a,popupPosition:u}),o&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:K.button,size:"s",onClick:()=>{const m=[...r];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:K.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},pn=l=>{const{isActiveButtons:r,setIsActiveButtons:e,buttons:s,setButtons:o}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:et.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:et.top,children:[t.jsxRuntimeExports.jsx("h3",{className:et.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:i=>e(i)})]}),t.jsxRuntimeExports.jsx(ft,{buttons:s,setButtons:o})]})})},hn="_wrapper_m18qi_1",_n="_subtitle_m18qi_7",jn="_content_m18qi_14",gn="_range_m18qi_22",fn="_track_m18qi_27",vn="_progress_m18qi_36",bn="_dots_m18qi_46",En="_dot_m18qi_46",Rn="_active_m18qi_65",yn="_input_m18qi_77",In="_countBlock_m18qi_91",kn="_count_m18qi_91",Nn="_controls_m18qi_107",$n="_button_m18qi_113",V={wrapper:hn,subtitle:_n,content:jn,range:gn,track:fn,progress:vn,dots:bn,dot:En,active:Rn,input:yn,countBlock:In,count:kn,controls:Nn,button:$n},mt=l=>{const{label:r,min:e=1,max:s=4,step:o=1,count:i,setCount:a}=l,[u,n]=h.useState(!1),c=Array.from({length:(s-e)/o+1}),f=(i-e)/(s-e)*100,j=()=>{i<s&&a(i+o)},p=()=>{i>e&&a(i-o)},m=_=>{const d=e+_*o;a(d)};return t.jsxRuntimeExports.jsxs("div",{className:V.wrapper,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:r}),t.jsxRuntimeExports.jsxs("div",{className:V.content,children:[t.jsxRuntimeExports.jsxs("div",{className:V.range,children:[t.jsxRuntimeExports.jsx("div",{className:V.track}),t.jsxRuntimeExports.jsx("div",{className:V.progress,style:{width:`${f}%`}}),t.jsxRuntimeExports.jsx("div",{className:V.dots,children:c.map((_,d)=>{const k=d<=(i-e)/o;return t.jsxRuntimeExports.jsx("button",{onClick:()=>m(d),className:t.clx(V.dot,{[V.active]:k,[V.inactive]:!k,[V.dragging]:u}),"aria-label":`Set value to ${e+d*o}`},d)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:o,value:i,onChange:_=>a(Number(_.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:V.input})]}),t.jsxRuntimeExports.jsxs("div",{className:V.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:_=>{const d=Number(_);d>s?a(s):d<e?a(e):a(d)},value:String(i)}),t.jsxRuntimeExports.jsxs("div",{className:V.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:j,disabled:i>=s,className:V.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:p,disabled:i<=e,className:V.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},wn="_title_12elg_1",Sn="_subtitle_12elg_5",Cn="_header_12elg_12",Bn="_text_12elg_13",Tn="_productsBlock_12elg_14",Pn="_top_12elg_26",An="_itemsBlock_12elg_35",On="_typeTexts_12elg_41",qn="_block_12elg_48",Ln="_active_12elg_61",Dn="_products_12elg_14",Mn="_product_12elg_14",Hn="_button_12elg_80",zn="_image_12elg_91",Fn="_info_12elg_98",Vn="_name_12elg_110",Un="_buttons_12elg_114",Yn="_modal_12elg_121",Gn="_link_12elg_141",Wn="_modalOptions_12elg_147",Xn="_addButton_12elg_159",Jn="_deleteButton_12elg_174",Qn="_closeIcon_12elg_186",z={title:wn,subtitle:Sn,header:Cn,text:Bn,productsBlock:Tn,top:Pn,itemsBlock:An,typeTexts:On,block:qn,active:Ln,products:Dn,product:Mn,button:Hn,image:zn,info:Fn,name:Vn,buttons:Un,modal:Yn,link:Gn,modalOptions:Wn,addButton:Xn,deleteButton:Jn,closeIcon:Qn},Kn=l=>{const{activeItem:r,setActiveItem:e,popupPosition:s,setIsOpenModal:o,itemsOptions:i}=l,a=i.find(n=>n.id===r.listingId);if(!a)return null;function u(n,c){return n.length>c?`${n.slice(0,c)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:z.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[t.jsxRuntimeExports.jsx("h3",{children:u(a.productData.name,20)}),t.jsxRuntimeExports.jsx("div",{className:z.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{o(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:z.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:a.productData.images.length>0?a.productData.images[0].cfId:void 0,onChange:n=>{const c={...r,image:n[0]};e(c)}})})]})};function Zn(l){const{product:r,children:e}=l,{attributes:s,listeners:o,setNodeRef:i,transform:a,transition:u,isDragging:n}=t.useSortable({id:String(r.listingId)}),c={transform:t.CSS.Transform.toString(a),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:i,style:c,className:`${z.product} ${n?z.dragging:""}`,...s,...o,children:e})}const to=l=>{const{isActiveItems:r,setIsActiveItems:e,items:s,setItems:o,other:i,title:a,subtitle:u,editable:n=!0,draggable:c=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsOptions:_}=l,[d,k]=h.useState(null),[P,E]=h.useState({top:0,left:0}),[q,$]=h.useState(!1),w=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const b=()=>{k(null),$(!1)};return document.body.addEventListener("click",b),k(null),$(!1),()=>{k(null),$(!1),document.body.removeEventListener("click",b)}},[]),h.useEffect(()=>{if(d){const b=[...s].map(y=>y.listingId===d.listingId?d:y);o(b)}},[d]);const g=(b,y)=>{b.stopPropagation();const A=b.target.getBoundingClientRect(),U=100,B=window.innerHeight;let M=A.top+window.scrollY;M+U>B&&(M=B-U-20),$(!0),E({top:M-80,left:A.left-30}),k(y)};function O(b){if(f)return b?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${b}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=b=>{const{active:y,over:A}=b;if(A&&y.id!==A.id){const U=s.findIndex(M=>String(M.listingId)===y.id),B=s.findIndex(M=>String(M.listingId)===A.id);if(U!==-1&&B!==-1){const M=[...s],[X]=M.splice(U,1);M.splice(B,0,X),o(M)}}},J=(b,y)=>{const A=_.find(B=>b.listingId===B.id);if(!A)return null;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[c&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const M=[...s],X=_.find(T=>T.productData.name===B);if(!X)return;const st={listingId:X.id,image:X.productData.images.length>0?X.productData.images[0].cfId:""},v=M.map(T=>T.listingId===b.listingId?st:T);k(st),o([...v])},value:A.productData.name,options:[..._.filter(B=>!s.find(M=>M.listingId===B.id)).map(B=>B.productData.name)],leftAddon:O(b.image||A.productData.images.length>0&&A.productData.images[0].cfId||"")},y),t.jsxRuntimeExports.jsxs("div",{className:z.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>g(B,b)})}),j&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(B=>B!==b))})})]})]});return c?t.jsxRuntimeExports.jsx(Zn,{product:b,children:U},b.listingId):t.jsxRuntimeExports.jsx("div",{className:z.product,children:U},b.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:z.productsBlock,children:[(a||r!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:z.title,children:a}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:b=>e==null?void 0:e(b)})]}),q&&d&&t.jsxRuntimeExports.jsx(Kn,{activeItem:d,setActiveItem:k,setIsOpenModal:$,popupPosition:P,itemsOptions:_}),t.jsxRuntimeExports.jsxs("div",{className:z.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:u}),c?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:w,onDragEnd:Y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>String(b.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((b,y)=>J(b,y))})}):s.map((b,y)=>J(b,y)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:z.button,size:"s",onClick:()=>{const b=[...s];for(let y=0;y<_.length;y++)if(!s.find(A=>A.listingId===_[y].id)){b.push({listingId:_[y].id,image:_[y].productData.images.length>0?_[y].productData.images[0].cfId:""});break}o(b)},disabled:s.length===_.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:z.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),i!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:i})]})},eo="_options_d1lk6_1",so="_price_d1lk6_12",no="_oldPrice_d1lk6_19",oo="_newPrice_d1lk6_27",io="_animate_d1lk6_34",ro="_appearAndBounce_d1lk6_1",co="_meta_d1lk6_52",ao="_info_d1lk6_58",lo="_infoRight_d1lk6_66",uo="_buttons_d1lk6_73",xo="_variants_d1lk6_80",mo="_variant_d1lk6_80",po="_stock_d1lk6_98",ho="_variantInfo_d1lk6_105",_o="_quantity_d1lk6_111",jo="_count_d1lk6_118",go="_focused_d1lk6_135",fo="_button_d1lk6_73",vo="_activeVariant_d1lk6_161",bo="_chargeTypes_d1lk6_165",Eo="_charge_d1lk6_165",Ro="_chargeActive_d1lk6_190",yo="_title_d1lk6_198",I={options:eo,price:so,oldPrice:no,newPrice:oo,animate:io,appearAndBounce:ro,meta:co,info:ao,infoRight:lo,buttons:uo,variants:xo,variant:mo,stock:po,variantInfo:ho,quantity:_o,count:jo,focused:go,button:fo,activeVariant:vo,chargeTypes:bo,charge:Eo,chargeActive:Ro,title:yo};var vt=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(vt||{});const Io=l=>{var $,w;const{variants:r}=l,[e,s]=h.useState(r[0]),[o,i]=h.useState(e.chargeTypes[0]),a=t.useNavigate(),[u,n]=h.useState(1),[c,f]=h.useState(!1),{reset:j,addProductToCart:p,getProducts:m}=t.useCart(),[_,d]=h.useState(!1);h.useEffect(()=>{d(!0);const g=setTimeout(()=>d(!1),600);return()=>clearTimeout(g)},[u]);async function k(){await m(),await p({productId:l.id,productVariantId:e.id,quantity:u})}function P(){j(),k(),a("/checkout")}function E(g){if(g>=864e5){const y=Math.floor(g/864e5);return`${y} ${y===1?"day":"days"}`}else if(g>=36e5){const y=Math.floor(g/36e5);return`${y} ${y===1?"hour":"hours"}`}else if(g>=6e4){const y=Math.floor(g/6e4);return`${y} ${y===1?"minute":"minutes"}`}else{const y=Math.floor(g/1e3);return`${y} ${y===1?"second":"seconds"}`}}function q(g,O){return g.length>O?g.slice(0,O)+"...":g}return t.jsxRuntimeExports.jsxs("div",{className:I.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:I.chargeTypes,children:e.chargeTypes.map(g=>t.jsxRuntimeExports.jsx("div",{className:t.clx(I.charge,{[I.chargeActive]:o===g}),onClick:()=>i(g),children:vt[g]},g))}),t.jsxRuntimeExports.jsx("div",{className:I.variants,children:r.map(g=>{var O;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(I.variant,{[I.activeVariant]:e.id===g.id}),onClick:()=>s(g),children:[t.jsxRuntimeExports.jsxs("div",{className:I.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:I.title,children:q(g.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?g.price.amount:g.subscriptionSettings?g.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:I.stock,children:[((O=g.quantity.restrictions)==null?void 0:O.max)||g.quantity.available||0," in stock"]})})]},g.id)})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:I.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{u>1?n(g=>g-1):n(1)},className:I.button,disabled:e.quantity.restrictions&&u<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(I.count,{[I.focused]:c}),onFocus:()=>f(!0),onBlur:()=>f(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(u),onChange:g=>n(Number(g)),max:(($=e.quantity.restrictions)==null?void 0:$.max)||e.quantity.available||1/0,min:((w=e.quantity.restrictions)==null?void 0:w.min)||0,style:{backgroundColor:"transparent",border:"none",textAlign:"center"}})}),t.jsxRuntimeExports.jsx("button",{onClick:()=>{n(g=>g+1)},className:I.button,disabled:!!(e.quantity.restrictions&&u>=e.quantity.restrictions.max||e.quantity.available&&u>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:I.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:I.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":E(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:I.infoRight,children:o==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:_}),children:["$ ",(e.price.amount||0)*u]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*u]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:_}),children:["$ ",(e.price.amount||0)*u]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>P(),children:t.jsxRuntimeExports.jsx("span",{children:o==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>k(),children:"Add to Cart"})]})]})},ko="_button_oyh2y_1",No="_login_oyh2y_14",$o="_signUp_oyh2y_18",wo="_buttons_oyh2y_23",So="_modal_oyh2y_32",Co="_closing_oyh2y_61",Bo="_info_oyh2y_85",To="_top_oyh2y_92",Po="_title_oyh2y_103",Ao="_clear_oyh2y_110",Oo="_activeClear_oyh2y_117",qo="_count_oyh2y_121",Lo="_cart_oyh2y_136",Do="_empty_oyh2y_144",Mo="_product_oyh2y_170",Ho="_products_oyh2y_179",zo="_image_oyh2y_187",Fo="_productInfo_oyh2y_193",Vo="_content_oyh2y_200",Uo="_name_oyh2y_206",Yo="_price_oyh2y_212",Go="_productButtons_oyh2y_218",Wo="_productButton_oyh2y_218",Xo="_productCount_oyh2y_238",Jo="_bottom_oyh2y_254",Qo="_subtotal_oyh2y_262",Ko="_block_oyh2y_270",Zo="_shoppingCount_oyh2y_277",ti="_total_oyh2y_297",ei="_link_oyh2y_303",si="_userInfo_oyh2y_310",N={button:ko,login:No,signUp:$o,buttons:wo,modal:So,"slide-in-fade":"_slide-in-fade_oyh2y_1",closing:Co,"slide-out-fade":"_slide-out-fade_oyh2y_1",info:Bo,top:To,title:Po,clear:Ao,activeClear:Oo,count:qo,cart:Lo,empty:Do,product:Mo,products:Ho,image:zo,productInfo:Fo,content:Vo,name:Uo,price:Yo,productButtons:Go,productButton:Wo,productCount:Xo,bottom:Jo,subtotal:Qo,block:Ko,shoppingCount:Zo,total:ti,link:ei,userInfo:si},ni="_button_85085_1",oi="_primary_85085_20",ii="_primaryHovered_85085_30",ri="_secondary_85085_34",ci="_secondaryHovered_85085_44",ai="_tertiary_85085_48",li="_tertiaryHovered_85085_58",ui="_content_85085_62",Z={button:ni,primary:oi,primaryHovered:ii,secondary:ri,secondaryHovered:ci,tertiary:ai,tertiaryHovered:li,content:ui},dt=l=>{const{children:r,onClick:e,style:s,className:o,disabled:i=!1,type:a="Primary"}=l,{themeSettings:u}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(Z.button,o,{[Z.primary]:a==="Primary",[Z.secondary]:a==="Secondary",[Z.tertiary]:a==="Tertiary",[Z.primaryHovered]:a==="Primary"&&!i&&u.buttons.primary.hover,[Z.secondaryHovered]:a==="Secondary"&&!i&&u.buttons.secondary.hover,[Z.tertiaryHovered]:a==="Tertiary"&&!i&&u.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:i,children:a==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:Z.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),r]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:r})})};class at extends Error{}at.prototype.name="InvalidTokenError";function di(l){return decodeURIComponent(atob(l).replace(/(.)/g,(r,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function xi(l){let r=l.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return di(r)}catch{return atob(r)}}function mi(l,r){if(typeof l!="string")throw new at("Invalid token specified: must be a string");r||(r={});const e=r.header===!0?0:1,s=l.split(".")[e];if(typeof s!="string")throw new at(`Invalid token specified: missing part #${e+1}`);let o;try{o=xi(s)}catch(i){throw new at(`Invalid token specified: invalid base64 for part #${e+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new at(`Invalid token specified: invalid json for part #${e+1} (${i.message})`)}}const pi=l=>{const{shopping:r,signUp:e}=l,s=t.useNavigate();function o(a){s(a)}const i=JSON.parse(localStorage.getItem("token")||"{}");return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[r&&t.jsxRuntimeExports.jsx(bt,{}),!i.data&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>o("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),!i.data&&e&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>o("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"}),i.data&&t.jsxRuntimeExports.jsx(yt,{token:i.data})]})},bt=()=>{const[l,r]=h.useState(!1),[e,s]=h.useState([]),{cart:o,getProducts:i}=t.useCart();function a(p){for(let m=0;m<o.parts.length;m++)for(let _=0;_<p.variants.length;_++)if(o.parts[m].productVariantId===p.variants[m].id)return o.parts[m].productVariantId}function u(p){for(let m=0;m<o.parts.length;m++)for(let _=0;_<p.variants.length;_++)if(o.parts[m].productVariantId===p.variants[m].id)return o.parts[m].quantity}h.useEffect(()=>{(async()=>{const m=o.parts.map(k=>String(k.productId)),d=(await i([...m])).map(k=>({...k,activeVariantId:a(k),quantity:u(k)}));s(d)})()},[o.parts.length]);function n(p){var m;return!p||!(p!=null&&p.variants)?!1:(m=p.variants.find(_=>_.id===p.activeVariantId))==null?void 0:m.subscriptionSettings}const c=o.parts.length>0&&e.length>0&&!n(e[0]),[f,j]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:N.button,onClick:p=>{p.stopPropagation(),r(!0),j(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),c&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:o.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{j(!1),setTimeout(()=>{r(!1)},300)},children:t.jsxRuntimeExports.jsx(Et,{activeProducts:e,isCartNotEmpty:c,isOpen:f})})]})},Et=l=>{const{activeProducts:r,isCartNotEmpty:e,isOpen:s}=l,{cart:o,reset:i,getTotalAndDiscount:a,updateQuantityOfProduct:u}=t.useCart(),n=t.useNavigate();function c(p){n(p)}function f(p){u({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity+1})}function j(p){u({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:p=>p.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:o.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:e}),disabled:!e,onClick:i,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:r.map(p=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:p.name}),t.jsxRuntimeExports.jsxs("div",{className:N.price,children:["$",p.variants.find(m=>m.id===p.activeVariantId).price.amount*((p==null?void 0:p.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{p.quantity!==1&&j(p)},className:N.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:p.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>f(p),className:N.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},p.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:N.total,children:["$",a().total]})]}),t.jsxRuntimeExports.jsx(dt,{onClick:()=>c("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(Rt,{})]})},Rt=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,children:"view products"})]})]}),yt=({token:l})=>{const[r,e]=h.useState("test-email@gmail.com"),s=t.useNavigate();h.useEffect(()=>{(async()=>{const a=mi(l);e(a.email)})()},[l]);function o(i){s(i)}return t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>o("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},hi="_share_11u0d_1",_i="_modal_11u0d_8",ji="_header_11u0d_14",gi="_socials_11u0d_24",fi="_social_11u0d_24",vi="_copy_11u0d_34",bi="_title_11u0d_41",Ei="_copyWrapper_11u0d_47",Ri="_copyText_11u0d_56",tt={share:hi,modal:_i,header:ji,socials:gi,social:fi,copy:vi,title:bi,copyWrapper:Ei,copyText:Ri},yi=()=>{const{isOpenModal:l,setIsOpenModal:r}=t.useShareLinkStore();function e(){r(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:tt.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:r,children:t.jsxRuntimeExports.jsx(Ii,{})})]})},Ii=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:r,setNotification:e}=t.useNotificationStore(),s=window.location.href;function o(){navigator.clipboard.writeText(s),e({message:"Link copied to clipboard",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:tt.modal,onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:tt.header,children:[t.jsxRuntimeExports.jsx("div",{className:tt.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>l(!1),hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:tt.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(tt.copy,tt.copyText),onClick:o,children:s}),t.jsxRuntimeExports.jsx("div",{onClick:o,className:tt.copy,children:r?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ki="_accordion_1s1lq_1",Ni="_header_1s1lq_9",$i="_icon_1s1lq_18",wi="_open_1s1lq_21",Si="_content_1s1lq_25",ct={accordion:ki,header:Ni,icon:$i,open:wi,content:Si},Ci=({title:l,content:r})=>{const[e,s]=h.useState(!1),[o,i]=h.useState(0),a=h.useRef(null),u=()=>{s(!e)};return h.useEffect(()=>{a.current&&i(e?a.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:ct.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:ct.header,onClick:u,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(ct.icon,{[ct.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:a,className:ct.content,style:{height:`${o}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:r})})]})},Bi="_wrapper_p74l6_1",Ti="_label_p74l6_9",Pi="_input_p74l6_18",Ai="_paddingless_p74l6_31",Oi="_content_p74l6_35",qi="_contentBorder_p74l6_48",Li="_borderless_p74l6_53",Di="_rightIcon_p74l6_58",Q={wrapper:Bi,label:Ti,input:Pi,paddingless:Ai,content:Oi,contentBorder:qi,borderless:Li,rightIcon:Di},Mi=l=>{const{onChange:r,style:e,label:s,value:o,type:i,min:a,max:u,placeholder:n,disabled:c=!1,required:f=!1,regex:j,paddingless:p=!1,borderless:m=!1,editable:_=!1,isSearch:d=!1}=l,{themeSettings:k}=t.useThemeSettingsStore(),{inputs:P}=k,[E,q]=h.useState(!1);function $(g){return Number(g)<0?String(a):g}function w(g){return!f||!j?!0:new RegExp(j).test(g)}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Q.content,{[Q.contentBorder]:P.border.active}),style:{paddingRight:P.general.height+15,...e,background:P.field.active?P.field.color:"transparent"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:i||"text",onChange:g=>{if(i==="text")r(g.target.value);else{const O=$(g.target.value);r(O)}},value:o,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Q.input,{[Q.required]:E&&f&&!w(o),[Q.paddingless]:p,[Q.borderless]:m}),min:i==="number"?a:void 0,max:i==="number"?u:void 0,disabled:c,onFocus:()=>q(!0)}),d&&t.jsxRuntimeExports.jsx("div",{className:Q.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:P.general.height,height:P.general.height})}),_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},Hi="_wrapper_st58d_1",zi="_label_st58d_10",Fi="_textarea_st58d_18",Vi="_length_st58d_33",ut={wrapper:Hi,label:zi,textarea:Fi,length:Vi},Ui=l=>{const{onChange:r,label:e,value:s,maxLength:o,placeholder:i="Type something..."}=l,[a,u]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:ut.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:ut.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{u(n.target.value.length),r(n.target.value)},placeholder:i,className:ut.textarea,maxLength:o}),o&&t.jsxRuntimeExports.jsxs("div",{className:ut.length,children:[a,"/",o]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=Ci;exports.Button=dt;exports.ButtonTypeSettings=ft;exports.ButtonsSettings=pn;exports.CategorySettings=We;exports.EmptyCart=Rt;exports.FormSettings=bs;exports.HeaderButtons=pi;exports.InputUI=Mi;exports.ItemsSettings=gt;exports.LayoutSettings=Dt;exports.ListingSelector=to;exports.ProductOptions=Io;exports.RangeSelector=mt;exports.ShareLink=yi;exports.ShoppingButton=bt;exports.ShoppingModalCart=Et;exports.TextSettings=jt;exports.TextareaUI=Ui;exports.TypesText=_t;exports.UserInfo=yt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-q8zCWetF.cjs"),_=require("react");require("@phosphor-icons/react");const Nt="_wrapper_1ibay_2",$t="_alignmentBlock_1ibay_8",St="_title_1ibay_15",wt="_subtitle_1ibay_22",Ct="_alignmentContent_1ibay_29",Bt="_alignments_1ibay_37",Tt="_alignment_1ibay_8",Pt="_circle_1ibay_60",Mt="_paddings_1ibay_67",At="_padding_1ibay_67",Ot="_active_1ibay_91",qt="_input_1ibay_98",G={wrapper:Nt,alignmentBlock:$t,title:St,subtitle:wt,alignmentContent:Ct,alignments:Bt,alignment:Tt,circle:Pt,paddings:Mt,padding:At,active:Ot,input:qt},Lt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Dt=["left","top","right","bottom"],Ht=l=>{const{alignment:i,padding:e,setPadding:s,setAlignment:o}=l;function a(j){switch(j){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function c(j){switch(j){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[d,n]=_.useState(null),[r,f]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:G.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:G.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:G.alignments,children:Lt.map(j=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{o(j)},className:G.alignment,onMouseEnter:()=>{n(j)},onMouseLeave:()=>{n(null)},children:[j!==i&&d!==j&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),j!==i&&d===j&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(d),fill:"#c2c2c2",width:22,height:22}),j===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(i),fill:"#FF3F19",width:22,height:22})]},j))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:Dt.map(j=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(G.padding,{[G.active]:r===j}),onFocus:()=>{f(j)},onBlur:()=>{f(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(j),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[j]),onChange:p=>s({...e,[j]:Number(p)}),paddingless:!0,borderless:!0})]},j))})]})]})]})},zt="_title_1jkiw_1",Ft="_subtitle_1jkiw_5",Vt="_header_1jkiw_12",Ut="_text_1jkiw_13",Yt="_top_1jkiw_20",Gt="_itemsBlock_1jkiw_29",rt={title:zt,subtitle:Ft,header:Vt,text:Ut,top:Yt,itemsBlock:Gt},Xt="_typeTexts_167ez_1",Wt="_block_167ez_8",Jt="_active_167ez_25",pt={typeTexts:Xt,block:Wt,active:Jt},Qt=["bold","italic","underline","strike-through","code"],ht=l=>{const{typesText:i,setTypesText:e}=l;function s(o){switch(o){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:pt.typeTexts,children:Qt.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(pt.block,{[pt.active]:i.includes(o)}),onClick:()=>{const a=[...i];if(a.includes(o)){const c=a.filter(d=>d!==o);e(c)}else a.push(o),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(o),fill:i.includes(o)?"#252525":"#757575",width:20,height:20})},String(o)))})},jt=l=>{const{typesText:i,isActiveText:e,setIsActiveText:s,text:o,setText:a,setTypesText:c,title:d,subtitle:n="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:rt.text,children:[(d||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:rt.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:rt.title,children:d}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:r=>s(r)})]}),t.jsxRuntimeExports.jsxs("div",{className:rt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:rt.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:r=>a(r),value:o,maxLength:150}),t.jsxRuntimeExports.jsx(ht,{typesText:i,setTypesText:c})]})]})},Kt="_title_xma5o_1",Zt="_subtitle_xma5o_5",te="_header_xma5o_12",ee="_text_xma5o_13",se="_productsBlock_xma5o_14",ne="_top_xma5o_26",oe="_itemsBlock_xma5o_35",ie="_typeTexts_xma5o_41",ae="_block_xma5o_48",re="_active_xma5o_61",ce="_products_xma5o_14",le="_product_xma5o_14",de="_button_xma5o_80",ue="_disabled_xma5o_91",xe="_image_xma5o_95",me="_info_xma5o_102",pe="_name_xma5o_114",_e="_buttons_xma5o_118",he="_modal_xma5o_125",je="_link_xma5o_145",ge="_modalOptions_xma5o_151",fe="_addButton_xma5o_165",be="_deleteButton_xma5o_180",ve="_closeIcon_xma5o_192",L={title:Kt,subtitle:Zt,header:te,text:ee,productsBlock:se,top:ne,itemsBlock:oe,typeTexts:ie,block:ae,active:re,products:ce,product:le,button:de,disabled:ue,image:xe,info:me,name:pe,buttons:_e,modal:he,link:je,modalOptions:ge,addButton:fe,deleteButton:be,closeIcon:ve},Ee=_.forwardRef((l,i)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:a,setIsOpenModal:c}=l;function d(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:i,className:L.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[t.jsxRuntimeExports.jsx("h3",{className:L.title,children:d(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:L.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:L.modalOptions,children:a.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:r=>{const f={...e,[n.field]:r};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:r=>{const f={...e,[n.field.type]:r};s(f)},text:e[n.field.text]||"",setText:r=>{const f={...e,[n.field.text]:r};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const f={...e,[n.field]:r};s(f)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:L.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const f={...e,[n.field.text]:r};s(f)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:r=>{const f={...e,[n.field.switch]:r};s(f)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(ft,{items:e[n.field]||[],setItems:r=>{const f={...e,[n.field]:r};s(f)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:!1,subtitle:n.label,addableOptions:n.addableOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:r=>{const f={...e,[n.field]:r};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),Re="_other_g74jx_1",ye="_subtitle_g74jx_7",Ie="_items_g74jx_14",_t={other:Re,subtitle:ye,items:Ie},xt=l=>{const{items:i,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:_t.other,children:[t.jsxRuntimeExports.jsx("h5",{className:_t.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:_t.items,children:i.map((s,o)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:a=>s.setIsItem(a),label:s.label,hasBackground:!0,paddingless:!1},o))})]})};function ke({product:l,children:i}){const{attributes:e,listeners:s,setNodeRef:o,transform:a,transition:c,isDragging:d}=t.useSortable({id:l.id}),n={transform:t.CSS.Transform.toString(a),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:o,style:n,className:`${L.product} ${d?L.dragging:""}`,...e,...s,children:i})}const ft=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:d,editable:n=!0,draggable:r=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:N=!1,rangeSelectorOptions:P,modalOptions:E,addableOptions:O={},limit:$,autoScrollInterval:S}=l,[g,A]=_.useState(null),[Y,J]=_.useState({top:0,left:0}),[v,y]=_.useState(null),M=_.useRef(null),[U,B]=_.useState(!1),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const x=()=>{A(null),B(!1)};return document.body.addEventListener("click",x),A(null),B(!1),()=>{A(null),B(!1),document.body.removeEventListener("click",x)}},[]),_.useEffect(()=>{if(g){const x=[...s].map(R=>R.id===g.id?g:R);o(x)}},[g]),_.useEffect(()=>{if(M.current&&v){const x=M.current.getBoundingClientRect().height,R=window.innerHeight;let w=v.top;w+x>R+window.scrollY-200&&(w=R+window.scrollY-x-200),w<0&&(w=10),J({top:w,left:v.left})}},[M.current,v]);const W=(x,R)=>{x.stopPropagation();const w=x.target.getBoundingClientRect();y({top:w.top+window.scrollY,left:w.left-30}),A(R),B(!0)};function st(x){if(f)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const b=x=>{const{active:R,over:w}=x;if(w&&R.id!==w.id){const q=s.findIndex(C=>C.id===R.id),F=s.findIndex(C=>C.id===w.id);if(q!==-1&&F!==-1){const C=[...s],[nt]=C.splice(q,1);C.splice(F,0,nt),o(C)}}},T=(x,R)=>{var q,F;const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const nt=[...s],at=u.find(dt=>dt.name===C);if(!at)return;const ot=nt.map(dt=>dt.id===x.id?{...at,name:C}:dt);A({...x,name:C}),o([...ot])},value:x.name,options:u.filter(C=>!s.find(nt=>nt.name===C.name)).map(C=>C.name),leftAddon:st(x.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:C=>{const at=[...s].map(ot=>ot.id===x.id?{...x,name:C}:ot);o([...at])},value:x.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:C=>{const at=[...s].map(ot=>ot.id===x.id?{...x,images:C}:ot);o([...at])},activeImage:(q=s.find(C=>C.id===x.id))!=null&&q.images?(F=s.find(C=>C.id===x.id))==null?void 0:F.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:C=>W(C,x)})}),j&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(C=>C.id!==x.id))})})]})]});return r?t.jsxRuntimeExports.jsx(ke,{product:x,index:R,children:w},x.id):t.jsxRuntimeExports.jsx("div",{className:L.product,children:w},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:L.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:L.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),g&&n&&E&&U&&t.jsxRuntimeExports.jsx(Ee,{ref:M,activeItem:g,setActiveItem:A,popupPosition:Y,modalOptions:E,setIsOpenModal:B}),N&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:L.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:L.subtitle,children:d}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:b,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,R)=>T(x,R))})}):s.map((x,R)=>T(x,R)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(L.button,{[L.disabled]:!!($&&$<=s.length||s.length===(u==null?void 0:u.length))}),size:"s",disabled:!!($&&$<=s.length||s.length===(u==null?void 0:u.length)),onClick:()=>{const x=[...s];let R=null;if(u){for(let w=0;w<u.length;w++)if(!s.find(q=>q.id===u[w].id)){R=u[w];break}}m==="select"&&u?x.push({name:R?R.name:u[0].name,id:(R==null?void 0:R.id)||u[0].id,...O}):m==="input"?x.push({name:"",id:t.v4(),...O}):x.push({name:`Image ${s.length+1}`,id:t.v4(),...O}),o(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:L.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:a}),S!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(S.scrollInterval),onChange:x=>S.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Ne="_title_82zux_1",$e="_subtitle_82zux_5",Se="_header_82zux_12",we="_text_82zux_13",Ce="_productsBlock_82zux_14",Be="_top_82zux_26",Te="_itemsBlock_82zux_35",Pe="_typeTexts_82zux_41",Me="_block_82zux_48",Ae="_active_82zux_61",Oe="_products_82zux_14",qe="_product_82zux_14",Le="_button_82zux_80",De="_disabled_82zux_91",He="_image_82zux_95",ze="_info_82zux_102",Fe="_name_82zux_114",Ve="_buttons_82zux_118",Ue="_modal_82zux_125",Ye="_link_82zux_145",Ge="_modalOptions_82zux_151",Xe="_addButton_82zux_157",We="_deleteButton_82zux_179",X={title:Ne,subtitle:$e,header:Se,text:we,productsBlock:Ce,top:Be,itemsBlock:Te,typeTexts:Pe,block:Me,active:Ae,products:Oe,product:qe,button:Le,disabled:De,image:He,info:ze,name:Fe,buttons:Ve,modal:Ue,link:Ye,modalOptions:Ge,addButton:Xe,deleteButton:We},Je=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:d,draggable:n=!1,withImage:r=!1,addable:f=!0,itemsOptions:j,hasRangeSelector:p=!1,rangeSelectorOptions:m,limit:h,autoScrollInterval:u}=l;function N(E){if(r)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=E=>{const O=j.find(S=>S.id===E);if(!O)return;const $=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:S=>{const g=[...s],A=j.find(v=>v.name===S);if(!A)return;const Y=A.id,J=g.map(v=>v===E?Y:v);o([...J])},value:O.name,options:j.filter(S=>!s.find(g=>g===S.id)).map(S=>S.name),leftAddon:N(O.images)}),t.jsxRuntimeExports.jsx("div",{className:X.buttons,children:t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(S=>S!==E))})})})]});return t.jsxRuntimeExports.jsx("div",{className:X.product,children:$},E)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:E=>e==null?void 0:e(E)})]}),p&&m&&t.jsxRuntimeExports.jsx(mt,{...m}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:d}),s.map(E=>P(E)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(h&&h<=s.length||s.length===j.length)}),size:"s",disabled:!!(h&&h<=s.length||s.length===j.length),onClick:()=>{const E=[...s];let O=null;if(j){for(let $=0;$<j.length;$++)if(!s.find(S=>S===j[$].id)){O=j[$];break}}E.push((O==null?void 0:O.id)||j[0].id),o(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:a}),u!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(u.scrollInterval),onChange:E=>u.setScrollInterval(Number(E)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Qe="_title_1vfw9_1",Ke="_subtitle_1vfw9_5",Ze="_header_1vfw9_12",ts="_text_1vfw9_13",es="_productsBlock_1vfw9_14",ss="_top_1vfw9_26",ns="_itemsBlock_1vfw9_35",os="_typeTexts_1vfw9_41",is="_block_1vfw9_48",as="_active_1vfw9_61",rs="_products_1vfw9_14",cs="_product_1vfw9_14",ls="_button_1vfw9_80",ds="_disabled_1vfw9_91",us="_image_1vfw9_95",xs="_info_1vfw9_102",ms="_name_1vfw9_114",ps="_buttons_1vfw9_118",_s="_modal_1vfw9_125",hs="_link_1vfw9_145",js="_modalOptions_1vfw9_151",gs="_addButton_1vfw9_164",fs="_deleteButton_1vfw9_179",bs="_closeIcon_1vfw9_191",H={title:Qe,subtitle:Ke,header:Ze,text:ts,productsBlock:es,top:ss,itemsBlock:ns,typeTexts:os,block:is,active:as,products:rs,product:cs,button:ls,disabled:ds,image:us,info:xs,name:ms,buttons:ps,modal:_s,link:hs,modalOptions:js,addButton:gs,deleteButton:fs,closeIcon:bs},vs=_.forwardRef((l,i)=>{const{activeItem:e,setActiveItem:s,popupPosition:o,modalOptions:a,setIsOpenModal:c}=l;function d(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:i,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:d(e.name,20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:a.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:r=>{const f={...e,[n.field]:r};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:r=>{const f={...e,[n.field.type]:r};s(f)},text:e[n.field.text]||"",setText:r=>{const f={...e,[n.field.text]:r};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const f={...e,[n.field]:r};s(f)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>{const f={...e,[n.field.text]:r};s(f)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:r=>{const f={...e,[n.field.switch]:r};s(f)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:r=>{const f={...e,[n.field]:r};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})});function Es(l){const{product:i,children:e}=l,{attributes:s,listeners:o,setNodeRef:a,transform:c,transition:d,isDragging:n}=t.useSortable({id:i.id}),r={transform:t.CSS.Transform.toString(c),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:a,style:r,className:`${H.product} ${n?H.dragging:""}`,...s,...o,children:e})}const Rs=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:d,editable:n=!0,draggable:r=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:N=!1,rangeSelectorOptions:P,modalOptions:E,addableOptions:O={}}=l,[$,S]=_.useState(null),[g,A]=_.useState({top:0,left:0}),[Y,J]=_.useState(null),v=_.useRef(null),[y,M]=_.useState(!1),U=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const b=()=>{S(null),M(!1)};return document.body.addEventListener("click",b),S(null),M(!1),()=>{S(null),M(!1),document.body.removeEventListener("click",b)}},[]),_.useEffect(()=>{if($){const b=[...s].map(T=>T.id===$.id?$:T);o(b)}},[$]),_.useEffect(()=>{if(v.current&&Y){const b=v.current.getBoundingClientRect().height,T=window.innerHeight;let x=Y.top;x+b>T+window.scrollY-200&&(x=T+window.scrollY-b-200),x<0&&(x=10),A({top:x,left:Y.left})}},[v.current,Y]);const B=(b,T)=>{b.stopPropagation();const x=b.target.getBoundingClientRect();J({top:x.top+window.scrollY,left:x.left-30}),S(T),M(!0)};function D(b){if(f)return b?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${b[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const W=b=>{const{active:T,over:x}=b;if(x&&T.id!==x.id){const R=s.findIndex(q=>q.id===T.id),w=s.findIndex(q=>q.id===x.id);if(R!==-1&&w!==-1){const q=[...s],[F]=q.splice(R,1);q.splice(w,0,F),o(q)}}},st=b=>{var x;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const q=[...s].map(F=>F.id===b.id?{...b,name:R}:F);S({...b,name:R}),o([...q])},value:b.name,options:u.filter(R=>!s.find(w=>w.name===R)),leftAddon:D(b.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>{const q=[...s].map(F=>F.id===b.id?{...b,name:R}:F);o([...q])},value:b.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:R=>{const q=[...s].map(F=>F.id===b.id?{...b,images:R}:F);o([...q])},activeImage:(x=s.find(R=>R.id===b.id))==null?void 0:x.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>B(R,b)})}),j&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(R=>R.id!==b.id))})})]})]});return r?t.jsxRuntimeExports.jsx(Es,{product:b,children:T},b.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:T},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:b=>e==null?void 0:e(b)})]}),$&&n&&E&&y&&t.jsxRuntimeExports.jsx(vs,{ref:v,activeItem:$,setActiveItem:S,popupPosition:g,modalOptions:E,setIsOpenModal:M}),N&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:d}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:U,onDragEnd:W,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>b.id),strategy:t.verticalListSortingStrategy,children:s.map(b=>st(b))})}):s.map(b=>st(b)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:H.button,size:"s",onClick:()=>{const b=[...s];let T=null;if(u){for(let x=0;x<u.length;x++)if(!s.find(R=>R.name===u[x])){T=u[x];break}}m==="select"&&u?b.push({name:T||u[0],id:t.v4(),...O,maxSymbols:100}):m==="input"?b.push({name:"",id:t.v4(),...O,maxSymbols:100}):b.push({name:`Image ${s.length+1}`,id:t.v4(),...O,maxSymbols:100}),o(b)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:a})]})},ys="_title_bn7sv_1",Is="_subtitle_bn7sv_5",ks="_header_bn7sv_12",Ns="_text_bn7sv_13",$s="_productsBlock_bn7sv_14",Ss="_buttonsBlock_bn7sv_15",ws="_top_bn7sv_26",Cs="_itemsBlock_bn7sv_35",Bs="_typeTexts_bn7sv_41",Ts="_block_bn7sv_48",Ps="_active_bn7sv_60",Ms="_products_bn7sv_14",As="_product_bn7sv_14",Os="_button_bn7sv_15",qs="_image_bn7sv_90",Ls="_info_bn7sv_97",Ds="_name_bn7sv_109",Hs="_buttons_bn7sv_15",zs="_modal_bn7sv_120",Fs="_other_bn7sv_139",Vs="_options_bn7sv_145",Us="_closeIcon_bn7sv_153",et={title:ys,subtitle:Is,header:ks,text:Ns,productsBlock:$s,buttonsBlock:Ss,top:ws,itemsBlock:Cs,typeTexts:Bs,block:Ts,active:Ps,products:Ms,product:As,button:Os,image:qs,info:Ls,name:Ds,buttons:Hs,modal:zs,other:Fs,options:Vs,closeIcon:Us},Ys=_.forwardRef((l,i)=>{const{activeButton:e,setActiveButton:s,popupPosition:o}=l,[a,c]=_.useState(e.typesText),[d,n]=_.useState(e.destination),[r,f]=_.useState(e.page),[j,p]=_.useState(e.link||""),[m,h]=_.useState(e.text||""),[u,N]=_.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return _.useEffect(()=>{s({...e,...{text:m,link:j,destination:d,typesText:a,page:r,openInNewTab:u}})},[a,d,j,m,r,u]),t.jsxRuntimeExports.jsxs("div",{className:et.modal,onClick:E=>{E.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},ref:i,children:[t.jsxRuntimeExports.jsxs("div",{className:et.top,children:[t.jsxRuntimeExports.jsx("h3",{className:et.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:et.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:et.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:E=>n(E),options:["Go to Page","Open Link"].filter(E=>E!==d),value:d}),d==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:E=>f(E),options:P?Object.values(P).filter(E=>E.name!==r).map(E=>E.name):[],value:r}):t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>p(E),value:j,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:E=>N(E)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:E=>h(E),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(ht,{typesText:a,setTypesText:c})]})]})}),Gs="_subtitle_jql1y_1",Xs="_header_jql1y_8",Ws="_text_jql1y_9",Js="_productsBlock_jql1y_10",Qs="_buttonsBlock_jql1y_11",Ks="_top_jql1y_23",Zs="_itemsBlock_jql1y_32",tn="_typeTexts_jql1y_38",en="_block_jql1y_45",sn="_active_jql1y_58",nn="_products_jql1y_10",on="_product_jql1y_10",an="_button_jql1y_11",rn="_image_jql1y_88",cn="_info_jql1y_95",ln="_name_jql1y_107",dn="_buttons_jql1y_11",un="_modal_jql1y_118",xn="_other_jql1y_138",mn="_options_jql1y_144",pn="_addButton_jql1y_150",_n="_deleteButton_jql1y_165",K={subtitle:Gs,header:Xs,text:Ws,productsBlock:Js,buttonsBlock:Qs,top:Ks,itemsBlock:Zs,typeTexts:tn,block:en,active:sn,products:nn,product:on,button:an,image:rn,info:cn,name:ln,buttons:dn,modal:un,other:xn,options:mn,addButton:pn,deleteButton:_n},bt=l=>{const{buttons:i,setButtons:e,deletable:s=!0,addable:o=!0}=l,[a,c]=_.useState(null),[d,n]=_.useState({top:0,left:0}),[r,f]=_.useState(null),j=_.useRef(null);_.useEffect(()=>{const m=()=>{c(null)};return document.body.addEventListener("click",m),c(null),()=>{c(null),document.body.removeEventListener("click",m)}},[]),_.useEffect(()=>{if(a){const m=[...i].map(h=>h.id===a.id?a:h);e(m)}},[a]),_.useEffect(()=>{if(j.current&&r){const m=j.current.getBoundingClientRect().height,h=window.innerHeight;let u=r.top;u+m>h+window.scrollY-200&&(u=h+window.scrollY-m-200),u<0&&(u=10),n({top:u,left:r.left})}},[j.current,r]);const p=(m,h)=>{m.stopPropagation();const u=m.target.getBoundingClientRect();f({top:u.top+window.scrollY,left:u.left-30}),c(h)};return t.jsxRuntimeExports.jsxs("div",{className:K.products,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:"Button Type"}),i.map(m=>t.jsxRuntimeExports.jsxs("div",{className:K.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:h=>{const N=[...i].map(P=>P.id===m.id?{...m,type:h}:P);e(N)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:K.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:h=>{p(h,m)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const h=i.filter(u=>u.id!==m.id);e(h)},width:20,height:20,fill:"#C12A2A"})})]})]},m.id)),a&&t.jsxRuntimeExports.jsx(Ys,{ref:j,activeButton:a,setActiveButton:c,popupPosition:d}),o&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:K.button,size:"s",onClick:()=>{const m=[...i];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:K.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},hn=l=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:s,setButtons:o}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:et.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:et.top,children:[t.jsxRuntimeExports.jsx("h3",{className:et.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(bt,{buttons:s,setButtons:o})]})})},jn="_wrapper_m18qi_1",gn="_subtitle_m18qi_7",fn="_content_m18qi_14",bn="_range_m18qi_22",vn="_track_m18qi_27",En="_progress_m18qi_36",Rn="_dots_m18qi_46",yn="_dot_m18qi_46",In="_active_m18qi_65",kn="_input_m18qi_77",Nn="_countBlock_m18qi_91",$n="_count_m18qi_91",Sn="_controls_m18qi_107",wn="_button_m18qi_113",V={wrapper:jn,subtitle:gn,content:fn,range:bn,track:vn,progress:En,dots:Rn,dot:yn,active:In,input:kn,countBlock:Nn,count:$n,controls:Sn,button:wn},mt=l=>{const{label:i,min:e=1,max:s=4,step:o=1,count:a,setCount:c}=l,[d,n]=_.useState(!1),r=Array.from({length:(s-e)/o+1}),f=(a-e)/(s-e)*100,j=()=>{a<s&&c(a+o)},p=()=>{a>e&&c(a-o)},m=h=>{const u=e+h*o;c(u)};return t.jsxRuntimeExports.jsxs("div",{className:V.wrapper,children:[i&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:i}),t.jsxRuntimeExports.jsxs("div",{className:V.content,children:[t.jsxRuntimeExports.jsxs("div",{className:V.range,children:[t.jsxRuntimeExports.jsx("div",{className:V.track}),t.jsxRuntimeExports.jsx("div",{className:V.progress,style:{width:`${f}%`}}),t.jsxRuntimeExports.jsx("div",{className:V.dots,children:r.map((h,u)=>{const N=u<=(a-e)/o;return t.jsxRuntimeExports.jsx("button",{onClick:()=>m(u),className:t.clx(V.dot,{[V.active]:N,[V.inactive]:!N,[V.dragging]:d}),"aria-label":`Set value to ${e+u*o}`},u)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:o,value:a,onChange:h=>c(Number(h.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:V.input})]}),t.jsxRuntimeExports.jsxs("div",{className:V.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:h=>{const u=Number(h);u>s?c(s):u<e?c(e):c(u)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:V.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:j,disabled:a>=s,className:V.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:p,disabled:a<=e,className:V.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},Cn="_title_ix5ax_1",Bn="_subtitle_ix5ax_5",Tn="_header_ix5ax_12",Pn="_text_ix5ax_13",Mn="_productsBlock_ix5ax_14",An="_top_ix5ax_26",On="_itemsBlock_ix5ax_35",qn="_typeTexts_ix5ax_41",Ln="_block_ix5ax_48",Dn="_active_ix5ax_61",Hn="_products_ix5ax_14",zn="_product_ix5ax_14",Fn="_button_ix5ax_80",Vn="_image_ix5ax_91",Un="_info_ix5ax_98",Yn="_name_ix5ax_110",Gn="_buttons_ix5ax_114",Xn="_modal_ix5ax_121",Wn="_link_ix5ax_141",Jn="_modalOptions_ix5ax_147",Qn="_addButton_ix5ax_160",Kn="_deleteButton_ix5ax_175",Zn="_closeIcon_ix5ax_187",z={title:Cn,subtitle:Bn,header:Tn,text:Pn,productsBlock:Mn,top:An,itemsBlock:On,typeTexts:qn,block:Ln,active:Dn,products:Hn,product:zn,button:Fn,image:Vn,info:Un,name:Yn,buttons:Gn,modal:Xn,link:Wn,modalOptions:Jn,addButton:Qn,deleteButton:Kn,closeIcon:Zn},to=l=>{const{activeItem:i,setActiveItem:e,popupPosition:s,setIsOpenModal:o,itemsOptions:a}=l,c=a.find(n=>n.id===i.listingId);if(!c)return null;function d(n,r){return n.length>r?`${n.slice(0,r)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:z.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[t.jsxRuntimeExports.jsx("h3",{children:d(c.productData.name,20)}),t.jsxRuntimeExports.jsx("div",{className:z.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{o(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:z.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:c.productData.images.length>0?c.productData.images[0].cfId:void 0,onChange:n=>{const r={...i,image:n[0]};e(r)}})})]})};function eo(l){const{product:i,children:e}=l,{attributes:s,listeners:o,setNodeRef:a,transform:c,transition:d,isDragging:n}=t.useSortable({id:String(i.listingId)}),r={transform:t.CSS.Transform.toString(c),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:a,style:r,className:`${z.product} ${n?z.dragging:""}`,...s,...o,children:e})}const so=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:o,other:a,title:c,subtitle:d,editable:n=!0,draggable:r=!1,withImage:f=!1,deletable:j=!0,addable:p=!0,itemsType:m,itemsOptions:h}=l,[u,N]=_.useState(null),[P,E]=_.useState({top:0,left:0}),[O,$]=_.useState(!1),S=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const v=()=>{N(null),$(!1)};return document.body.addEventListener("click",v),N(null),$(!1),()=>{N(null),$(!1),document.body.removeEventListener("click",v)}},[]),_.useEffect(()=>{if(u){const v=[...s].map(y=>y.listingId===u.listingId?u:y);o(v)}},[u]);const g=(v,y)=>{v.stopPropagation();const M=v.target.getBoundingClientRect(),U=100,B=window.innerHeight;let D=M.top+window.scrollY;D+U>B&&(D=B-U-20),$(!0),E({top:D-80,left:M.left-30}),N(y)};function A(v){if(f)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=v=>{const{active:y,over:M}=v;if(M&&y.id!==M.id){const U=s.findIndex(D=>String(D.listingId)===y.id),B=s.findIndex(D=>String(D.listingId)===M.id);if(U!==-1&&B!==-1){const D=[...s],[W]=D.splice(U,1);D.splice(B,0,W),o(D)}}},J=(v,y)=>{const M=h.find(B=>v.listingId===B.id);if(!M)return null;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const D=[...s],W=h.find(T=>T.productData.name===B);if(!W)return;const st={listingId:W.id,image:W.productData.images.length>0?W.productData.images[0].cfId:""},b=D.map(T=>T.listingId===v.listingId?st:T);N(st),o([...b])},value:M.productData.name,options:[...h.filter(B=>!s.find(D=>D.listingId===B.id)).map(B=>B.productData.name)],leftAddon:A(v.image||M.productData.images.length>0&&M.productData.images[0].cfId||"")},y),t.jsxRuntimeExports.jsxs("div",{className:z.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>g(B,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(s.filter(B=>B!==v))})})]})]});return r?t.jsxRuntimeExports.jsx(eo,{product:v,children:U},v.listingId):t.jsxRuntimeExports.jsx("div",{className:z.product,children:U},v.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:z.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:z.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:v=>e==null?void 0:e(v)})]}),O&&u&&t.jsxRuntimeExports.jsx(to,{activeItem:u,setActiveItem:N,setIsOpenModal:$,popupPosition:P,itemsOptions:h}),t.jsxRuntimeExports.jsxs("div",{className:z.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:d}),r?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:S,onDragEnd:Y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>String(v.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((v,y)=>J(v,y))})}):s.map((v,y)=>J(v,y)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:z.button,size:"s",onClick:()=>{const v=[...s];for(let y=0;y<h.length;y++)if(!s.find(M=>M.listingId===h[y].id)){v.push({listingId:h[y].id,image:h[y].productData.images.length>0?h[y].productData.images[0].cfId:""});break}o(v)},disabled:s.length===h.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:z.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),a!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:a})]})},no="_options_d1lk6_1",oo="_price_d1lk6_12",io="_oldPrice_d1lk6_19",ao="_newPrice_d1lk6_27",ro="_animate_d1lk6_34",co="_appearAndBounce_d1lk6_1",lo="_meta_d1lk6_52",uo="_info_d1lk6_58",xo="_infoRight_d1lk6_66",mo="_buttons_d1lk6_73",po="_variants_d1lk6_80",_o="_variant_d1lk6_80",ho="_stock_d1lk6_98",jo="_variantInfo_d1lk6_105",go="_quantity_d1lk6_111",fo="_count_d1lk6_118",bo="_focused_d1lk6_135",vo="_button_d1lk6_73",Eo="_activeVariant_d1lk6_161",Ro="_chargeTypes_d1lk6_165",yo="_charge_d1lk6_165",Io="_chargeActive_d1lk6_190",ko="_title_d1lk6_198",I={options:no,price:oo,oldPrice:io,newPrice:ao,animate:ro,appearAndBounce:co,meta:lo,info:uo,infoRight:xo,buttons:mo,variants:po,variant:_o,stock:ho,variantInfo:jo,quantity:go,count:fo,focused:bo,button:vo,activeVariant:Eo,chargeTypes:Ro,charge:yo,chargeActive:Io,title:ko};var vt=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(vt||{});const No=l=>{var $,S;const{variants:i}=l,[e,s]=_.useState(i[0]),[o,a]=_.useState(e.chargeTypes[0]),c=t.useNavigate(),[d,n]=_.useState(1),[r,f]=_.useState(!1),{reset:j,addProductToCart:p,getProducts:m}=t.useCart(),[h,u]=_.useState(!1);_.useEffect(()=>{u(!0);const g=setTimeout(()=>u(!1),600);return()=>clearTimeout(g)},[d]);async function N(){await m(),await p({productId:l.id,productVariantId:e.id,quantity:d})}function P(){j(),N(),c("/checkout")}function E(g){if(g>=864e5){const y=Math.floor(g/864e5);return`${y} ${y===1?"day":"days"}`}else if(g>=36e5){const y=Math.floor(g/36e5);return`${y} ${y===1?"hour":"hours"}`}else if(g>=6e4){const y=Math.floor(g/6e4);return`${y} ${y===1?"minute":"minutes"}`}else{const y=Math.floor(g/1e3);return`${y} ${y===1?"second":"seconds"}`}}function O(g,A){return g.length>A?g.slice(0,A)+"...":g}return t.jsxRuntimeExports.jsxs("div",{className:I.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:I.chargeTypes,children:e.chargeTypes.map(g=>t.jsxRuntimeExports.jsx("div",{className:t.clx(I.charge,{[I.chargeActive]:o===g}),onClick:()=>a(g),children:vt[g]},g))}),t.jsxRuntimeExports.jsx("div",{className:I.variants,children:i.map(g=>{var A;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(I.variant,{[I.activeVariant]:e.id===g.id}),onClick:()=>s(g),children:[t.jsxRuntimeExports.jsxs("div",{className:I.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:I.title,children:O(g.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?g.price.amount:g.subscriptionSettings?g.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:I.stock,children:[((A=g.quantity.restrictions)==null?void 0:A.max)||g.quantity.available||0," in stock"]})})]},g.id)})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:I.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{d>1?n(g=>g-1):n(1)},className:I.button,disabled:e.quantity.restrictions&&d<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(I.count,{[I.focused]:r}),onFocus:()=>f(!0),onBlur:()=>f(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(d),onChange:g=>n(Number(g)),max:(($=e.quantity.restrictions)==null?void 0:$.max)||e.quantity.available||1/0,min:((S=e.quantity.restrictions)==null?void 0:S.min)||0,style:{backgroundColor:"transparent",border:"none",textAlign:"center"}})}),t.jsxRuntimeExports.jsx("button",{onClick:()=>{n(g=>g+1)},className:I.button,disabled:!!(e.quantity.restrictions&&d>=e.quantity.restrictions.max||e.quantity.available&&d>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:I.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:I.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":E(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:I.infoRight,children:o==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",(e.price.amount||0)*d]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*d]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",(e.price.amount||0)*d]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>P(),children:t.jsxRuntimeExports.jsx("span",{children:o==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>N(),children:"Add to Cart"})]})]})},$o="_button_1tdo3_1",So="_login_1tdo3_14",wo="_signUp_1tdo3_18",Co="_buttons_1tdo3_23",Bo="_modal_1tdo3_32",To="_closing_1tdo3_64",Po="_info_1tdo3_113",Mo="_top_1tdo3_120",Ao="_title_1tdo3_131",Oo="_clear_1tdo3_138",qo="_activeClear_1tdo3_145",Lo="_count_1tdo3_149",Do="_cart_1tdo3_164",Ho="_empty_1tdo3_172",zo="_product_1tdo3_198",Fo="_products_1tdo3_207",Vo="_image_1tdo3_215",Uo="_productInfo_1tdo3_221",Yo="_content_1tdo3_228",Go="_name_1tdo3_234",Xo="_price_1tdo3_240",Wo="_productButtons_1tdo3_246",Jo="_productButton_1tdo3_246",Qo="_productCount_1tdo3_266",Ko="_bottom_1tdo3_282",Zo="_subtotal_1tdo3_290",ti="_block_1tdo3_298",ei="_shoppingCount_1tdo3_305",si="_total_1tdo3_325",ni="_link_1tdo3_331",oi="_userInfo_1tdo3_338",ii="_pagesMobileModal_1tdo3_349",ai="_pagesMobileModalContent_1tdo3_363",ri="_pagesMobileModalHeader_1tdo3_369",ci="_pagesMobileModalFooter_1tdo3_379",k={button:$o,login:So,signUp:wo,buttons:Co,modal:Bo,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:To,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Po,top:Mo,title:Ao,clear:Oo,activeClear:qo,count:Lo,cart:Do,empty:Ho,product:zo,products:Fo,image:Vo,productInfo:Uo,content:Yo,name:Go,price:Xo,productButtons:Wo,productButton:Jo,productCount:Qo,bottom:Ko,subtotal:Zo,block:ti,shoppingCount:ei,total:si,link:ni,userInfo:oi,pagesMobileModal:ii,pagesMobileModalContent:ai,pagesMobileModalHeader:ri,pagesMobileModalFooter:ci},li="_button_85085_1",di="_primary_85085_20",ui="_primaryHovered_85085_30",xi="_secondary_85085_34",mi="_secondaryHovered_85085_44",pi="_tertiary_85085_48",_i="_tertiaryHovered_85085_58",hi="_content_85085_62",Z={button:li,primary:di,primaryHovered:ui,secondary:xi,secondaryHovered:mi,tertiary:pi,tertiaryHovered:_i,content:hi},it=l=>{const{children:i,onClick:e,style:s,className:o,disabled:a=!1,type:c="Primary"}=l,{themeSettings:d}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(Z.button,o,{[Z.primary]:c==="Primary",[Z.secondary]:c==="Secondary",[Z.tertiary]:c==="Tertiary",[Z.primaryHovered]:c==="Primary"&&!a&&d.buttons.primary.hover,[Z.secondaryHovered]:c==="Secondary"&&!a&&d.buttons.secondary.hover,[Z.tertiaryHovered]:c==="Tertiary"&&!a&&d.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:a,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:Z.content,children:[i,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:i})})};class lt extends Error{}lt.prototype.name="InvalidTokenError";function ji(l){return decodeURIComponent(atob(l).replace(/(.)/g,(i,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function gi(l){let i=l.replace(/-/g,"+").replace(/_/g,"/");switch(i.length%4){case 0:break;case 2:i+="==";break;case 3:i+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ji(i)}catch{return atob(i)}}function fi(l,i){if(typeof l!="string")throw new lt("Invalid token specified: must be a string");i||(i={});const e=i.header===!0?0:1,s=l.split(".")[e];if(typeof s!="string")throw new lt(`Invalid token specified: missing part #${e+1}`);let o;try{o=gi(s)}catch(a){throw new lt(`Invalid token specified: invalid base64 for part #${e+1} (${a.message})`)}try{return JSON.parse(o)}catch(a){throw new lt(`Invalid token specified: invalid json for part #${e+1} (${a.message})`)}}const bi=l=>{const{shopping:i,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[i&&t.jsxRuntimeExports.jsx(Et,{}),s&&t.jsxRuntimeExports.jsx(gt,{signUp:e})]})},Et=()=>{const[l,i]=_.useState(!1),[e,s]=_.useState([]),{cart:o,getProducts:a}=t.useCart();function c(p){for(let m=0;m<o.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(o.parts[m].productVariantId===p.variants[m].id)return o.parts[m].productVariantId}function d(p){for(let m=0;m<o.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(o.parts[m].productVariantId===p.variants[m].id)return o.parts[m].quantity}_.useEffect(()=>{(async()=>{const m=o.parts.map(N=>String(N.productId)),u=(await a([...m])).map(N=>({...N,activeVariantId:c(N),quantity:d(N)}));s(u)})()},[o.parts.length]);function n(p){var m;return!p||!(p!=null&&p.variants)?!1:(m=p.variants.find(h=>h.id===p.activeVariantId))==null?void 0:m.subscriptionSettings}const r=o.parts.length>0&&e.length>0&&!n(e[0]),[f,j]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(it,{type:"Secondary",style:{padding:10},onClick:p=>{p.stopPropagation(),window.location.pathname!=="/admin/builder"&&(i(!0),j(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),r&&t.jsxRuntimeExports.jsx("div",{className:k.shoppingCount,children:o.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{j(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(Rt,{activeProducts:e,isCartNotEmpty:r,isOpen:f})})]})},Rt=l=>{const{activeProducts:i,isCartNotEmpty:e,isOpen:s}=l,{cart:o,reset:a,getTotalAndDiscount:c,updateQuantityOfProduct:d}=t.useCart(),n=t.useNavigate();function r(p){n(p)}function f(p){d({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity+1})}function j(p){d({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(k.modal,{[k.closing]:!s}),onClick:p=>p.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{className:k.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:k.count,children:o.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(k.clear,{[k.activeClear]:e}),disabled:!e,onClick:a,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:k.cart,children:[t.jsxRuntimeExports.jsx("div",{className:k.products,children:i.map(p=>t.jsxRuntimeExports.jsxs("div",{className:k.product,children:[t.jsxRuntimeExports.jsxs("div",{className:k.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:k.image}),t.jsxRuntimeExports.jsxs("div",{className:k.content,children:[t.jsxRuntimeExports.jsx("div",{className:k.name,children:p.name}),t.jsxRuntimeExports.jsxs("div",{className:k.price,children:["$",p.variants.find(m=>m.id===p.activeVariantId).price.amount*((p==null?void 0:p.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{p.quantity!==1&&j(p)},className:k.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:k.productCount,children:p.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>f(p),className:k.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},p.id))}),t.jsxRuntimeExports.jsxs("div",{className:k.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:k.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:k.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:k.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(it,{onClick:()=>r("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(yt,{})]})},yt=()=>t.jsxRuntimeExports.jsxs("div",{className:k.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:k.link,children:"view products"})]})]}),gt=({signUp:l})=>{const i=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=i;if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(it,{onClick:()=>c("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(it,{onClick:()=>c("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[s,o]=_.useState("test-email@gmail.com"),a=t.useNavigate();_.useEffect(()=>{(async()=>{const n=fi(e);o(n.email)})()},[e]);function c(d){a(d)}return t.jsxRuntimeExports.jsx("div",{className:k.userInfo,onClick:()=>c("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:s||"test-email@gmail.com"})})},It=({children:l,logo:i,setIsOpen:e,signUp:s})=>{const{setIsOpen:o}=t.useModalStore(),a=()=>{o(!1),setTimeout(()=>{e(!1),o(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:k.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:k.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(it,{type:"Secondary",onClick:a,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:k.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:k.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(gt,{signUp:s})})]})},vi=({children:l,logo:i,signUp:e})=>{const[s,o]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(kt,{setIsOpenModal:o}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>o(!1),children:t.jsxRuntimeExports.jsx(It,{logo:i,setIsOpen:o,signUp:e,children:l})})]})},kt=l=>{const{setIsOpenModal:i}=l;return t.jsxRuntimeExports.jsx(it,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Ei="_share_xddz7_1",Ri="_modal_xddz7_8",yi="_header_xddz7_20",Ii="_socials_xddz7_30",ki="_social_xddz7_30",Ni="_copy_xddz7_40",$i="_title_xddz7_47",Si="_copyWrapper_xddz7_53",wi="_copyText_xddz7_62",Ci="_copyTextMobile_xddz7_75",Bi="_copyTextMiniMobile_xddz7_94",tt={share:Ei,modal:Ri,header:yi,socials:Ii,social:ki,copy:Ni,title:$i,copyWrapper:Si,copyText:wi,copyTextMobile:Ci,copyTextMiniMobile:Bi},Ti=()=>{const{isOpenModal:l,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:tt.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(Pi,{})})]})},Pi=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),o=window.location.href;function a(){navigator.clipboard.writeText(o),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{l(!1),s(!0)},300)}function d(n,r){return n.length>r?n.slice(0,r)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:tt.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:tt.header,children:[t.jsxRuntimeExports.jsx("div",{className:tt.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:tt.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:a,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:tt.copyText,children:d(o,100)}),t.jsxRuntimeExports.jsx("div",{className:tt.copyTextMobile,children:d(o,40)}),t.jsxRuntimeExports.jsx("div",{className:tt.copyTextMiniMobile,children:d(o,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:a,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},Mi="_accordion_1s1lq_1",Ai="_header_1s1lq_9",Oi="_icon_1s1lq_18",qi="_open_1s1lq_21",Li="_content_1s1lq_25",ct={accordion:Mi,header:Ai,icon:Oi,open:qi,content:Li},Di=({title:l,content:i})=>{const[e,s]=_.useState(!1),[o,a]=_.useState(0),c=_.useRef(null),d=()=>{s(!e)};return _.useEffect(()=>{c.current&&a(e?c.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:ct.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:ct.header,onClick:d,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(ct.icon,{[ct.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:c,className:ct.content,style:{height:`${o}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},Hi="_wrapper_p74l6_1",zi="_label_p74l6_9",Fi="_input_p74l6_18",Vi="_paddingless_p74l6_31",Ui="_content_p74l6_35",Yi="_contentBorder_p74l6_48",Gi="_borderless_p74l6_53",Xi="_rightIcon_p74l6_58",Q={wrapper:Hi,label:zi,input:Fi,paddingless:Vi,content:Ui,contentBorder:Yi,borderless:Gi,rightIcon:Xi},Wi=l=>{const{onChange:i,style:e,label:s,value:o,type:a,min:c,max:d,placeholder:n,disabled:r=!1,required:f=!1,regex:j,paddingless:p=!1,borderless:m=!1,editable:h=!1,isSearch:u=!1}=l,{themeSettings:N}=t.useThemeSettingsStore(),{inputs:P}=N,[E,O]=_.useState(!1);function $(g){return Number(g)<0?String(c):g}function S(g){return!f||!j?!0:new RegExp(j).test(g)}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Q.content,{[Q.contentBorder]:P.border.active}),style:{paddingRight:P.general.height+15,...e,background:P.field.active?P.field.color:"transparent"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:a||"text",onChange:g=>{if(a==="text")i(g.target.value);else{const A=$(g.target.value);i(A)}},value:o,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Q.input,{[Q.required]:E&&f&&!S(o),[Q.paddingless]:p,[Q.borderless]:m}),min:a==="number"?c:void 0,max:a==="number"?d:void 0,disabled:r,onFocus:()=>O(!0)}),u&&t.jsxRuntimeExports.jsx("div",{className:Q.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:P.general.height,height:P.general.height})}),h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},Ji="_wrapper_st58d_1",Qi="_label_st58d_10",Ki="_textarea_st58d_18",Zi="_length_st58d_33",ut={wrapper:Ji,label:Qi,textarea:Ki,length:Zi},ta=l=>{const{onChange:i,label:e,value:s,maxLength:o,placeholder:a="Type something..."}=l,[c,d]=_.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:ut.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:ut.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{d(n.target.value.length),i(n.target.value)},placeholder:a,className:ut.textarea,maxLength:o}),o&&t.jsxRuntimeExports.jsxs("div",{className:ut.length,children:[c,"/",o]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=Di;exports.BurgerMenuButton=kt;exports.Button=it;exports.ButtonTypeSettings=bt;exports.ButtonsSettings=hn;exports.CategorySettings=Je;exports.EmptyCart=yt;exports.FormSettings=Rs;exports.HeaderButtons=bi;exports.InputUI=Wi;exports.ItemsSettings=ft;exports.LayoutSettings=Ht;exports.ListingSelector=so;exports.PagesMobileMenu=vi;exports.PagesMobileModal=It;exports.ProductOptions=No;exports.RangeSelector=mt;exports.ShareLink=Ti;exports.ShoppingButton=Et;exports.ShoppingModalCart=Rt;exports.TextSettings=jt;exports.TextareaUI=ta;exports.TypesText=ht;exports.UserInfo=gt;
|