@billgangcom/theme-lib 1.70.5 → 1.71.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/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-Bua5YW4M.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.useBuilderPages=e.useBuilderPages;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useReCaptcha=t.useReCaptcha;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-DKMsxm1h.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.createTicket=e.createTicket;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.useBuilderPages=e.useBuilderPages;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useReCaptcha=t.useReCaptcha;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App as s, ColorVariables as t, createTicket as o, hotReload as r, iconNames as p, useBuilderPages as i } from "./builder.es.js";
2
- import { R as l, a as u, f as R, s as d, b as f, u as m } from "./index-CFTzPE7U.js";
2
+ import { R as l, a as u, f as R, s as d, b as f, u as m } from "./index-DmoEjH7_.js";
3
3
  export {
4
4
  s as App,
5
5
  t as ColorVariables,
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Bua5YW4M.cjs"),j=require("react");require("react-dom");const ct="_block_kh9z8_8",lt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",dt="_alignmentContent_kh9z8_30",xt="_alignments_kh9z8_39",pt="_alignment_kh9z8_30",mt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",jt="_padding_kh9z8_71",gt="_active_kh9z8_97",z={block:ct,title:lt,subtitle:ut,alignmentContent:dt,alignments:xt,alignment:pt,circle:mt,paddings:ht,padding:jt,active:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],Rt=d=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:l=!0,isPadding:c=!0}=d;function h(R){switch(R){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 f(R){switch(R){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[E,k]=j.useState(null),[g,p]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:z.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:z.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:z.alignmentContent,children:[l&&t.jsxRuntimeExports.jsxs("div",{className:z.block,children:[t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:z.alignments,children:ft.map(R=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(R)},className:z.alignment,onMouseEnter:()=>{k(R)},onMouseLeave:()=>{k(null)},children:[R!==i&&E!==R&&t.jsxRuntimeExports.jsx("div",{className:z.circle}),R!==i&&E===R&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(E),fill:"#c2c2c2",width:22,height:22}),R===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(i),fill:"#FF3F19",width:22,height:22})]},R))})]}),c&&t.jsxRuntimeExports.jsxs("div",{className:z.block,children:[t.jsxRuntimeExports.jsx("h5",{className:z.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:z.paddings,children:Et.map(R=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(z.padding,{[z.active]:g===R}),onFocus:()=>{p(R)},onBlur:()=>{p(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:f(R),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[R]),onChange:a=>s({...o,[R]:Math.min(Number(a),999)}),max:999,paddingless:!0,borderless:!0})]},R))})]})]})]})},_t="_title_82zux_1",yt="_subtitle_82zux_5",vt="_productsBlock_82zux_14",bt="_top_82zux_26",It="_products_82zux_14",St="_product_82zux_14",Nt="_button_82zux_80",Ct="_disabled_82zux_91",kt="_buttons_82zux_118",Pt="_addButton_82zux_157",wt="_deleteButton_82zux_179",F={title:_t,subtitle:yt,productsBlock:vt,top:bt,products:It,product:St,button:Nt,disabled:Ct,buttons:kt,addButton:Pt,deleteButton:wt};function Bt({id:d,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:h}=t.useSortable({id:d}),f={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${F.product} ${h?F.dragging:""}`,...o,...s,children:i})}const Mt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,tags:c,title:h,subtitle:f,draggable:E=!1,withImage:k=!1,addable:g=!0,itemsOptions:p,hasRangeSelector:R=!1,rangeSelectorOptions:a,limit:n,autoScrollInterval:r,deletable:b,aspectRatio:_,setAspectRatio:P}=d,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),q=x=>{const{active:I,over:C}=x;if(C&&I.id!==C.id){const M=s.findIndex(T=>T===I.id),v=s.findIndex(T=>T===C.id);if(M!==-1&&v!==-1){const T=[...s],[y]=T.splice(M,1);T.splice(v,0,y),e(T)}}};function V(x){if(k)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const m=(x,I=!1)=>{const C=p.find(v=>v.id===x);if(!C)return;const M=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const T=[...s],y=p.find(u=>u.name===v);if(!y)return;const $=y.id,L=T.map(u=>u===x?$:u);e([...L])},value:C.name,options:p.filter(v=>!s.find(T=>T===v.id)).map(v=>v.name),leftAddonOptions:p.map(v=>({value:v.name,addon:V(v.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:F.buttons,children:t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(v=>v!==x))})})})]});return E?t.jsxRuntimeExports.jsx(Bt,{id:x,children:M},t.v4()):t.jsxRuntimeExports.jsx("div",{className:F.product,children:M},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(h||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[h&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:h}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),R&&a&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...a}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[f&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:f}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:q,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>m(x,b))})}):s.map(x=>m(x,b)),g&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(n&&n<=s.length||s.length===p.length)}),size:"s",disabled:!!(n&&n<=s.length||s.length===p.length),onClick:()=>{const x=[...s];let I=null;if(p){for(let C=0;C<p.length;C++)if(!s.find(M=>M===p[C].id)){I=p[C];break}}x.push((I==null?void 0:I.id)||p[0].id),e(x)},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})]})})})]}),_&&P&&t.jsxRuntimeExports.jsx(t.Select,{value:_,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>P(x),leftAddonOptions:t.aspectRatioOptions}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:c}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(r.scrollInterval),onChange:x=>r.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Tt="_title_roi3a_1",$t="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",qt="_top_roi3a_26",At="_products_roi3a_14",Dt="_product_roi3a_14",Lt="_button_roi3a_80",Ut="_disabled_roi3a_91",zt="_buttons_roi3a_118",Ht="_addButton_roi3a_164",Ft="_deleteButton_roi3a_179",U={title:Tt,subtitle:$t,productsBlock:Ot,top:qt,products:At,product:Dt,button:Lt,disabled:Ut,buttons:zt,addButton:Ht,deleteButton:Ft};function Vt({product:d,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:h}=t.useSortable({id:d.id}),f={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${U.product} ${h?U.dragging:""}`,...o,...s,children:i})}const Yt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:l,subtitle:c,editable:h=!0,draggable:f=!1,deletable:E=!0,addable:k=!0,itemsType:g,itemsOptions:p,addableOptions:R={},limit:a}=d,[n,r]=j.useState(null),[b,_]=j.useState(null),P=j.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(n){const x=[...s].map(I=>I.id===n.id?n:I);e(x)}},[n]),j.useEffect(()=>{P.current&&b&&(P.current.getBoundingClientRect().height,b.top)},[P.current,b]);const q=(x,I)=>{x.stopPropagation();const C=x.target.getBoundingClientRect();_({top:C.top+window.scrollY,left:C.left-30}),r(I)},V=x=>{const{active:I,over:C}=x;if(C&&I.id!==C.id){const M=s.findIndex(T=>T.id===I.id),v=s.findIndex(T=>T.id===C.id);if(M!==-1&&v!==-1){const T=[...s],[y]=T.splice(M,1);T.splice(v,0,y),e(T)}}},m=(x,I)=>{const C=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[f&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const v=[...s],T=p.find($=>$.name===M);if(!T)return;const y=v.map($=>$.id===x.id?{...T,name:{"en-US":M}}:$);r({...x,name:{"en-US":M}}),e([...y])},value:x.name,options:p.filter(M=>!s.find(v=>v.name===M.name)).map(M=>M.name)}),t.jsxRuntimeExports.jsxs("div",{className:U.buttons,children:[h&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>q(M,x)})}),E&&t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(M=>M.id!==x.id))})})]})]});return f?t.jsxRuntimeExports.jsx(Vt,{product:x,index:I,children:C},x.id):t.jsxRuntimeExports.jsx("div",{className:U.product,children:C},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(l||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:l}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:c}),f?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:V,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>m(x,I))})}):s.map((x,I)=>m(x,I)),k&&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]:!!(a&&a<=s.length||s.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(a&&a<=s.length||s.length===(p==null?void 0:p.length)),onClick:()=>{const x=[...s];let I=null;if(p){for(let C=0;C<p.length;C++)if(!s.find(M=>M.id===p[C].id)){I=p[C];break}}g==="select"&&p&&x.push({name:I?I.name:p[0].name,id:(I==null?void 0:I.id)||p[0].id,...R}),e(x)},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})]})})})]})]})};function Gt(d){const{product:i,children:o}=d,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:h,isDragging:f}=t.useSortable({id:i.id}),E={transform:t.CSS.Transform.toString(c),transition:h};return t.jsxRuntimeExports.jsx("div",{ref:l,style:E,className:`${t.styles.product} ${f?t.styles.dragging:""}`,...s,...e,children:o})}const Wt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:h,editable:f=!0,draggable:E=!1,deletable:k=!0,addable:g=!0,itemsType:p,itemsPlaceholder:R="",itemsOptions:a,hasRangeSelector:n=!1,rangeSelectorOptions:r,modalOptions:b,addableOptions:_={},limit:P}=d,[D,q]=j.useState(null),[V,m]=j.useState({top:0,left:0}),[x,I]=j.useState(null),C=j.useRef(null),[M,v]=j.useState(!1),T=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const u=()=>{q(null),v(!1)};return document.body.addEventListener("click",u),q(null),v(!1),()=>{q(null),v(!1),document.body.removeEventListener("click",u)}},[]),j.useEffect(()=>{if(D){const u=[...s].map(B=>B.id===D.id?D:B);e(u)}},[D]),j.useEffect(()=>{if(C.current&&x){const u=C.current.getBoundingClientRect().height,B=window.innerHeight;let S=x.top;S+u>B+window.scrollY-200&&(S=B+window.scrollY-u-200),S<0&&(S=10),m({top:S,left:x.left})}},[C.current,x]);const y=(u,B)=>{u.stopPropagation();const S=u.target.getBoundingClientRect();I({top:S.top+window.scrollY,left:S.left-30}),q(B),v(!0)},$=u=>{const{active:B,over:S}=u;if(S&&B.id!==S.id){const O=s.findIndex(A=>A.id===B.id),W=s.findIndex(A=>A.id===S.id);if(O!==-1&&W!==-1){const A=[...s],[Y]=A.splice(O,1);A.splice(W,0,Y),e(A)}}},L=u=>{var S;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),p==="select"&&a&&t.jsxRuntimeExports.jsx(t.Select,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,name:{"en-US":O}}:Y);q({...u,name:{"en-US":O}}),e([...A])},value:u.name["en-US"],options:a.filter(O=>!s.find(W=>W.name["en-US"]===O))}),p==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,name:{"en-US":O}}:Y);e([...A])},value:u.name["en-US"],placeholder:R}),p==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,images:O}:Y);e([...A])},activeImage:(S=s.find(O=>O.id===u.id))==null?void 0:S.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:O=>y(O,u)})}),k&&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:()=>e(s.filter(O=>O.id!==u.id))})})]})]});return E?t.jsxRuntimeExports.jsx(Gt,{product:u,children:B},u.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:B},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:u=>o==null?void 0:o(u)})]}),D&&f&&b&&M&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:C,activeItem:D,setActiveItem:q,popupPosition:V,modalOptions:b,setIsOpenModal:v}),n&&r&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...r}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[h&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:h}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:T,onDragEnd:$,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(u=>u.id),strategy:t.verticalListSortingStrategy,children:s.map(u=>L(u))})}):s.map(u=>L(u)),g&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(P&&P<=s.length)}),size:"s",disabled:!!(P&&P<=s.length),onClick:()=>{const u=[...s];let B=null;if(a){for(let S=0;S<a.length;S++)if(!s.find(O=>O.name["en-US"]===a[S])){B=a[S];break}}p==="select"&&a?u.push({name:{"en-US":B||a[0]},id:t.v4(),..._,maxSymbols:100}):p==="input"?u.push({name:{"en-US":""},id:t.v4(),..._,maxSymbols:100}):u.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),..._,maxSymbols:100}),e(u)},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.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},Xt="_subtitle_jql1y_1",Qt="_products_jql1y_10",Jt="_product_jql1y_10",Kt="_button_jql1y_11",Zt="_buttons_jql1y_11",te="_addButton_jql1y_150",ee="_deleteButton_jql1y_165",X={subtitle:Xt,products:Qt,product:Jt,button:Kt,buttons:Zt,addButton:te,deleteButton:ee},et=d=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:l=!0}=d,{pages:c}=t.usePagesStore(),[h,f]=j.useState(null),[E,k]=j.useState({top:0,left:0}),[g,p]=j.useState(null),R=j.useRef(null);j.useEffect(()=>{if(h){const r=[...i].map(b=>b.id===h.id?h:b);o(r)}},[h]),j.useEffect(()=>{if(R.current&&g){const r=R.current.getBoundingClientRect().height,b=window.innerHeight;let _=g.top;_+r>b+window.scrollY-200&&(_=b+window.scrollY-r-200),_<0&&(_=10),k({top:_,left:g.left})}},[R.current,g]);const a=(r,b)=>{r.stopPropagation();const _=r.target.getBoundingClientRect();p({top:_.top+window.scrollY-70,left:_.left-(e?30:65)}),f(b)},n=(r,b)=>{const _=[...i],P={...r,id:Math.random().toString(36).substr(2,9)};_.splice(b+1,0,P),o(_)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),i.map((r,b)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:_=>{const D=[...i].map(q=>q.id===r.id?{...r,type:_}:q);o(D)},value:r.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:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{n(r,b)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:_=>{a(_,r)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const _=i.filter(P=>P.id!==r.id);o(_)},width:20,height:20,fill:"#C12A2A"})})]})]},r.id)),h&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:R,activeButton:h,setActiveButton:f,popupPosition:E,editableLink:l}),e&&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 r=[...i];l?r.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}):r.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}),o(r)},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})]})})})]})},se=d=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:l=!0,addable:c=!0,deletable:h=!0}=d;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:f=>o(f)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:l,addable:c,deletable:h})]})})};function ne(d){const{product:i,children:o}=d,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:h,isDragging:f}=t.useSortable({id:String(i.listingId)}),E={transform:t.CSS.Transform.toString(c),transition:h};return t.jsxRuntimeExports.jsx("div",{ref:l,style:E,className:`${t.styles$2.product} ${f?t.styles$2.dragging:""}`,...s,...e,children:o})}const ie=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:h,editable:f=!0,draggable:E=!1,withImage:k=!1,deletable:g=!0,addable:p=!0,itemsType:R,itemsOptions:a,limit:n,aspectRatio:r,setAspectRatio:b}=d,[_,P]=j.useState(null),[D,q]=j.useState({top:0,left:0}),[V,m]=j.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const y=()=>{P(null),m(!1)};return document.body.addEventListener("click",y),P(null),m(!1),()=>{P(null),m(!1),document.body.removeEventListener("click",y)}},[]),j.useEffect(()=>{if(_){const y=[...s].map($=>$.listingId===_.listingId?_:$);e(y)}},[_]);const I=(y,$)=>{y.stopPropagation();const L=y.target.getBoundingClientRect(),u=100,B=window.innerHeight;let S=L.top+window.scrollY;S+u>B&&(S=B-u-20),m(!0),q({top:S-80,left:L.left-30}),P($)};function C(y){if(k)return y?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${y}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const M=y=>{const{active:$,over:L}=y;if(L&&$.id!==L.id){const u=s.findIndex(S=>String(S.listingId)===$.id),B=s.findIndex(S=>String(S.listingId)===L.id);if(u!==-1&&B!==-1){const S=[...s],[O]=S.splice(u,1);S.splice(B,0,O),e(S)}}},v=y=>{const $=a.find(u=>y.listingId===u.id);if(!$)return null;const L=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),R==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:u=>{const B=[...s],S=a.find(A=>A.productData.name===u);if(!S)return;const O={listingId:S.id,image:S.productData.images.length>0?S.productData.images[0].cfId:""},W=B.map(A=>A.listingId===y.listingId?O:A);P(O),e([...W])},value:$.productData.name,options:[...a.filter(u=>!s.find(B=>B.listingId===u.id)).map(u=>u.productData.name)],leftAddonOptions:a.map(u=>{var B;return{value:u.productData.name,addon:C(((B=u.productData.images[0])==null?void 0:B.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:u=>I(u,y)})}),g&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(u=>u!==y))})})]})]});return E?t.jsxRuntimeExports.jsx(ne,{product:y,children:L},y.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:L},y.listingId)},T=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:y=>o==null?void 0:o(y)})]}),V&&_&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:T,activeItem:_,setActiveItem:P,setIsOpenModal:m,popupPosition:D,itemsOptions:a}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[h&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:h}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:M,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(y=>String(y.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(y=>v(y))})}):s.map(y=>v(y)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const y=[...s];for(let $=0;$<a.length;$++)if(!s.find(L=>L.listingId===a[$].id)){y.push({listingId:a[$].id,image:a[$].productData.images.length>0?a[$].productData.images[0].cfId:""});break}e(y)},disabled:s.length===(n||a.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r&&b&&t.jsxRuntimeExports.jsx(t.Select,{value:r,options:Object.keys(t.aspectRatio),onChange:y=>b(y),leftAddonOptions:t.aspectRatioOptions}),i&&l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},oe="_options_167h8_1",re="_price_167h8_18",ae="_oldPrice_167h8_25",ce="_newPrice_167h8_33",le="_animate_167h8_40",ue="_meta_167h8_58",de="_info_167h8_64",xe="_infoRight_167h8_73",pe="_buttons_167h8_80",me="_variants_167h8_87",he="_variant_167h8_87",je="_stock_167h8_105",ge="_variantInfo_167h8_112",fe="_quantity_167h8_119",Ee="_button_167h8_80",Re="_activeVariant_167h8_165",_e="_chargeTypes_167h8_169",ye="_charge_167h8_169",ve="_chargeActive_167h8_194",be="_title_167h8_202",w={options:oe,price:re,oldPrice:ae,newPrice:ce,animate:le,meta:ue,info:de,infoRight:xe,buttons:pe,variants:me,variant:he,stock:je,variantInfo:ge,quantity:fe,button:Ee,activeVariant:Re,chargeTypes:_e,charge:ye,chargeActive:ve,title:be};var Z=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(Z||{});const st=d=>{var q,V;const{product:i,setIsOpen:o}=d,{variants:s}=i,[e,l]=j.useState(s[0]),[c,h]=j.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:f,setNotifications:E}=t.useNotificationStore(),k=t.useNavigate(),[g,p]=j.useState(1),{cart:R,reset:a,addProductToCart:n}=t.useCart(),[r,b]=j.useState(!1);j.useEffect(()=>{b(!0);const m=setTimeout(()=>b(!1),600);return()=>clearTimeout(m)},[g]);async function _(){try{n({productId:i.id,productVariantId:e.id,chargeType:c,quantity:g}),E([...f,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(m){E([...f,{id:t.v4(),message:`Product failed to add to cart: ${m}`,status:"error"}])}o==null||o(!1)}function P(){a(),_(),k("/checkout")}function D(m){if(m>=864e5){const v=Math.floor(m/864e5);return`${v} ${v===1?"day":"days"}`}else if(m>=36e5){const v=Math.floor(m/36e5);return`${v} ${v===1?"hour":"hours"}`}else if(m>=6e4){const v=Math.floor(m/6e4);return`${v} ${v===1?"minute":"minutes"}`}else{const v=Math.floor(m/1e3);return`${v} ${v===1?"second":"seconds"}`}}return j.useEffect(()=>{e.quantity&&e.quantity.available===0?p(0):p(1)},[e.quantity.available]),j.useEffect(()=>{e.chargeTypes&&h(e.chargeTypes.includes(c)?c:e.chargeTypes[0])},[e.chargeTypes]),t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(m=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:c===m}),onClick:()=>h(m),children:Z[m]},m))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:s.filter(m=>{var x;return(x=m.chargeTypes)==null?void 0:x.includes(c)}).map(m=>{var x,I;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===m.id}),onClick:()=>l(m),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:t.splitTextIntoSpans(m.name)}),t.jsxRuntimeExports.jsxs("span",{children:[t.formatPrice({amount:c==="ONE_TIME"?m.price.amount:m.subscriptionSettings?m.subscriptionSettings.price.amount:0,currency:c==="ONE_TIME"?m.price.currency:m.subscriptionSettings?m.subscriptionSettings.price.currency:"USD"})," ",c==="RECURRING"&&m.subscriptionSettings&&` / ${t.normalizeInterval(m.subscriptionSettings.recurringIntervalDays||0)}`]})]}),t.jsxRuntimeExports.jsx("div",{children:c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[(x=m.quantity.restrictions)!=null&&x.max||m.quantity.available!==void 0?((I=m.quantity.restrictions)==null?void 0:I.max)||m.quantity.available:"∞"," ","in stock"]})})]},m.id)})}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{g>1?p(m=>m-1):p(1)},className:w.button,disabled:e.quantity.available&&e.quantity.restrictions&&g<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(g),onChange:m=>{e.quantity.available&&Number(m)>e.quantity.available?p(e.quantity.available):p(Number(m))},max:((q=e.quantity.restrictions)==null?void 0:q.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((V=e.quantity.restrictions)==null?void 0:V.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&g>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{p(m=>m+1)},className:w.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&g>=e.quantity.restrictions.max||e.quantity.available===0||e.quantity.available&&g>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"var(--text-action)",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":D(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:c==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.price.amount*g,currency:e.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,children:t.formatPrice({amount:e.compareAtPrice.amount*g,currency:e.compareAtPrice.currency})})]}):t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.price.amount*g,currency:e.price.currency})}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.subscriptionSettings.price.amount*g,currency:e.subscriptionSettings.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,children:t.formatPrice({amount:e.subscriptionSettings.compareAtPrice.amount*g,currency:e.subscriptionSettings.compareAtPrice.currency})})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.subscriptionSettings.price.amount*g,currency:e.subscriptionSettings.price.currency})})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>P(),disabled:e.quantity&&e.quantity.available===0,children:c==="ONE_TIME"?"Buy Now":"Subscribe Now"}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>_(),disabled:e.quantity&&e.quantity.available===0,children:R.parts.some(m=>m.productId===i.id&&m.productVariantId===e.id)?"Add More":"Add to Cart"})]})]})},Ie="_buttons_r2kti_23",Se="_modal_r2kti_32",Ne="_closing_r2kti_65",Ce="_info_r2kti_114",ke="_top_r2kti_121",Pe="_title_r2kti_132",we="_clear_r2kti_139",Be="_activeClear_r2kti_146",Me="_count_r2kti_150",Te="_cart_r2kti_165",$e="_empty_r2kti_173",Oe="_product_r2kti_199",qe="_products_r2kti_208",Ae="_image_r2kti_216",De="_productInfo_r2kti_232",Le="_content_r2kti_239",Ue="_name_r2kti_245",ze="_price_r2kti_251",He="_productButtons_r2kti_257",Fe="_productButton_r2kti_257",Ve="_productCount_r2kti_274",Ye="_bottom_r2kti_291",Ge="_subtotal_r2kti_299",We="_block_r2kti_307",Xe="_shoppingCount_r2kti_314",Qe="_total_r2kti_334",Je="_link_r2kti_340",Ke="_userInfo_r2kti_347",Ze="_pagesMobileModal_r2kti_359",ts="_pagesMobileModalContent_r2kti_373",es="_pagesMobileModalHeader_r2kti_379",ss="_pagesMobileModalFooter_r2kti_389",ns="_pageLink_r2kti_396",is="_rightButtons_r2kti_405",N={buttons:Ie,modal:Se,closing:Ne,info:Ce,top:ke,title:Pe,clear:we,activeClear:Be,count:Me,cart:Te,empty:$e,product:Oe,products:qe,image:Ae,productInfo:De,content:Le,name:Ue,price:ze,productButtons:He,productButton:Fe,productCount:Ve,bottom:Ye,subtotal:Ge,block:We,shoppingCount:Xe,total:Qe,link:Je,userInfo:Ke,pagesMobileModal:Ze,pagesMobileModalContent:ts,pagesMobileModalHeader:es,pagesMobileModalFooter:ss,pageLink:ns,rightButtons:is},os=d=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[d,i]=j.useState(!1),[o,s]=j.useState([]),[e,l]=j.useState(!1),{cart:c,products:h}=t.useCart();function f(a){if(a.variants.length>0){for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].productVariantId}return a.variants[0].id}function E(a){for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].quantity}const k=a=>{for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].chargeType;return"ONE_TIME"};j.useEffect(()=>{(async()=>{const n=c.parts.map(_=>String(_.productId)),b=(h.filter(_=>n.includes(String(_.id)))||[]).map(_=>({..._,activeVariantId:f(_),quantity:E(_),chargeType:k(_)}));s(b)})()},[c.parts]);function g(a){return!a||!(a!=null&&a.variants)?!1:a.chargeType==="RECURRING"}const p=c.parts.length>0&&o.length>0&&!g(o[0]);function R(){l(!1),setTimeout(()=>{i(!1)},300)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:a=>{a.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),l(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"}),p&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:c.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:R,withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:p,isOpen:e,close:R})})]})},it=d=>{var R,a;const{activeProducts:i,isCartNotEmpty:o,isOpen:s,close:e}=d,{cart:l,reset:c,getTotalAndDiscount:h,updateQuantityOfProduct:f}=t.useCart(),E=t.useNavigate();function k(n,r){E(n,{replace:r})}function g(n){n.quantity&&f({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1,chargeType:n.chargeType})}function p(n){n.quantity&&f({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1,chargeType:n.chargeType})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:l.parts.length})]}),t.jsxRuntimeExports.jsxs("div",{className:N.rightButtons,children:[o&&t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:c,children:"Clear all"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:e,hoverable:!0,width:24,height:24,fill:"var(--text-primary)"})]})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:[...new Map(i.map(n=>[n.id,n])).values()].map(n=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}):t.jsxRuntimeExports.jsx("div",{className:N.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsx("div",{className:N.price,children:t.formatPrice({amount:n.variants.find(r=>r.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1),currency:n.variants.find(r=>r.id===n.activeVariantId).price.currency})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&p(n)},className:N.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>g(n),className:N.productButton,disabled:n.quantity===n.variants.find(r=>r.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsx("div",{className:N.total,children:t.formatPrice({amount:h().total,currency:l.parts.length>0&&((a=(R=i.find(n=>n.id===l.parts[0].productId))==null?void 0:R.variants.find(n=>n.id===l.parts[0].productVariantId))==null?void 0:a.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>k("/checkout",!1),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,children:"view products"})]})]}),tt=({signUp:d,close:i})=>{const{token:o}=t.useStorefrontStore(),s=t.useNavigate(),[e,l]=j.useState("test-email@gmail.com");j.useEffect(()=>{o&&(async()=>{if(!o)return;const f=t.jwtDecode(o);l(f.email)})()},[o]);function c(h){window.location.pathname.includes("/admin/builder")||s(h)}return o?t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:N.userInfo,onClick:()=>{c("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:e||"test-email@gmail.com"})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]})},rt=({logo:d,setIsOpen:i,signUp:o,pages:s})=>{const{setIsOpen:e}=t.useModalStore(),l=()=>{e(!1),setTimeout(()=>{i(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:d}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:l,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:s.length>0&&s.map(c=>t.jsxRuntimeExports.jsx("div",{className:N.pageLink,onClick:l,children:t.jsxRuntimeExports.jsx(t.Link,{path:c.path,children:c.name["en-US"]},c.id)}))}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:o,close:l})})]})},rs=({logo:d,signUp:i,pages:o})=>{const[s,e]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),hasPadding:!1,children:t.jsxRuntimeExports.jsx(rt,{logo:d,setIsOpen:e,signUp:i,pages:o})})]})},at=d=>{const{setIsOpenModal:i}=d;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List"})})},as="_share_rlgln_1",cs="_modal_rlgln_8",ls="_header_rlgln_20",us="_title_rlgln_46",ds="_copyWrapper_rlgln_52",xs="_copyText_rlgln_61",ps="_copyTextMobile_rlgln_74",ms="_copyTextMiniMobile_rlgln_93",Q={share:as,modal:cs,header:ls,title:us,copyWrapper:ds,copyText:xs,copyTextMobile:ps,copyTextMiniMobile:ms},hs=({title:d="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:Q.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(js,{title:d})})]})},js=({title:d="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),l=window.location.href;function c(){navigator.clipboard.writeText(l),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function h(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function f(E,k){return E.length>k?E.slice(0,k)+"...":E}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:E=>E.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,children:d}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:h,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:c,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,children:f(l,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,children:f(l,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,children:f(l,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:o.find(E=>E.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},gs="_accordion_1to77_1",fs="_header_1to77_9",Es="_icon_1to77_18",Rs="_open_1to77_21",_s="_content_1to77_25",J={accordion:gs,header:fs,icon:Es,open:Rs,content:_s},ys=({title:d,content:i,defaultOpen:o=!1})=>{const[s,e]=j.useState(o),[l,c]=j.useState(0),h=j.useRef(null),f=()=>{e(!s)};return j.useEffect(()=>{h.current&&c(s?h.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:f,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:h,className:J.content,style:{height:`${l}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},vs="_buttonsBlock_1b2rb_1",bs={buttonsBlock:vs},Is=d=>{var E,k;const{setIsOpen:i,setModalType:o,productId:s}=d,{cart:e}=t.useCart(),{pageContext:l}=t.usePagesStore(),c=(E=l==null?void 0:l.listings)==null?void 0:E.find(g=>g.id===s);if(!c)return null;const h=(k=l==null?void 0:l.products)==null?void 0:k.find(g=>g.uniquePath===c.productData.uniquePath);if(!h)return null;const f=e.parts.find(g=>g.productId===h.id);return t.jsxRuntimeExports.jsxs("div",{className:bs.buttonsBlock,onClick:g=>g.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:f?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},Ss="_wrapper_27wzz_1",Ns="_logo_27wzz_8",Cs="_info_27wzz_12",K={wrapper:Ss,logo:Ns,info:Cs},ks=({date:d})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),l={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",l)}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:K.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:K.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(d)})]})]})},Ps="_variants_hphv8_80",ws="_variant_hphv8_80",Bs="_stock_hphv8_98",Ms="_variantInfo_hphv8_105",Ts="_title_hphv8_199",$s="_modal_hphv8_205",Os="_header_hphv8_225",qs="_productOptions_hphv8_233",As="_loading_hphv8_237",G={variants:Ps,variant:ws,stock:Bs,variantInfo:Ms,title:Ts,modal:$s,header:Os,productOptions:qs,loading:As},Ds=d=>{var p;const{pageContext:i}=t.usePagesStore(),o=(p=i==null?void 0:i.listings)==null?void 0:p.find(R=>R.id===d.productId),[s,e]=j.useState(!0),[l,c]=j.useState(null),h=(l==null?void 0:l.variants[0])||null,[f,E]=j.useState("ONE_TIME"),{addProducts:k}=t.useCart(),{setIsOpen:g}=t.useModalStore();return j.useEffect(()=>{(async()=>{e(!0);const a=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));k(a==null?void 0:a.data.products),c(a==null?void 0:a.data.products[0]),e(!1)})()},[]),j.useEffect(()=>{g(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:d.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:R=>R.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:G.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),d.type==="Add To Cart"&&l&&h&&!s&&t.jsxRuntimeExports.jsx(Ls,{variants:l.variants,activeVariant:h,activeChargeType:f,setActiveChargeType:E,productId:l.id,setIsOpen:d.setIsOpen}),d.type==="Buy Now"&&l&&!s&&t.jsxRuntimeExports.jsx(Us,{product:l,setIsOpen:d.setIsOpen})]})})},Ls=d=>{const{variants:i,activeChargeType:o,productId:s,setIsOpen:e}=d,{cart:l,addProductToCart:c,addProducts:h,updateQuantityOfProduct:f}=t.useCart(),{notifications:E,setNotifications:k}=t.useNotificationStore(),{pageContext:g}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),R=()=>{p(!1),setTimeout(()=>{e(!1)},300)};async function a(n){const r=i.find(P=>P.id===n),b=l.parts.find(P=>P.productId===d.productId&&P.productVariantId===n);if((r==null?void 0:r.quantity.available)&&(r==null?void 0:r.quantity.restrictions)&&((b==null?void 0:b.quantity)||0)+1>(r==null?void 0:r.quantity.restrictions.max)||(r==null?void 0:r.quantity.available)===0||(r==null?void 0:r.quantity.available)&&((b==null?void 0:b.quantity)||0)+1>(r==null?void 0:r.quantity.available)){k([...E,{id:t.v4(),message:"Product is out of stock",status:"error"}]);return}if(b)f({productId:s,productVariantId:n,quantity:b.quantity+1,chargeType:o});else{g!=null&&g.products&&h(g.products);try{c({productId:s,productVariantId:n,quantity:1,chargeType:o}),k([...E,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(P){k([...E,{id:t.v4(),message:`Product failed to add to cart: ${P}`,status:"error"}])}}}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a Variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:R})]}),t.jsxRuntimeExports.jsx("div",{className:G.variants,children:i.filter(n=>{var r;return(r=n.chargeTypes)==null?void 0:r.includes(o)}).map(n=>{var r,b,_;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(G.variant),onClick:()=>{a(n.id),e(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:G.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:G.title,children:n.name}),t.jsxRuntimeExports.jsx("span",{children:t.formatPrice({amount:o==="ONE_TIME"?n.price.amount:n.subscriptionSettings?n.subscriptionSettings.price.amount:0,currency:o==="ONE_TIME"?n.price.currency:((r=n.subscriptionSettings)==null?void 0:r.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:G.stock,children:[(b=n.quantity.restrictions)!=null&&b.max||n.quantity.available!==void 0?((_=n.quantity.restrictions)==null?void 0:_.max)||n.quantity.available:"∞"," ","in stock"]})})]},n.id)})})]})},Us=d=>{const{product:i,setIsOpen:o}=d,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:e,style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:G.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},zs="_contentModal_1bixq_1",Hs="_modalTop_1bixq_13",Fs="_loading_1bixq_19",Vs="_modalCards_1bixq_27",Ys="_modalImage_1bixq_32",Gs="_card_1bixq_37",Ws="_cardInfo_1bixq_49",Xs="_cardButtons_1bixq_56",Qs="_title_1bixq_62",Js="_blockImage_1bixq_69",Ks="_short_1bixq_78",H={contentModal:zs,modalTop:Hs,loading:Fs,modalCards:Vs,modalImage:Ys,card:Gs,cardInfo:Ws,cardButtons:Xs,title:Qs,blockImage:Js,short:Ks},Zs=d=>{const{setIsOpen:i,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:l,setShowDropdown:c}=d,[h,f]=j.useState(null),[E,k]=j.useState(!0),{setIsOpen:g}=t.useModalStore();j.useEffect(()=>{var n;k(!0);const a=(n=o.listings)==null?void 0:n.filter(r=>s.listingIdList.includes(r.id));a&&f([...a]),k(!1)},[o]),j.useEffect(()=>{g(!0)},[]);const p=()=>{g(!1),setTimeout(()=>{i(!1)},300)};function R(a){return a.productData.compareAtPrice?a.productData.compareAtPrice.amount:0}return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsxs("div",{className:H.contentModal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:H.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:H.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),!E&&h&&t.jsxRuntimeExports.jsx("div",{className:H.modalCards,children:h.map(a=>t.jsxRuntimeExports.jsxs("div",{className:H.card,children:[t.jsxRuntimeExports.jsx("div",{children:a.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:H.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(H.blockImage,H.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:H.cardInfo,children:[t.jsxRuntimeExports.jsxs("span",{className:H.name,id:"h5",children:[t.splitTextIntoSpans(a.productData.name)," $",a.productData.minPrice.amount," ","- $",R(a)]}),a.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:H.short,id:"md",children:t.splitTextIntoSpans(a.productData.shortDescription)}),t.jsxRuntimeExports.jsx("span",{})]}),t.jsxRuntimeExports.jsxs("div",{className:H.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(a.id),i(!1),l(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(t.Link,{path:`/product/${a.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{whiteSpace:"nowrap"},onClick:()=>{c(!1),p()},children:"View Details"})})]})]},a.id))}),E&&t.jsxRuntimeExports.jsx("div",{className:H.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]})})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Link=t.Link;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectUI=t.Select$1;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TextareaUI=t.Textarea$1;exports.TypesText=t.TypesText;exports.Wrapper=t.Wrapper;exports.Accordion=ys;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=se;exports.CategorySettings=Mt;exports.ChargeTypes=Z;exports.EmptyCart=ot;exports.FormSettings=Wt;exports.GroupCardModal=Zs;exports.HeaderButtons=os;exports.LayoutSettings=Rt;exports.ListingSelector=ie;exports.MetaInfoPost=ks;exports.PagesMobileMenu=rs;exports.PagesMobileModal=rt;exports.PagesSettings=Yt;exports.ProductCardButtons=Is;exports.ProductCardModal=Ds;exports.ProductOptions=st;exports.ShareLink=hs;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DKMsxm1h.cjs"),j=require("react");require("react-dom");const ct="_block_kh9z8_8",lt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",dt="_alignmentContent_kh9z8_30",xt="_alignments_kh9z8_39",pt="_alignment_kh9z8_30",mt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",jt="_padding_kh9z8_71",gt="_active_kh9z8_97",U={block:ct,title:lt,subtitle:ut,alignmentContent:dt,alignments:xt,alignment:pt,circle:mt,paddings:ht,padding:jt,active:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],Rt=d=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:l=!0,isPadding:c=!0}=d;function h(R){switch(R){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 f(R){switch(R){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[E,P]=j.useState(null),[g,p]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[l&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:ft.map(R=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(R)},className:U.alignment,onMouseEnter:()=>{P(R)},onMouseLeave:()=>{P(null)},children:[R!==i&&E!==R&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),R!==i&&E===R&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(E),fill:"#c2c2c2",width:22,height:22}),R===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:h(i),fill:"#FF3F19",width:22,height:22})]},R))})]}),c&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:Et.map(R=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:g===R}),onFocus:()=>{p(R)},onBlur:()=>{p(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:f(R),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[R]),onChange:a=>s({...o,[R]:Math.min(Number(a),999)}),max:999,paddingless:!0,borderless:!0})]},R))})]})]})]})},_t="_title_82zux_1",yt="_subtitle_82zux_5",vt="_productsBlock_82zux_14",bt="_top_82zux_26",It="_products_82zux_14",St="_product_82zux_14",Nt="_button_82zux_80",Ct="_disabled_82zux_91",Pt="_buttons_82zux_118",kt="_addButton_82zux_157",wt="_deleteButton_82zux_179",F={title:_t,subtitle:yt,productsBlock:vt,top:bt,products:It,product:St,button:Nt,disabled:Ct,buttons:Pt,addButton:kt,deleteButton:wt};function Bt({id:d,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:h}=t.useSortable({id:d}),f={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${F.product} ${h?F.dragging:""}`,...o,...s,children:i})}const Mt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,tags:c,title:h,subtitle:f,draggable:E=!1,withImage:P=!1,addable:g=!0,itemsOptions:p,hasRangeSelector:R=!1,rangeSelectorOptions:a,limit:n,autoScrollInterval:r,deletable:b,aspectRatio:_,setAspectRatio:k}=d,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),q=x=>{const{active:I,over:C}=x;if(C&&I.id!==C.id){const M=s.findIndex(T=>T===I.id),v=s.findIndex(T=>T===C.id);if(M!==-1&&v!==-1){const T=[...s],[y]=T.splice(M,1);T.splice(v,0,y),e(T)}}};function V(x){if(P)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const m=(x,I=!1)=>{const C=p.find(v=>v.id===x);if(!C)return;const M=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const T=[...s],y=p.find(u=>u.name===v);if(!y)return;const $=y.id,z=T.map(u=>u===x?$:u);e([...z])},value:C.name,options:p.filter(v=>!s.find(T=>T===v.id)).map(v=>v.name),leftAddonOptions:p.map(v=>({value:v.name,addon:V(v.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:F.buttons,children:t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(v=>v!==x))})})})]});return E?t.jsxRuntimeExports.jsx(Bt,{id:x,children:M},t.v4()):t.jsxRuntimeExports.jsx("div",{className:F.product,children:M},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(h||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[h&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:h}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),R&&a&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...a}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[f&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:f}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:q,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>m(x,b))})}):s.map(x=>m(x,b)),g&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(n&&n<=s.length||s.length===p.length)}),size:"s",disabled:!!(n&&n<=s.length||s.length===p.length),onClick:()=>{const x=[...s];let I=null;if(p){for(let C=0;C<p.length;C++)if(!s.find(M=>M===p[C].id)){I=p[C];break}}x.push((I==null?void 0:I.id)||p[0].id),e(x)},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})]})})})]}),_&&k&&t.jsxRuntimeExports.jsx(t.Select,{value:_,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>k(x),leftAddonOptions:t.aspectRatioOptions}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:c}),l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l}),r!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(r.scrollInterval),onChange:x=>r.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Tt="_title_roi3a_1",$t="_subtitle_roi3a_5",Ot="_productsBlock_roi3a_14",qt="_top_roi3a_26",At="_products_roi3a_14",Dt="_product_roi3a_14",zt="_button_roi3a_80",Lt="_disabled_roi3a_91",Ut="_buttons_roi3a_118",Ht="_addButton_roi3a_164",Ft="_deleteButton_roi3a_179",L={title:Tt,subtitle:$t,productsBlock:Ot,top:qt,products:At,product:Dt,button:zt,disabled:Lt,buttons:Ut,addButton:Ht,deleteButton:Ft};function Vt({product:d,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:l,transition:c,isDragging:h}=t.useSortable({id:d.id}),f={transform:t.CSS.Transform.toString(l),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:e,style:f,className:`${L.product} ${h?L.dragging:""}`,...o,...s,children:i})}const Yt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:l,subtitle:c,editable:h=!0,draggable:f=!1,deletable:E=!0,addable:P=!0,itemsType:g,itemsOptions:p,addableOptions:R={},limit:a}=d,[n,r]=j.useState(null),[b,_]=j.useState(null),k=j.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(n){const x=[...s].map(I=>I.id===n.id?n:I);e(x)}},[n]),j.useEffect(()=>{k.current&&b&&(k.current.getBoundingClientRect().height,b.top)},[k.current,b]);const q=(x,I)=>{x.stopPropagation();const C=x.target.getBoundingClientRect();_({top:C.top+window.scrollY,left:C.left-30}),r(I)},V=x=>{const{active:I,over:C}=x;if(C&&I.id!==C.id){const M=s.findIndex(T=>T.id===I.id),v=s.findIndex(T=>T.id===C.id);if(M!==-1&&v!==-1){const T=[...s],[y]=T.splice(M,1);T.splice(v,0,y),e(T)}}},m=(x,I)=>{const C=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[f&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const v=[...s],T=p.find($=>$.name===M);if(!T)return;const y=v.map($=>$.id===x.id?{...T,name:{"en-US":M}}:$);r({...x,name:{"en-US":M}}),e([...y])},value:x.name,options:p.filter(M=>!s.find(v=>v.name===M.name)).map(M=>M.name)}),t.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[h&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>q(M,x)})}),E&&t.jsxRuntimeExports.jsx("div",{className:L.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(M=>M.id!==x.id))})})]})]});return f?t.jsxRuntimeExports.jsx(Vt,{product:x,index:I,children:C},x.id):t.jsxRuntimeExports.jsx("div",{className:L.product,children:C},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:L.productsBlock,children:[(l||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:L.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:L.title,children:l}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:L.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:L.subtitle,children:c}),f?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:V,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>m(x,I))})}):s.map((x,I)=>m(x,I)),P&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(L.button,{[L.disabled]:!!(a&&a<=s.length||s.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(a&&a<=s.length||s.length===(p==null?void 0:p.length)),onClick:()=>{const x=[...s];let I=null;if(p){for(let C=0;C<p.length;C++)if(!s.find(M=>M.id===p[C].id)){I=p[C];break}}g==="select"&&p&&x.push({name:I?I.name:p[0].name,id:(I==null?void 0:I.id)||p[0].id,...R}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:L.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function Gt(d){const{product:i,children:o}=d,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:h,isDragging:f}=t.useSortable({id:i.id}),E={transform:t.CSS.Transform.toString(c),transition:h};return t.jsxRuntimeExports.jsx("div",{ref:l,style:E,className:`${t.styles.product} ${f?t.styles.dragging:""}`,...s,...e,children:o})}const Wt=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:h,editable:f=!0,draggable:E=!1,deletable:P=!0,addable:g=!0,itemsType:p,itemsPlaceholder:R="",itemsOptions:a,hasRangeSelector:n=!1,rangeSelectorOptions:r,modalOptions:b,addableOptions:_={},limit:k}=d,[D,q]=j.useState(null),[V,m]=j.useState({top:0,left:0}),[x,I]=j.useState(null),C=j.useRef(null),[M,v]=j.useState(!1),T=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const u=()=>{q(null),v(!1)};return document.body.addEventListener("click",u),q(null),v(!1),()=>{q(null),v(!1),document.body.removeEventListener("click",u)}},[]),j.useEffect(()=>{if(D){const u=[...s].map(B=>B.id===D.id?D:B);e(u)}},[D]),j.useEffect(()=>{if(C.current&&x){const u=C.current.getBoundingClientRect().height,B=window.innerHeight;let S=x.top;S+u>B+window.scrollY-200&&(S=B+window.scrollY-u-200),S<0&&(S=10),m({top:S,left:x.left})}},[C.current,x]);const y=(u,B)=>{u.stopPropagation();const S=u.target.getBoundingClientRect();I({top:S.top+window.scrollY,left:S.left-30}),q(B),v(!0)},$=u=>{const{active:B,over:S}=u;if(S&&B.id!==S.id){const O=s.findIndex(A=>A.id===B.id),W=s.findIndex(A=>A.id===S.id);if(O!==-1&&W!==-1){const A=[...s],[Y]=A.splice(O,1);A.splice(W,0,Y),e(A)}}},z=u=>{var S;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),p==="select"&&a&&t.jsxRuntimeExports.jsx(t.Select,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,name:{"en-US":O}}:Y);q({...u,name:{"en-US":O}}),e([...A])},value:u.name["en-US"],options:a.filter(O=>!s.find(W=>W.name["en-US"]===O))}),p==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,name:{"en-US":O}}:Y);e([...A])},value:u.name["en-US"],placeholder:R}),p==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:O=>{const A=[...s].map(Y=>Y.id===u.id?{...u,images:O}:Y);e([...A])},activeImage:(S=s.find(O=>O.id===u.id))==null?void 0:S.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:O=>y(O,u)})}),P&&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:()=>e(s.filter(O=>O.id!==u.id))})})]})]});return E?t.jsxRuntimeExports.jsx(Gt,{product:u,children:B},u.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:B},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:u=>o==null?void 0:o(u)})]}),D&&f&&b&&M&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:C,activeItem:D,setActiveItem:q,popupPosition:V,modalOptions:b,setIsOpenModal:v}),n&&r&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...r}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[h&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:h}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:T,onDragEnd:$,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(u=>u.id),strategy:t.verticalListSortingStrategy,children:s.map(u=>z(u))})}):s.map(u=>z(u)),g&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(k&&k<=s.length)}),size:"s",disabled:!!(k&&k<=s.length),onClick:()=>{const u=[...s];let B=null;if(a){for(let S=0;S<a.length;S++)if(!s.find(O=>O.name["en-US"]===a[S])){B=a[S];break}}p==="select"&&a?u.push({name:{"en-US":B||a[0]},id:t.v4(),..._,maxSymbols:100}):p==="input"?u.push({name:{"en-US":""},id:t.v4(),..._,maxSymbols:100}):u.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),..._,maxSymbols:100}),e(u)},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.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},Xt="_subtitle_jql1y_1",Qt="_products_jql1y_10",Jt="_product_jql1y_10",Kt="_button_jql1y_11",Zt="_buttons_jql1y_11",te="_addButton_jql1y_150",ee="_deleteButton_jql1y_165",X={subtitle:Xt,products:Qt,product:Jt,button:Kt,buttons:Zt,addButton:te,deleteButton:ee},et=d=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:l=!0}=d,{pages:c}=t.usePagesStore(),[h,f]=j.useState(null),[E,P]=j.useState({top:0,left:0}),[g,p]=j.useState(null),R=j.useRef(null);j.useEffect(()=>{if(h){const r=[...i].map(b=>b.id===h.id?h:b);o(r)}},[h]),j.useEffect(()=>{if(R.current&&g){const r=R.current.getBoundingClientRect().height,b=window.innerHeight;let _=g.top;_+r>b+window.scrollY-200&&(_=b+window.scrollY-r-200),_<0&&(_=10),P({top:_,left:g.left})}},[R.current,g]);const a=(r,b)=>{r.stopPropagation();const _=r.target.getBoundingClientRect();p({top:_.top+window.scrollY-70,left:_.left-(e?30:65)}),f(b)},n=(r,b)=>{const _=[...i],k={...r,id:Math.random().toString(36).substr(2,9)};_.splice(b+1,0,k),o(_)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),i.map((r,b)=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:_=>{const D=[...i].map(q=>q.id===r.id?{...r,type:_}:q);o(D)},value:r.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:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{n(r,b)}})}),t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:_=>{a(_,r)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const _=i.filter(k=>k.id!==r.id);o(_)},width:20,height:20,fill:"#C12A2A"})})]})]},r.id)),h&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:R,activeButton:h,setActiveButton:f,popupPosition:E,editableLink:l}),e&&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 r=[...i];l?r.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}):r.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:c?Object.values(c)[0].path:"/",openInNewTab:!1}),o(r)},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})]})})})]})},se=d=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:l=!0,addable:c=!0,deletable:h=!0}=d;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:f=>o(f)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:l,addable:c,deletable:h})]})})};function ne(d){const{product:i,children:o}=d,{attributes:s,listeners:e,setNodeRef:l,transform:c,transition:h,isDragging:f}=t.useSortable({id:String(i.listingId)}),E={transform:t.CSS.Transform.toString(c),transition:h};return t.jsxRuntimeExports.jsx("div",{ref:l,style:E,className:`${t.styles$2.product} ${f?t.styles$2.dragging:""}`,...s,...e,children:o})}const ie=d=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:l,title:c,subtitle:h,editable:f=!0,draggable:E=!1,withImage:P=!1,deletable:g=!0,addable:p=!0,itemsType:R,itemsOptions:a,limit:n,aspectRatio:r,setAspectRatio:b}=d,[_,k]=j.useState(null),[D,q]=j.useState({top:0,left:0}),[V,m]=j.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const y=()=>{k(null),m(!1)};return document.body.addEventListener("click",y),k(null),m(!1),()=>{k(null),m(!1),document.body.removeEventListener("click",y)}},[]),j.useEffect(()=>{if(_){const y=[...s].map($=>$.listingId===_.listingId?_:$);e(y)}},[_]);const I=(y,$)=>{y.stopPropagation();const z=y.target.getBoundingClientRect(),u=100,B=window.innerHeight;let S=z.top+window.scrollY;S+u>B&&(S=B-u-20),m(!0),q({top:S-80,left:z.left-30}),k($)};function C(y){if(P)return y?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${y}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const M=y=>{const{active:$,over:z}=y;if(z&&$.id!==z.id){const u=s.findIndex(S=>String(S.listingId)===$.id),B=s.findIndex(S=>String(S.listingId)===z.id);if(u!==-1&&B!==-1){const S=[...s],[O]=S.splice(u,1);S.splice(B,0,O),e(S)}}},v=y=>{const $=a.find(u=>y.listingId===u.id);if(!$)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),R==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:u=>{const B=[...s],S=a.find(A=>A.productData.name===u);if(!S)return;const O={listingId:S.id,image:S.productData.images.length>0?S.productData.images[0].cfId:""},W=B.map(A=>A.listingId===y.listingId?O:A);k(O),e([...W])},value:$.productData.name,options:[...a.filter(u=>!s.find(B=>B.listingId===u.id)).map(u=>u.productData.name)],leftAddonOptions:a.map(u=>{var B;return{value:u.productData.name,addon:C(((B=u.productData.images[0])==null?void 0:B.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[f&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:u=>I(u,y)})}),g&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(u=>u!==y))})})]})]});return E?t.jsxRuntimeExports.jsx(ne,{product:y,children:z},y.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},y.listingId)},T=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:y=>o==null?void 0:o(y)})]}),V&&_&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:T,activeItem:_,setActiveItem:k,setIsOpenModal:m,popupPosition:D,itemsOptions:a}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[h&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:h}),E?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:M,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(y=>String(y.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(y=>v(y))})}):s.map(y=>v(y)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const y=[...s];for(let $=0;$<a.length;$++)if(!s.find(z=>z.listingId===a[$].id)){y.push({listingId:a[$].id,image:a[$].productData.images.length>0?a[$].productData.images[0].cfId:""});break}e(y)},disabled:s.length===(n||a.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r&&b&&t.jsxRuntimeExports.jsx(t.Select,{value:r,options:Object.keys(t.aspectRatio),onChange:y=>b(y),leftAddonOptions:t.aspectRatioOptions}),i&&l!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:l})]})},oe="_options_167h8_1",re="_price_167h8_18",ae="_oldPrice_167h8_25",ce="_newPrice_167h8_33",le="_animate_167h8_40",ue="_meta_167h8_58",de="_info_167h8_64",xe="_infoRight_167h8_73",pe="_buttons_167h8_80",me="_variants_167h8_87",he="_variant_167h8_87",je="_stock_167h8_105",ge="_variantInfo_167h8_112",fe="_quantity_167h8_119",Ee="_button_167h8_80",Re="_activeVariant_167h8_165",_e="_chargeTypes_167h8_169",ye="_charge_167h8_169",ve="_chargeActive_167h8_194",be="_title_167h8_202",w={options:oe,price:re,oldPrice:ae,newPrice:ce,animate:le,meta:ue,info:de,infoRight:xe,buttons:pe,variants:me,variant:he,stock:je,variantInfo:ge,quantity:fe,button:Ee,activeVariant:Re,chargeTypes:_e,charge:ye,chargeActive:ve,title:be};var Z=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(Z||{});const st=d=>{var q,V;const{product:i,setIsOpen:o}=d,{variants:s}=i,[e,l]=j.useState(s[0]),[c,h]=j.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),{notifications:f,setNotifications:E}=t.useNotificationStore(),P=t.useNavigate(),[g,p]=j.useState(1),{cart:R,reset:a,addProductToCart:n}=t.useCart(),[r,b]=j.useState(!1);j.useEffect(()=>{b(!0);const m=setTimeout(()=>b(!1),600);return()=>clearTimeout(m)},[g]);async function _(){try{n({productId:i.id,productVariantId:e.id,chargeType:c,quantity:g}),E([...f,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(m){E([...f,{id:t.v4(),message:`Product failed to add to cart: ${m}`,status:"error"}])}o==null||o(!1)}function k(){a(),_(),P("/checkout")}function D(m){if(m>=864e5){const v=Math.floor(m/864e5);return`${v} ${v===1?"day":"days"}`}else if(m>=36e5){const v=Math.floor(m/36e5);return`${v} ${v===1?"hour":"hours"}`}else if(m>=6e4){const v=Math.floor(m/6e4);return`${v} ${v===1?"minute":"minutes"}`}else{const v=Math.floor(m/1e3);return`${v} ${v===1?"second":"seconds"}`}}return j.useEffect(()=>{e.quantity&&e.quantity.available===0?p(0):p(1)},[e.quantity.available]),j.useEffect(()=>{e.chargeTypes&&h(e.chargeTypes.includes(c)?c:e.chargeTypes[0])},[e.chargeTypes]),t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(m=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:c===m}),onClick:()=>h(m),children:Z[m]},m))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:s.filter(m=>{var x;return(x=m.chargeTypes)==null?void 0:x.includes(c)}).map(m=>{var x,I;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===m.id}),onClick:()=>l(m),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:t.splitTextIntoSpans(m.name)}),t.jsxRuntimeExports.jsxs("span",{children:[t.formatPrice({amount:c==="ONE_TIME"?m.price.amount:m.subscriptionSettings?m.subscriptionSettings.price.amount:0,currency:c==="ONE_TIME"?m.price.currency:m.subscriptionSettings?m.subscriptionSettings.price.currency:"USD"})," ",c==="RECURRING"&&m.subscriptionSettings&&` / ${t.normalizeInterval(m.subscriptionSettings.recurringIntervalDays||0)}`]})]}),t.jsxRuntimeExports.jsx("div",{children:c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[(x=m.quantity.restrictions)!=null&&x.max||m.quantity.available!==void 0?((I=m.quantity.restrictions)==null?void 0:I.max)||m.quantity.available:"∞"," ","in stock"]})})]},m.id)})}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{g>1?p(m=>m-1):p(1)},className:w.button,disabled:e.quantity.available&&e.quantity.restrictions&&g<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(g),onChange:m=>{e.quantity.available&&Number(m)>e.quantity.available?p(e.quantity.available):p(Number(m))},max:((q=e.quantity.restrictions)==null?void 0:q.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((V=e.quantity.restrictions)==null?void 0:V.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&g>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{p(m=>m+1)},className:w.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&g>=e.quantity.restrictions.max||e.quantity.available===0||e.quantity.available&&g>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"var(--text-action)",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":D(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:c==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.price.amount*g,currency:e.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,children:t.formatPrice({amount:e.compareAtPrice.amount*g,currency:e.compareAtPrice.currency})})]}):t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.price.amount*g,currency:e.price.currency})}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.subscriptionSettings.price.amount*g,currency:e.subscriptionSettings.price.currency})}),t.jsxRuntimeExports.jsx("span",{className:w.oldPrice,children:t.formatPrice({amount:e.subscriptionSettings.compareAtPrice.amount*g,currency:e.subscriptionSettings.compareAtPrice.currency})})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsx("span",{className:t.clx(w.newPrice,{[w.animate]:r}),children:t.formatPrice({amount:e.subscriptionSettings.price.amount*g,currency:e.subscriptionSettings.price.currency})})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>k(),disabled:e.quantity&&e.quantity.available===0,children:c==="ONE_TIME"?"Buy Now":"Subscribe Now"}),c==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>_(),disabled:e.quantity&&e.quantity.available===0,children:R.parts.some(m=>m.productId===i.id&&m.productVariantId===e.id)?"Add More":"Add to Cart"})]})]})},Ie="_buttons_3z0t7_23",Se="_modal_3z0t7_32",Ne="_closing_3z0t7_65",Ce="_info_3z0t7_114",Pe="_top_3z0t7_121",ke="_title_3z0t7_132",we="_clear_3z0t7_139",Be="_activeClear_3z0t7_146",Me="_count_3z0t7_150",Te="_cart_3z0t7_165",$e="_empty_3z0t7_173",Oe="_product_3z0t7_199",qe="_products_3z0t7_208",Ae="_image_3z0t7_216",De="_productInfo_3z0t7_233",ze="_content_3z0t7_240",Le="_name_3z0t7_246",Ue="_price_3z0t7_252",He="_productButtons_3z0t7_258",Fe="_productButton_3z0t7_258",Ve="_productCount_3z0t7_275",Ye="_bottom_3z0t7_292",Ge="_subtotal_3z0t7_300",We="_block_3z0t7_308",Xe="_shoppingCount_3z0t7_315",Qe="_total_3z0t7_335",Je="_link_3z0t7_341",Ke="_userInfo_3z0t7_348",Ze="_pagesMobileModal_3z0t7_360",ts="_pagesMobileModalContent_3z0t7_374",es="_pagesMobileModalHeader_3z0t7_380",ss="_pagesMobileModalFooter_3z0t7_390",ns="_pageLink_3z0t7_397",is="_rightButtons_3z0t7_406",N={buttons:Ie,modal:Se,closing:Ne,info:Ce,top:Pe,title:ke,clear:we,activeClear:Be,count:Me,cart:Te,empty:$e,product:Oe,products:qe,image:Ae,productInfo:De,content:ze,name:Le,price:Ue,productButtons:He,productButton:Fe,productCount:Ve,bottom:Ye,subtotal:Ge,block:We,shoppingCount:Xe,total:Qe,link:Je,userInfo:Ke,pagesMobileModal:Ze,pagesMobileModalContent:ts,pagesMobileModalHeader:es,pagesMobileModalFooter:ss,pageLink:ns,rightButtons:is},os=d=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[d,i]=j.useState(!1),[o,s]=j.useState([]),[e,l]=j.useState(!1),{cart:c,products:h}=t.useCart();function f(a){if(a.variants.length>0){for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].productVariantId}return a.variants[0].id}function E(a){for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].quantity}const P=a=>{for(let n=0;n<c.parts.length;n++)for(let r=0;r<a.variants.length;r++)if(a.variants[r]&&c.parts[n].productVariantId===a.variants[r].id)return c.parts[n].chargeType;return"ONE_TIME"};j.useEffect(()=>{(async()=>{const n=c.parts.map(_=>String(_.productId)),b=(h.filter(_=>n.includes(String(_.id)))||[]).map(_=>({..._,activeVariantId:f(_),quantity:E(_),chargeType:P(_)}));s(b)})()},[c.parts]);function g(a){return!a||!(a!=null&&a.variants)?!1:a.chargeType==="RECURRING"}const p=c.parts.length>0&&o.length>0&&!g(o[0]);function R(){l(!1),setTimeout(()=>{i(!1)},300)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:a=>{a.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),l(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"}),p&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:c.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:R,withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:p,isOpen:e,close:R})})]})},it=d=>{var R,a;const{activeProducts:i,isCartNotEmpty:o,isOpen:s,close:e}=d,{cart:l,reset:c,getTotalAndDiscount:h,updateQuantityOfProduct:f}=t.useCart(),E=t.useNavigate();function P(n,r){E(n,{replace:r})}function g(n){n.quantity&&f({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1,chargeType:n.chargeType})}function p(n){n.quantity&&f({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1,chargeType:n.chargeType})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:l.parts.length})]}),t.jsxRuntimeExports.jsxs("div",{className:N.rightButtons,children:[o&&t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:c,children:"Clear all"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",onClick:e,hoverable:!0,width:24,height:24,fill:"var(--text-primary)"})]})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:[...new Map(i.map(n=>[n.id,n])).values()].map(n=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}):t.jsxRuntimeExports.jsx("div",{className:N.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsx("div",{className:N.price,children:t.formatPrice({amount:n.variants.find(r=>r.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1),currency:n.variants.find(r=>r.id===n.activeVariantId).price.currency})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&p(n)},className:N.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>g(n),className:N.productButton,disabled:n.quantity===n.variants.find(r=>r.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsx("div",{className:N.total,children:t.formatPrice({amount:h().total,currency:l.parts.length>0&&((a=(R=i.find(n=>n.id===l.parts[0].productId))==null?void 0:R.variants.find(n=>n.id===l.parts[0].productVariantId))==null?void 0:a.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>P("/checkout",!1),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,children:"view products"})]})]}),tt=({signUp:d,close:i})=>{const{token:o}=t.useStorefrontStore(),s=t.useNavigate(),[e,l]=j.useState("test-email@gmail.com");j.useEffect(()=>{o&&(async()=>{if(!o)return;const f=t.jwtDecode(o);l(f.email)})()},[o]);function c(h){window.location.pathname.includes("/admin/builder")||s(h)}return o?t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",className:N.userInfo,onClick:()=>{c("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:e||"test-email@gmail.com"})}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]})},rt=({logo:d,setIsOpen:i,signUp:o,pages:s})=>{const{setIsOpen:e}=t.useModalStore(),l=()=>{e(!1),setTimeout(()=>{i(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:d}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:l,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:s.length>0&&s.map(c=>t.jsxRuntimeExports.jsx("div",{className:N.pageLink,onClick:l,children:t.jsxRuntimeExports.jsx(t.Link,{path:c.path,children:c.name["en-US"]},c.id)}))}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:o,close:l})})]})},rs=({logo:d,signUp:i,pages:o})=>{const[s,e]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),hasPadding:!1,children:t.jsxRuntimeExports.jsx(rt,{logo:d,setIsOpen:e,signUp:i,pages:o})})]})},at=d=>{const{setIsOpenModal:i}=d;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List"})})},as="_share_rlgln_1",cs="_modal_rlgln_8",ls="_header_rlgln_20",us="_title_rlgln_46",ds="_copyWrapper_rlgln_52",xs="_copyText_rlgln_61",ps="_copyTextMobile_rlgln_74",ms="_copyTextMiniMobile_rlgln_93",Q={share:as,modal:cs,header:ls,title:us,copyWrapper:ds,copyText:xs,copyTextMobile:ps,copyTextMiniMobile:ms},hs=({title:d="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:Q.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(js,{title:d})})]})},js=({title:d="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notifications:o,setNotifications:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),l=window.location.href;function c(){navigator.clipboard.writeText(l),s([...o,{id:t.v4(),message:"Link copied to clipboard",status:"success"}])}function h(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function f(E,P){return E.length>P?E.slice(0,P)+"...":E}return t.jsxRuntimeExports.jsxs("div",{className:Q.modal,onClick:E=>E.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,children:[t.jsxRuntimeExports.jsx("div",{className:Q.title,children:d}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:h,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:Q.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:c,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:Q.copyText,children:f(l,100)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMobile,children:f(l,40)}),t.jsxRuntimeExports.jsx("div",{className:Q.copyTextMiniMobile,children:f(l,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:o.find(E=>E.message==="Link copied to clipboard")?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},gs="_accordion_1to77_1",fs="_header_1to77_9",Es="_icon_1to77_18",Rs="_open_1to77_21",_s="_content_1to77_25",J={accordion:gs,header:fs,icon:Es,open:Rs,content:_s},ys=({title:d,content:i,defaultOpen:o=!1})=>{const[s,e]=j.useState(o),[l,c]=j.useState(0),h=j.useRef(null),f=()=>{e(!s)};return j.useEffect(()=>{h.current&&c(s?h.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:f,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:h,className:J.content,style:{height:`${l}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},vs="_buttonsBlock_1b2rb_1",bs={buttonsBlock:vs},Is=d=>{var E,P;const{setIsOpen:i,setModalType:o,productId:s}=d,{cart:e}=t.useCart(),{pageContext:l}=t.usePagesStore(),c=(E=l==null?void 0:l.listings)==null?void 0:E.find(g=>g.id===s);if(!c)return null;const h=(P=l==null?void 0:l.products)==null?void 0:P.find(g=>g.uniquePath===c.productData.uniquePath);if(!h)return null;const f=e.parts.find(g=>g.productId===h.id);return t.jsxRuntimeExports.jsxs("div",{className:bs.buttonsBlock,onClick:g=>g.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:f?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},Ss="_wrapper_27wzz_1",Ns="_logo_27wzz_8",Cs="_info_27wzz_12",K={wrapper:Ss,logo:Ns,info:Cs},Ps=({date:d})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),l={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",l)}return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:K.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:K.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(d)})]})]})},ks="_variants_hphv8_80",ws="_variant_hphv8_80",Bs="_stock_hphv8_98",Ms="_variantInfo_hphv8_105",Ts="_title_hphv8_199",$s="_modal_hphv8_205",Os="_header_hphv8_225",qs="_productOptions_hphv8_233",As="_loading_hphv8_237",G={variants:ks,variant:ws,stock:Bs,variantInfo:Ms,title:Ts,modal:$s,header:Os,productOptions:qs,loading:As},Ds=d=>{var p;const{pageContext:i}=t.usePagesStore(),o=(p=i==null?void 0:i.listings)==null?void 0:p.find(R=>R.id===d.productId),[s,e]=j.useState(!0),[l,c]=j.useState(null),h=(l==null?void 0:l.variants[0])||null,[f,E]=j.useState("ONE_TIME"),{addProducts:P}=t.useCart(),{setIsOpen:g}=t.useModalStore();return j.useEffect(()=>{(async()=>{e(!0);const a=await t.getDynamicPage(encodeURIComponent(`/product/${o.productData.uniquePath}`));P(a==null?void 0:a.data.products),c(a==null?void 0:a.data.products[0]),e(!1)})()},[]),j.useEffect(()=>{g(!0)},[]),t.jsxRuntimeExports.jsx(t.Modal,{close:d.setIsOpen,children:t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:R=>R.stopPropagation(),children:[s&&t.jsxRuntimeExports.jsx("div",{className:G.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})}),d.type==="Add To Cart"&&l&&h&&!s&&t.jsxRuntimeExports.jsx(zs,{variants:l.variants,activeVariant:h,activeChargeType:f,setActiveChargeType:E,productId:l.id,setIsOpen:d.setIsOpen}),d.type==="Buy Now"&&l&&!s&&t.jsxRuntimeExports.jsx(Ls,{product:l,setIsOpen:d.setIsOpen})]})})},zs=d=>{const{variants:i,activeChargeType:o,productId:s,setIsOpen:e}=d,{cart:l,addProductToCart:c,addProducts:h,updateQuantityOfProduct:f}=t.useCart(),{notifications:E,setNotifications:P}=t.useNotificationStore(),{pageContext:g}=t.usePagesStore(),{setIsOpen:p}=t.useModalStore(),R=()=>{p(!1),setTimeout(()=>{e(!1)},300)};async function a(n){const r=i.find(k=>k.id===n),b=l.parts.find(k=>k.productId===d.productId&&k.productVariantId===n);if((r==null?void 0:r.quantity.available)&&(r==null?void 0:r.quantity.restrictions)&&((b==null?void 0:b.quantity)||0)+1>(r==null?void 0:r.quantity.restrictions.max)||(r==null?void 0:r.quantity.available)===0||(r==null?void 0:r.quantity.available)&&((b==null?void 0:b.quantity)||0)+1>(r==null?void 0:r.quantity.available)){P([...E,{id:t.v4(),message:"Product is out of stock",status:"error"}]);return}if(b)f({productId:s,productVariantId:n,quantity:b.quantity+1,chargeType:o});else{g!=null&&g.products&&h(g.products);try{c({productId:s,productVariantId:n,quantity:1,chargeType:o}),P([...E,{id:t.v4(),message:"Product added to cart",status:"success"}])}catch(k){P([...E,{id:t.v4(),message:`Product failed to add to cart: ${k}`,status:"error"}])}}}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a Variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:R})]}),t.jsxRuntimeExports.jsx("div",{className:G.variants,children:i.filter(n=>{var r;return(r=n.chargeTypes)==null?void 0:r.includes(o)}).map(n=>{var r,b,_;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(G.variant),onClick:()=>{a(n.id),e(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:G.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:G.title,children:n.name}),t.jsxRuntimeExports.jsx("span",{children:t.formatPrice({amount:o==="ONE_TIME"?n.price.amount:n.subscriptionSettings?n.subscriptionSettings.price.amount:0,currency:o==="ONE_TIME"?n.price.currency:((r=n.subscriptionSettings)==null?void 0:r.price.currency)||"USD"})})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:G.stock,children:[(b=n.quantity.restrictions)!=null&&b.max||n.quantity.available!==void 0?((_=n.quantity.restrictions)==null?void 0:_.max)||n.quantity.available:"∞"," ","in stock"]})})]},n.id)})})]})},Ls=d=>{const{product:i,setIsOpen:o}=d,{setIsOpen:s}=t.useModalStore(),e=()=>{s(!1),setTimeout(()=>{o(!1)},300)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:e,style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:G.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},Us="_contentModal_1bixq_1",Hs="_modalTop_1bixq_13",Fs="_loading_1bixq_19",Vs="_modalCards_1bixq_27",Ys="_modalImage_1bixq_32",Gs="_card_1bixq_37",Ws="_cardInfo_1bixq_49",Xs="_cardButtons_1bixq_56",Qs="_title_1bixq_62",Js="_blockImage_1bixq_69",Ks="_short_1bixq_78",H={contentModal:Us,modalTop:Hs,loading:Fs,modalCards:Vs,modalImage:Ys,card:Gs,cardInfo:Ws,cardButtons:Xs,title:Qs,blockImage:Js,short:Ks},Zs=d=>{const{setIsOpen:i,pageContext:o,groupData:s,setProductId:e,setIsProductModalOpen:l,setShowDropdown:c}=d,[h,f]=j.useState(null),[E,P]=j.useState(!0),{setIsOpen:g}=t.useModalStore();j.useEffect(()=>{var n;P(!0);const a=(n=o.listings)==null?void 0:n.filter(r=>s.listingIdList.includes(r.id));a&&f([...a]),P(!1)},[o]),j.useEffect(()=>{g(!0)},[]);const p=()=>{g(!1),setTimeout(()=>{i(!1)},300)};function R(a){return a.productData.compareAtPrice?a.productData.compareAtPrice.amount:0}return t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsxs("div",{className:H.contentModal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:H.modalTop,children:[t.jsxRuntimeExports.jsx("span",{className:H.title,id:"h4",children:t.splitTextIntoSpans(s.name)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",hoverable:!0,onClick:p,fill:"var(--text-primary)"})]}),!E&&h&&t.jsxRuntimeExports.jsx("div",{className:H.modalCards,children:h.map(a=>t.jsxRuntimeExports.jsxs("div",{className:H.card,children:[t.jsxRuntimeExports.jsx("div",{children:a.productData.images[0]?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a.productData.images[0].cfId}/w=500`,alt:"",width:64,height:64,className:H.modalImage}):t.jsxRuntimeExports.jsx("div",{className:t.clx(H.blockImage,H.modalImage),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image"})})}),t.jsxRuntimeExports.jsxs("div",{className:H.cardInfo,children:[t.jsxRuntimeExports.jsxs("span",{className:H.name,id:"h5",children:[t.splitTextIntoSpans(a.productData.name)," $",a.productData.minPrice.amount," ","- $",R(a)]}),a.productData.shortDescription&&t.jsxRuntimeExports.jsx("span",{className:H.short,id:"md",children:t.splitTextIntoSpans(a.productData.shortDescription)}),t.jsxRuntimeExports.jsx("span",{})]}),t.jsxRuntimeExports.jsxs("div",{className:H.cardButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{e(a.id),i(!1),l(!0)},children:"Buy"}),t.jsxRuntimeExports.jsx(t.Link,{path:`/product/${a.productData.uniquePath}`,children:t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{whiteSpace:"nowrap"},onClick:()=>{c(!1),p()},children:"View Details"})})]})]},a.id))}),E&&t.jsxRuntimeExports.jsx("div",{className:H.loading,children:t.jsxRuntimeExports.jsx(t.Loader,{})})]})})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Link=t.Link;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectUI=t.Select$1;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TextareaUI=t.Textarea$1;exports.TypesText=t.TypesText;exports.Wrapper=t.Wrapper;exports.Accordion=ys;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=se;exports.CategorySettings=Mt;exports.ChargeTypes=Z;exports.EmptyCart=ot;exports.FormSettings=Wt;exports.GroupCardModal=Zs;exports.HeaderButtons=os;exports.LayoutSettings=Rt;exports.ListingSelector=ie;exports.MetaInfoPost=Ps;exports.PagesMobileMenu=rs;exports.PagesMobileModal=rt;exports.PagesSettings=Yt;exports.ProductCardButtons=Is;exports.ProductCardModal=Ds;exports.ProductOptions=st;exports.ShareLink=hs;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.UserInfo=tt;