@billgangcom/theme-lib 1.33.0 → 1.33.1
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.cjs.js +4 -4
- package/dist/builder.es.js +559 -548
- package/dist/{index-DSREXVyt.js → index-CqF7deZx.js} +11 -9
- package/dist/{index-CZcNDk0w.cjs → index-J6kEvjGE.cjs} +3 -3
- package/dist/ui/ItemsSettings/popup.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1367 -1346
- package/package.json +1 -1
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CZcNDk0w.cjs"),m=require("react");require("@phosphor-icons/react");const Rt="_wrapper_9rr5j_2",yt="_alignmentBlock_9rr5j_8",It="_title_9rr5j_15",kt="_subtitle_9rr5j_22",$t="_alignmentContent_9rr5j_29",wt="_alignments_9rr5j_37",Nt="_alignment_9rr5j_8",Ct="_circle_9rr5j_58",St="_paddings_9rr5j_65",Tt="_padding_9rr5j_65",Bt="_input_9rr5j_84",G={wrapper:Rt,alignmentBlock:yt,title:It,subtitle:kt,alignmentContent:$t,alignments:wt,alignment:Nt,circle:Ct,paddings:St,padding:Tt,input:Bt},Pt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],At=["left","top","right","bottom"],Ot=d=>{const{alignment:i,padding:e,setPadding:n,setAlignment:o}=d;function r(){switch(i){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(s){switch(s){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}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:Pt.map(s=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{o(s)},className:G.alignment,children:[s!==i&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),s===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},s))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:At.map(s=>t.jsxRuntimeExports.jsxs("label",{className:G.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:a(s),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(e[s]),onChange:c=>n({...e,[s]:Number(c)}),paddingless:!0,borderless:!0})]},s))})]})]})]})},qt="_title_18dz7_1",Dt="_subtitle_18dz7_5",Lt="_header_18dz7_12",Mt="_text_18dz7_13",Ht="_top_18dz7_21",Ft="_itemsBlock_18dz7_30",nt={title:qt,subtitle:Dt,header:Lt,text:Mt,top:Ht,itemsBlock:Ft},Vt="_typeTexts_rcw8p_1",Ut="_block_rcw8p_8",zt="_active_rcw8p_21",dt={typeTexts:Vt,block:Ut,active:zt},Yt=["bold","italic","underline","strike-through","code"],pt=d=>{const{typesText:i,setTypesText:e}=d;function n(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:dt.typeTexts,children:Yt.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(dt.block,{[dt.active]:i.includes(o)}),onClick:()=>{const r=[...i];if(r.includes(o)){const a=r.filter(s=>s!==o);e(a)}else r.push(o),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:n(o),fill:i.includes(o)?"#252525":"#757575",width:20,height:20})},String(o)))})},mt=d=>{const{typesText:i,isActiveText:e,setIsActiveText:n,text:o,setText:r,setTypesText:a,title:s,subtitle:c="Items"}=d;return t.jsxRuntimeExports.jsxs("div",{className:nt.text,children:[(s||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:s}),e!==void 0&&n&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:u=>n(u)})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:nt.subtitle,children:c}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>r(u),value:o,maxLength:150}),t.jsxRuntimeExports.jsx(pt,{typesText:i,setTypesText:a})]})]})},Gt="_title_fyopx_1",Wt="_subtitle_fyopx_5",Xt="_header_fyopx_12",Jt="_text_fyopx_13",Qt="_productsBlock_fyopx_14",Kt="_top_fyopx_26",Zt="_itemsBlock_fyopx_35",te="_typeTexts_fyopx_41",ee="_block_fyopx_48",se="_active_fyopx_61",ne="_products_fyopx_14",oe="_product_fyopx_14",ie="_button_fyopx_80",re="_disabled_fyopx_91",ae="_image_fyopx_95",ce="_info_fyopx_102",le="_name_fyopx_114",ue="_buttons_fyopx_118",de="_modal_fyopx_125",xe="_link_fyopx_145",pe="_modalOptions_fyopx_151",H={title:Gt,subtitle:Wt,header:Xt,text:Jt,productsBlock:Qt,top:Kt,itemsBlock:Zt,typeTexts:te,block:ee,active:se,products:ne,product:oe,button:ie,disabled:re,image:ae,info:ce,name:le,buttons:ue,modal:de,link:xe,modalOptions:pe},me=m.forwardRef((d,i)=>{const{activeItem:e,setActiveItem:n,popupPosition:o,modalOptions:r,setIsOpenModal:a}=d;return t.jsxRuntimeExports.jsxs("div",{ref:i,className:H.modal,onClick:s=>{s.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:e.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{n(null),a(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:r.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[s.field],onChange:c=>{const u={...e,[s.field]:c};n(u)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(mt,{typesText:e[s.field.type],setTypesText:c=>{const u={...e,[s.field.type]:c};n(u)},text:e[s.field.text]||"",setText:c=>{const u={...e,[s.field.text]:c};n(u)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const u={...e,[s.field]:c};n(u)},value:e[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const u={...e,[s.field.text]:c};n(u)},value:e[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[s.field.switch]||!1,label:s.switchLabel,onChange:c=>{const u={...e,[s.field.switch]:c};n(u)}})]});if(s.type==="list")return t.jsxRuntimeExports.jsx(_t,{items:e[s.field]||[],setItems:c=>{const u={...e,[s.field]:c};n(u)},itemsType:"select",draggable:s.draggable||!1,itemsOptions:s.itemsOptions,deletable:s.deletable||!1,editable:!1,subtitle:s.label});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:c=>{const u={...e,[s.field]:c};n(u)},label:s.label,value:e[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[s.field]})})})})]})}),he="_other_g74jx_1",_e="_subtitle_g74jx_7",je="_items_g74jx_14",xt={other:he,subtitle:_e,items:je},lt=d=>{const{items:i,title:e="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:xt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:xt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:xt.items,children:i.map((n,o)=>t.jsxRuntimeExports.jsx(t.Switch,{current:n.isItem,onChange:r=>n.setIsItem(r),label:n.label,hasBackground:!0,paddingless:!1},o))})]})},ge=d=>{const{index:i,moveProduct:e,children:n}=d,[,o]=t.useDrop({accept:"product",hover(s){s.index!==i&&(e(s.index,i),s.index=i)}}),[{isDragging:r},a]=t.useDrag({type:"product",item:{index:i},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>a(o(s)),className:`${H.product} ${r?H.dragging:""}`,children:n})},_t=d=>{const{isActiveItems:i,setIsActiveItems:e,items:n,setItems:o,other:r,title:a,subtitle:s,editable:c=!0,draggable:u=!1,withImage:R=!1,deletable:l=!0,addable:S=!0,itemsType:j,itemsPlaceholder:h="",itemsOptions:p,hasRangeSelector:B=!1,rangeSelectorOptions:P,modalOptions:g,addableOptions:A={},limit:$,autoScrollInterval:w}=d,[_,b]=m.useState(null),[L,E]=m.useState({top:0,left:0}),[v,I]=m.useState(null),O=m.useRef(null),[q,F]=m.useState(!1),J=(x,N)=>{const y=[...n],[Y]=y.splice(x,1);y.splice(N,0,Y),o(y)};m.useEffect(()=>{const x=()=>{b(null),F(!1)};return document.body.addEventListener("click",x),b(null),F(!1),()=>{b(null),F(!1),document.body.removeEventListener("click",x)}},[]),m.useEffect(()=>{if(_){const x=[...n].map(N=>N.id===_.id?_:N);o(x)}},[_]),m.useEffect(()=>{if(O.current&&v){const x=O.current.getBoundingClientRect().height,N=window.innerHeight;let y=v.top;y+x>N+window.scrollY&&(y=N+window.scrollY-x-200),y<0&&(y=10),E({top:y,left:v.left})}},[O.current,v]);const tt=(x,N)=>{x.stopPropagation();const y=x.target.getBoundingClientRect();I({top:y.top+window.scrollY,left:y.left-30}),b(N),F(!0)};function f(x){if(R)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 T=(x,N)=>{var Y;const y=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),j==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:D=>{const st=[...n].map(Q=>Q.id===x.id?{...x,name:D}:Q);b({...x,name:D}),o([...st])},value:x.name,options:p.filter(D=>!n.find(U=>U.name===D.name)).map(D=>D.name),leftAddon:f(x.images)}),j==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:D=>{const st=[...n].map(Q=>Q.id===x.id?{...x,name:D}:Q);o([...st])},value:x.name,placeholder:h}),j==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:D=>{const st=[...n].map(Q=>Q.id===x.id?{...x,images:D}:Q);o([...st])},activeImage:(Y=n.find(D=>D.id===x.id))==null?void 0:Y.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[c&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:D=>tt(D,x)}),l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(n.filter(D=>D.id!==x.id))})]})]});return u?t.jsxRuntimeExports.jsx(ge,{product:x,index:N,moveProduct:J,children:y},x.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:y},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),_&&c&&g&&q&&t.jsxRuntimeExports.jsx(me,{ref:O,activeItem:_,setActiveItem:b,popupPosition:L,modalOptions:g,setIsOpenModal:F}),B&&P&&t.jsxRuntimeExports.jsx(ut,{...P}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:s}),u?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:n.map((x,N)=>T(x,N))}):n.map((x,N)=>T(x,N)),S&&t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!($&&$<=n.length||n.length===(p==null?void 0:p.length))}),size:"s",disabled:!!($&&$<=n.length||n.length===(p==null?void 0:p.length)),onClick:()=>{const x=[...n];let N=null;if(p){for(let y=0;y<p.length;y++)if(!n.find(Y=>Y.id===p[y].id)){N=p[y];break}}j==="select"?x.push({name:N?N.name:p[0].name,id:(N==null?void 0:N.id)||p[0].id,...A}):j==="input"?x.push({name:"",id:t.v4(),...A}):x.push({name:`Image ${n.length+1}`,id:t.v4(),...A}),o(x)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(lt,{items:r}),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."})]})},fe="_title_fyopx_1",be="_subtitle_fyopx_5",ve="_header_fyopx_12",Ee="_text_fyopx_13",Re="_productsBlock_fyopx_14",ye="_top_fyopx_26",Ie="_itemsBlock_fyopx_35",ke="_typeTexts_fyopx_41",$e="_block_fyopx_48",we="_active_fyopx_61",Ne="_products_fyopx_14",Ce="_product_fyopx_14",Se="_button_fyopx_80",Te="_disabled_fyopx_91",Be="_image_fyopx_95",Pe="_info_fyopx_102",Ae="_name_fyopx_114",Oe="_buttons_fyopx_118",qe="_modal_fyopx_125",De="_link_fyopx_145",Le="_modalOptions_fyopx_151",X={title:fe,subtitle:be,header:ve,text:Ee,productsBlock:Re,top:ye,itemsBlock:Ie,typeTexts:ke,block:$e,active:we,products:Ne,product:Ce,button:Se,disabled:Te,image:Be,info:Pe,name:Ae,buttons:Oe,modal:qe,link:De,modalOptions:Le},Me=d=>{const{isActiveItems:i,setIsActiveItems:e,items:n,setItems:o,other:r,title:a,subtitle:s,draggable:c=!1,withImage:u=!1,addable:R=!0,itemsOptions:l,hasRangeSelector:S=!1,rangeSelectorOptions:j,limit:h,autoScrollInterval:p}=d;function B(g){if(u)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=g=>{const A=l.find(w=>w.id===g);if(!A)return;const $=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})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:w=>{const _=[...n],b=l.find(v=>v.name===w);if(!b)return;const L=b.id,E=_.map(v=>v===g?L:v);o([...E])},value:A.name,options:l.filter(w=>!n.find(_=>_===w.id)).map(w=>w.name),leftAddon:B(A.images)}),t.jsxRuntimeExports.jsx("div",{className:X.buttons,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(n.filter(w=>w!==g))})})]});return t.jsxRuntimeExports.jsx("div",{className:X.product,children:$},g)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>e==null?void 0:e(g)})]}),S&&j&&t.jsxRuntimeExports.jsx(ut,{...j}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:s}),n.map(g=>P(g)),R&&t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(h&&h<=n.length||n.length===l.length)}),size:"s",disabled:!!(h&&h<=n.length||n.length===l.length),onClick:()=>{const g=[...n];let A=null;if(l){for(let $=0;$<l.length;$++)if(!n.find(w=>w===l[$].id)){A=l[$];break}}g.push((A==null?void 0:A.id)||l[0].id),o(g)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(lt,{items:r}),p!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(p.scrollInterval),onChange:g=>p.setScrollInterval(Number(g)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},He="_title_fyopx_1",Fe="_subtitle_fyopx_5",Ve="_header_fyopx_12",Ue="_text_fyopx_13",ze="_productsBlock_fyopx_14",Ye="_top_fyopx_26",Ge="_itemsBlock_fyopx_35",We="_typeTexts_fyopx_41",Xe="_block_fyopx_48",Je="_active_fyopx_61",Qe="_products_fyopx_14",Ke="_product_fyopx_14",Ze="_button_fyopx_80",ts="_disabled_fyopx_91",es="_image_fyopx_95",ss="_info_fyopx_102",ns="_name_fyopx_114",os="_buttons_fyopx_118",is="_modal_fyopx_125",rs="_link_fyopx_145",as="_modalOptions_fyopx_151",V={title:He,subtitle:Fe,header:Ve,text:Ue,productsBlock:ze,top:Ye,itemsBlock:Ge,typeTexts:We,block:Xe,active:Je,products:Qe,product:Ke,button:Ze,disabled:ts,image:es,info:ss,name:ns,buttons:os,modal:is,link:rs,modalOptions:as},cs=m.forwardRef((d,i)=>{const{activeItem:e,setActiveItem:n,popupPosition:o,modalOptions:r,setIsOpenModal:a}=d;return t.jsxRuntimeExports.jsxs("div",{ref:i,className:V.modal,onClick:s=>{s.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:e.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{n(null),a(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:V.modalOptions,children:r.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[s.field],onChange:c=>{const u={...e,[s.field]:c};n(u)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(mt,{typesText:e[s.field.type],setTypesText:c=>{const u={...e,[s.field.type]:c};n(u)},text:e[s.field.text]||"",setText:c=>{const u={...e,[s.field.text]:c};n(u)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const u={...e,[s.field]:c};n(u)},value:e[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:V.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const u={...e,[s.field.text]:c};n(u)},value:e[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[s.field.switch]||!1,label:s.switchLabel,onChange:c=>{const u={...e,[s.field.switch]:c};n(u)}})]});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:c=>{const u={...e,[s.field]:c};n(u)},label:s.label,value:e[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[s.field]})})})})]})}),ls=d=>{const{index:i,moveProduct:e,children:n}=d,[,o]=t.useDrop({accept:"product",hover(s){s.index!==i&&(e(s.index,i),s.index=i)}}),[{isDragging:r},a]=t.useDrag({type:"product",item:{index:i},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>a(o(s)),className:`${V.product} ${r?V.dragging:""}`,children:n})},us=d=>{const{isActiveItems:i,setIsActiveItems:e,items:n,setItems:o,other:r,title:a,subtitle:s,editable:c=!0,draggable:u=!1,withImage:R=!1,deletable:l=!0,addable:S=!0,itemsType:j,itemsPlaceholder:h="",itemsOptions:p,hasRangeSelector:B=!1,rangeSelectorOptions:P,modalOptions:g,addableOptions:A={}}=d,[$,w]=m.useState(null),[_,b]=m.useState({top:0,left:0}),[L,E]=m.useState(null),v=m.useRef(null),[I,O]=m.useState(!1),q=(f,T)=>{const x=[...n],[N]=x.splice(f,1);x.splice(T,0,N),o(x)};m.useEffect(()=>{const f=()=>{w(null),O(!1)};return document.body.addEventListener("click",f),w(null),O(!1),()=>{w(null),O(!1),document.body.removeEventListener("click",f)}},[]),m.useEffect(()=>{if($){const f=[...n].map(T=>T.id===$.id?$:T);o(f)}},[$]),m.useEffect(()=>{if(v.current&&L){const f=v.current.getBoundingClientRect().height,T=window.innerHeight;let x=L.top;x+f>T+window.scrollY&&(x=T+window.scrollY-f-200),x<0&&(x=10),b({top:x,left:L.left})}},[v.current,L]);const F=(f,T)=>{f.stopPropagation();const x=f.target.getBoundingClientRect();E({top:x.top+window.scrollY,left:x.left-30}),w(T),O(!0)};function J(f){if(R)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const tt=(f,T)=>{var N;const x=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),j==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const D=[...n].map(U=>U.id===f.id?{...f,name:y}:U);w({...f,name:y}),o([...D])},value:f.name,options:p.filter(y=>!n.find(Y=>Y.name===y)),leftAddon:J(f.images)}),j==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:y=>{const D=[...n].map(U=>U.id===f.id?{...f,name:y}:U);o([...D])},value:f.name,placeholder:h}),j==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:y=>{const D=[...n].map(U=>U.id===f.id?{...f,images:y}:U);o([...D])},activeImage:(N=n.find(y=>y.id===f.id))==null?void 0:N.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[c&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>F(y,f)}),l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(n.filter(y=>y.id!==f.id))})]})]});return u?t.jsxRuntimeExports.jsx(ls,{product:f,index:T,moveProduct:q,children:x},f.id):t.jsxRuntimeExports.jsx("div",{className:V.product,children:x},f.id)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:f=>e==null?void 0:e(f)})]}),$&&c&&g&&I&&t.jsxRuntimeExports.jsx(cs,{ref:v,activeItem:$,setActiveItem:w,popupPosition:_,modalOptions:g,setIsOpenModal:O}),B&&P&&t.jsxRuntimeExports.jsx(ut,{...P}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:s}),u?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:n.map((f,T)=>tt(f,T))}):n.map((f,T)=>tt(f,T)),S&&t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:V.button,size:"s",onClick:()=>{const f=[...n];let T=null;if(p){for(let x=0;x<p.length;x++)if(!n.find(N=>N.name===p[x])){T=p[x];break}}j==="select"?f.push({name:T||p[0],id:t.v4(),...A}):j==="input"?f.push({name:"",id:t.v4(),...A}):f.push({name:`Image ${n.length+1}`,id:t.v4(),...A}),o(f)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(lt,{items:r})]})},ds="_title_dkxs6_1",xs="_subtitle_dkxs6_5",ps="_header_dkxs6_12",ms="_text_dkxs6_13",hs="_productsBlock_dkxs6_14",_s="_buttonsBlock_dkxs6_15",js="_top_dkxs6_26",gs="_itemsBlock_dkxs6_35",fs="_typeTexts_dkxs6_41",bs="_block_dkxs6_48",vs="_active_dkxs6_60",Es="_products_dkxs6_14",Rs="_product_dkxs6_14",ys="_button_dkxs6_15",Is="_image_dkxs6_90",ks="_info_dkxs6_97",$s="_name_dkxs6_109",ws="_buttons_dkxs6_15",Ns="_modal_dkxs6_120",Cs="_other_dkxs6_140",Ss="_options_dkxs6_146",et={title:ds,subtitle:xs,header:ps,text:ms,productsBlock:hs,buttonsBlock:_s,top:js,itemsBlock:gs,typeTexts:fs,block:bs,active:vs,products:Es,product:Rs,button:ys,image:Is,info:ks,name:$s,buttons:ws,modal:Ns,other:Cs,options:Ss},Ts=m.forwardRef((d,i)=>{const{activeButton:e,setActiveButton:n,popupPosition:o}=d,[r,a]=m.useState(e.typesText),[s,c]=m.useState(e.destination),[u,R]=m.useState(e.page),[l,S]=m.useState(e.link||""),[j,h]=m.useState(e.text||""),[p,B]=m.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return m.useEffect(()=>{n({...e,...{text:j,link:l,destination:s,typesText:r,page:u,openInNewTab:p}})},[r,s,l,j,u,p]),t.jsxRuntimeExports.jsxs("div",{className:et.modal,onClick:g=>{g.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(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>n(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:et.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:g=>c(g),options:["Go to Page","Open Link"].filter(g=>g!==s),value:s}),s==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:g=>R(g),options:P?Object.values(P).filter(g=>g.name!==u).map(g=>g.name):[],value:u}):t.jsxRuntimeExports.jsx(t.Input,{onChange:g=>S(g),value:l,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:g=>B(g)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:g=>h(g),value:j,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(pt,{typesText:r,setTypesText:a})]})]})}),Bs="_subtitle_m8qel_1",Ps="_header_m8qel_8",As="_text_m8qel_9",Os="_productsBlock_m8qel_10",qs="_buttonsBlock_m8qel_11",Ds="_top_m8qel_23",Ls="_itemsBlock_m8qel_32",Ms="_typeTexts_m8qel_38",Hs="_block_m8qel_45",Fs="_active_m8qel_58",Vs="_products_m8qel_10",Us="_product_m8qel_10",zs="_button_m8qel_11",Ys="_image_m8qel_88",Gs="_info_m8qel_95",Ws="_name_m8qel_107",Xs="_buttons_m8qel_11",Js="_modal_m8qel_118",Qs="_other_m8qel_137",Ks="_options_m8qel_143",ot={subtitle:Bs,header:Ps,text:As,productsBlock:Os,buttonsBlock:qs,top:Ds,itemsBlock:Ls,typeTexts:Ms,block:Hs,active:Fs,products:Vs,product:Us,button:zs,image:Ys,info:Gs,name:Ws,buttons:Xs,modal:Js,other:Qs,options:Ks},jt=d=>{const{buttons:i,setButtons:e,deletable:n=!0,addable:o=!0}=d,[r,a]=m.useState(null),[s,c]=m.useState({top:0,left:0}),[u,R]=m.useState(null),l=m.useRef(null);m.useEffect(()=>{const j=()=>{a(null)};return document.body.addEventListener("click",j),a(null),()=>{a(null),document.body.removeEventListener("click",j)}},[]),m.useEffect(()=>{if(r){const j=[...i].map(h=>h.id===r.id?r:h);e(j)}},[r]),m.useEffect(()=>{if(l.current&&u){const j=l.current.getBoundingClientRect().height,h=window.innerHeight;let p=u.top;p+j>h+window.scrollY&&(p=h+window.scrollY-j-200),p<0&&(p=10),c({top:p,left:u.left})}},[l.current,u]);const S=(j,h)=>{j.stopPropagation();const p=j.target.getBoundingClientRect();R({top:p.top+window.scrollY,left:p.left-30}),a(h)};return t.jsxRuntimeExports.jsxs("div",{className:ot.products,children:[t.jsxRuntimeExports.jsx("h5",{className:ot.subtitle,children:"Button Type"}),i.map(j=>t.jsxRuntimeExports.jsxs("div",{className:ot.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:h=>{const B=[...i].map(P=>P.id===j.id?{...j,type:h}:P);e(B)},value:j.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:ot.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:h=>{S(h,j)}}),n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const h=i.filter(p=>p.id!==j.id);e(h)},width:20,height:20,fill:"#C12A2A"})]})]},j.id)),r&&t.jsxRuntimeExports.jsx(Ts,{ref:l,activeButton:r,setActiveButton:a,popupPosition:s}),o&&t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:ot.button,size:"s",onClick:()=>{const j=[...i];j.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(j)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Zs=d=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:n,setButtons:o}=d;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:r=>e(r)})]}),t.jsxRuntimeExports.jsx(jt,{buttons:n,setButtons:o})]})})},tn="_wrapper_m18qi_1",en="_subtitle_m18qi_7",sn="_content_m18qi_14",nn="_range_m18qi_22",on="_track_m18qi_27",rn="_progress_m18qi_36",an="_dots_m18qi_46",cn="_dot_m18qi_46",ln="_active_m18qi_65",un="_input_m18qi_77",dn="_countBlock_m18qi_91",xn="_count_m18qi_91",pn="_controls_m18qi_107",mn="_button_m18qi_113",M={wrapper:tn,subtitle:en,content:sn,range:nn,track:on,progress:rn,dots:an,dot:cn,active:ln,input:un,countBlock:dn,count:xn,controls:pn,button:mn},ut=d=>{const{label:i,min:e=1,max:n=4,step:o=1,count:r,setCount:a}=d,[s,c]=m.useState(!1),u=Array.from({length:(n-e)/o+1}),R=(r-e)/(n-e)*100,l=()=>{r<n&&a(r+o)},S=()=>{r>e&&a(r-o)},j=h=>{const p=e+h*o;a(p)};return t.jsxRuntimeExports.jsxs("div",{className:M.wrapper,children:[i&&t.jsxRuntimeExports.jsx("h5",{className:M.subtitle,children:i}),t.jsxRuntimeExports.jsxs("div",{className:M.content,children:[t.jsxRuntimeExports.jsxs("div",{className:M.range,children:[t.jsxRuntimeExports.jsx("div",{className:M.track}),t.jsxRuntimeExports.jsx("div",{className:M.progress,style:{width:`${R}%`}}),t.jsxRuntimeExports.jsx("div",{className:M.dots,children:u.map((h,p)=>{const B=p<=(r-e)/o;return t.jsxRuntimeExports.jsx("button",{onClick:()=>j(p),className:t.clx(M.dot,{[M.active]:B,[M.inactive]:!B,[M.dragging]:s}),"aria-label":`Set value to ${e+p*o}`},p)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:n,step:o,value:r,onChange:h=>a(Number(h.target.value)),onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),className:M.input})]}),t.jsxRuntimeExports.jsxs("div",{className:M.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:n,paddingless:!0,onChange:h=>{const p=Number(h);p>n?a(n):p<e?a(e):a(p)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:M.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:l,disabled:r>=n,className:M.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:S,disabled:r<=e,className:M.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},hn="_title_1hw31_1",_n="_subtitle_1hw31_5",jn="_header_1hw31_12",gn="_text_1hw31_13",fn="_productsBlock_1hw31_14",bn="_top_1hw31_26",vn="_itemsBlock_1hw31_35",En="_typeTexts_1hw31_41",Rn="_block_1hw31_48",yn="_active_1hw31_61",In="_products_1hw31_14",kn="_product_1hw31_14",$n="_button_1hw31_80",wn="_image_1hw31_91",Nn="_info_1hw31_98",Cn="_name_1hw31_110",Sn="_buttons_1hw31_114",Tn="_modal_1hw31_121",Bn="_link_1hw31_141",Pn="_modalOptions_1hw31_147",z={title:hn,subtitle:_n,header:jn,text:gn,productsBlock:fn,top:bn,itemsBlock:vn,typeTexts:En,block:Rn,active:yn,products:In,product:kn,button:$n,image:wn,info:Nn,name:Cn,buttons:Sn,modal:Tn,link:Bn,modalOptions:Pn},An=d=>{const{activeItem:i,setActiveItem:e,popupPosition:n,setIsOpenModal:o,itemsOptions:r}=d,a=r.find(c=>c.id===i.listingId);if(!a)return null;function s(c,u){return c.length>u?`${c.slice(0,u)}...`:c}return t.jsxRuntimeExports.jsxs("div",{className:z.modal,onClick:c=>{c.stopPropagation()},style:{top:`${n.top}px`,left:`${n.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[t.jsxRuntimeExports.jsx("h3",{children:s(a.productData.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,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:c=>{const u={...i,image:c[0]};e(u)}})})]})},On=d=>{const{index:i,moveProduct:e,children:n}=d,[,o]=t.useDrop({accept:"product",hover(s){s.index!==i&&(e(s.index,i),s.index=i)}}),[{isDragging:r},a]=t.useDrag({type:"product",item:{index:i},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>a(o(s)),className:`${z.product} ${r?z.dragging:""}`,children:n})},qn=d=>{const{isActiveItems:i,setIsActiveItems:e,items:n,setItems:o,other:r,title:a,subtitle:s,editable:c=!0,draggable:u=!1,withImage:R=!1,deletable:l=!0,addable:S=!0,itemsType:j,itemsOptions:h}=d,[p,B]=m.useState(null),[P,g]=m.useState({top:0,left:0}),[A,$]=m.useState(!1),w=(E,v)=>{const I=[...n],[O]=I.splice(E,1);I.splice(v,0,O),o(I)};m.useEffect(()=>{const E=()=>{B(null),$(!1)};return document.body.addEventListener("click",E),B(null),$(!1),()=>{B(null),$(!1),document.body.removeEventListener("click",E)}},[]),m.useEffect(()=>{if(p){const E=[...n].map(v=>v.listingId===p.listingId?p:v);o(E)}},[p]);const _=(E,v)=>{E.stopPropagation();const I=E.target.getBoundingClientRect(),O=100,q=window.innerHeight;let F=I.top+window.scrollY;F+O>q&&(F=q-O-20),$(!0),g({top:F-80,left:I.left-30}),B(v)};function b(E){if(R)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=(E,v)=>{const I=h.find(q=>E.listingId===q.id);if(!I)return null;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},v),j==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:q=>{const F=[...n],J=h.find(T=>T.productData.name===q);if(!J)return;const tt={listingId:J.id,image:J.productData.images.length>0?J.productData.images[0].cfId:""},f=F.map(T=>T.listingId===E.listingId?tt:T);B(tt),o([...f])},value:I.productData.name,options:[...h.filter(q=>!n.find(F=>F.listingId===q.id)).map(q=>q.productData.name)],leftAddon:b(E.image||I.productData.images.length>0&&I.productData.images[0].cfId||"")},v),t.jsxRuntimeExports.jsxs("div",{className:z.buttons,children:[c&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:q=>_(q,E)}),l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(n.filter(q=>q!==E))})]})]});return u?t.jsxRuntimeExports.jsx(On,{product:E,index:v,moveProduct:w,children:O},E.listingId):t.jsxRuntimeExports.jsx("div",{className:z.product,children:O},E.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:z.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:z.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:E=>e==null?void 0:e(E)})]}),A&&p&&t.jsxRuntimeExports.jsx(An,{activeItem:p,setActiveItem:B,setIsOpenModal:$,popupPosition:P,itemsOptions:h}),t.jsxRuntimeExports.jsxs("div",{className:z.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:s}),u?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:n.map((E,v)=>L(E,v))}):n.map((E,v)=>L(E,v)),S&&t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:z.button,size:"s",onClick:()=>{const E=[...n];for(let v=0;v<h.length;v++)if(!n.find(I=>I.listingId===h[v].id)){E.push({listingId:h[v].id,image:h[v].productData.images.length>0?h[v].productData.images[0].cfId:""});break}o(E)},disabled:n.length===h.length,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(lt,{items:r})]})},Dn="_options_1w11v_1",Ln="_price_1w11v_12",Mn="_oldPrice_1w11v_19",Hn="_newPrice_1w11v_27",Fn="_animate_1w11v_34",Vn="_appearAndBounce_1w11v_1",Un="_meta_1w11v_52",zn="_info_1w11v_58",Yn="_infoRight_1w11v_66",Gn="_buttons_1w11v_73",Wn="_variants_1w11v_80",Xn="_variant_1w11v_80",Jn="_stock_1w11v_97",Qn="_variantInfo_1w11v_104",Kn="_quantity_1w11v_110",Zn="_count_1w11v_117",to="_focused_1w11v_134",eo="_button_1w11v_73",so="_activeVariant_1w11v_160",no="_chargeTypes_1w11v_164",oo="_charge_1w11v_164",io="_chargeActive_1w11v_185",ro="_title_1w11v_190",k={options:Dn,price:Ln,oldPrice:Mn,newPrice:Hn,animate:Fn,appearAndBounce:Vn,meta:Un,info:zn,infoRight:Yn,buttons:Gn,variants:Wn,variant:Xn,stock:Jn,variantInfo:Qn,quantity:Kn,count:Zn,focused:to,button:eo,activeVariant:so,chargeTypes:no,charge:oo,chargeActive:io,title:ro};var gt=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(gt||{});const ao=d=>{var $,w;const{variants:i}=d,[e,n]=m.useState(i[0]),[o,r]=m.useState(e.chargeTypes[0]),a=t.useNavigate(),[s,c]=m.useState(1),[u,R]=m.useState(!1),{reset:l,addProductToCart:S,getProducts:j}=t.useCart(),[h,p]=m.useState(!1);m.useEffect(()=>{p(!0);const _=setTimeout(()=>p(!1),600);return()=>clearTimeout(_)},[s]);async function B(){await j(),await S({productId:d.id,productVariantId:e.id,quantity:s})}function P(){l(),B(),a("/checkout")}function g(_){if(_>=864e5){const I=Math.floor(_/864e5);return`${I} ${I===1?"day":"days"}`}else if(_>=36e5){const I=Math.floor(_/36e5);return`${I} ${I===1?"hour":"hours"}`}else if(_>=6e4){const I=Math.floor(_/6e4);return`${I} ${I===1?"minute":"minutes"}`}else{const I=Math.floor(_/1e3);return`${I} ${I===1?"second":"seconds"}`}}function A(_,b){return _.length>b?_.slice(0,b)+"...":_}return t.jsxRuntimeExports.jsxs("div",{className:k.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:k.chargeTypes,children:e.chargeTypes.map(_=>t.jsxRuntimeExports.jsx("div",{className:t.clx(k.charge,{[k.chargeActive]:o===_}),onClick:()=>r(_),children:gt[_]},_))}),t.jsxRuntimeExports.jsx("div",{className:k.variants,children:i.map(_=>{var b;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(k.variant,{[k.activeVariant]:e.id===_.id}),onClick:()=>n(_),children:[t.jsxRuntimeExports.jsxs("div",{className:k.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:k.title,children:A(_.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?_.price.amount:_.subscriptionSettings?_.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:k.stock,children:[((b=_.quantity.restrictions)==null?void 0:b.max)||_.quantity.available||0," in stock"]})})]},_.id)})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:k.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{s>1?c(_=>_-1):c(1)},className:k.button,disabled:e.quantity.restrictions&&s<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(k.count,{[k.focused]:u}),onFocus:()=>R(!0),onBlur:()=>R(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(s),onChange:_=>c(Number(_)),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:()=>{c(_=>_+1)},className:k.button,disabled:!!(e.quantity.restrictions&&s>=e.quantity.restrictions.max||e.quantity.available&&s>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:k.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:k.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":g(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:k.infoRight,children:o==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",(e.price.amount||0)*s]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*s]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",(e.price.amount||0)*s]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.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:()=>B(),children:"Add to Cart"})]})]})},co="_button_1861a_1",lo="_login_1861a_14",uo="_signUp_1861a_18",xo="_buttons_1861a_23",po="_modal_1861a_32",mo="_info_1861a_60",ho="_top_1861a_67",_o="_title_1861a_78",jo="_clear_1861a_84",go="_activeClear_1861a_91",fo="_count_1861a_95",bo="_cart_1861a_110",vo="_empty_1861a_118",Eo="_product_1861a_144",Ro="_products_1861a_153",yo="_image_1861a_161",Io="_productInfo_1861a_167",ko="_content_1861a_174",$o="_name_1861a_180",wo="_price_1861a_186",No="_productButtons_1861a_192",Co="_productButton_1861a_192",So="_productCount_1861a_212",To="_bottom_1861a_228",Bo="_subtotal_1861a_236",Po="_block_1861a_244",Ao="_shoppingCount_1861a_251",Oo="_total_1861a_271",qo="_link_1861a_277",Do="_userInfo_1861a_284",C={button:co,login:lo,signUp:uo,buttons:xo,modal:po,info:mo,top:ho,title:_o,clear:jo,activeClear:go,count:fo,cart:bo,empty:vo,product:Eo,products:Ro,image:yo,productInfo:Io,content:ko,name:$o,price:wo,productButtons:No,productButton:Co,productCount:So,bottom:To,subtotal:Bo,block:Po,shoppingCount:Ao,total:Oo,link:qo,userInfo:Do},Lo="_button_bymeg_1",Mo="_primary_bymeg_19",Ho="_primaryHovered_bymeg_30",Fo="_secondary_bymeg_34",Vo="_secondaryHovered_bymeg_44",Uo="_tertiary_bymeg_48",zo="_tertiaryHovered_bymeg_58",Yo="_content_bymeg_62",K={button:Lo,primary:Mo,primaryHovered:Ho,secondary:Fo,secondaryHovered:Vo,tertiary:Uo,tertiaryHovered:zo,content:Yo},ct=d=>{const{children:i,onClick:e,style:n,className:o,disabled:r=!1,type:a="Primary"}=d,{themeSettings:s}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(K.button,o,{[K.primary]:a==="Primary",[K.secondary]:a==="Secondary",[K.tertiary]:a==="Tertiary",[K.primaryHovered]:a==="Primary"&&!r&&s.buttons.primary.hover,[K.secondaryHovered]:a==="Secondary"&&!r&&s.buttons.secondary.hover,[K.tertiaryHovered]:a==="Tertiary"&&!r&&s.buttons.tertiary.hover}),onClick:e,style:{...n},disabled:r,children:a==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:K.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),i]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:i})})};class rt extends Error{}rt.prototype.name="InvalidTokenError";function Go(d){return decodeURIComponent(atob(d).replace(/(.)/g,(i,e)=>{let n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Wo(d){let i=d.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 Go(i)}catch{return atob(i)}}function Xo(d,i){if(typeof d!="string")throw new rt("Invalid token specified: must be a string");i||(i={});const e=i.header===!0?0:1,n=d.split(".")[e];if(typeof n!="string")throw new rt(`Invalid token specified: missing part #${e+1}`);let o;try{o=Wo(n)}catch(r){throw new rt(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(o)}catch(r){throw new rt(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const Jo=d=>{const{shopping:i,signUp:e}=d,n=t.useNavigate();function o(a){n(a)}const r=JSON.parse(localStorage.getItem("token")||"{}");return t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[i&&t.jsxRuntimeExports.jsx(ft,{}),!r.data&&t.jsxRuntimeExports.jsx(ct,{onClick:()=>o("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),!r.data&&e&&t.jsxRuntimeExports.jsx(ct,{onClick:()=>o("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"}),r.data&&t.jsxRuntimeExports.jsx(Et,{token:r.data})]})},ft=()=>{const[d,i]=m.useState(!1),[e,n]=m.useState([]),{cart:o,getProducts:r}=t.useCart();function a(R){for(let l=0;l<o.parts.length;l++)for(let S=0;S<R.variants.length;S++)if(o.parts[l].productVariantId===R.variants[l].id)return o.parts[l].productVariantId}function s(R){for(let l=0;l<o.parts.length;l++)for(let S=0;S<R.variants.length;S++)if(o.parts[l].productVariantId===R.variants[l].id)return o.parts[l].quantity}m.useEffect(()=>{(async()=>{const l=o.parts.map(h=>String(h.productId)),j=(await r([...l])).map(h=>({...h,activeVariantId:a(h),quantity:s(h)}));n(j)})()},[o]);function c(R){var l;return!R||!(R!=null&&R.variants)?!1:(l=R.variants.find(S=>S.id===R.activeVariantId))==null?void 0:l.subscriptionSettings}const u=o.parts.length>0&&e.length>0&&!c(e[0]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:C.button,onClick:R=>{R.stopPropagation(),window.location.pathname!=="/admin/builder"&&i(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),u&&t.jsxRuntimeExports.jsx("div",{className:C.shoppingCount,children:o.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(bt,{activeProducts:e,isCartNotEmpty:u})})]})},bt=d=>{const{activeProducts:i,isCartNotEmpty:e}=d,{cart:n,reset:o,getTotalAndDiscount:r,updateQuantityOfProduct:a}=t.useCart(),s=t.useNavigate();function c(l){s(l)}function u(l){a({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity+1})}function R(l){a({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:C.modal,onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:C.count,children:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(C.clear,{[C.activeClear]:e}),disabled:!e,onClick:()=>o(),children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:C.cart,children:[t.jsxRuntimeExports.jsx("div",{className:C.products,children:i.map(l=>t.jsxRuntimeExports.jsxs("div",{className:C.product,children:[t.jsxRuntimeExports.jsxs("div",{className:C.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:C.image}),t.jsxRuntimeExports.jsxs("div",{className:C.content,children:[t.jsxRuntimeExports.jsx("div",{className:C.name,children:l.name}),t.jsxRuntimeExports.jsxs("div",{className:C.price,children:["$",l.variants.find(S=>S.id===l.activeVariantId).price.amount*((l==null?void 0:l.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{l.quantity!==1&&R(l)},className:C.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:C.productCount,children:l.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>u(l),className:C.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},l.id))}),t.jsxRuntimeExports.jsxs("div",{className:C.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:C.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:C.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:C.total,children:["$",r().total]})]}),t.jsxRuntimeExports.jsx(ct,{onClick:()=>c("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(vt,{})]})},vt=()=>t.jsxRuntimeExports.jsxs("div",{className:C.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsxs("span",{children:["Check out the store's products and add them"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:C.link,children:"here"})]})]}),Et=({token:d})=>{const[i,e]=m.useState("test-email@gmail.com"),n=t.useNavigate();m.useEffect(()=>{(async()=>{const a=Xo(d);e(a.email)})()},[d]);function o(r){n(r)}return t.jsxRuntimeExports.jsx("div",{className:C.userInfo,onClick:()=>o("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:i||"test-email@gmail.com"})})},Qo="_share_9g414_1",Ko="_modal_9g414_8",Zo="_header_9g414_14",ti="_socials_9g414_24",ei="_social_9g414_24",si="_copy_9g414_34",ni="_title_9g414_41",oi="_copyWrapper_9g414_47",ii="_copyText_9g414_56",W={share:Qo,modal:Ko,header:Zo,socials:ti,social:ei,copy:si,title:ni,copyWrapper:oi,copyText:ii},ri=()=>{const{isOpenModal:d,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:W.share,onClick:n=>{n.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(ai,{})})]})},ht={facebook:"FacebookLogo","x.com":"TwitterLogo",telegram:"TelegramLogo",instagram:"InstagramLogo",discord:"MessengerLogo",tiktok:"TiktokLogo"},ai=()=>{const{setIsOpenModal:d}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),n=window.location.href;function o(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:W.modal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:W.header,children:[t.jsxRuntimeExports.jsx("div",{className:W.title,children:"Share this Post"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>d(!1),hoverable:!0})]}),t.jsxRuntimeExports.jsx("div",{className:W.socials,children:Object.keys(ht).map(r=>t.jsxRuntimeExports.jsx("div",{className:W.social,children:t.jsxRuntimeExports.jsx(t.Icon,{name:ht[r]})}))}),t.jsxRuntimeExports.jsxs("div",{className:W.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(W.copy,W.copyText),onClick:o,children:n}),t.jsxRuntimeExports.jsx("div",{onClick:o,className:W.copy,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ci="_accordion_1s1lq_1",li="_header_1s1lq_9",ui="_icon_1s1lq_18",di="_open_1s1lq_21",xi="_content_1s1lq_25",it={accordion:ci,header:li,icon:ui,open:di,content:xi},pi=({title:d,content:i})=>{const[e,n]=m.useState(!1),[o,r]=m.useState(0),a=m.useRef(null),s=()=>{n(!e)};return m.useEffect(()=>{a.current&&r(e?a.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:it.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:it.header,onClick:s,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(it.icon,{[it.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:a,className:it.content,style:{height:`${o}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},mi="_wrapper_1r14x_1",hi="_label_1r14x_9",_i="_input_1r14x_18",ji="_required_1r14x_35",gi="_paddingless_1r14x_39",fi="_content_1r14x_43",bi="_borderless_1r14x_58",vi="_rightIcon_1r14x_63",Z={wrapper:mi,label:hi,input:_i,required:ji,paddingless:gi,content:fi,borderless:bi,rightIcon:vi},Ei=d=>{const{onChange:i,style:e,label:n,value:o,type:r,min:a,max:s,placeholder:c,disabled:u=!1,required:R=!1,regex:l,paddingless:S=!1,borderless:j=!1,editable:h=!1,isSearch:p=!1}=d,{themeSettings:B}=t.useThemeSettingsStore(),{inputs:P}=B,[g,A]=m.useState(!1);function $(b,L){if(b.startsWith("#")){let I,O,q;return b.length===7?(I=parseInt(b.slice(1,3),16),O=parseInt(b.slice(3,5),16),q=parseInt(b.slice(5,7),16)):b.length===4&&(I=parseInt(b[1]+b[1],16),O=parseInt(b[2]+b[2],16),q=parseInt(b[3]+b[3],16)),`rgba(${I}, ${O}, ${q}, ${L})`}const v={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff"}[b.toLowerCase()];return v?$(v,L):b}function w(b){return Number(b)<0?String(a):b}function _(b){return!R||!l?!0:new RegExp(l).test(b)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[n&&t.jsxRuntimeExports.jsx("label",{className:Z.label,htmlFor:n,children:n}),t.jsxRuntimeExports.jsxs("div",{className:Z.content,style:{paddingRight:P.general.height+15,...e,backgroundColor:$(P.field.color,P.field.opacity/100)},children:[t.jsxRuntimeExports.jsx("input",{id:n,type:r||"text",onChange:b=>{if(r==="text")i(b.target.value);else{const L=w(b.target.value);i(L)}},value:o,autoComplete:"off",placeholder:c||"Type something...",className:t.clx(Z.input,{[Z.required]:g&&R&&!_(o),[Z.paddingless]:S,[Z.borderless]:j}),min:r==="number"?a:void 0,max:r==="number"?s:void 0,disabled:u,onFocus:()=>A(!0)}),p&&t.jsxRuntimeExports.jsx("div",{className:Z.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})})]})]})},Ri="_wrapper_st58d_1",yi="_label_st58d_10",Ii="_textarea_st58d_18",ki="_length_st58d_33",at={wrapper:Ri,label:yi,textarea:Ii,length:ki},$i=d=>{const{onChange:i,label:e,value:n,maxLength:o,placeholder:r="Type something..."}=d,[a,s]=m.useState(n.length);return t.jsxRuntimeExports.jsxs("div",{className:at.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:at.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:n,onChange:c=>{s(c.target.value.length),i(c.target.value)},placeholder:r,className:at.textarea,maxLength:o}),o&&t.jsxRuntimeExports.jsxs("div",{className:at.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=pi;exports.Button=ct;exports.ButtonTypeSettings=jt;exports.ButtonsSettings=Zs;exports.CategorySettings=Me;exports.EmptyCart=vt;exports.FormSettings=us;exports.HeaderButtons=Jo;exports.InputUI=Ei;exports.ItemsSettings=_t;exports.LayoutSettings=Ot;exports.ListingSelector=qn;exports.ProductOptions=ao;exports.RangeSelector=ut;exports.ShareLink=ri;exports.ShoppingButton=ft;exports.ShoppingModalCart=bt;exports.TextSettings=mt;exports.TextareaUI=$i;exports.TypesText=pt;exports.UserInfo=Et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-J6kEvjGE.cjs"),h=require("react");require("@phosphor-icons/react");const Rt="_wrapper_9rr5j_2",yt="_alignmentBlock_9rr5j_8",It="_title_9rr5j_15",wt="_subtitle_9rr5j_22",kt="_alignmentContent_9rr5j_29",$t="_alignments_9rr5j_37",Nt="_alignment_9rr5j_8",Ct="_circle_9rr5j_58",St="_paddings_9rr5j_65",Bt="_padding_9rr5j_65",Tt="_input_9rr5j_84",G={wrapper:Rt,alignmentBlock:yt,title:It,subtitle:wt,alignmentContent:kt,alignments:$t,alignment:Nt,circle:Ct,paddings:St,padding:Bt,input:Tt},Pt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],At=["left","top","right","bottom"],Ot=u=>{const{alignment:o,padding:e,setPadding:s,setAlignment:i}=u;function a(){switch(o){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(r){switch(r){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}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:Pt.map(r=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(r)},className:G.alignment,children:[r!==o&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),r===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(),fill:"#FF3F19",width:22,height:22})]},r))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:At.map(r=>t.jsxRuntimeExports.jsxs("label",{className:G.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(r),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[r]),onChange:n=>s({...e,[r]:Number(n)}),paddingless:!0,borderless:!0})]},r))})]})]})]})},qt="_title_voimd_1",Dt="_subtitle_voimd_5",Lt="_header_voimd_12",Mt="_text_voimd_13",Ht="_top_voimd_20",zt="_itemsBlock_voimd_29",it={title:qt,subtitle:Dt,header:Lt,text:Mt,top:Ht,itemsBlock:zt},Ft="_typeTexts_167ez_1",Vt="_block_167ez_8",Ut="_active_167ez_25",xt={typeTexts:Ft,block:Vt,active:Ut},Yt=["bold","italic","underline","strike-through","code"],pt=u=>{const{typesText:o,setTypesText:e}=u;function s(i){switch(i){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:xt.typeTexts,children:Yt.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(xt.block,{[xt.active]:o.includes(i)}),onClick:()=>{const a=[...o];if(a.includes(i)){const c=a.filter(r=>r!==i);e(c)}else a.push(i),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(i),fill:o.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},ht=u=>{const{typesText:o,isActiveText:e,setIsActiveText:s,text:i,setText:a,setTypesText:c,title:r,subtitle:n="Items"}=u;return t.jsxRuntimeExports.jsxs("div",{className:it.text,children:[(r||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:it.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:it.title,children:r}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:l=>s(l)})]}),t.jsxRuntimeExports.jsxs("div",{className:it.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:it.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:l=>a(l),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(pt,{typesText:o,setTypesText:c})]})]})},Gt="_title_vzbkd_1",Wt="_subtitle_vzbkd_5",Xt="_header_vzbkd_12",Jt="_text_vzbkd_13",Qt="_productsBlock_vzbkd_14",Kt="_top_vzbkd_26",Zt="_itemsBlock_vzbkd_35",te="_typeTexts_vzbkd_41",ee="_block_vzbkd_48",se="_active_vzbkd_61",ne="_products_vzbkd_14",ie="_product_vzbkd_14",oe="_button_vzbkd_80",re="_disabled_vzbkd_91",ae="_image_vzbkd_95",ce="_info_vzbkd_102",le="_name_vzbkd_114",de="_buttons_vzbkd_118",ue="_modal_vzbkd_125",xe="_link_vzbkd_145",me="_modalOptions_vzbkd_151",pe="_addButton_vzbkd_163",M={title:Gt,subtitle:Wt,header:Xt,text:Jt,productsBlock:Qt,top:Kt,itemsBlock:Zt,typeTexts:te,block:ee,active:se,products:ne,product:ie,button:oe,disabled:re,image:ae,info:ce,name:le,buttons:de,modal:ue,link:xe,modalOptions:me,addButton:pe},he=h.forwardRef((u,o)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:a,setIsOpenModal:c}=u;function r(n,l){return n.length>l?`${n.slice(0,l)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:o,className:M.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[t.jsxRuntimeExports.jsx("h3",{className:M.title,children:r(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:M.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:l=>{const x={...e,[n.field]:l};s(x)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ht,{typesText:e[n.field.type],setTypesText:l=>{const x={...e,[n.field.type]:l};s(x)},text:e[n.field.text]||"",setText:l=>{const x={...e,[n.field.text]:l};s(x)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:l=>{const x={...e,[n.field]:l};s(x)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:M.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:l=>{const x={...e,[n.field.text]:l};s(x)},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:l=>{const x={...e,[n.field.switch]:l};s(x)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(_t,{items:e[n.field]||[],setItems:l=>{const x={...e,[n.field]:l};s(x)},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:l=>{const x={...e,[n.field]:l};s(x)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),_e="_other_g74jx_1",je="_subtitle_g74jx_7",ge="_items_g74jx_14",mt={other:_e,subtitle:je,items:ge},dt=u=>{const{items:o,title:e="Other"}=u;return t.jsxRuntimeExports.jsxs("div",{className:mt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:mt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:mt.items,children:o.map((s,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:a=>s.setIsItem(a),label:s.label,hasBackground:!0,paddingless:!1},i))})]})},fe=u=>{const{index:o,moveProduct:e,children:s}=u,[,i]=t.useDrop({accept:"product",hover(r){r.index!==o&&(e(r.index,o),r.index=o)}}),[{isDragging:a},c]=t.useDrag({type:"product",item:{index:o},collect:r=>({isDragging:r.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:r=>c(i(r)),className:`${M.product} ${a?M.dragging:""}`,children:s})},_t=u=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:i,other:a,title:c,subtitle:r,editable:n=!0,draggable:l=!1,withImage:x=!1,deletable:d=!0,addable:S=!0,itemsType:g,itemsPlaceholder:_="",itemsOptions:p,hasRangeSelector:T=!1,rangeSelectorOptions:P,modalOptions:f,addableOptions:O={},limit:k,autoScrollInterval:$}=u,[j,v]=h.useState(null),[L,R]=h.useState({top:0,left:0}),[E,I]=h.useState(null),q=h.useRef(null),[D,F]=h.useState(!1),X=(m,N)=>{const y=[...s],[Y]=y.splice(m,1);y.splice(N,0,Y),i(y)};h.useEffect(()=>{const m=()=>{v(null),F(!1)};return document.body.addEventListener("click",m),v(null),F(!1),()=>{v(null),F(!1),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(j){const m=[...s].map(N=>N.id===j.id?j:N);i(m)}},[j]),h.useEffect(()=>{if(q.current&&E){const m=q.current.getBoundingClientRect().height,N=window.innerHeight;let y=E.top;y+m>N+window.scrollY-200&&(y=N+window.scrollY-m-200),y<0&&(y=10),R({top:y,left:E.left})}},[q.current,E]);const Z=(m,N)=>{m.stopPropagation();const y=m.target.getBoundingClientRect();I({top:y.top+window.scrollY,left:y.left-30}),v(N),F(!0)};function b(m){if(x)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const B=(m,N)=>{var Y;const y=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[l&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const V=[...s],st=p.find(at=>at.name===A);if(!st)return;const tt=V.map(at=>at.id===m.id?{...st,name:A}:at);v({...m,name:A}),i([...tt])},value:m.name,options:p.filter(A=>!s.find(V=>V.name===A.name)).map(A=>A.name),leftAddon:b(m.images)}),g==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const st=[...s].map(tt=>tt.id===m.id?{...m,name:A}:tt);i([...st])},value:m.name,placeholder:_}),g==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const st=[...s].map(tt=>tt.id===m.id?{...m,images:A}:tt);i([...st])},activeImage:(Y=s.find(A=>A.id===m.id))==null?void 0:Y.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:M.buttons,children:[n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>Z(A,m)}),d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(A=>A.id!==m.id))})]})]});return l?t.jsxRuntimeExports.jsx(fe,{product:m,index:N,moveProduct:X,children:y},m.id):t.jsxRuntimeExports.jsx("div",{className:M.product,children:y},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:M.productsBlock,children:[(c||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:M.title,children:c}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:m=>e==null?void 0:e(m)})]}),j&&n&&f&&D&&t.jsxRuntimeExports.jsx(he,{ref:q,activeItem:j,setActiveItem:v,popupPosition:L,modalOptions:f,setIsOpenModal:F}),T&&P&&t.jsxRuntimeExports.jsx(ut,{...P}),t.jsxRuntimeExports.jsxs("div",{className:M.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:M.subtitle,children:r}),l?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:s.map((m,N)=>B(m,N))}):s.map((m,N)=>B(m,N)),S&&t.jsxRuntimeExports.jsx("div",{className:M.addButton,children:t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:t.clx(M.button,{[M.disabled]:!!(k&&k<=s.length||s.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(k&&k<=s.length||s.length===(p==null?void 0:p.length)),onClick:()=>{const m=[...s];let N=null;if(p){for(let y=0;y<p.length;y++)if(!s.find(Y=>Y.id===p[y].id)){N=p[y];break}}g==="select"?m.push({name:N?N.name:p[0].name,id:(N==null?void 0:N.id)||p[0].id,...O}):g==="input"?m.push({name:"",id:t.v4(),...O}):m.push({name:`Image ${s.length+1}`,id:t.v4(),...O}),i(m)},style:{width:"fit-content"},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(dt,{items:a}),$!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String($.scrollInterval),onChange:m=>$.setScrollInterval(Number(m)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},be="_title_1jjcw_1",ve="_subtitle_1jjcw_5",Ee="_header_1jjcw_12",Re="_text_1jjcw_13",ye="_productsBlock_1jjcw_14",Ie="_top_1jjcw_26",we="_itemsBlock_1jjcw_35",ke="_typeTexts_1jjcw_41",$e="_block_1jjcw_48",Ne="_active_1jjcw_61",Ce="_products_1jjcw_14",Se="_product_1jjcw_14",Be="_button_1jjcw_80",Te="_disabled_1jjcw_91",Pe="_image_1jjcw_95",Ae="_info_1jjcw_102",Oe="_name_1jjcw_114",qe="_buttons_1jjcw_118",De="_modal_1jjcw_125",Le="_link_1jjcw_145",Me="_modalOptions_1jjcw_151",He="_addButton_1jjcw_157",W={title:be,subtitle:ve,header:Ee,text:Re,productsBlock:ye,top:Ie,itemsBlock:we,typeTexts:ke,block:$e,active:Ne,products:Ce,product:Se,button:Be,disabled:Te,image:Pe,info:Ae,name:Oe,buttons:qe,modal:De,link:Le,modalOptions:Me,addButton:He},ze=u=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:i,other:a,title:c,subtitle:r,draggable:n=!1,withImage:l=!1,addable:x=!0,itemsOptions:d,hasRangeSelector:S=!1,rangeSelectorOptions:g,limit:_,autoScrollInterval:p}=u;function T(f){if(l)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=f=>{const O=d.find($=>$.id===f);if(!O)return;const k=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:$=>{const j=[...s],v=d.find(E=>E.name===$);if(!v)return;const L=v.id,R=j.map(E=>E===f?L:E);i([...R])},value:O.name,options:d.filter($=>!s.find(j=>j===$.id)).map($=>$.name),leftAddon:T(O.images)}),t.jsxRuntimeExports.jsx("div",{className:W.buttons,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter($=>$!==f))})})]});return t.jsxRuntimeExports.jsx("div",{className:W.product,children:k},f)};return t.jsxRuntimeExports.jsxs("div",{className:W.productsBlock,children:[(c||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:c}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:f=>e==null?void 0:e(f)})]}),S&&g&&t.jsxRuntimeExports.jsx(ut,{...g}),t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:r}),s.map(f=>P(f)),x&&t.jsxRuntimeExports.jsx("div",{className:W.addButton,children:t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:t.clx(W.button,{[W.disabled]:!!(_&&_<=s.length||s.length===d.length)}),size:"s",disabled:!!(_&&_<=s.length||s.length===d.length),onClick:()=>{const f=[...s];let O=null;if(d){for(let k=0;k<d.length;k++)if(!s.find($=>$===d[k].id)){O=d[k];break}}f.push((O==null?void 0:O.id)||d[0].id),i(f)},style:{width:"fit-content"},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(dt,{items:a}),p!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(p.scrollInterval),onChange:f=>p.setScrollInterval(Number(f)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Fe="_title_iqcxl_1",Ve="_subtitle_iqcxl_5",Ue="_header_iqcxl_12",Ye="_text_iqcxl_13",Ge="_productsBlock_iqcxl_14",We="_top_iqcxl_26",Xe="_itemsBlock_iqcxl_35",Je="_typeTexts_iqcxl_41",Qe="_block_iqcxl_48",Ke="_active_iqcxl_61",Ze="_products_iqcxl_14",ts="_product_iqcxl_14",es="_button_iqcxl_80",ss="_disabled_iqcxl_91",ns="_image_iqcxl_95",is="_info_iqcxl_102",os="_name_iqcxl_114",rs="_buttons_iqcxl_118",as="_modal_iqcxl_125",cs="_link_iqcxl_146",ls="_modalOptions_iqcxl_152",ds="_addButton_iqcxl_164",z={title:Fe,subtitle:Ve,header:Ue,text:Ye,productsBlock:Ge,top:We,itemsBlock:Xe,typeTexts:Je,block:Qe,active:Ke,products:Ze,product:ts,button:es,disabled:ss,image:ns,info:is,name:os,buttons:rs,modal:as,link:cs,modalOptions:ls,addButton:ds},us=h.forwardRef((u,o)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:a,setIsOpenModal:c}=u;function r(n,l){return n.length>l?`${n.slice(0,l)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:o,className:z.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[t.jsxRuntimeExports.jsx("h3",{className:z.title,children:r(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:z.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:l=>{const x={...e,[n.field]:l};s(x)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ht,{typesText:e[n.field.type],setTypesText:l=>{const x={...e,[n.field.type]:l};s(x)},text:e[n.field.text]||"",setText:l=>{const x={...e,[n.field.text]:l};s(x)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:l=>{const x={...e,[n.field]:l};s(x)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:z.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:l=>{const x={...e,[n.field.text]:l};s(x)},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:l=>{const x={...e,[n.field.switch]:l};s(x)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:l=>{const x={...e,[n.field]:l};s(x)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),xs=u=>{const{index:o,moveProduct:e,children:s}=u,[,i]=t.useDrop({accept:"product",hover(r){r.index!==o&&(e(r.index,o),r.index=o)}}),[{isDragging:a},c]=t.useDrag({type:"product",item:{index:o},collect:r=>({isDragging:r.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:r=>c(i(r)),className:`${z.product} ${a?z.dragging:""}`,children:s})},ms=u=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:i,other:a,title:c,subtitle:r,editable:n=!0,draggable:l=!1,withImage:x=!1,deletable:d=!0,addable:S=!0,itemsType:g,itemsPlaceholder:_="",itemsOptions:p,hasRangeSelector:T=!1,rangeSelectorOptions:P,modalOptions:f,addableOptions:O={}}=u,[k,$]=h.useState(null),[j,v]=h.useState({top:0,left:0}),[L,R]=h.useState(null),E=h.useRef(null),[I,q]=h.useState(!1),D=(b,B)=>{const m=[...s],[N]=m.splice(b,1);m.splice(B,0,N),i(m)};h.useEffect(()=>{const b=()=>{$(null),q(!1)};return document.body.addEventListener("click",b),$(null),q(!1),()=>{$(null),q(!1),document.body.removeEventListener("click",b)}},[]),h.useEffect(()=>{if(k){const b=[...s].map(B=>B.id===k.id?k:B);i(b)}},[k]),h.useEffect(()=>{if(E.current&&L){const b=E.current.getBoundingClientRect().height,B=window.innerHeight;let m=L.top;m+b>B+window.scrollY-200&&(m=B+window.scrollY-b-200),m<0&&(m=10),v({top:m,left:L.left})}},[E.current,L]);const F=(b,B)=>{b.stopPropagation();const m=b.target.getBoundingClientRect();R({top:m.top+window.scrollY,left:m.left-30}),$(B),q(!0)};function X(b){if(x)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 Z=(b,B)=>{var N;const m=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[l&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const A=[...s].map(V=>V.id===b.id?{...b,name:y}:V);$({...b,name:y}),i([...A])},value:b.name,options:p.filter(y=>!s.find(Y=>Y.name===y)),leftAddon:X(b.images)}),g==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:y=>{const A=[...s].map(V=>V.id===b.id?{...b,name:y}:V);i([...A])},value:b.name,placeholder:_}),g==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:y=>{const A=[...s].map(V=>V.id===b.id?{...b,images:y}:V);i([...A])},activeImage:(N=s.find(y=>y.id===b.id))==null?void 0:N.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:z.buttons,children:[n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>F(y,b)}),d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(y=>y.id!==b.id))})]})]});return l?t.jsxRuntimeExports.jsx(xs,{product:b,index:B,moveProduct:D,children:m},b.id):t.jsxRuntimeExports.jsx("div",{className:z.product,children:m},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:z.productsBlock,children:[(c||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:z.title,children:c}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:b=>e==null?void 0:e(b)})]}),k&&n&&f&&I&&t.jsxRuntimeExports.jsx(us,{ref:E,activeItem:k,setActiveItem:$,popupPosition:j,modalOptions:f,setIsOpenModal:q}),T&&P&&t.jsxRuntimeExports.jsx(ut,{...P}),t.jsxRuntimeExports.jsxs("div",{className:z.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:r}),l?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:s.map((b,B)=>Z(b,B))}):s.map((b,B)=>Z(b,B)),S&&t.jsxRuntimeExports.jsx("div",{className:z.addButton,children:t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:z.button,size:"s",onClick:()=>{const b=[...s];let B=null;if(p){for(let m=0;m<p.length;m++)if(!s.find(N=>N.name===p[m])){B=p[m];break}}g==="select"?b.push({name:B||p[0],id:t.v4(),...O}):g==="input"?b.push({name:"",id:t.v4(),...O}):b.push({name:`Image ${s.length+1}`,id:t.v4(),...O}),i(b)},style:{width:"fit-content"},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(dt,{items:a})]})},ps="_title_oravb_1",hs="_subtitle_oravb_5",_s="_header_oravb_12",js="_text_oravb_13",gs="_productsBlock_oravb_14",fs="_buttonsBlock_oravb_15",bs="_top_oravb_26",vs="_itemsBlock_oravb_35",Es="_typeTexts_oravb_41",Rs="_block_oravb_48",ys="_active_oravb_60",Is="_products_oravb_14",ws="_product_oravb_14",ks="_button_oravb_15",$s="_image_oravb_90",Ns="_info_oravb_97",Cs="_name_oravb_109",Ss="_buttons_oravb_15",Bs="_modal_oravb_120",Ts="_other_oravb_139",Ps="_options_oravb_145",et={title:ps,subtitle:hs,header:_s,text:js,productsBlock:gs,buttonsBlock:fs,top:bs,itemsBlock:vs,typeTexts:Es,block:Rs,active:ys,products:Is,product:ws,button:ks,image:$s,info:Ns,name:Cs,buttons:Ss,modal:Bs,other:Ts,options:Ps},As=h.forwardRef((u,o)=>{const{activeButton:e,setActiveButton:s,popupPosition:i}=u,[a,c]=h.useState(e.typesText),[r,n]=h.useState(e.destination),[l,x]=h.useState(e.page),[d,S]=h.useState(e.link||""),[g,_]=h.useState(e.text||""),[p,T]=h.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:g,link:d,destination:r,typesText:a,page:l,openInNewTab:p}})},[a,r,d,g,l,p]),t.jsxRuntimeExports.jsxs("div",{className:et.modal,onClick:f=>{f.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:o,children:[t.jsxRuntimeExports.jsxs("div",{className:et.top,children:[t.jsxRuntimeExports.jsx("h3",{className:et.title,children:e.type}),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:f=>n(f),options:["Go to Page","Open Link"].filter(f=>f!==r),value:r}),r==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:f=>x(f),options:P?Object.values(P).filter(f=>f.name!==l).map(f=>f.name):[],value:l}):t.jsxRuntimeExports.jsx(t.Input,{onChange:f=>S(f),value:d,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:f=>T(f)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:f=>_(f),value:g,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(pt,{typesText:a,setTypesText:c})]})]})}),Os="_subtitle_w0d5g_1",qs="_header_w0d5g_8",Ds="_text_w0d5g_9",Ls="_productsBlock_w0d5g_10",Ms="_buttonsBlock_w0d5g_11",Hs="_top_w0d5g_23",zs="_itemsBlock_w0d5g_32",Fs="_typeTexts_w0d5g_38",Vs="_block_w0d5g_45",Us="_active_w0d5g_58",Ys="_products_w0d5g_10",Gs="_product_w0d5g_10",Ws="_button_w0d5g_11",Xs="_image_w0d5g_88",Js="_info_w0d5g_95",Qs="_name_w0d5g_107",Ks="_buttons_w0d5g_11",Zs="_modal_w0d5g_118",tn="_other_w0d5g_138",en="_options_w0d5g_144",sn="_addButton_w0d5g_150",nt={subtitle:Os,header:qs,text:Ds,productsBlock:Ls,buttonsBlock:Ms,top:Hs,itemsBlock:zs,typeTexts:Fs,block:Vs,active:Us,products:Ys,product:Gs,button:Ws,image:Xs,info:Js,name:Qs,buttons:Ks,modal:Zs,other:tn,options:en,addButton:sn},jt=u=>{const{buttons:o,setButtons:e,deletable:s=!0,addable:i=!0}=u,[a,c]=h.useState(null),[r,n]=h.useState({top:0,left:0}),[l,x]=h.useState(null),d=h.useRef(null);h.useEffect(()=>{const g=()=>{c(null)};return document.body.addEventListener("click",g),c(null),()=>{c(null),document.body.removeEventListener("click",g)}},[]),h.useEffect(()=>{if(a){const g=[...o].map(_=>_.id===a.id?a:_);e(g)}},[a]),h.useEffect(()=>{if(d.current&&l){const g=d.current.getBoundingClientRect().height,_=window.innerHeight;let p=l.top;p+g>_+window.scrollY-200&&(p=_+window.scrollY-g-200),p<0&&(p=10),n({top:p,left:l.left})}},[d.current,l]);const S=(g,_)=>{g.stopPropagation();const p=g.target.getBoundingClientRect();x({top:p.top+window.scrollY,left:p.left-30}),c(_)};return t.jsxRuntimeExports.jsxs("div",{className:nt.products,children:[t.jsxRuntimeExports.jsx("h5",{className:nt.subtitle,children:"Button Type"}),o.map(g=>t.jsxRuntimeExports.jsxs("div",{className:nt.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:_=>{const T=[...o].map(P=>P.id===g.id?{...g,type:_}:P);e(T)},value:g.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:nt.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:_=>{S(_,g)}}),s&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const _=o.filter(p=>p.id!==g.id);e(_)},width:20,height:20,fill:"#C12A2A"})]})]},g.id)),a&&t.jsxRuntimeExports.jsx(As,{ref:d,activeButton:a,setActiveButton:c,popupPosition:r}),i&&t.jsxRuntimeExports.jsx("div",{className:nt.addButton,children:t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:nt.button,size:"s",onClick:()=>{const g=[...o];g.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(g)},style:{width:"fit-content"},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})]})},nn=u=>{const{isActiveButtons:o,setIsActiveButtons:e,buttons:s,setButtons:i}=u;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:o,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(jt,{buttons:s,setButtons:i})]})})},on="_wrapper_m18qi_1",rn="_subtitle_m18qi_7",an="_content_m18qi_14",cn="_range_m18qi_22",ln="_track_m18qi_27",dn="_progress_m18qi_36",un="_dots_m18qi_46",xn="_dot_m18qi_46",mn="_active_m18qi_65",pn="_input_m18qi_77",hn="_countBlock_m18qi_91",_n="_count_m18qi_91",jn="_controls_m18qi_107",gn="_button_m18qi_113",H={wrapper:on,subtitle:rn,content:an,range:cn,track:ln,progress:dn,dots:un,dot:xn,active:mn,input:pn,countBlock:hn,count:_n,controls:jn,button:gn},ut=u=>{const{label:o,min:e=1,max:s=4,step:i=1,count:a,setCount:c}=u,[r,n]=h.useState(!1),l=Array.from({length:(s-e)/i+1}),x=(a-e)/(s-e)*100,d=()=>{a<s&&c(a+i)},S=()=>{a>e&&c(a-i)},g=_=>{const p=e+_*i;c(p)};return t.jsxRuntimeExports.jsxs("div",{className:H.wrapper,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:o}),t.jsxRuntimeExports.jsxs("div",{className:H.content,children:[t.jsxRuntimeExports.jsxs("div",{className:H.range,children:[t.jsxRuntimeExports.jsx("div",{className:H.track}),t.jsxRuntimeExports.jsx("div",{className:H.progress,style:{width:`${x}%`}}),t.jsxRuntimeExports.jsx("div",{className:H.dots,children:l.map((_,p)=>{const T=p<=(a-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>g(p),className:t.clx(H.dot,{[H.active]:T,[H.inactive]:!T,[H.dragging]:r}),"aria-label":`Set value to ${e+p*i}`},p)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:a,onChange:_=>c(Number(_.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:H.input})]}),t.jsxRuntimeExports.jsxs("div",{className:H.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:_=>{const p=Number(_);p>s?c(s):p<e?c(e):c(p)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:H.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:d,disabled:a>=s,className:H.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:S,disabled:a<=e,className:H.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},fn="_title_w64fy_1",bn="_subtitle_w64fy_5",vn="_header_w64fy_12",En="_text_w64fy_13",Rn="_productsBlock_w64fy_14",yn="_top_w64fy_26",In="_itemsBlock_w64fy_35",wn="_typeTexts_w64fy_41",kn="_block_w64fy_48",$n="_active_w64fy_61",Nn="_products_w64fy_14",Cn="_product_w64fy_14",Sn="_button_w64fy_80",Bn="_image_w64fy_91",Tn="_info_w64fy_98",Pn="_name_w64fy_110",An="_buttons_w64fy_114",On="_modal_w64fy_121",qn="_link_w64fy_141",Dn="_modalOptions_w64fy_147",Ln="_addButton_w64fy_159",U={title:fn,subtitle:bn,header:vn,text:En,productsBlock:Rn,top:yn,itemsBlock:In,typeTexts:wn,block:kn,active:$n,products:Nn,product:Cn,button:Sn,image:Bn,info:Tn,name:Pn,buttons:An,modal:On,link:qn,modalOptions:Dn,addButton:Ln},Mn=u=>{const{activeItem:o,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:a}=u,c=a.find(n=>n.id===o.listingId);if(!c)return null;function r(n,l){return n.length>l?`${n.slice(0,l)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:U.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[t.jsxRuntimeExports.jsx("h3",{children:r(c.productData.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{i(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:U.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 l={...o,image:n[0]};e(l)}})})]})},Hn=u=>{const{index:o,moveProduct:e,children:s}=u,[,i]=t.useDrop({accept:"product",hover(r){r.index!==o&&(e(r.index,o),r.index=o)}}),[{isDragging:a},c]=t.useDrag({type:"product",item:{index:o},collect:r=>({isDragging:r.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:r=>c(i(r)),className:`${U.product} ${a?U.dragging:""}`,children:s})},zn=u=>{const{isActiveItems:o,setIsActiveItems:e,items:s,setItems:i,other:a,title:c,subtitle:r,editable:n=!0,draggable:l=!1,withImage:x=!1,deletable:d=!0,addable:S=!0,itemsType:g,itemsOptions:_}=u,[p,T]=h.useState(null),[P,f]=h.useState({top:0,left:0}),[O,k]=h.useState(!1),$=(R,E)=>{const I=[...s],[q]=I.splice(R,1);I.splice(E,0,q),i(I)};h.useEffect(()=>{const R=()=>{T(null),k(!1)};return document.body.addEventListener("click",R),T(null),k(!1),()=>{T(null),k(!1),document.body.removeEventListener("click",R)}},[]),h.useEffect(()=>{if(p){const R=[...s].map(E=>E.listingId===p.listingId?p:E);i(R)}},[p]);const j=(R,E)=>{R.stopPropagation();const I=R.target.getBoundingClientRect(),q=100,D=window.innerHeight;let F=I.top+window.scrollY;F+q>D&&(F=D-q-20),k(!0),f({top:F-80,left:I.left-30}),T(E)};function v(R){if(x)return R?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${R}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=(R,E)=>{const I=_.find(D=>R.listingId===D.id);if(!I)return null;const q=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[l&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},E),g==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:D=>{const F=[...s],X=_.find(B=>B.productData.name===D);if(!X)return;const Z={listingId:X.id,image:X.productData.images.length>0?X.productData.images[0].cfId:""},b=F.map(B=>B.listingId===R.listingId?Z:B);T(Z),i([...b])},value:I.productData.name,options:[..._.filter(D=>!s.find(F=>F.listingId===D.id)).map(D=>D.productData.name)],leftAddon:v(R.image||I.productData.images.length>0&&I.productData.images[0].cfId||"")},E),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:D=>j(D,R)}),d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(D=>D!==R))})]})]});return l?t.jsxRuntimeExports.jsx(Hn,{product:R,index:E,moveProduct:$,children:q},R.listingId):t.jsxRuntimeExports.jsx("div",{className:U.product,children:q},R.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(c||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:c}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:R=>e==null?void 0:e(R)})]}),O&&p&&t.jsxRuntimeExports.jsx(Mn,{activeItem:p,setActiveItem:T,setIsOpenModal:k,popupPosition:P,itemsOptions:_}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:r}),l?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:s.map((R,E)=>L(R,E))}):s.map((R,E)=>L(R,E)),S&&t.jsxRuntimeExports.jsx("div",{className:U.addButton,children:t.jsxRuntimeExports.jsxs(t.Button,{withoutHover:!0,className:U.button,size:"s",onClick:()=>{const R=[...s];for(let E=0;E<_.length;E++)if(!s.find(I=>I.listingId===_[E].id)){R.push({listingId:_[E].id,image:_[E].productData.images.length>0?_[E].productData.images[0].cfId:""});break}i(R)},disabled:s.length===_.length,style:{width:"fit-content"},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(dt,{items:a})]})},Fn="_options_jdafm_1",Vn="_price_jdafm_12",Un="_oldPrice_jdafm_19",Yn="_newPrice_jdafm_27",Gn="_animate_jdafm_34",Wn="_appearAndBounce_jdafm_1",Xn="_meta_jdafm_52",Jn="_info_jdafm_58",Qn="_infoRight_jdafm_66",Kn="_buttons_jdafm_73",Zn="_variants_jdafm_80",ti="_variant_jdafm_80",ei="_stock_jdafm_97",si="_variantInfo_jdafm_104",ni="_quantity_jdafm_110",ii="_count_jdafm_117",oi="_focused_jdafm_134",ri="_button_jdafm_73",ai="_activeVariant_jdafm_160",ci="_chargeTypes_jdafm_164",li="_charge_jdafm_164",di="_chargeActive_jdafm_189",ui="_title_jdafm_197",w={options:Fn,price:Vn,oldPrice:Un,newPrice:Yn,animate:Gn,appearAndBounce:Wn,meta:Xn,info:Jn,infoRight:Qn,buttons:Kn,variants:Zn,variant:ti,stock:ei,variantInfo:si,quantity:ni,count:ii,focused:oi,button:ri,activeVariant:ai,chargeTypes:ci,charge:li,chargeActive:di,title:ui};var gt=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(gt||{});const xi=u=>{var k,$;const{variants:o}=u,[e,s]=h.useState(o[0]),[i,a]=h.useState(e.chargeTypes[0]),c=t.useNavigate(),[r,n]=h.useState(1),[l,x]=h.useState(!1),{reset:d,addProductToCart:S,getProducts:g}=t.useCart(),[_,p]=h.useState(!1);h.useEffect(()=>{p(!0);const j=setTimeout(()=>p(!1),600);return()=>clearTimeout(j)},[r]);async function T(){await g(),await S({productId:u.id,productVariantId:e.id,quantity:r})}function P(){d(),T(),c("/checkout")}function f(j){if(j>=864e5){const I=Math.floor(j/864e5);return`${I} ${I===1?"day":"days"}`}else if(j>=36e5){const I=Math.floor(j/36e5);return`${I} ${I===1?"hour":"hours"}`}else if(j>=6e4){const I=Math.floor(j/6e4);return`${I} ${I===1?"minute":"minutes"}`}else{const I=Math.floor(j/1e3);return`${I} ${I===1?"second":"seconds"}`}}function O(j,v){return j.length>v?j.slice(0,v)+"...":j}return t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(j=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:i===j}),onClick:()=>a(j),children:gt[j]},j))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:o.map(j=>{var v;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===j.id}),onClick:()=>s(j),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:O(j.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?j.price.amount:j.subscriptionSettings?j.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[((v=j.quantity.restrictions)==null?void 0:v.max)||j.quantity.available||0," in stock"]})})]},j.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{r>1?n(j=>j-1):n(1)},className:w.button,disabled:e.quantity.restrictions&&r<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(w.count,{[w.focused]:l}),onFocus:()=>x(!0),onBlur:()=>x(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(r),onChange:j=>n(Number(j)),max:((k=e.quantity.restrictions)==null?void 0:k.max)||e.quantity.available||1/0,min:(($=e.quantity.restrictions)==null?void 0:$.min)||0,style:{backgroundColor:"transparent",border:"none",textAlign:"center"}})}),t.jsxRuntimeExports.jsx("button",{onClick:()=>{n(j=>j+1)},className:w.button,disabled:!!(e.quantity.restrictions&&r>=e.quantity.restrictions.max||e.quantity.available&&r>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.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":f(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:_}),children:["$ ",(e.price.amount||0)*r]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*r]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:_}),children:["$ ",(e.price.amount||0)*r]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:_}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>P(),children:t.jsxRuntimeExports.jsx("span",{children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>T(),children:"Add to Cart"})]})]})},mi="_button_1861a_1",pi="_login_1861a_14",hi="_signUp_1861a_18",_i="_buttons_1861a_23",ji="_modal_1861a_32",gi="_info_1861a_60",fi="_top_1861a_67",bi="_title_1861a_78",vi="_clear_1861a_84",Ei="_activeClear_1861a_91",Ri="_count_1861a_95",yi="_cart_1861a_110",Ii="_empty_1861a_118",wi="_product_1861a_144",ki="_products_1861a_153",$i="_image_1861a_161",Ni="_productInfo_1861a_167",Ci="_content_1861a_174",Si="_name_1861a_180",Bi="_price_1861a_186",Ti="_productButtons_1861a_192",Pi="_productButton_1861a_192",Ai="_productCount_1861a_212",Oi="_bottom_1861a_228",qi="_subtotal_1861a_236",Di="_block_1861a_244",Li="_shoppingCount_1861a_251",Mi="_total_1861a_271",Hi="_link_1861a_277",zi="_userInfo_1861a_284",C={button:mi,login:pi,signUp:hi,buttons:_i,modal:ji,info:gi,top:fi,title:bi,clear:vi,activeClear:Ei,count:Ri,cart:yi,empty:Ii,product:wi,products:ki,image:$i,productInfo:Ni,content:Ci,name:Si,price:Bi,productButtons:Ti,productButton:Pi,productCount:Ai,bottom:Oi,subtotal:qi,block:Di,shoppingCount:Li,total:Mi,link:Hi,userInfo:zi},Fi="_button_bymeg_1",Vi="_primary_bymeg_19",Ui="_primaryHovered_bymeg_30",Yi="_secondary_bymeg_34",Gi="_secondaryHovered_bymeg_44",Wi="_tertiary_bymeg_48",Xi="_tertiaryHovered_bymeg_58",Ji="_content_bymeg_62",J={button:Fi,primary:Vi,primaryHovered:Ui,secondary:Yi,secondaryHovered:Gi,tertiary:Wi,tertiaryHovered:Xi,content:Ji},lt=u=>{const{children:o,onClick:e,style:s,className:i,disabled:a=!1,type:c="Primary"}=u,{themeSettings:r}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(J.button,i,{[J.primary]:c==="Primary",[J.secondary]:c==="Secondary",[J.tertiary]:c==="Tertiary",[J.primaryHovered]:c==="Primary"&&!a&&r.buttons.primary.hover,[J.secondaryHovered]:c==="Secondary"&&!a&&r.buttons.secondary.hover,[J.tertiaryHovered]:c==="Tertiary"&&!a&&r.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:a,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:J.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),o]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:o})})};class rt extends Error{}rt.prototype.name="InvalidTokenError";function Qi(u){return decodeURIComponent(atob(u).replace(/(.)/g,(o,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function Ki(u){let o=u.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Qi(o)}catch{return atob(o)}}function Zi(u,o){if(typeof u!="string")throw new rt("Invalid token specified: must be a string");o||(o={});const e=o.header===!0?0:1,s=u.split(".")[e];if(typeof s!="string")throw new rt(`Invalid token specified: missing part #${e+1}`);let i;try{i=Ki(s)}catch(a){throw new rt(`Invalid token specified: invalid base64 for part #${e+1} (${a.message})`)}try{return JSON.parse(i)}catch(a){throw new rt(`Invalid token specified: invalid json for part #${e+1} (${a.message})`)}}const to=u=>{const{shopping:o,signUp:e}=u,s=t.useNavigate();function i(c){s(c)}const a=JSON.parse(localStorage.getItem("token")||"{}");return t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[o&&t.jsxRuntimeExports.jsx(ft,{}),!a.data&&t.jsxRuntimeExports.jsx(lt,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),!a.data&&e&&t.jsxRuntimeExports.jsx(lt,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"}),a.data&&t.jsxRuntimeExports.jsx(Et,{token:a.data})]})},ft=()=>{const[u,o]=h.useState(!1),[e,s]=h.useState([]),{cart:i,getProducts:a}=t.useCart();function c(x){for(let d=0;d<i.parts.length;d++)for(let S=0;S<x.variants.length;S++)if(i.parts[d].productVariantId===x.variants[d].id)return i.parts[d].productVariantId}function r(x){for(let d=0;d<i.parts.length;d++)for(let S=0;S<x.variants.length;S++)if(i.parts[d].productVariantId===x.variants[d].id)return i.parts[d].quantity}h.useEffect(()=>{(async()=>{const d=i.parts.map(_=>String(_.productId)),g=(await a([...d])).map(_=>({..._,activeVariantId:c(_),quantity:r(_)}));s(g)})()},[i]);function n(x){var d;return!x||!(x!=null&&x.variants)?!1:(d=x.variants.find(S=>S.id===x.activeVariantId))==null?void 0:d.subscriptionSettings}const l=i.parts.length>0&&e.length>0&&!n(e[0]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:C.button,onClick:x=>{x.stopPropagation(),window.location.pathname!=="/admin/builder"&&o(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),l&&t.jsxRuntimeExports.jsx("div",{className:C.shoppingCount,children:i.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(bt,{activeProducts:e,isCartNotEmpty:l})})]})},bt=u=>{const{activeProducts:o,isCartNotEmpty:e}=u,{cart:s,reset:i,getTotalAndDiscount:a,updateQuantityOfProduct:c}=t.useCart(),r=t.useNavigate();function n(d){r(d)}function l(d){c({productId:d.id,productVariantId:d.activeVariantId,quantity:d.quantity+1})}function x(d){c({productId:d.id,productVariantId:d.activeVariantId,quantity:d.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:C.modal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:C.count,children:s.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(C.clear,{[C.activeClear]:e}),disabled:!e,onClick:()=>i(),children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:C.cart,children:[t.jsxRuntimeExports.jsx("div",{className:C.products,children:o.map(d=>t.jsxRuntimeExports.jsxs("div",{className:C.product,children:[t.jsxRuntimeExports.jsxs("div",{className:C.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${d.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:C.image}),t.jsxRuntimeExports.jsxs("div",{className:C.content,children:[t.jsxRuntimeExports.jsx("div",{className:C.name,children:d.name}),t.jsxRuntimeExports.jsxs("div",{className:C.price,children:["$",d.variants.find(S=>S.id===d.activeVariantId).price.amount*((d==null?void 0:d.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{d.quantity!==1&&x(d)},className:C.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:C.productCount,children:d.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>l(d),className:C.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},d.id))}),t.jsxRuntimeExports.jsxs("div",{className:C.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:C.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:C.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:C.total,children:["$",a().total]})]}),t.jsxRuntimeExports.jsx(lt,{onClick:()=>n("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(vt,{})]})},vt=()=>t.jsxRuntimeExports.jsxs("div",{className:C.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsxs("span",{children:["Check out the store's products and add them"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:C.link,children:"here"})]})]}),Et=({token:u})=>{const[o,e]=h.useState("test-email@gmail.com"),s=t.useNavigate();h.useEffect(()=>{(async()=>{const c=Zi(u);e(c.email)})()},[u]);function i(a){s(a)}return t.jsxRuntimeExports.jsx("div",{className:C.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:o||"test-email@gmail.com"})})},eo="_share_11u0d_1",so="_modal_11u0d_8",no="_header_11u0d_14",io="_socials_11u0d_24",oo="_social_11u0d_24",ro="_copy_11u0d_34",ao="_title_11u0d_41",co="_copyWrapper_11u0d_47",lo="_copyText_11u0d_56",K={share:eo,modal:so,header:no,socials:io,social:oo,copy:ro,title:ao,copyWrapper:co,copyText:lo},uo=()=>{const{isOpenModal:u,setIsOpenModal:o}=t.useShareLinkStore();function e(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:K.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(xo,{})})]})},xo=()=>{const{setIsOpenModal:u}=t.useShareLinkStore(),{notification:o,setNotification:e}=t.useNotificationStore(),s=window.location.href;function i(){navigator.clipboard.writeText(s),e({message:"Link copied to clipboard",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:K.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:K.header,children:[t.jsxRuntimeExports.jsx("div",{className:K.title,children:"Share this Post"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>u(!1),hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:K.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(K.copy,K.copyText),onClick:i,children:s}),t.jsxRuntimeExports.jsx("div",{onClick:i,className:K.copy,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},mo="_accordion_1s1lq_1",po="_header_1s1lq_9",ho="_icon_1s1lq_18",_o="_open_1s1lq_21",jo="_content_1s1lq_25",ot={accordion:mo,header:po,icon:ho,open:_o,content:jo},go=({title:u,content:o})=>{const[e,s]=h.useState(!1),[i,a]=h.useState(0),c=h.useRef(null),r=()=>{s(!e)};return h.useEffect(()=>{c.current&&a(e?c.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:ot.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:ot.header,onClick:r,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(ot.icon,{[ot.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:c,className:ot.content,style:{height:`${i}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:o})})]})},fo="_wrapper_1r14x_1",bo="_label_1r14x_9",vo="_input_1r14x_18",Eo="_required_1r14x_35",Ro="_paddingless_1r14x_39",yo="_content_1r14x_43",Io="_borderless_1r14x_58",wo="_rightIcon_1r14x_63",Q={wrapper:fo,label:bo,input:vo,required:Eo,paddingless:Ro,content:yo,borderless:Io,rightIcon:wo},ko=u=>{const{onChange:o,style:e,label:s,value:i,type:a,min:c,max:r,placeholder:n,disabled:l=!1,required:x=!1,regex:d,paddingless:S=!1,borderless:g=!1,editable:_=!1,isSearch:p=!1}=u,{themeSettings:T}=t.useThemeSettingsStore(),{inputs:P}=T,[f,O]=h.useState(!1);function k(v,L){if(v.startsWith("#")){let I,q,D;return v.length===7?(I=parseInt(v.slice(1,3),16),q=parseInt(v.slice(3,5),16),D=parseInt(v.slice(5,7),16)):v.length===4&&(I=parseInt(v[1]+v[1],16),q=parseInt(v[2]+v[2],16),D=parseInt(v[3]+v[3],16)),`rgba(${I}, ${q}, ${D}, ${L})`}const E={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff"}[v.toLowerCase()];return E?k(E,L):v}function $(v){return Number(v)<0?String(c):v}function j(v){return!x||!d?!0:new RegExp(d).test(v)}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:Q.content,style:{paddingRight:P.general.height+15,...e,backgroundColor:k(P.field.color,P.field.opacity/100)},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:a||"text",onChange:v=>{if(a==="text")o(v.target.value);else{const L=$(v.target.value);o(L)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Q.input,{[Q.required]:f&&x&&!j(i),[Q.paddingless]:S,[Q.borderless]:g}),min:a==="number"?c:void 0,max:a==="number"?r:void 0,disabled:l,onFocus:()=>O(!0)}),p&&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})})]})]})},$o="_wrapper_st58d_1",No="_label_st58d_10",Co="_textarea_st58d_18",So="_length_st58d_33",ct={wrapper:$o,label:No,textarea:Co,length:So},Bo=u=>{const{onChange:o,label:e,value:s,maxLength:i,placeholder:a="Type something..."}=u,[c,r]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:ct.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:ct.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{r(n.target.value.length),o(n.target.value)},placeholder:a,className:ct.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:ct.length,children:[c,"/",i]})]})};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=go;exports.Button=lt;exports.ButtonTypeSettings=jt;exports.ButtonsSettings=nn;exports.CategorySettings=ze;exports.EmptyCart=vt;exports.FormSettings=ms;exports.HeaderButtons=to;exports.InputUI=ko;exports.ItemsSettings=_t;exports.LayoutSettings=Ot;exports.ListingSelector=zn;exports.ProductOptions=xi;exports.RangeSelector=ut;exports.ShareLink=uo;exports.ShoppingButton=ft;exports.ShoppingModalCart=bt;exports.TextSettings=ht;exports.TextareaUI=Bo;exports.TypesText=pt;exports.UserInfo=Et;
|