@billgangcom/theme-lib 1.49.1 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +2 -2
- package/dist/api/index.d.ts +5 -0
- package/dist/api/request.d.ts +13 -0
- package/dist/builder/components/AddSections/utils/index.d.ts +1 -0
- package/dist/builder/components/AddSectionsBlock/index.d.ts +7 -0
- package/dist/builder/components/BlockSettings/index.d.ts +2 -0
- package/dist/builder/components/BlockSettings/settings.d.ts +7 -0
- package/dist/builder/components/BlockSettingsHeader/index.d.ts +8 -0
- package/dist/builder/components/{Header/Buttons → HeaderButtons}/index.d.ts +1 -1
- package/dist/builder/components/{Header/Devices → HeaderDevices}/index.d.ts +1 -1
- package/dist/builder/components/HeaderPreviewButton/index.d.ts +5 -0
- package/dist/builder/components/HeaderSaveButton/api/index.d.ts +5 -0
- package/dist/builder/components/{Header/SaveButton → HeaderSaveButton}/index.d.ts +1 -1
- package/dist/builder/components/HeaderSaveButton/utils/index.d.ts +6 -0
- package/dist/builder/components/HeaderSettingsLanguage/index.d.ts +4 -0
- package/dist/builder/components/HeaderSettingsPages/api/index.d.ts +4 -0
- package/dist/builder/components/HeaderSettingsPages/index.d.ts +5 -0
- package/dist/builder/components/{Header/PreviewButton → HeaderSettingsZoom}/index.d.ts +1 -1
- package/dist/builder/components/HeaderSwitchTheme/index.d.ts +4 -0
- package/dist/builder/components/{Preview/Render → PreviewRender}/index.d.ts +1 -1
- package/dist/builder/components/SidebarLayer/index.d.ts +7 -0
- package/dist/builder/components/{Sidebar/Layers → SidebarLayers}/index.d.ts +1 -1
- package/dist/builder/components/SidebarSettings/index.d.ts +2 -0
- package/dist/builder/components/SidebarTheme/index.d.ts +4 -0
- package/dist/builder/components/ThemeSettingsBorders/index.d.ts +5 -0
- package/dist/builder/components/ThemeSettingsButtons/index.d.ts +5 -0
- package/dist/builder/components/ThemeSettingsCategories/index.d.ts +1 -0
- package/dist/builder/components/ThemeSettingsColors/index.d.ts +5 -0
- package/dist/builder/components/ThemeSettingsColors/utils/getDuplicateColors.d.ts +2 -0
- package/dist/builder/components/ThemeSettingsColors/utils/index.d.ts +1 -0
- package/dist/builder/components/ThemeSettingsCurrentFont/index.d.ts +5 -0
- package/dist/builder/components/ThemeSettingsFonts/index.d.ts +5 -0
- package/dist/builder/components/ThemeSettingsHeaderItem/index.d.ts +7 -0
- package/dist/builder/components/ThemeSettingsInputs/index.d.ts +5 -0
- package/dist/builder/index.d.ts +1 -2
- package/dist/builder/store/useSubmodalStore.d.ts +2 -0
- package/dist/builder/ui/AnimatedPanel/index.d.ts +7 -0
- package/dist/builder/ui/ChooseImage/api/index.d.ts +8 -0
- package/dist/builder/ui/Submodal/index.d.ts +1 -0
- package/dist/builder/utils/getDisplayName.d.ts +1 -0
- package/dist/builder/utils/getModalPosition.d.ts +4 -0
- package/dist/builder/utils/index.d.ts +2 -7
- package/dist/builder.cjs.js +11 -11
- package/dist/builder.es.js +2322 -2308
- package/dist/{index-TpZnQKML.js → index-C87hOfMQ.js} +28280 -27151
- package/dist/index-DSOQcy7R.cjs +154 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/lib/index.d.ts +2 -3
- package/dist/pages/dynamic-page/api/index.d.ts +8 -0
- package/dist/pages/error-page/api/index.d.ts +10 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1196 -2361
- package/package.json +1 -1
- package/dist/builder/components/Header/Settings/Language/index.d.ts +0 -4
- package/dist/builder/components/Header/Settings/Pages/index.d.ts +0 -5
- package/dist/builder/components/Header/Settings/Zoom/index.d.ts +0 -5
- package/dist/builder/components/Header/SwitchTheme/index.d.ts +0 -4
- package/dist/builder/components/Sidebar/AddSections/RenderBlockSettings/index.d.ts +0 -2
- package/dist/builder/components/Sidebar/AddSections/RenderBlockSettings/settings.d.ts +0 -7
- package/dist/builder/components/Sidebar/Layers/AnnouncementLayer/index.d.ts +0 -1
- package/dist/builder/components/Sidebar/Layers/FooterLayer/index.d.ts +0 -1
- package/dist/builder/components/Sidebar/Layers/HeaderLayer/index.d.ts +0 -1
- package/dist/builder/components/Sidebar/Settings/index.d.ts +0 -2
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Colors/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Fonts/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Inputs/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Item/Border/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Item/Button/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Item/Font/index.d.ts +0 -5
- package/dist/builder/components/Sidebar/Theme/ThemeSettings/Item/index.d.ts +0 -4
- package/dist/builder/components/Sidebar/Theme/index.d.ts +0 -4
- package/dist/builder/components/index.d.ts +0 -5
- package/dist/builder/utils/api.d.ts +0 -25
- package/dist/index-C-fclBTt.cjs +0 -154
- package/dist/lib/api.d.ts +0 -26
- package/dist/lib/clearQueryParams.d.ts +0 -1
- /package/dist/{builder/utils → api}/fetchAll.d.ts +0 -0
- /package/dist/{builder/utils → api}/fetchData.d.ts +0 -0
- /package/dist/{builder/utils → api}/fetchFontsData.d.ts +0 -0
- /package/dist/{builder/utils → api}/fetchPagesData.d.ts +0 -0
- /package/dist/builder/components/{Sidebar/AddSections → AddSections}/index.d.ts +0 -0
- /package/dist/builder/components/{Sidebar/AddSections/BlockColors → BlockColors}/index.d.ts +0 -0
- /package/dist/builder/components/{Navbar/ExitButton → ExitButton}/index.d.ts +0 -0
- /package/dist/builder/components/{Header/Settings → HeaderSettings}/index.d.ts +0 -0
- /package/dist/builder/components/{Header/Settings/Pages/ModifyPage → ModifyPage}/index.d.ts +0 -0
- /package/dist/builder/components/{Preview/PreviewBlockSidebar → PreviewBlockSidebar}/index.d.ts +0 -0
- /package/dist/builder/components/{Preview/PreviewContent → PreviewContent}/index.d.ts +0 -0
- /package/dist/builder/components/{Preview/PreviewHeader → PreviewHeader}/index.d.ts +0 -0
- /package/dist/builder/components/{Sidebar/Theme/ThemeSettings → ThemeSettings}/index.d.ts +0 -0
- /package/dist/builder/{components/layout.d.ts → layout.d.ts} +0 -0
- /package/dist/{builder/utils → lib}/hotReload.d.ts +0 -0
- /package/dist/{builder/utils → lib}/splitTextIntoSpans.d.ts +0 -0
- /package/dist/{lib/checkAuth.d.ts → pages/builder/utils/index.d.ts} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-DSOQcy7R.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.splitTextIntoSpans=o.splitTextIntoSpans;
|
package/dist/index.es.js
CHANGED
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export * from './api';
|
|
2
|
-
export * from './checkAuth';
|
|
3
1
|
export * from './getDynamicRoutes';
|
|
4
|
-
export * from './clearQueryParams';
|
|
5
2
|
export * from './generateDynamicStyles';
|
|
6
3
|
export * from './injectStylesToDOM';
|
|
7
4
|
export * from './setupDynamicFonts';
|
|
5
|
+
export * from './hotReload';
|
|
6
|
+
export * from './splitTextIntoSpans';
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-C-fclBTt.cjs"),h=require("react");require("@phosphor-icons/react");const Ct="_wrapper_1ibay_2",wt="_alignmentBlock_1ibay_8",Bt="_title_1ibay_15",Tt="_subtitle_1ibay_22",Pt="_alignmentContent_1ibay_29",At="_alignments_1ibay_37",Mt="_alignment_1ibay_8",Ot="_circle_1ibay_60",qt="_paddings_1ibay_67",zt="_padding_1ibay_67",Lt="_active_1ibay_91",Dt="_input_1ibay_98",J={wrapper:Ct,alignmentBlock:wt,title:Bt,subtitle:Tt,alignmentContent:Pt,alignments:At,alignment:Mt,circle:Ot,paddings:qt,padding:zt,active:Lt,input:Dt},Ut=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Ht=["left","top","right","bottom"],Ft=d=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=d;function r(j){switch(j){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function c(j){switch(j){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,n]=h.useState(null),[x,f]=h.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:J.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:J.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:J.alignments,children:Ut.map(j=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(j)},className:J.alignment,onMouseEnter:()=>{n(j)},onMouseLeave:()=>{n(null)},children:[j!==a&&o!==j&&t.jsxRuntimeExports.jsx("div",{className:J.circle}),j!==a&&o===j&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(o),fill:"#c2c2c2",width:22,height:22}),j===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(a),fill:"#FF3F19",width:22,height:22})]},j))}),t.jsxRuntimeExports.jsx("div",{className:J.paddings,children:Ht.map(j=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(J.padding,{[J.active]:x===j}),onFocus:()=>{f(j)},onBlur:()=>{f(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(j),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[j]),onChange:l=>s({...e,[j]:Number(l)}),paddingless:!0,borderless:!0})]},j))})]})]})]})},Vt="_title_1jkiw_1",Yt="_subtitle_1jkiw_5",Gt="_header_1jkiw_12",Xt="_text_1jkiw_13",Wt="_top_1jkiw_20",Jt="_itemsBlock_1jkiw_29",ct={title:Vt,subtitle:Yt,header:Gt,text:Xt,top:Wt,itemsBlock:Jt},Qt="_typeTexts_167ez_1",Kt="_block_167ez_8",Zt="_active_167ez_25",ht={typeTexts:Qt,block:Kt,active:Zt},te=["bold","italic","underline","strike-through","code"],gt=d=>{const{typesText:a,setTypesText:e}=d;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:ht.typeTexts,children:te.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(ht.block,{[ht.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(o=>o!==i);e(c)}else r.push(i),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(i),fill:a.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},lt={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},ft=d=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:o,subtitle:n="Items",typeFont:x,setTypeFont:f}=d;return t.jsxRuntimeExports.jsxs("div",{className:ct.text,children:[(o||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:ct.top,children:[o&&t.jsxRuntimeExports.jsx("h3",{className:ct.title,children:o}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:j=>s(j)})]}),t.jsxRuntimeExports.jsxs("div",{className:ct.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:ct.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:j=>r(j),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:a,setTypesText:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Type Text",options:Object.values(lt).filter(j=>j!==lt[x]),onChange:j=>f(Object.keys(lt).find(l=>lt[l]===j)),value:lt[x]})]})]})},ee="_title_1fz6i_1",se="_subtitle_1fz6i_5",ne="_header_1fz6i_12",ie="_text_1fz6i_13",oe="_productsBlock_1fz6i_14",ae="_top_1fz6i_26",re="_itemsBlock_1fz6i_35",ce="_typeTexts_1fz6i_41",le="_block_1fz6i_48",de="_active_1fz6i_61",ue="_products_1fz6i_14",xe="_product_1fz6i_14",me="_button_1fz6i_80",pe="_disabled_1fz6i_91",_e="_image_1fz6i_95",he="_info_1fz6i_102",je="_name_1fz6i_114",ge="_buttons_1fz6i_118",fe="_modal_1fz6i_125",be="_link_1fz6i_146",ve="_modalOptions_1fz6i_152",Ee="_addButton_1fz6i_165",Re="_deleteButton_1fz6i_180",ye="_closeIcon_1fz6i_192",U={title:ee,subtitle:se,header:ne,text:ie,productsBlock:oe,top:ae,itemsBlock:re,typeTexts:ce,block:le,active:de,products:ue,product:xe,button:me,disabled:pe,image:_e,info:he,name:je,buttons:ge,modal:fe,link:be,modalOptions:ve,addButton:Ee,deleteButton:Re,closeIcon:ye},Ie=h.forwardRef((d,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=d;function o(n,x){return n.length>x?`${n.slice(0,x)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:U.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:o(e.name["en-US"],20)}),t.jsxRuntimeExports.jsx("div",{className:U.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:U.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:x=>{const f={...e,[n.field]:x};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[n.field.type],setTypesText:x=>{const f={...e,[n.field.type]:x};s(f)},text:e[n.field.text]["en-US"]||"",setText:x=>{const f={...e,[n.field.text]:{"en-US":x}};s(f)},typeFont:e[n.field.typeFont],setTypeFont:x=>{const f={...e,[n.field.typeFont]:x};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>{const f={...e,[n.field]:x};s(f)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:U.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>{const f={...e,[n.field.text]:x};s(f)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:x=>{const f={...e,[n.field.switch]:x};s(f)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(vt,{items:e[n.field]||[],setItems:x=>{const f={...e,[n.field]:x};s(f)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:n.editable||!1,subtitle:n.label,addableOptions:n.addableOptions,modalOptions:n.modalOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:x=>{const f={...e,[n.field]:x};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]}),switcher:n.switcher?{value:!!e[n.switcher],onChange:x=>{if(n.switcher==="isActive"){const f={...e,[n.switcher]:x};s(f)}}}:void 0})})})]})}),ke="_other_g74jx_1",Se="_subtitle_g74jx_7",$e="_items_g74jx_14",jt={other:ke,subtitle:Se,items:$e},pt=d=>{const{items:a,title:e="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:jt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:jt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:jt.items,children:a.map((s,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:r=>s.setIsItem(r),label:s.label,hasBackground:!0,paddingless:!1},i))})]})};function Ne({product:d,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:d.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${U.product} ${o?U.dragging:""}`,...e,...s,children:a})}const vt=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsPlaceholder:p="",itemsOptions:m,hasRangeSelector:R=!1,rangeSelectorOptions:L,modalOptions:P,addableOptions:u={},limit:$,autoInterval:A}=d,[H,N]=h.useState(null),[b,w]=h.useState({top:0,left:0}),[g,y]=h.useState(null),k=h.useRef(null),[z,B]=h.useState(!1),q=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const _=()=>{N(null),B(!1)};return document.body.addEventListener("click",_),N(null),B(!1),()=>{N(null),B(!1),document.body.removeEventListener("click",_)}},[]),h.useEffect(()=>{if(H){const _=[...s].map(I=>I.id===H.id?H:I);i(_)}},[H]),h.useEffect(()=>{if(k.current&&g){const _=k.current.getBoundingClientRect().height,I=window.innerHeight;let T=g.top;T+_>I+window.scrollY-200&&(T=I+window.scrollY-_-200),T<0&&(T=10),w({top:T,left:g.left})}},[k.current,g]);const K=(_,I)=>{_.stopPropagation();const T=_.target.getBoundingClientRect();y({top:T.top+window.scrollY-70,left:T.left-(l?30:65)}),N(I),B(!0)};function it(_){if(f)return _?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const v=_=>{const{active:I,over:T}=_;if(T&&I.id!==T.id){const D=s.findIndex(M=>M.id===I.id),Y=s.findIndex(M=>M.id===T.id);if(D!==-1&&Y!==-1){const M=[...s],[ot]=M.splice(D,1);M.splice(Y,0,ot),i(M)}}},O=(_,I)=>{var D,Y;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&m&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const ot=[...s],rt=m.find(xt=>xt.name["en-US"]===M);if(!rt)return;const at=ot.map(xt=>xt.id===_.id?{...rt,name:{"en-US":M}}:xt);N({..._,name:{"en-US":M}}),i([...at])},value:_.name["en-US"],options:m.filter(M=>!s.find(ot=>ot.name["en-US"]===M.name["en-US"])).map(M=>M.name["en-US"]),leftAddon:it(_.images)}),E==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const rt=[...s].map(at=>at.id===_.id?{..._,name:{"en-US":M}}:at);i([...rt])},value:_.name["en-US"],placeholder:p}),E==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const rt=[...s].map(at=>at.id===_.id?{..._,images:M}:at);i([...rt])},activeImage:(D=s.find(M=>M.id===_.id))!=null&&D.images?(Y=s.find(M=>M.id===_.id))==null?void 0:Y.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>{K(M,_)}})}),j&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(M=>M.id!==_.id))})})]})]});return x?t.jsxRuntimeExports.jsx(Ne,{product:_,index:I,children:T},_.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:T},_.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:_=>e==null?void 0:e(_)})]}),H&&n&&P&&z&&t.jsxRuntimeExports.jsx(Ie,{ref:k,activeItem:H,setActiveItem:N,popupPosition:b,modalOptions:P,setIsOpenModal:B}),R&&L&&t.jsxRuntimeExports.jsx(_t,{...L}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:q,onDragEnd:v,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(_=>_.id),strategy:t.verticalListSortingStrategy,children:s.map((_,I)=>O(_,I))})}):s.map((_,I)=>O(_,I)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!($&&$<=s.length||s.length===(m==null?void 0:m.length))}),size:"s",disabled:!!($&&$<=s.length||s.length===(m==null?void 0:m.length)),onClick:()=>{const _=[...s];let I=null;if(m){for(let T=0;T<m.length;T++)if(!s.find(D=>D.id===m[T].id)){I=m[T];break}}E==="select"&&m?_.push({name:I?I.name:m[0].name,id:(I==null?void 0:I.id)||m[0].id,...u}):E==="input"?_.push({name:{"en-US":""},id:t.v4(),...u}):_.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...u}),i(_)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,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(pt,{items:r}),A!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:A.title||"Auto scroll interval",type:"number",value:String(A.autoInterval),onChange:_=>A.setAutoInterval(Number(_)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Ce="_title_82zux_1",we="_subtitle_82zux_5",Be="_header_82zux_12",Te="_text_82zux_13",Pe="_productsBlock_82zux_14",Ae="_top_82zux_26",Me="_itemsBlock_82zux_35",Oe="_typeTexts_82zux_41",qe="_block_82zux_48",ze="_active_82zux_61",Le="_products_82zux_14",De="_product_82zux_14",Ue="_button_82zux_80",He="_disabled_82zux_91",Fe="_image_82zux_95",Ve="_info_82zux_102",Ye="_name_82zux_114",Ge="_buttons_82zux_118",Xe="_modal_82zux_125",We="_link_82zux_145",Je="_modalOptions_82zux_151",Qe="_addButton_82zux_157",Ke="_deleteButton_82zux_179",Q={title:Ce,subtitle:we,header:Be,text:Te,productsBlock:Pe,top:Ae,itemsBlock:Me,typeTexts:Oe,block:qe,active:ze,products:Le,product:De,button:Ue,disabled:He,image:Fe,info:Ve,name:Ye,buttons:Ge,modal:Xe,link:We,modalOptions:Je,addButton:Qe,deleteButton:Ke},Ze=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,draggable:n=!1,withImage:x=!1,addable:f=!0,itemsOptions:j,hasRangeSelector:l=!1,rangeSelectorOptions:E,limit:p,autoScrollInterval:m,deletable:R}=d;function L(u){if(x)return u?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${u[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=(u,$=!1)=>{const A=j.find(N=>N.id===u);if(!A)return;const H=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:N=>{const b=[...s],w=j.find(k=>k.name===N);if(!w)return;const g=w.id,y=b.map(k=>k===u?g:k);i([...y])},value:A.name,options:j.filter(N=>!s.find(b=>b===N.id)).map(N=>N.name),leftAddon:L(A.images)}),$&&t.jsxRuntimeExports.jsx("div",{className:Q.buttons,children:t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(N=>N!==u))})})})]});return t.jsxRuntimeExports.jsx("div",{className:Q.product,children:H},u)};return t.jsxRuntimeExports.jsxs("div",{className:Q.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:Q.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:Q.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:u=>e==null?void 0:e(u)})]}),l&&E&&t.jsxRuntimeExports.jsx(_t,{...E}),t.jsxRuntimeExports.jsxs("div",{className:Q.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:o}),s.map(u=>P(u,R)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(Q.button,{[Q.disabled]:!!(p&&p<=s.length||s.length===j.length)}),size:"s",disabled:!!(p&&p<=s.length||s.length===j.length),onClick:()=>{const u=[...s];let $=null;if(j){for(let A=0;A<j.length;A++)if(!s.find(H=>H===j[A].id)){$=j[A];break}}u.push(($==null?void 0:$.id)||j[0].id),i(u)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:Q.addButton,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(pt,{items:r}),m!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(m.scrollInterval),onChange:u=>m.setScrollInterval(Number(u)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},ts="_title_roi3a_1",es="_subtitle_roi3a_5",ss="_header_roi3a_12",ns="_text_roi3a_13",is="_productsBlock_roi3a_14",os="_top_roi3a_26",as="_itemsBlock_roi3a_35",rs="_typeTexts_roi3a_41",cs="_block_roi3a_48",ls="_active_roi3a_61",ds="_products_roi3a_14",us="_product_roi3a_14",xs="_button_roi3a_80",ms="_disabled_roi3a_91",ps="_image_roi3a_95",_s="_info_roi3a_102",hs="_name_roi3a_114",js="_buttons_roi3a_118",gs="_modal_roi3a_125",fs="_link_roi3a_145",bs="_modalOptions_roi3a_151",vs="_addButton_roi3a_164",Es="_deleteButton_roi3a_179",Rs="_closeIcon_roi3a_191",X={title:ts,subtitle:es,header:ss,text:ns,productsBlock:is,top:os,itemsBlock:as,typeTexts:rs,block:cs,active:ls,products:ds,product:us,button:xs,disabled:ms,image:ps,info:_s,name:hs,buttons:js,modal:gs,link:fs,modalOptions:bs,addButton:vs,deleteButton:Es,closeIcon:Rs};function ys({product:d,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:d.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${X.product} ${o?X.dragging:""}`,...e,...s,children:a})}const Is=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,title:r,subtitle:c,editable:o=!0,draggable:n=!1,deletable:x=!0,addable:f=!0,itemsType:j,itemsOptions:l,addableOptions:E={},limit:p}=d,[m,R]=h.useState(null),[L,P]=h.useState(null),u=h.useRef(null),$=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{if(m){const b=[...s].map(w=>w.id===m.id?m:w);i(b)}},[m]),h.useEffect(()=>{u.current&&L&&(u.current.getBoundingClientRect().height,L.top)},[u.current,L]);const A=(b,w)=>{b.stopPropagation();const g=b.target.getBoundingClientRect();P({top:g.top+window.scrollY,left:g.left-30}),R(w)},H=b=>{const{active:w,over:g}=b;if(g&&w.id!==g.id){const y=s.findIndex(z=>z.id===w.id),k=s.findIndex(z=>z.id===g.id);if(y!==-1&&k!==-1){const z=[...s],[B]=z.splice(y,1);z.splice(k,0,B),i(z)}}},N=(b,w)=>{const g=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})}),j==="select"&&l&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const k=[...s],z=l.find(q=>q.name===y);if(!z)return;const B=k.map(q=>q.id===b.id?{...z,name:{"en-US":y}}:q);R({...b,name:{"en-US":y}}),i([...B])},value:b.name,options:l.filter(y=>!s.find(k=>k.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>A(y,b)})}),x&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children: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 n?t.jsxRuntimeExports.jsx(ys,{product:b,index:w,children:g},b.id):t.jsxRuntimeExports.jsx("div",{className:X.product,children:g},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(r||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:b=>e==null?void 0:e(b)})]}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:c}),n?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:$,onDragEnd:H,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>b.id),strategy:t.verticalListSortingStrategy,children:s.map((b,w)=>N(b,w))})}):s.map((b,w)=>N(b,w)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length))}),size:"s",disabled:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length)),onClick:()=>{const b=[...s];let w=null;if(l){for(let g=0;g<l.length;g++)if(!s.find(y=>y.id===l[g].id)){w=l[g];break}}j==="select"&&l&&b.push({name:w?w.name:l[0].name,id:(w==null?void 0:w.id)||l[0].id,...E}),i(b)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})},ks="_title_5iipd_1",Ss="_subtitle_5iipd_5",$s="_header_5iipd_12",Ns="_text_5iipd_13",Cs="_productsBlock_5iipd_14",ws="_top_5iipd_26",Bs="_itemsBlock_5iipd_35",Ts="_typeTexts_5iipd_41",Ps="_block_5iipd_48",As="_active_5iipd_61",Ms="_products_5iipd_14",Os="_product_5iipd_14",qs="_button_5iipd_80",zs="_disabled_5iipd_91",Ls="_image_5iipd_95",Ds="_info_5iipd_102",Us="_name_5iipd_114",Hs="_buttons_5iipd_118",Fs="_modal_5iipd_125",Vs="_link_5iipd_146",Ys="_modalOptions_5iipd_152",Gs="_addButton_5iipd_165",Xs="_deleteButton_5iipd_180",Ws="_closeIcon_5iipd_192",F={title:ks,subtitle:Ss,header:$s,text:Ns,productsBlock:Cs,top:ws,itemsBlock:Bs,typeTexts:Ts,block:Ps,active:As,products:Ms,product:Os,button:qs,disabled:zs,image:Ls,info:Ds,name:Us,buttons:Hs,modal:Fs,link:Vs,modalOptions:Ys,addButton:Gs,deleteButton:Xs,closeIcon:Ws},Js=h.forwardRef((d,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=d;return t.jsxRuntimeExports.jsxs("div",{ref:a,className:F.modal,onClick:o=>{o.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:e.name["en-US"]}),t.jsxRuntimeExports.jsx("div",{className:F.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:F.modalOptions,children:r.map(o=>{if(o.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[o.field],onChange:n=>{const x={...e,[o.field]:n};s(x)}},String(o.field));if(o.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[o.field.type],setTypesText:n=>{const x={...e,[o.field.type]:n};s(x)},text:e[o.field.text]["en-US"]||"",setText:n=>{const x={...e,[o.field.text]:{"en-US":n}};s(x)},typeFont:e[o.field.type],setTypeFont:n=>{const x={...e,[o.field.type]:n};s(x)},subtitle:o.label});if(o.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const x={...e,[o.field]:n};s(x)},value:e[o.field]||"",label:o.label,placeholder:o.placeholder});if(o.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:F.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const x={...e,[o.field.text]:n};s(x)},value:e[o.field.text]||"",label:o.inputLabel,placeholder:o.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[o.field.switch]||!1,label:o.switchLabel,onChange:n=>{const x={...e,[o.field.switch]:n};s(x)}})]});if(o.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:o.itemsOptions,onChange:n=>{const x={...e,[o.field]:n};s(x)},label:o.label,value:e[o.field]||"String",leftAddon:o.leftAddon&&o.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[o.field]})})})})]})});function Qs(d){const{product:a,children:e}=d,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:a.id}),x={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:x,className:`${F.product} ${n?F.dragging:""}`,...s,...i,children:e})}const Ks=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsPlaceholder:p="",itemsOptions:m,hasRangeSelector:R=!1,rangeSelectorOptions:L,modalOptions:P,addableOptions:u={}}=d,[$,A]=h.useState(null),[H,N]=h.useState({top:0,left:0}),[b,w]=h.useState(null),g=h.useRef(null),[y,k]=h.useState(!1),z=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const v=()=>{A(null),k(!1)};return document.body.addEventListener("click",v),A(null),k(!1),()=>{A(null),k(!1),document.body.removeEventListener("click",v)}},[]),h.useEffect(()=>{if($){const v=[...s].map(O=>O.id===$.id?$:O);i(v)}},[$]),h.useEffect(()=>{if(g.current&&b){const v=g.current.getBoundingClientRect().height,O=window.innerHeight;let _=b.top;_+v>O+window.scrollY-200&&(_=O+window.scrollY-v-200),_<0&&(_=10),N({top:_,left:b.left})}},[g.current,b]);const B=(v,O)=>{v.stopPropagation();const _=v.target.getBoundingClientRect();w({top:_.top+window.scrollY,left:_.left-30}),A(O),k(!0)};function q(v){if(f)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const K=v=>{const{active:O,over:_}=v;if(_&&O.id!==_.id){const I=s.findIndex(D=>D.id===O.id),T=s.findIndex(D=>D.id===_.id);if(I!==-1&&T!==-1){const D=[...s],[Y]=D.splice(I,1);D.splice(T,0,Y),i(D)}}},it=v=>{var _;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&m&&t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const D=[...s].map(Y=>Y.id===v.id?{...v,name:{"en-US":I}}:Y);A({...v,name:{"en-US":I}}),i([...D])},value:v.name["en-US"],options:m.filter(I=>!s.find(T=>T.name["en-US"]===I)),leftAddon:q(v.images)}),E==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:I=>{const D=[...s].map(Y=>Y.id===v.id?{...v,name:{"en-US":I}}:Y);i([...D])},value:v.name["en-US"],placeholder:p}),E==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:I=>{const D=[...s].map(Y=>Y.id===v.id?{...v,images:I}:Y);i([...D])},activeImage:(_=s.find(I=>I.id===v.id))==null?void 0:_.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:I=>B(I,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I.id!==v.id))})})]})]});return x?t.jsxRuntimeExports.jsx(Qs,{product:v,children:O},v.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:O},v.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:v=>e==null?void 0:e(v)})]}),$&&n&&P&&y&&t.jsxRuntimeExports.jsx(Js,{ref:g,activeItem:$,setActiveItem:A,popupPosition:H,modalOptions:P,setIsOpenModal:k}),R&&L&&t.jsxRuntimeExports.jsx(_t,{...L}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:z,onDragEnd:K,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>v.id),strategy:t.verticalListSortingStrategy,children:s.map(v=>it(v))})}):s.map(v=>it(v)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:F.button,size:"s",onClick:()=>{const v=[...s];let O=null;if(m){for(let _=0;_<m.length;_++)if(!s.find(I=>I.name["en-US"]===m[_])){O=m[_];break}}E==="select"&&m?v.push({name:{"en-US":O||m[0]},id:t.v4(),...u,maxSymbols:100}):E==="input"?v.push({name:{"en-US":""},id:t.v4(),...u,maxSymbols:100}):v.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...u,maxSymbols:100}),i(v)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,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(pt,{items:r})]})},Zs="_title_hvj8m_1",tn="_subtitle_hvj8m_5",en="_header_hvj8m_12",sn="_text_hvj8m_13",nn="_productsBlock_hvj8m_14",on="_buttonsBlock_hvj8m_15",an="_top_hvj8m_26",rn="_itemsBlock_hvj8m_35",cn="_typeTexts_hvj8m_41",ln="_block_hvj8m_48",dn="_active_hvj8m_60",un="_products_hvj8m_14",xn="_product_hvj8m_14",mn="_button_hvj8m_15",pn="_image_hvj8m_90",_n="_info_hvj8m_97",hn="_name_hvj8m_109",jn="_buttons_hvj8m_15",gn="_modal_hvj8m_120",fn="_other_hvj8m_140",bn="_options_hvj8m_146",vn="_closeIcon_hvj8m_154",nt={title:Zs,subtitle:tn,header:en,text:sn,productsBlock:nn,buttonsBlock:on,top:an,itemsBlock:rn,typeTexts:cn,block:ln,active:dn,products:un,product:xn,button:mn,image:pn,info:_n,name:hn,buttons:jn,modal:gn,other:fn,options:bn,closeIcon:vn},En=h.forwardRef((d,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i,editableLink:r=!0}=d,[c,o]=h.useState(e.typesText),[n,x]=h.useState(e.destination),[f,j]=h.useState(e.page),[l,E]=h.useState(e.link||""),[p,m]=h.useState(e.text||{"en-US":""}),[R,L]=h.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:p,link:l,destination:n,typesText:c,page:f,openInNewTab:R}})},[c,n,l,p,f,R]),t.jsxRuntimeExports.jsxs("div",{className:nt.modal,onClick:u=>{u.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:nt.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.options,children:[r&&t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:u=>x(u),options:["Go to Page","Open Link"].filter(u=>u!==n),value:n}),r&&(n==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:u=>j(u),options:P?Object.values(P).filter(u=>u.name!==f).map(u=>u.name):[],value:f}):t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>E(u),value:l,placeholder:"https://",label:"Link"})),r&&t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:u=>L(u)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>m({"en-US":u}),value:p["en-US"],label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:c,setTypesText:o})]})]})}),Rn="_subtitle_jql1y_1",yn="_header_jql1y_8",In="_text_jql1y_9",kn="_productsBlock_jql1y_10",Sn="_buttonsBlock_jql1y_11",$n="_top_jql1y_23",Nn="_itemsBlock_jql1y_32",Cn="_typeTexts_jql1y_38",wn="_block_jql1y_45",Bn="_active_jql1y_58",Tn="_products_jql1y_10",Pn="_product_jql1y_10",An="_button_jql1y_11",Mn="_image_jql1y_88",On="_info_jql1y_95",qn="_name_jql1y_107",zn="_buttons_jql1y_11",Ln="_modal_jql1y_118",Dn="_other_jql1y_138",Un="_options_jql1y_144",Hn="_addButton_jql1y_150",Fn="_deleteButton_jql1y_165",tt={subtitle:Rn,header:yn,text:In,productsBlock:kn,buttonsBlock:Sn,top:$n,itemsBlock:Nn,typeTexts:Cn,block:wn,active:Bn,products:Tn,product:Pn,button:An,image:Mn,info:On,name:qn,buttons:zn,modal:Ln,other:Dn,options:Un,addButton:Hn,deleteButton:Fn},Et=d=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0,editableLink:r=!0}=d,[c,o]=h.useState(null),[n,x]=h.useState({top:0,left:0}),[f,j]=h.useState(null),l=h.useRef(null);h.useEffect(()=>{const p=()=>{o(null)};return document.body.addEventListener("click",p),o(null),()=>{o(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(c){const p=[...a].map(m=>m.id===c.id?c:m);e(p)}},[c]),h.useEffect(()=>{if(l.current&&f){const p=l.current.getBoundingClientRect().height,m=window.innerHeight;let R=f.top;R+p>m+window.scrollY-200&&(R=m+window.scrollY-p-200),R<0&&(R=10),x({top:R,left:f.left})}},[l.current,f]);const E=(p,m)=>{p.stopPropagation();const R=p.target.getBoundingClientRect();j({top:R.top+window.scrollY-70,left:R.left-(i?30:65)}),o(m)};return t.jsxRuntimeExports.jsxs("div",{className:tt.products,children:[t.jsxRuntimeExports.jsx("h5",{className:tt.subtitle,children:"Button Type"}),a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:tt.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:m=>{const L=[...a].map(P=>P.id===p.id?{...p,type:m}:P);e(L)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:tt.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:m=>{E(m,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const m=a.filter(R=>R.id!==p.id);e(m)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),c&&t.jsxRuntimeExports.jsx(En,{ref:l,activeButton:c,setActiveButton:o,popupPosition:n,editableLink:r}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:tt.button,size:"s",onClick:()=>{const p=[...a];r?p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:"",openInNewTab:!1}):p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:"",openInNewTab:!1}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:tt.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Vn=d=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i,editableLink:r=!0}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:nt.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:c=>e(c)})]}),t.jsxRuntimeExports.jsx(Et,{buttons:s,setButtons:i,editableLink:r})]})})},Yn="_wrapper_m18qi_1",Gn="_subtitle_m18qi_7",Xn="_content_m18qi_14",Wn="_range_m18qi_22",Jn="_track_m18qi_27",Qn="_progress_m18qi_36",Kn="_dots_m18qi_46",Zn="_dot_m18qi_46",ti="_active_m18qi_65",ei="_input_m18qi_77",si="_countBlock_m18qi_91",ni="_count_m18qi_91",ii="_controls_m18qi_107",oi="_button_m18qi_113",G={wrapper:Yn,subtitle:Gn,content:Xn,range:Wn,track:Jn,progress:Qn,dots:Kn,dot:Zn,active:ti,input:ei,countBlock:si,count:ni,controls:ii,button:oi},_t=d=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=d,[o,n]=h.useState(!1),x=Array.from({length:(s-e)/i+1}),f=(r-e)/(s-e)*100,j=()=>{r<s&&c(r+i)},l=()=>{r>e&&c(r-i)},E=p=>{const m=e+p*i;c(m)};return t.jsxRuntimeExports.jsxs("div",{className:G.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:G.content,children:[t.jsxRuntimeExports.jsxs("div",{className:G.range,children:[t.jsxRuntimeExports.jsx("div",{className:G.track}),t.jsxRuntimeExports.jsx("div",{className:G.progress,style:{width:`${f}%`}}),t.jsxRuntimeExports.jsx("div",{className:G.dots,children:x.map((p,m)=>{const R=m<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>E(m),className:t.clx(G.dot,{[G.active]:R,[G.inactive]:!R,[G.dragging]:o}),"aria-label":`Set value to ${e+m*i}`},m)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:p=>c(Number(p.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:G.input})]}),t.jsxRuntimeExports.jsxs("div",{className:G.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:p=>{const m=Number(p);m>s?c(s):m<e?c(e):c(m)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:G.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:j,disabled:r>=s,className:G.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:l,disabled:r<=e,className:G.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ai="_title_1ropb_1",ri="_subtitle_1ropb_5",ci="_header_1ropb_12",li="_text_1ropb_13",di="_productsBlock_1ropb_14",ui="_top_1ropb_26",xi="_itemsBlock_1ropb_35",mi="_typeTexts_1ropb_41",pi="_block_1ropb_48",_i="_active_1ropb_61",hi="_products_1ropb_14",ji="_product_1ropb_14",gi="_button_1ropb_80",fi="_image_1ropb_91",bi="_info_1ropb_98",vi="_name_1ropb_110",Ei="_buttons_1ropb_114",Ri="_modal_1ropb_121",yi="_link_1ropb_142",Ii="_modalOptions_1ropb_148",ki="_addButton_1ropb_161",Si="_deleteButton_1ropb_176",$i="_closeIcon_1ropb_188",V={title:ai,subtitle:ri,header:ci,text:li,productsBlock:di,top:ui,itemsBlock:xi,typeTexts:mi,block:pi,active:_i,products:hi,product:ji,button:gi,image:fi,info:bi,name:vi,buttons:Ei,modal:Ri,link:yi,modalOptions:Ii,addButton:ki,deleteButton:Si,closeIcon:$i},Ni=d=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=d,c=r.find(o=>o.id===a.listingId);return c?t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:o=>{o.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:t.splitTextIntoSpans(c.productData.name)}),t.jsxRuntimeExports.jsx("div",{className:V.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{i(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:V.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:o=>{const n={...a,image:o[0]};e(n)}})})]}):null};function Ci(d){const{product:a,children:e}=d,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:String(a.listingId)}),x={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:x,className:`${V.product} ${n?V.dragging:""}`,...s,...i,children:e})}const wi=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsOptions:p}=d,[m,R]=h.useState(null),[L,P]=h.useState({top:0,left:0}),[u,$]=h.useState(!1),A=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const g=()=>{R(null),$(!1)};return document.body.addEventListener("click",g),R(null),$(!1),()=>{R(null),$(!1),document.body.removeEventListener("click",g)}},[]),h.useEffect(()=>{if(m){const g=[...s].map(y=>y.listingId===m.listingId?m:y);i(g)}},[m]);const H=(g,y)=>{g.stopPropagation();const k=g.target.getBoundingClientRect(),z=100,B=window.innerHeight;let q=k.top+window.scrollY;q+z>B&&(q=B-z-20),$(!0),P({top:q-80,left:k.left-30}),R(y)};function N(g){if(f)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const b=g=>{const{active:y,over:k}=g;if(k&&y.id!==k.id){const z=s.findIndex(q=>String(q.listingId)===y.id),B=s.findIndex(q=>String(q.listingId)===k.id);if(z!==-1&&B!==-1){const q=[...s],[K]=q.splice(z,1);q.splice(B,0,K),i(q)}}},w=(g,y)=>{const k=p.find(B=>g.listingId===B.id);if(!k)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const q=[...s],K=p.find(O=>O.productData.name===B);if(!K)return;const it={listingId:K.id,image:K.productData.images.length>0?K.productData.images[0].cfId:""},v=q.map(O=>O.listingId===g.listingId?it:O);R(it),i([...v])},value:k.productData.name,options:[...p.filter(B=>!s.find(q=>q.listingId===B.id)).map(B=>B.productData.name)],leftAddon:N(g.image||k.productData.images.length>0&&k.productData.images[0].cfId||"")},y),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>H(B,g)})}),j&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(B=>B!==g))})})]})]});return x?t.jsxRuntimeExports.jsx(Ci,{product:g,children:z},g.listingId):t.jsxRuntimeExports.jsx("div",{className:V.product,children:z},g.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:g=>e==null?void 0:e(g)})]}),u&&m&&t.jsxRuntimeExports.jsx(Ni,{activeItem:m,setActiveItem:R,setIsOpenModal:$,popupPosition:L,itemsOptions:p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:A,onDragEnd:b,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((g,y)=>w(g,y))})}):s.map((g,y)=>w(g,y)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:V.button,size:"s",onClick:()=>{const g=[...s];for(let y=0;y<p.length;y++)if(!s.find(k=>k.listingId===p[y].id)){g.push({listingId:p[y].id,image:p[y].productData.images.length>0?p[y].productData.images[0].cfId:""});break}i(g)},disabled:s.length===p.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,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(pt,{items:r})]})},Bi="_options_6cemk_1",Ti="_price_6cemk_12",Pi="_oldPrice_6cemk_19",Ai="_newPrice_6cemk_27",Mi="_animate_6cemk_34",Oi="_appearAndBounce_6cemk_1",qi="_meta_6cemk_52",zi="_info_6cemk_58",Li="_infoRight_6cemk_66",Di="_buttons_6cemk_73",Ui="_variants_6cemk_80",Hi="_variant_6cemk_80",Fi="_stock_6cemk_98",Vi="_variantInfo_6cemk_105",Yi="_quantity_6cemk_111",Gi="_count_6cemk_118",Xi="_focused_6cemk_135",Wi="_button_6cemk_73",Ji="_activeVariant_6cemk_161",Qi="_chargeTypes_6cemk_165",Ki="_charge_6cemk_165",Zi="_chargeActive_6cemk_190",to="_title_6cemk_198",C={options:Bi,price:Ti,oldPrice:Pi,newPrice:Ai,animate:Mi,appearAndBounce:Oi,meta:qi,info:zi,infoRight:Li,buttons:Di,variants:Ui,variant:Hi,stock:Fi,variantInfo:Vi,quantity:Yi,count:Gi,focused:Xi,button:Wi,activeVariant:Ji,chargeTypes:Qi,charge:Ki,chargeActive:Zi,title:to},eo="_wrapper_c1dht_1",so="_label_c1dht_9",no="_input_c1dht_18",io="_paddingless_c1dht_31",oo="_content_c1dht_35",ao="_contentBorder_c1dht_47",ro="_borderless_c1dht_52",co="_rightIcon_c1dht_57",Z={wrapper:eo,label:so,input:no,paddingless:io,content:oo,contentBorder:ao,borderless:ro,rightIcon:co},Rt=d=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:o,placeholder:n,disabled:x=!1,required:f=!1,regex:j,paddingless:l=!1,borderless:E=!1,editable:p=!1,isSearch:m=!1,centered:R=!1}=d,{themeSettings:L}=t.useThemeSettingsStore(),{inputs:P}=L,[u,$]=h.useState(!1);function A(N){return Number(N)<0?String(c):N}function H(N){return!f||!j?!0:new RegExp(j).test(N)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Z.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Z.content,{[Z.contentBorder]:P.border.active}),style:{...e},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:N=>{if(r==="text")a(N.target.value);else{const b=A(N.target.value);a(b)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Z.input,{[Z.required]:u&&f&&!H(i),[Z.paddingless]:l,[Z.borderless]:E}),min:r==="number"?c:void 0,max:r==="number"?o:void 0,disabled:x,onFocus:()=>$(!0),style:{textAlign:R?"center":"left",background:P.field.active?P.field.color:"transparent",padding:m?`7px ${Number(P.general.size)+20}px 7px 11px`:"7px 11px"}}),m&&t.jsxRuntimeExports.jsx("div",{className:Z.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:P.general.size,height:P.general.size})}),p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},lo="_button_85085_1",uo="_primary_85085_20",xo="_primaryHovered_85085_30",mo="_secondary_85085_34",po="_secondaryHovered_85085_44",_o="_tertiary_85085_48",ho="_tertiaryHovered_85085_58",jo="_content_85085_62",et={button:lo,primary:uo,primaryHovered:xo,secondary:mo,secondaryHovered:po,tertiary:_o,tertiaryHovered:ho,content:jo},W=d=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=d,{themeSettings:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(et.button,i,{[et.primary]:c==="Primary",[et.secondary]:c==="Secondary",[et.tertiary]:c==="Tertiary",[et.primaryHovered]:c==="Primary"&&!r&&o.buttons.primary.hover,[et.secondaryHovered]:c==="Secondary"&&!r&&o.buttons.secondary.hover,[et.tertiaryHovered]:c==="Tertiary"&&!r&&o.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:et.content,children:[a,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};var yt=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(yt||{});const go=d=>{var L,P;const{variants:a}=d,[e,s]=h.useState(a[0]),[i,r]=h.useState(e.chargeTypes[0]),c=t.useNavigate(),[o,n]=h.useState(1),{reset:x,addProductToCart:f,getProducts:j}=t.useCart(),[l,E]=h.useState(!1);h.useEffect(()=>{E(!0);const u=setTimeout(()=>E(!1),600);return()=>clearTimeout(u)},[o]);async function p(){await j(),await f({productId:d.id,productVariantId:e.id,quantity:o})}function m(){x(),p(),c("/checkout")}function R(u){if(u>=864e5){const b=Math.floor(u/864e5);return`${b} ${b===1?"day":"days"}`}else if(u>=36e5){const b=Math.floor(u/36e5);return`${b} ${b===1?"hour":"hours"}`}else if(u>=6e4){const b=Math.floor(u/6e4);return`${b} ${b===1?"minute":"minutes"}`}else{const b=Math.floor(u/1e3);return`${b} ${b===1?"second":"seconds"}`}}return h.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&n(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(u=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:i===u}),onClick:()=>r(u),children:yt[u]},u))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:a.map(u=>{var $;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===u.id}),onClick:()=>s(u),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:u.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?u.price.amount:u.subscriptionSettings?u.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[(($=u.quantity.restrictions)==null?void 0:$.max)||u.quantity.available||0," in stock"]})})]},u.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{o>1?n(u=>u-1):n(1)},className:C.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(Rt,{type:"number",value:String(o),onChange:u=>n(Number(u)),max:((L=e.quantity.restrictions)==null?void 0:L.max)||e.quantity.available||1/0,min:((P=e.quantity.restrictions)==null?void 0:P.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{n(u=>u+1)},className:C.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.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":R(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",onClick:()=>m(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>p(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},fo="_button_1tdo3_1",bo="_login_1tdo3_14",vo="_signUp_1tdo3_18",Eo="_buttons_1tdo3_23",Ro="_modal_1tdo3_32",yo="_closing_1tdo3_64",Io="_info_1tdo3_113",ko="_top_1tdo3_120",So="_title_1tdo3_131",$o="_clear_1tdo3_138",No="_activeClear_1tdo3_145",Co="_count_1tdo3_149",wo="_cart_1tdo3_164",Bo="_empty_1tdo3_172",To="_product_1tdo3_198",Po="_products_1tdo3_207",Ao="_image_1tdo3_215",Mo="_productInfo_1tdo3_221",Oo="_content_1tdo3_228",qo="_name_1tdo3_234",zo="_price_1tdo3_240",Lo="_productButtons_1tdo3_246",Do="_productButton_1tdo3_246",Uo="_productCount_1tdo3_266",Ho="_bottom_1tdo3_282",Fo="_subtotal_1tdo3_290",Vo="_block_1tdo3_298",Yo="_shoppingCount_1tdo3_305",Go="_total_1tdo3_325",Xo="_link_1tdo3_331",Wo="_userInfo_1tdo3_338",Jo="_pagesMobileModal_1tdo3_349",Qo="_pagesMobileModalContent_1tdo3_363",Ko="_pagesMobileModalHeader_1tdo3_369",Zo="_pagesMobileModalFooter_1tdo3_379",S={button:fo,login:bo,signUp:vo,buttons:Eo,modal:Ro,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:yo,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Io,top:ko,title:So,clear:$o,activeClear:No,count:Co,cart:wo,empty:Bo,product:To,products:Po,image:Ao,productInfo:Mo,content:Oo,name:qo,price:zo,productButtons:Lo,productButton:Do,productCount:Uo,bottom:Ho,subtotal:Fo,block:Vo,shoppingCount:Yo,total:Go,link:Xo,userInfo:Wo,pagesMobileModal:Jo,pagesMobileModalContent:Qo,pagesMobileModalHeader:Ko,pagesMobileModalFooter:Zo};class ut extends Error{}ut.prototype.name="InvalidTokenError";function ta(d){return decodeURIComponent(atob(d).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ea(d){let a=d.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ta(a)}catch{return atob(a)}}function sa(d,a){if(typeof d!="string")throw new ut("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=d.split(".")[e];if(typeof s!="string")throw new ut(`Invalid token specified: missing part #${e+1}`);let i;try{i=ea(s)}catch(r){throw new ut(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ut(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const na=d=>{const{shopping:a,signUp:e,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:S.buttons,children:[a&&t.jsxRuntimeExports.jsx(It,{}),s&&t.jsxRuntimeExports.jsx(bt,{signUp:e})]})},It=()=>{const[d,a]=h.useState(!1),[e,s]=h.useState([]),{cart:i,getProducts:r}=t.useCart();function c(l){for(let E=0;E<i.parts.length;E++)for(let p=0;p<l.variants.length;p++)if(i.parts[E].productVariantId===l.variants[E].id)return i.parts[E].productVariantId}function o(l){for(let E=0;E<i.parts.length;E++)for(let p=0;p<l.variants.length;p++)if(i.parts[E].productVariantId===l.variants[E].id)return i.parts[E].quantity}h.useEffect(()=>{(async()=>{const E=i.parts.map(R=>String(R.productId)),m=(await r([...E])).map(R=>({...R,activeVariantId:c(R),quantity:o(R)}));s(m)})()},[i.parts.length]);function n(l){var E;return!l||!(l!=null&&l.variants)?!1:(E=l.variants.find(p=>p.id===l.activeVariantId))==null?void 0:E.subscriptionSettings}const x=i.parts.length>0&&e.length>0&&!n(e[0]),[f,j]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(W,{type:"Secondary",style:{padding:10},onClick:l=>{l.stopPropagation(),window.location.pathname.includes("/admin/builder")||(a(!0),j(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),x&&t.jsxRuntimeExports.jsx("div",{className:S.shoppingCount,children:i.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{j(!1),setTimeout(()=>{a(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(kt,{activeProducts:e,isCartNotEmpty:x,isOpen:f})})]})},kt=d=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=d,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:o}=t.useCart(),n=t.useNavigate();function x(l){n(l)}function f(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity+1})}function j(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(S.modal,{[S.closing]:!s}),onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:S.top,children:[t.jsxRuntimeExports.jsxs("div",{className:S.info,children:[t.jsxRuntimeExports.jsx("span",{className:S.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:S.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(S.clear,{[S.activeClear]:e}),disabled:!e,onClick:r,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:S.cart,children:[t.jsxRuntimeExports.jsx("div",{className:S.products,children:a.map(l=>t.jsxRuntimeExports.jsxs("div",{className:S.product,children:[t.jsxRuntimeExports.jsxs("div",{className:S.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:S.image}),t.jsxRuntimeExports.jsxs("div",{className:S.content,children:[t.jsxRuntimeExports.jsx("div",{className:S.name,children:l.name}),t.jsxRuntimeExports.jsxs("div",{className:S.price,children:["$",l.variants.find(E=>E.id===l.activeVariantId).price.amount*((l==null?void 0:l.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:S.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{l.quantity!==1&&j(l)},className:S.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:S.productCount,children:l.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>f(l),className:S.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},l.id))}),t.jsxRuntimeExports.jsxs("div",{className:S.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:S.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:S.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:S.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(W,{onClick:()=>x("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(St,{})]})},St=()=>t.jsxRuntimeExports.jsxs("div",{className:S.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:S.link,children:"view products"})]})]}),bt=({signUp:d})=>{const a=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=a,s=t.useNavigate();function i(o){window.location.pathname.includes("/admin/builder")||s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[r,c]=h.useState("test-email@gmail.com");return h.useEffect(()=>{(async()=>{const n=sa(e);c(n.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:S.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},$t=({children:d,logo:a,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),r=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:S.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:S.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:a}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:S.pagesMobileModalContent,children:d}),t.jsxRuntimeExports.jsx("div",{className:S.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(bt,{signUp:s})})]})},ia=({children:d,logo:a,signUp:e})=>{const[s,i]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Nt,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx($t,{logo:a,setIsOpen:i,signUp:e,children:d})})]})},Nt=d=>{const{setIsOpenModal:a}=d;return t.jsxRuntimeExports.jsx(W,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),a(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},oa="_share_xddz7_1",aa="_modal_xddz7_8",ra="_header_xddz7_20",ca="_socials_xddz7_30",la="_social_xddz7_30",da="_copy_xddz7_40",ua="_title_xddz7_47",xa="_copyWrapper_xddz7_53",ma="_copyText_xddz7_62",pa="_copyTextMobile_xddz7_75",_a="_copyTextMiniMobile_xddz7_94",st={share:oa,modal:aa,header:ra,socials:ca,social:la,copy:da,title:ua,copyWrapper:xa,copyText:ma,copyTextMobile:pa,copyTextMiniMobile:_a},ha=()=>{const{isOpenModal:d,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:st.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(ja,{})})]})},ja=()=>{const{setIsOpenModal:d}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),i=window.location.href;function r(){navigator.clipboard.writeText(i),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{d(!1),s(!0)},300)}function o(n,x){return n.length>x?n.slice(0,x)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:st.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:st.header,children:[t.jsxRuntimeExports.jsx("div",{className:st.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:st.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:st.copyText,children:o(i,100)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMobile,children:o(i,40)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMiniMobile,children:o(i,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:r,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ga="_accordion_1s1lq_1",fa="_header_1s1lq_9",ba="_icon_1s1lq_18",va="_open_1s1lq_21",Ea="_content_1s1lq_25",dt={accordion:ga,header:fa,icon:ba,open:va,content:Ea},Ra=({title:d,content:a,defaultOpen:e=!1})=>{const[s,i]=h.useState(e),[r,c]=h.useState(0),o=h.useRef(null),n=()=>{i(!s)};return h.useEffect(()=>{o.current&&c(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:dt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.header,onClick:n,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(dt.icon,{[dt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:dt.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},ya=({children:d,path:a,className:e,target:s="_self",id:i})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:i,children:d});const r=t.useNavigate(),c=/^https?:\/\//.test(a),o=n=>{c||s==="_blank"?s==="_blank"?window.open(a,"_blank"):window.location.href=a:(n.preventDefault(),r(a,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:d})},Ia="_buttonsBlock_1b2rb_1",ka="_slideUp_1b2rb_1",Sa={buttonsBlock:Ia,slideUp:ka},$a=()=>t.jsxRuntimeExports.jsxs("div",{className:Sa.buttonsBlock,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",children:"Buy"})]}),Na="_wrapper_st58d_1",Ca="_label_st58d_10",wa="_textarea_st58d_18",Ba="_length_st58d_33",mt={wrapper:Na,label:Ca,textarea:wa,length:Ba},Ta=d=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=d,[c,o]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:mt.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:mt.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{o(n.target.value.length),a(n.target.value)},placeholder:r,className:mt.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:mt.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=Ra;exports.BurgerMenuButton=Nt;exports.Button=W;exports.ButtonTypeSettings=Et;exports.ButtonsSettings=Vn;exports.CategorySettings=Ze;exports.EmptyCart=St;exports.FormSettings=Ks;exports.HeaderButtons=na;exports.InputUI=Rt;exports.ItemsSettings=vt;exports.LayoutSettings=Ft;exports.Link=ya;exports.ListingSelector=wi;exports.PagesMobileMenu=ia;exports.PagesMobileModal=$t;exports.PagesSettings=Is;exports.ProductCardButtons=$a;exports.ProductOptions=go;exports.RangeSelector=_t;exports.ShareLink=ha;exports.ShoppingButton=It;exports.ShoppingModalCart=kt;exports.TextSettings=ft;exports.TextareaUI=Ta;exports.TypesText=gt;exports.UserInfo=bt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DSOQcy7R.cjs"),_=require("react");require("@phosphor-icons/react");const ut="_wrapper_1ibay_2",xt="_alignmentBlock_1ibay_8",pt="_title_1ibay_15",mt="_subtitle_1ibay_22",jt="_alignmentContent_1ibay_29",ht="_alignments_1ibay_37",_t="_alignment_1ibay_8",gt="_circle_1ibay_60",ft="_paddings_1ibay_67",bt="_padding_1ibay_67",Et="_active_1ibay_91",vt="_input_1ibay_98",F={wrapper:ut,alignmentBlock:xt,title:pt,subtitle:mt,alignmentContent:jt,alignments:ht,alignment:_t,circle:gt,paddings:ft,padding:bt,active:Et,input:vt},yt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],It=u=>{const{alignment:i,padding:e,setPadding:s,setAlignment:n}=u;function l(j){switch(j){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function a(j){switch(j){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[r,m]=_.useState(null),[y,C]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:F.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:F.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:F.alignments,children:yt.map(j=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(j)},className:F.alignment,onMouseEnter:()=>{m(j)},onMouseLeave:()=>{m(null)},children:[j!==i&&r!==j&&t.jsxRuntimeExports.jsx("div",{className:F.circle}),j!==i&&r===j&&t.jsxRuntimeExports.jsx(t.Icon,{name:l(r),fill:"#c2c2c2",width:22,height:22}),j===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:l(i),fill:"#FF3F19",width:22,height:22})]},j))}),t.jsxRuntimeExports.jsx("div",{className:F.paddings,children:Rt.map(j=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(F.padding,{[F.active]:y===j}),onFocus:()=>{C(j)},onBlur:()=>{C(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:a(j),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[j]),onChange:o=>s({...e,[j]:Number(o)}),paddingless:!0,borderless:!0})]},j))})]})]})]})},St="_title_82zux_1",Nt="_subtitle_82zux_5",kt="_header_82zux_12",Ct="_text_82zux_13",$t="_productsBlock_82zux_14",Bt="_top_82zux_26",wt="_itemsBlock_82zux_35",Pt="_typeTexts_82zux_41",Mt="_block_82zux_48",Tt="_active_82zux_61",qt="_products_82zux_14",At="_product_82zux_14",Ot="_button_82zux_80",Lt="_disabled_82zux_91",zt="_image_82zux_95",Dt="_info_82zux_102",Ht="_name_82zux_114",Ut="_buttons_82zux_118",Ft="_modal_82zux_125",Vt="_link_82zux_145",Yt="_modalOptions_82zux_151",Wt="_addButton_82zux_157",Gt="_deleteButton_82zux_179",V={title:St,subtitle:Nt,header:kt,text:Ct,productsBlock:$t,top:Bt,itemsBlock:wt,typeTexts:Pt,block:Mt,active:Tt,products:qt,product:At,button:Ot,disabled:Lt,image:zt,info:Dt,name:Ht,buttons:Ut,modal:Ft,link:Vt,modalOptions:Yt,addButton:Wt,deleteButton:Gt},Xt=u=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:l,title:a,subtitle:r,draggable:m=!1,withImage:y=!1,addable:C=!0,itemsOptions:j,hasRangeSelector:o=!1,rangeSelectorOptions:b,limit:d,autoScrollInterval:g,deletable:E}=u;function O(c){if(y)return c?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const M=(c,N=!1)=>{const B=j.find(k=>k.id===c);if(!B)return;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[m&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const p=[...s],S=j.find(R=>R.name===k);if(!S)return;const x=S.id,f=p.map(R=>R===c?x:R);n([...f])},value:B.name,options:j.filter(k=>!s.find(p=>p===k.id)).map(k=>k.name),leftAddon:O(B.images)}),N&&t.jsxRuntimeExports.jsx("div",{className:V.buttons,children:t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(k=>k!==c))})})})]});return t.jsxRuntimeExports.jsx("div",{className:V.product,children:U},c)};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:c=>e==null?void 0:e(c)})]}),o&&b&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...b}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:r}),s.map(c=>M(c,E)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(V.button,{[V.disabled]:!!(d&&d<=s.length||s.length===j.length)}),size:"s",disabled:!!(d&&d<=s.length||s.length===j.length),onClick:()=>{const c=[...s];let N=null;if(j){for(let B=0;B<j.length;B++)if(!s.find(U=>U===j[B].id)){N=j[B];break}}c.push((N==null?void 0:N.id)||j[0].id),n(c)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:l}),g!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(g.scrollInterval),onChange:c=>g.setScrollInterval(Number(c)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Qt="_title_roi3a_1",Jt="_subtitle_roi3a_5",Kt="_header_roi3a_12",Zt="_text_roi3a_13",te="_productsBlock_roi3a_14",ee="_top_roi3a_26",se="_itemsBlock_roi3a_35",ne="_typeTexts_roi3a_41",oe="_block_roi3a_48",ie="_active_roi3a_61",re="_products_roi3a_14",ae="_product_roi3a_14",ce="_button_roi3a_80",le="_disabled_roi3a_91",de="_image_roi3a_95",ue="_info_roi3a_102",xe="_name_roi3a_114",pe="_buttons_roi3a_118",me="_modal_roi3a_125",je="_link_roi3a_145",he="_modalOptions_roi3a_151",_e="_addButton_roi3a_164",ge="_deleteButton_roi3a_179",fe="_closeIcon_roi3a_191",z={title:Qt,subtitle:Jt,header:Kt,text:Zt,productsBlock:te,top:ee,itemsBlock:se,typeTexts:ne,block:oe,active:ie,products:re,product:ae,button:ce,disabled:le,image:de,info:ue,name:xe,buttons:pe,modal:me,link:je,modalOptions:he,addButton:_e,deleteButton:ge,closeIcon:fe};function be({product:u,children:i}){const{attributes:e,listeners:s,setNodeRef:n,transform:l,transition:a,isDragging:r}=t.useSortable({id:u.id}),m={transform:t.CSS.Transform.toString(l),transition:a};return t.jsxRuntimeExports.jsx("div",{ref:n,style:m,className:`${z.product} ${r?z.dragging:""}`,...e,...s,children:i})}const Ee=u=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,title:l,subtitle:a,editable:r=!0,draggable:m=!1,deletable:y=!0,addable:C=!0,itemsType:j,itemsOptions:o,addableOptions:b={},limit:d}=u,[g,E]=_.useState(null),[O,M]=_.useState(null),c=_.useRef(null),N=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(g){const p=[...s].map(S=>S.id===g.id?g:S);n(p)}},[g]),_.useEffect(()=>{c.current&&O&&(c.current.getBoundingClientRect().height,O.top)},[c.current,O]);const B=(p,S)=>{p.stopPropagation();const x=p.target.getBoundingClientRect();M({top:x.top+window.scrollY,left:x.left-30}),E(S)},U=p=>{const{active:S,over:x}=p;if(x&&S.id!==x.id){const f=s.findIndex(T=>T.id===S.id),R=s.findIndex(T=>T.id===x.id);if(f!==-1&&R!==-1){const T=[...s],[$]=T.splice(f,1);T.splice(R,0,$),n(T)}}},k=(p,S)=>{const x=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[m&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),j==="select"&&o&&t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const R=[...s],T=o.find(w=>w.name===f);if(!T)return;const $=R.map(w=>w.id===p.id?{...T,name:{"en-US":f}}:w);E({...p,name:{"en-US":f}}),n([...$])},value:p.name,options:o.filter(f=>!s.find(R=>R.name===f.name)).map(f=>f.name)}),t.jsxRuntimeExports.jsxs("div",{className:z.buttons,children:[r&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>B(f,p)})}),y&&t.jsxRuntimeExports.jsx("div",{className:z.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(f=>f.id!==p.id))})})]})]});return m?t.jsxRuntimeExports.jsx(be,{product:p,index:S,children:x},p.id):t.jsxRuntimeExports.jsx("div",{className:z.product,children:x},p.id)};return t.jsxRuntimeExports.jsxs("div",{className:z.productsBlock,children:[(l||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:z.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:z.title,children:l}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:p=>e==null?void 0:e(p)})]}),t.jsxRuntimeExports.jsxs("div",{className:z.products,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:a}),m?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:N,onDragEnd:U,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(p=>p.id),strategy:t.verticalListSortingStrategy,children:s.map((p,S)=>k(p,S))})}):s.map((p,S)=>k(p,S)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(z.button,{[z.disabled]:!!(d&&d<=s.length||s.length===(o==null?void 0:o.length))}),size:"s",disabled:!!(d&&d<=s.length||s.length===(o==null?void 0:o.length)),onClick:()=>{const p=[...s];let S=null;if(o){for(let x=0;x<o.length;x++)if(!s.find(f=>f.id===o[x].id)){S=o[x];break}}j==="select"&&o&&p.push({name:S?S.name:o[0].name,id:(S==null?void 0:S.id)||o[0].id,...b}),n(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:z.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function ve(u){const{product:i,children:e}=u,{attributes:s,listeners:n,setNodeRef:l,transform:a,transition:r,isDragging:m}=t.useSortable({id:i.id}),y={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:l,style:y,className:`${t.styles.product} ${m?t.styles.dragging:""}`,...s,...n,children:e})}const ye=u=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:l,title:a,subtitle:r,editable:m=!0,draggable:y=!1,withImage:C=!1,deletable:j=!0,addable:o=!0,itemsType:b,itemsPlaceholder:d="",itemsOptions:g,hasRangeSelector:E=!1,rangeSelectorOptions:O,modalOptions:M,addableOptions:c={}}=u,[N,B]=_.useState(null),[U,k]=_.useState({top:0,left:0}),[p,S]=_.useState(null),x=_.useRef(null),[f,R]=_.useState(!1),T=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const h=()=>{B(null),R(!1)};return document.body.addEventListener("click",h),B(null),R(!1),()=>{B(null),R(!1),document.body.removeEventListener("click",h)}},[]),_.useEffect(()=>{if(N){const h=[...s].map(P=>P.id===N.id?N:P);n(h)}},[N]),_.useEffect(()=>{if(x.current&&p){const h=x.current.getBoundingClientRect().height,P=window.innerHeight;let q=p.top;q+h>P+window.scrollY-200&&(q=P+window.scrollY-h-200),q<0&&(q=10),k({top:q,left:p.left})}},[x.current,p]);const $=(h,P)=>{h.stopPropagation();const q=h.target.getBoundingClientRect();S({top:q.top+window.scrollY,left:q.left-30}),B(P),R(!0)};function w(h){if(C)return h?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${h[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const G=h=>{const{active:P,over:q}=h;if(q&&P.id!==q.id){const A=s.findIndex(D=>D.id===P.id),K=s.findIndex(D=>D.id===q.id);if(A!==-1&&K!==-1){const D=[...s],[Y]=D.splice(A,1);D.splice(K,0,Y),n(D)}}},Z=h=>{var q;const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),b==="select"&&g&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const D=[...s].map(Y=>Y.id===h.id?{...h,name:{"en-US":A}}:Y);B({...h,name:{"en-US":A}}),n([...D])},value:h.name["en-US"],options:g.filter(A=>!s.find(K=>K.name["en-US"]===A)),leftAddon:w(h.images)}),b==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const D=[...s].map(Y=>Y.id===h.id?{...h,name:{"en-US":A}}:Y);n([...D])},value:h.name["en-US"],placeholder:d}),b==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const D=[...s].map(Y=>Y.id===h.id?{...h,images:A}:Y);n([...D])},activeImage:(q=s.find(A=>A.id===h.id))==null?void 0:q.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>$(A,h)})}),j&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(A=>A.id!==h.id))})})]})]});return y?t.jsxRuntimeExports.jsx(ve,{product:h,children:P},h.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:P},h.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:h=>e==null?void 0:e(h)})]}),N&&m&&M&&f&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:x,activeItem:N,setActiveItem:B,popupPosition:U,modalOptions:M,setIsOpenModal:R}),E&&O&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...O}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:r}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:T,onDragEnd:G,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(h=>h.id),strategy:t.verticalListSortingStrategy,children:s.map(h=>Z(h))})}):s.map(h=>Z(h)),o&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles.button,size:"s",onClick:()=>{const h=[...s];let P=null;if(g){for(let q=0;q<g.length;q++)if(!s.find(A=>A.name["en-US"]===g[q])){P=g[q];break}}b==="select"&&g?h.push({name:{"en-US":P||g[0]},id:t.v4(),...c,maxSymbols:100}):b==="input"?h.push({name:{"en-US":""},id:t.v4(),...c,maxSymbols:100}):h.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...c,maxSymbols:100}),n(h)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:l})]})},Re="_subtitle_jql1y_1",Ie="_header_jql1y_8",Se="_text_jql1y_9",Ne="_productsBlock_jql1y_10",ke="_buttonsBlock_jql1y_11",Ce="_top_jql1y_23",$e="_itemsBlock_jql1y_32",Be="_typeTexts_jql1y_38",we="_block_jql1y_45",Pe="_active_jql1y_58",Me="_products_jql1y_10",Te="_product_jql1y_10",qe="_button_jql1y_11",Ae="_image_jql1y_88",Oe="_info_jql1y_95",Le="_name_jql1y_107",ze="_buttons_jql1y_11",De="_modal_jql1y_118",He="_other_jql1y_138",Ue="_options_jql1y_144",Fe="_addButton_jql1y_150",Ve="_deleteButton_jql1y_165",X={subtitle:Re,header:Ie,text:Se,productsBlock:Ne,buttonsBlock:ke,top:Ce,itemsBlock:$e,typeTexts:Be,block:we,active:Pe,products:Me,product:Te,button:qe,image:Ae,info:Oe,name:Le,buttons:ze,modal:De,other:He,options:Ue,addButton:Fe,deleteButton:Ve},nt=u=>{const{buttons:i,setButtons:e,deletable:s=!0,addable:n=!0,editableLink:l=!0}=u,[a,r]=_.useState(null),[m,y]=_.useState({top:0,left:0}),[C,j]=_.useState(null),o=_.useRef(null);_.useEffect(()=>{const d=()=>{r(null)};return document.body.addEventListener("click",d),r(null),()=>{r(null),document.body.removeEventListener("click",d)}},[]),_.useEffect(()=>{if(a){const d=[...i].map(g=>g.id===a.id?a:g);e(d)}},[a]),_.useEffect(()=>{if(o.current&&C){const d=o.current.getBoundingClientRect().height,g=window.innerHeight;let E=C.top;E+d>g+window.scrollY-200&&(E=g+window.scrollY-d-200),E<0&&(E=10),y({top:E,left:C.left})}},[o.current,C]);const b=(d,g)=>{d.stopPropagation();const E=d.target.getBoundingClientRect();j({top:E.top+window.scrollY-70,left:E.left-(n?30:65)}),r(g)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),i.map(d=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:g=>{const O=[...i].map(M=>M.id===d.id?{...d,type:g}:M);e(O)},value:d.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:g=>{b(g,d)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const g=i.filter(E=>E.id!==d.id);e(g)},width:20,height:20,fill:"#C12A2A"})})]})]},d.id)),a&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:o,activeButton:a,setActiveButton:r,popupPosition:m,editableLink:l}),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:X.button,size:"s",onClick:()=>{const d=[...i];l?d.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:"",openInNewTab:!1}):d.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:"",openInNewTab:!1}),e(d)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ye=u=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:s,setButtons:n,editableLink:l=!0}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(nt,{buttons:s,setButtons:n,editableLink:l})]})})},We="_title_1ropb_1",Ge="_subtitle_1ropb_5",Xe="_header_1ropb_12",Qe="_text_1ropb_13",Je="_productsBlock_1ropb_14",Ke="_top_1ropb_26",Ze="_itemsBlock_1ropb_35",ts="_typeTexts_1ropb_41",es="_block_1ropb_48",ss="_active_1ropb_61",ns="_products_1ropb_14",os="_product_1ropb_14",is="_button_1ropb_80",rs="_image_1ropb_91",as="_info_1ropb_98",cs="_name_1ropb_110",ls="_buttons_1ropb_114",ds="_modal_1ropb_121",us="_link_1ropb_142",xs="_modalOptions_1ropb_148",ps="_addButton_1ropb_161",ms="_deleteButton_1ropb_176",js="_closeIcon_1ropb_188",L={title:We,subtitle:Ge,header:Xe,text:Qe,productsBlock:Je,top:Ke,itemsBlock:Ze,typeTexts:ts,block:es,active:ss,products:ns,product:os,button:is,image:rs,info:as,name:cs,buttons:ls,modal:ds,link:us,modalOptions:xs,addButton:ps,deleteButton:ms,closeIcon:js},hs=u=>{const{activeItem:i,setActiveItem:e,popupPosition:s,setIsOpenModal:n,itemsOptions:l}=u,a=l.find(r=>r.id===i.listingId);return a?t.jsxRuntimeExports.jsxs("div",{className:L.modal,onClick:r=>{r.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[t.jsxRuntimeExports.jsx("h3",{children:t.splitTextIntoSpans(a.productData.name)}),t.jsxRuntimeExports.jsx("div",{className:L.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,onClick:()=>{n(!1),e(null)}})})]}),t.jsxRuntimeExports.jsx("div",{className:L.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:r=>{const m={...i,image:r[0]};e(m)}})})]}):null};function _s(u){const{product:i,children:e}=u,{attributes:s,listeners:n,setNodeRef:l,transform:a,transition:r,isDragging:m}=t.useSortable({id:String(i.listingId)}),y={transform:t.CSS.Transform.toString(a),transition:r};return t.jsxRuntimeExports.jsx("div",{ref:l,style:y,className:`${L.product} ${m?L.dragging:""}`,...s,...n,children:e})}const gs=u=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:l,title:a,subtitle:r,editable:m=!0,draggable:y=!1,withImage:C=!1,deletable:j=!0,addable:o=!0,itemsType:b,itemsOptions:d}=u,[g,E]=_.useState(null),[O,M]=_.useState({top:0,left:0}),[c,N]=_.useState(!1),B=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const x=()=>{E(null),N(!1)};return document.body.addEventListener("click",x),E(null),N(!1),()=>{E(null),N(!1),document.body.removeEventListener("click",x)}},[]),_.useEffect(()=>{if(g){const x=[...s].map(f=>f.listingId===g.listingId?g:f);n(x)}},[g]);const U=(x,f)=>{x.stopPropagation();const R=x.target.getBoundingClientRect(),T=100,$=window.innerHeight;let w=R.top+window.scrollY;w+T>$&&(w=$-T-20),N(!0),M({top:w-80,left:R.left-30}),E(f)};function k(x){if(C)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const p=x=>{const{active:f,over:R}=x;if(R&&f.id!==R.id){const T=s.findIndex(w=>String(w.listingId)===f.id),$=s.findIndex(w=>String(w.listingId)===R.id);if(T!==-1&&$!==-1){const w=[...s],[G]=w.splice(T,1);w.splice($,0,G),n(w)}}},S=(x,f)=>{const R=d.find($=>x.listingId===$.id);if(!R)return null;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[y&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),b==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:$=>{const w=[...s],G=d.find(P=>P.productData.name===$);if(!G)return;const Z={listingId:G.id,image:G.productData.images.length>0?G.productData.images[0].cfId:""},h=w.map(P=>P.listingId===x.listingId?Z:P);E(Z),n([...h])},value:R.productData.name,options:[...d.filter($=>!s.find(w=>w.listingId===$.id)).map($=>$.productData.name)],leftAddon:k(x.image||R.productData.images.length>0&&R.productData.images[0].cfId||"")},f),t.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[m&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:$=>U($,x)})}),j&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter($=>$!==x))})})]})]});return y?t.jsxRuntimeExports.jsx(_s,{product:x,children:T},x.listingId):t.jsxRuntimeExports.jsx("div",{className:L.product,children:T},x.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:L.productsBlock,children:[(a||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[a&&t.jsxRuntimeExports.jsx("h3",{className:L.title,children:a}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),c&&g&&t.jsxRuntimeExports.jsx(hs,{activeItem:g,setActiveItem:E,setIsOpenModal:N,popupPosition:O,itemsOptions:d}),t.jsxRuntimeExports.jsxs("div",{className:L.products,children:[r&&t.jsxRuntimeExports.jsx("h5",{className:L.subtitle,children:r}),y?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:B,onDragEnd:p,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>String(x.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((x,f)=>S(x,f))})}):s.map((x,f)=>S(x,f)),o&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:L.button,size:"s",onClick:()=>{const x=[...s];for(let f=0;f<d.length;f++)if(!s.find(R=>R.listingId===d[f].id)){x.push({listingId:d[f].id,image:d[f].productData.images.length>0?d[f].productData.images[0].cfId:""});break}n(x)},disabled:s.length===d.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:L.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:l})]})},fs="_options_6cemk_1",bs="_price_6cemk_12",Es="_oldPrice_6cemk_19",vs="_newPrice_6cemk_27",ys="_animate_6cemk_34",Rs="_appearAndBounce_6cemk_1",Is="_meta_6cemk_52",Ss="_info_6cemk_58",Ns="_infoRight_6cemk_66",ks="_buttons_6cemk_73",Cs="_variants_6cemk_80",$s="_variant_6cemk_80",Bs="_stock_6cemk_98",ws="_variantInfo_6cemk_105",Ps="_quantity_6cemk_111",Ms="_count_6cemk_118",Ts="_focused_6cemk_135",qs="_button_6cemk_73",As="_activeVariant_6cemk_161",Os="_chargeTypes_6cemk_165",Ls="_charge_6cemk_165",zs="_chargeActive_6cemk_190",Ds="_title_6cemk_198",I={options:fs,price:bs,oldPrice:Es,newPrice:vs,animate:ys,appearAndBounce:Rs,meta:Is,info:Ss,infoRight:Ns,buttons:ks,variants:Cs,variant:$s,stock:Bs,variantInfo:ws,quantity:Ps,count:Ms,focused:Ts,button:qs,activeVariant:As,chargeTypes:Os,charge:Ls,chargeActive:zs,title:Ds},Hs="_wrapper_c1dht_1",Us="_label_c1dht_9",Fs="_input_c1dht_18",Vs="_paddingless_c1dht_31",Ys="_content_c1dht_35",Ws="_contentBorder_c1dht_47",Gs="_borderless_c1dht_52",Xs="_rightIcon_c1dht_57",W={wrapper:Hs,label:Us,input:Fs,paddingless:Vs,content:Ys,contentBorder:Ws,borderless:Gs,rightIcon:Xs},ot=u=>{const{onChange:i,style:e,label:s,value:n,type:l,min:a,max:r,placeholder:m,disabled:y=!1,required:C=!1,regex:j,paddingless:o=!1,borderless:b=!1,editable:d=!1,isSearch:g=!1,centered:E=!1}=u,{themeSettings:O}=t.useThemeSettingsStore(),{inputs:M}=O,[c,N]=_.useState(!1);function B(k){return Number(k)<0?String(a):k}function U(k){return!C||!j?!0:new RegExp(j).test(k)}return t.jsxRuntimeExports.jsxs("div",{className:W.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:W.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(W.content,{[W.contentBorder]:M.border.active}),style:{...e},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:l||"text",onChange:k=>{if(l==="text")i(k.target.value);else{const p=B(k.target.value);i(p)}},value:n,autoComplete:"off",placeholder:m||"Type something...",className:t.clx(W.input,{[W.required]:c&&C&&!U(n),[W.paddingless]:o,[W.borderless]:b}),min:l==="number"?a:void 0,max:l==="number"?r:void 0,disabled:y,onFocus:()=>N(!0),style:{textAlign:E?"center":"left",background:M.field.active?M.field.color:"transparent",padding:g?`7px ${Number(M.general.size)+20}px 7px 11px`:"7px 11px"}}),g&&t.jsxRuntimeExports.jsx("div",{className:W.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:M.general.size,height:M.general.size})}),d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},Qs="_button_85085_1",Js="_primary_85085_20",Ks="_primaryHovered_85085_30",Zs="_secondary_85085_34",tn="_secondaryHovered_85085_44",en="_tertiary_85085_48",sn="_tertiaryHovered_85085_58",nn="_content_85085_62",Q={button:Qs,primary:Js,primaryHovered:Ks,secondary:Zs,secondaryHovered:tn,tertiary:en,tertiaryHovered:sn,content:nn},H=u=>{const{children:i,onClick:e,style:s,className:n,disabled:l=!1,type:a="Primary"}=u,{themeSettings:r}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(Q.button,n,{[Q.primary]:a==="Primary",[Q.secondary]:a==="Secondary",[Q.tertiary]:a==="Tertiary",[Q.primaryHovered]:a==="Primary"&&!l&&r.buttons.primary.hover,[Q.secondaryHovered]:a==="Secondary"&&!l&&r.buttons.secondary.hover,[Q.tertiaryHovered]:a==="Tertiary"&&!l&&r.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:l,children:a==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:Q.content,children:[i,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:i})})};var it=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(it||{});const on=u=>{var O,M;const{variants:i}=u,[e,s]=_.useState(i[0]),[n,l]=_.useState(e.chargeTypes[0]),a=t.useNavigate(),[r,m]=_.useState(1),{reset:y,addProductToCart:C,getProducts:j}=t.useCart(),[o,b]=_.useState(!1);_.useEffect(()=>{b(!0);const c=setTimeout(()=>b(!1),600);return()=>clearTimeout(c)},[r]);async function d(){await j(),await C({productId:u.id,productVariantId:e.id,quantity:r})}function g(){y(),d(),a("/checkout")}function E(c){if(c>=864e5){const p=Math.floor(c/864e5);return`${p} ${p===1?"day":"days"}`}else if(c>=36e5){const p=Math.floor(c/36e5);return`${p} ${p===1?"hour":"hours"}`}else if(c>=6e4){const p=Math.floor(c/6e4);return`${p} ${p===1?"minute":"minutes"}`}else{const p=Math.floor(c/1e3);return`${p} ${p===1?"second":"seconds"}`}}return _.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&m(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:I.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:I.chargeTypes,children:e.chargeTypes.map(c=>t.jsxRuntimeExports.jsx("div",{className:t.clx(I.charge,{[I.chargeActive]:n===c}),onClick:()=>l(c),children:it[c]},c))}),t.jsxRuntimeExports.jsx("div",{className:I.variants,children:i.map(c=>{var N;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(I.variant,{[I.activeVariant]:e.id===c.id}),onClick:()=>s(c),children:[t.jsxRuntimeExports.jsxs("div",{className:I.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:I.title,children:c.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",n==="ONE_TIME"?c.price.amount:c.subscriptionSettings?c.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:I.stock,children:[((N=c.quantity.restrictions)==null?void 0:N.max)||c.quantity.available||0," in stock"]})})]},c.id)})}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:I.quantity,children:[t.jsxRuntimeExports.jsx(H,{type:"Secondary",onClick:()=>{r>1?m(c=>c-1):m(1)},className:I.button,disabled:e.quantity.available===0||e.quantity.restrictions&&r<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(ot,{type:"number",value:String(r),onChange:c=>m(Number(c)),max:((O=e.quantity.restrictions)==null?void 0:O.max)||e.quantity.available||1/0,min:((M=e.quantity.restrictions)==null?void 0:M.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(H,{type:"Secondary",onClick:()=>{m(c=>c+1)},className:I.button,disabled:!!(e.quantity.restrictions&&r>=e.quantity.restrictions.max||e.quantity.available!==void 0&&r>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:I.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:I.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":E(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:I.infoRight,children:n==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:o}),children:["$ ",(e.price.amount||0)*r]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*r]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:o}),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:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:o}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:o}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[t.jsxRuntimeExports.jsx(H,{type:"Primary",onClick:()=>g(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:n==="ONE_TIME"?"Buy Now":"Subscribe Now"}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsx(H,{type:"Secondary",onClick:()=>d(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},rn="_button_1tdo3_1",an="_login_1tdo3_14",cn="_signUp_1tdo3_18",ln="_buttons_1tdo3_23",dn="_modal_1tdo3_32",un="_closing_1tdo3_64",xn="_info_1tdo3_113",pn="_top_1tdo3_120",mn="_title_1tdo3_131",jn="_clear_1tdo3_138",hn="_activeClear_1tdo3_145",_n="_count_1tdo3_149",gn="_cart_1tdo3_164",fn="_empty_1tdo3_172",bn="_product_1tdo3_198",En="_products_1tdo3_207",vn="_image_1tdo3_215",yn="_productInfo_1tdo3_221",Rn="_content_1tdo3_228",In="_name_1tdo3_234",Sn="_price_1tdo3_240",Nn="_productButtons_1tdo3_246",kn="_productButton_1tdo3_246",Cn="_productCount_1tdo3_266",$n="_bottom_1tdo3_282",Bn="_subtotal_1tdo3_290",wn="_block_1tdo3_298",Pn="_shoppingCount_1tdo3_305",Mn="_total_1tdo3_325",Tn="_link_1tdo3_331",qn="_userInfo_1tdo3_338",An="_pagesMobileModal_1tdo3_349",On="_pagesMobileModalContent_1tdo3_363",Ln="_pagesMobileModalHeader_1tdo3_369",zn="_pagesMobileModalFooter_1tdo3_379",v={button:rn,login:an,signUp:cn,buttons:ln,modal:dn,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:un,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:xn,top:pn,title:mn,clear:jn,activeClear:hn,count:_n,cart:gn,empty:fn,product:bn,products:En,image:vn,productInfo:yn,content:Rn,name:In,price:Sn,productButtons:Nn,productButton:kn,productCount:Cn,bottom:$n,subtotal:Bn,block:wn,shoppingCount:Pn,total:Mn,link:Tn,userInfo:qn,pagesMobileModal:An,pagesMobileModalContent:On,pagesMobileModalHeader:Ln,pagesMobileModalFooter:zn},Dn=u=>{const{shopping:i,signUp:e,isShowUserInfo:s=!0}=u;return t.jsxRuntimeExports.jsxs("div",{className:v.buttons,children:[i&&t.jsxRuntimeExports.jsx(rt,{}),s&&t.jsxRuntimeExports.jsx(st,{signUp:e})]})},rt=()=>{const[u,i]=_.useState(!1),[e,s]=_.useState([]),{cart:n,getProducts:l}=t.useCart();function a(o){for(let b=0;b<n.parts.length;b++)for(let d=0;d<o.variants.length;d++)if(n.parts[b].productVariantId===o.variants[b].id)return n.parts[b].productVariantId}function r(o){for(let b=0;b<n.parts.length;b++)for(let d=0;d<o.variants.length;d++)if(n.parts[b].productVariantId===o.variants[b].id)return n.parts[b].quantity}_.useEffect(()=>{(async()=>{const b=n.parts.map(E=>String(E.productId)),g=(await l([...b])).map(E=>({...E,activeVariantId:a(E),quantity:r(E)}));s(g)})()},[n.parts.length]);function m(o){var b;return!o||!(o!=null&&o.variants)?!1:(b=o.variants.find(d=>d.id===o.activeVariantId))==null?void 0:b.subscriptionSettings}const y=n.parts.length>0&&e.length>0&&!m(e[0]),[C,j]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(H,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),j(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),y&&t.jsxRuntimeExports.jsx("div",{className:v.shoppingCount,children:n.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{j(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(at,{activeProducts:e,isCartNotEmpty:y,isOpen:C})})]})},at=u=>{const{activeProducts:i,isCartNotEmpty:e,isOpen:s}=u,{cart:n,reset:l,getTotalAndDiscount:a,updateQuantityOfProduct:r}=t.useCart(),m=t.useNavigate();function y(o){m(o)}function C(o){r({productId:o.id,productVariantId:o.activeVariantId,quantity:o.quantity+1})}function j(o){r({productId:o.id,productVariantId:o.activeVariantId,quantity:o.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(v.modal,{[v.closing]:!s}),onClick:o=>o.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{className:v.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:v.count,children:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(v.clear,{[v.activeClear]:e}),disabled:!e,onClick:l,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:v.cart,children:[t.jsxRuntimeExports.jsx("div",{className:v.products,children:i.map(o=>t.jsxRuntimeExports.jsxs("div",{className:v.product,children:[t.jsxRuntimeExports.jsxs("div",{className:v.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${o.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:v.image}),t.jsxRuntimeExports.jsxs("div",{className:v.content,children:[t.jsxRuntimeExports.jsx("div",{className:v.name,children:o.name}),t.jsxRuntimeExports.jsxs("div",{className:v.price,children:["$",o.variants.find(b=>b.id===o.activeVariantId).price.amount*((o==null?void 0:o.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{o.quantity!==1&&j(o)},className:v.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:v.productCount,children:o.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>C(o),className:v.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},o.id))}),t.jsxRuntimeExports.jsxs("div",{className:v.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:v.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:v.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:v.total,children:["$",a().total]})]}),t.jsxRuntimeExports.jsx(H,{onClick:()=>y("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ct,{})]})},ct=()=>t.jsxRuntimeExports.jsxs("div",{className:v.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:v.link,children:"view products"})]})]}),st=({signUp:u})=>{const i=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=i,s=t.useNavigate();function n(r){window.location.pathname.includes("/admin/builder")||s(r)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(H,{onClick:()=>n("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),u&&t.jsxRuntimeExports.jsx(H,{onClick:()=>n("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[l,a]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const m=t.jwtDecode(e);a(m.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:v.userInfo,onClick:()=>n("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:l||"test-email@gmail.com"})})},lt=({children:u,logo:i,setIsOpen:e,signUp:s})=>{const{setIsOpen:n}=t.useModalStore(),l=()=>{n(!1),setTimeout(()=>{e(!1),n(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:v.pagesMobileModal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:v.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(H,{type:"Secondary",onClick:l,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:v.pagesMobileModalContent,children:u}),t.jsxRuntimeExports.jsx("div",{className:v.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(st,{signUp:s})})]})},Hn=({children:u,logo:i,signUp:e})=>{const[s,n]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(dt,{setIsOpenModal:n}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsx(lt,{logo:i,setIsOpen:n,signUp:e,children:u})})]})},dt=u=>{const{setIsOpenModal:i}=u;return t.jsxRuntimeExports.jsx(H,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Un="_share_xddz7_1",Fn="_modal_xddz7_8",Vn="_header_xddz7_20",Yn="_socials_xddz7_30",Wn="_social_xddz7_30",Gn="_copy_xddz7_40",Xn="_title_xddz7_47",Qn="_copyWrapper_xddz7_53",Jn="_copyText_xddz7_62",Kn="_copyTextMobile_xddz7_75",Zn="_copyTextMiniMobile_xddz7_94",J={share:Un,modal:Fn,header:Vn,socials:Yn,social:Wn,copy:Gn,title:Xn,copyWrapper:Qn,copyText:Jn,copyTextMobile:Kn,copyTextMiniMobile:Zn},to=()=>{const{isOpenModal:u,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:J.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:i,children:t.jsxRuntimeExports.jsx(eo,{})})]})},eo=()=>{const{setIsOpenModal:u}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),n=window.location.href;function l(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}function a(){s(!1),setTimeout(()=>{u(!1),s(!0)},300)}function r(m,y){return m.length>y?m.slice(0,y)+"...":m}return t.jsxRuntimeExports.jsxs("div",{className:J.modal,onClick:m=>m.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,children:[t.jsxRuntimeExports.jsx("div",{className:J.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:a,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:J.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:l,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:J.copyText,children:r(n,100)}),t.jsxRuntimeExports.jsx("div",{className:J.copyTextMobile,children:r(n,40)}),t.jsxRuntimeExports.jsx("div",{className:J.copyTextMiniMobile,children:r(n,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:l,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},so="_accordion_1s1lq_1",no="_header_1s1lq_9",oo="_icon_1s1lq_18",io="_open_1s1lq_21",ro="_content_1s1lq_25",tt={accordion:so,header:no,icon:oo,open:io,content:ro},ao=({title:u,content:i,defaultOpen:e=!1})=>{const[s,n]=_.useState(e),[l,a]=_.useState(0),r=_.useRef(null),m=()=>{n(!s)};return _.useEffect(()=>{r.current&&a(s?r.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:tt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:tt.header,onClick:m,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(tt.icon,{[tt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:r,className:tt.content,style:{height:`${l}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},co=({children:u,path:i,className:e,target:s="_self",id:n})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:n,children:u});const l=t.useNavigate(),a=/^https?:\/\//.test(i),r=m=>{a||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.location.href=i:(m.preventDefault(),l(i,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:r,className:e,role:"link",style:{cursor:"pointer"},id:n,children:u})},lo="_buttonsBlock_1b2rb_1",uo="_slideUp_1b2rb_1",xo={buttonsBlock:lo,slideUp:uo},po=()=>t.jsxRuntimeExports.jsxs("div",{className:xo.buttonsBlock,children:[t.jsxRuntimeExports.jsx(H,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(H,{type:"Secondary",children:"Buy"})]}),mo="_wrapper_st58d_1",jo="_label_st58d_10",ho="_textarea_st58d_18",_o="_length_st58d_33",et={wrapper:mo,label:jo,textarea:ho,length:_o},go=u=>{const{onChange:i,label:e,value:s,maxLength:n,placeholder:l="Type something..."}=u,[a,r]=_.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:et.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:et.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:m=>{r(m.target.value.length),i(m.target.value)},placeholder:l,className:et.textarea,maxLength:n}),n&&t.jsxRuntimeExports.jsxs("div",{className:et.length,children:[a,"/",n]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=ao;exports.BurgerMenuButton=dt;exports.Button=H;exports.ButtonTypeSettings=nt;exports.ButtonsSettings=Ye;exports.CategorySettings=Xt;exports.EmptyCart=ct;exports.FormSettings=ye;exports.HeaderButtons=Dn;exports.InputUI=ot;exports.LayoutSettings=It;exports.Link=co;exports.ListingSelector=gs;exports.PagesMobileMenu=Hn;exports.PagesMobileModal=lt;exports.PagesSettings=Ee;exports.ProductCardButtons=po;exports.ProductOptions=on;exports.ShareLink=to;exports.ShoppingButton=rt;exports.ShoppingModalCart=at;exports.TextareaUI=go;exports.UserInfo=st;
|