@billgangcom/theme-lib 1.15.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +8 -8
- package/dist/builder.es.js +887 -886
- package/dist/{index-O85p6vDc.cjs → index-Cr8kurIY.cjs} +15 -15
- package/dist/{index-QsuPYj6C.js → index-D4jHAwqq.js} +488 -506
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +2 -2
- package/package.json +1 -1
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-O85p6vDc.cjs"),p=require("react"),nt="_accordion_2tiiw_1",ot="_header_2tiiw_9",it="_icon_2tiiw_16",ct="_open_2tiiw_19",rt="_content_2tiiw_23",z={accordion:nt,header:ot,icon:it,open:ct,content:rt},at=({title:d,content:o})=>{const[n,i]=p.useState(!1),[c,r]=p.useState(0),e=p.useRef(null),s=()=>{i(!n)};return p.useEffect(()=>{e.current&&r(n?e.current.scrollHeight:0)},[n]),t.jsxRuntimeExports.jsxs("div",{className:z.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:z.header,onClick:s,children:[t.jsxRuntimeExports.jsx("h3",{children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(z.icon,{[z.open]:n}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:e,className:z.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{children:o})})]})},lt="_wrapper_1g82c_2",xt="_alignmentBlock_1g82c_8",ut="_title_1g82c_15",dt="_subtitle_1g82c_22",mt="_alignmentContent_1g82c_29",pt="_alignments_1g82c_35",_t="_alignment_1g82c_8",ht="_circle_1g82c_54",jt="_paddings_1g82c_61",gt="_padding_1g82c_61",bt="_input_1g82c_79",T={wrapper:lt,alignmentBlock:xt,title:ut,subtitle:dt,alignmentContent:mt,alignments:pt,alignment:_t,circle:ht,paddings:jt,padding:gt,input:bt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],vt=d=>{const{alignment:o,padding:n,setPadding:i,setAlignment:c}=d;function r(){switch(o){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function e(s){switch(s){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:T.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:T.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:T.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:T.alignments,children:ft.map(s=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{c(s)},className:T.alignment,children:[s!==o&&t.jsxRuntimeExports.jsx("div",{className:T.circle}),s===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},s))}),t.jsxRuntimeExports.jsx("div",{className:T.paddings,children:Rt.map(s=>t.jsxRuntimeExports.jsxs("label",{className:T.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:e(s),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(n[s]),onChange:l=>i({...n,[s]:Number(l)}),paddingless:!0,borderless:!0})]}))})]})]})]})},Et="_subtitle_2zbxx_1",kt="_header_2zbxx_8",yt="_text_2zbxx_9",$t="_top_2zbxx_16",It="_itemsBlock_2zbxx_23",F={subtitle:Et,header:kt,text:yt,top:$t,itemsBlock:It},wt="_typeTexts_3zlec_1",Nt="_block_3zlec_7",Ct="_active_3zlec_18",J={typeTexts:wt,block:Nt,active:Ct},Bt=["bold","italic","underline","strike-through","code"],Q=d=>{const{typesText:o,setTypesText:n}=d;function i(c){switch(c){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:J.typeTexts,children:Bt.map(c=>t.jsxRuntimeExports.jsx("div",{className:t.clx(J.block,{[J.active]:o.includes(c)}),onClick:()=>{const r=[...o];if(r.includes(c)){const e=r.filter(s=>s!==c);n(e)}else r.push(c),n(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(c),fill:o.includes(c)?"#252525":"#757575",width:20,height:20})},String(c)))})},W=d=>{const{typesText:o,isActiveText:n,setIsActiveText:i,text:c,setText:r,setTypesText:e,title:s,subtitle:l="Items"}=d;return t.jsxRuntimeExports.jsxs("div",{className:F.text,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:s}),n!==void 0&&i&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:R=>i(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:l}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>r(R),value:c,maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:o,setTypesText:e})]})]})},Pt="_subtitle_11qr1_1",Tt="_header_11qr1_8",St="_text_11qr1_9",At="_productsBlock_11qr1_10",Ot="_top_11qr1_22",Dt="_itemsBlock_11qr1_29",Lt="_typeTexts_11qr1_35",qt="_block_11qr1_41",Mt="_active_11qr1_52",Ht="_products_11qr1_10",zt="_product_11qr1_10",Ft="_button_11qr1_70",Vt="_disabled_11qr1_80",Gt="_image_11qr1_84",Ut="_info_11qr1_91",Xt="_name_11qr1_102",Yt="_buttons_11qr1_106",Jt="_modal_11qr1_112",Kt="_link_11qr1_130",Qt="_modalOptions_11qr1_136",k={subtitle:Pt,header:Tt,text:St,productsBlock:At,top:Ot,itemsBlock:Dt,typeTexts:Lt,block:qt,active:Mt,products:Ht,product:zt,button:Ft,disabled:Vt,image:Gt,info:Ut,name:Xt,buttons:Yt,modal:Jt,link:Kt,modalOptions:Qt},Wt=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,modalOptions:c,setIsOpenModal:r}=d;return t.jsxRuntimeExports.jsxs("div",{className:k.modal,onClick:e=>{e.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{n(null),r(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:k.modalOptions,children:c.map(e=>{if(e.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:s=>{const l={...o,[e.field]:s};n(l)}});if(e.type==="text")return t.jsxRuntimeExports.jsx(W,{typesText:o[e.field.type],setTypesText:s=>{const l={...o,[e.field.type]:s};n(l)},text:o[e.field.text]||"",setText:s=>{const l={...o,[e.field.text]:s};n(l)},subtitle:e.label});if(e.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field]:s};n(l)},value:o[e.field]||"",label:e.label,placeholder:e.placeholder});if(e.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:k.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field.text]:s};n(l)},value:o[e.field.text]||"",label:e.inputLabel,placeholder:e.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!o[e.field.switch]||!1,label:e.switchLabel,onChange:s=>{const l={...o,[e.field.switch]:s};n(l)}})]});if(e.type==="list")return t.jsxRuntimeExports.jsx(tt,{items:o[e.field]||[],setItems:s=>{const l={...o,[e.field]:s};n(l)},itemsType:"select",draggable:e.draggable||!1,itemsOptions:e.itemsOptions,deletable:e.deletable||!1,editable:!1,subtitle:e.label});if(e.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:e.itemsOptions,onChange:s=>{const l={...o,[e.field]:s};n(l)},label:e.label,value:o[e.field]||"String",leftAddon:e.leftAddon&&e.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:o[e.field]})})})})]})},Zt="_other_1wtgi_1",te="_subtitle_1wtgi_7",ee="_items_1wtgi_14",K={other:Zt,subtitle:te,items:ee},Z=d=>{const{items:o,title:n="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:K.other,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:n}),t.jsxRuntimeExports.jsx("div",{className:K.items,children:o.map(i=>t.jsxRuntimeExports.jsx(t.Switch,{current:i.isItem,onChange:c=>i.setIsItem(c),label:i.label,hasBackground:!0,paddingless:!1}))})]})},se=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${k.product} ${r?k.dragging:""}`,children:i})},tt=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsPlaceholder:j="",itemsOptions:_,hasRangeSelector:w=!1,rangeSelectorOptions:G,modalOptions:U,addableOptions:M={},limit:B}=d,[A,O]=p.useState(null),[Y,X]=p.useState({top:0,left:0}),[x,g]=p.useState(!1),N=(a,$)=>{const C=[...i],[b]=C.splice(a,1);C.splice($,0,b),c(C)};p.useEffect(()=>{const a=()=>{O(null),g(!1)};return document.body.addEventListener("click",a),O(null),g(!1),()=>{O(null),g(!1),document.body.removeEventListener("click",a)}},[]),p.useEffect(()=>{if(A){const a=[...i].map($=>$.id===A.id?A:$);c(a)}},[A]);const v=(a,$)=>{a.stopPropagation(),g(!0);const C=a.target.getBoundingClientRect(),b=500,H=window.innerHeight;let S=C.top+window.scrollY;S+b>H&&(S=H-b-20),X({top:S-80,left:C.left-30}),O($)};function L(a){if(m)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=(a,$)=>{const C=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);O({...a,name:b}),c([...S])},value:a.name,options:_,leftAddon:L(a.images)}),y==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);c([...S])},value:a.name,placeholder:j}),y==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,images:b}:D);c([...S])}}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>v(b,a)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(b=>b.id!==a.id))})]})]});return R?t.jsxRuntimeExports.jsx(se,{product:a,index:$,moveProduct:N,children:C},a.id):t.jsxRuntimeExports.jsx("div",{className:k.product,children:C},a.id)};return t.jsxRuntimeExports.jsxs("div",{className:k.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:k.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:a=>n==null?void 0:n(a)})]}),A&&l&&U&&x&&t.jsxRuntimeExports.jsx(Wt,{activeItem:A,setActiveItem:O,popupPosition:Y,modalOptions:U,setIsOpenModal:g}),w&&G&&t.jsxRuntimeExports.jsx(st,{...G}),t.jsxRuntimeExports.jsxs("div",{className:k.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:k.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((a,$)=>P(a,$))}):i.map((a,$)=>P(a,$)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx(k.button,{[k.disabled]:!!(B&&B<=i.length)}),size:"s",disabled:!!(B&&B<=i.length),onClick:()=>{const a=[...i];y==="select"?a.push({name:_[0]||`Product ${i.length+1}`,id:t.v4(),...M}):y==="input"?a.push({name:"",id:t.v4(),...M}):a.push({name:`Image ${i.length+1}`,id:t.v4(),...M}),c(a)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(Z,{items:r})]})},ne="_subtitle_41klp_1",oe="_header_41klp_8",ie="_text_41klp_9",ce="_productsBlock_41klp_10",re="_buttonsBlock_41klp_11",ae="_top_41klp_21",le="_itemsBlock_41klp_28",xe="_typeTexts_41klp_34",ue="_block_41klp_40",de="_active_41klp_51",me="_products_41klp_10",pe="_product_41klp_10",_e="_button_41klp_11",he="_image_41klp_79",je="_info_41klp_86",ge="_name_41klp_97",be="_buttons_41klp_11",fe="_modal_41klp_107",Re="_other_41klp_124",ve="_options_41klp_130",q={subtitle:ne,header:oe,text:ie,productsBlock:ce,buttonsBlock:re,top:ae,itemsBlock:le,typeTexts:xe,block:ue,active:de,products:me,product:pe,button:_e,image:he,info:je,name:ge,buttons:be,modal:fe,other:Re,options:ve},Ee=d=>{const{activeButton:o,setActiveButton:n,popupPosition:i}=d,[c,r]=p.useState(o.typesText),[e,s]=p.useState(o.destination),[l,R]=p.useState(o.link||""),[m,f]=p.useState(o.text||"");return p.useEffect(()=>{n({...o,...{text:m,link:l,destination:e,typesText:c}})},[c,e,l,m]),t.jsxRuntimeExports.jsxs("div",{className:q.modal,onClick:u=>{u.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>n(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:q.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:u=>s(u),options:["Go to Page","Open Link"],value:e}),e==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>R(u),value:l,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>f(u),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:c,setTypesText:r})]})]})},ke="_subtitle_1y5sw_1",ye="_header_1y5sw_8",$e="_text_1y5sw_9",Ie="_productsBlock_1y5sw_10",we="_buttonsBlock_1y5sw_11",Ne="_top_1y5sw_22",Ce="_itemsBlock_1y5sw_29",Be="_typeTexts_1y5sw_35",Pe="_block_1y5sw_41",Te="_active_1y5sw_52",Se="_products_1y5sw_10",Ae="_product_1y5sw_10",Oe="_button_1y5sw_11",De="_image_1y5sw_80",Le="_info_1y5sw_87",qe="_name_1y5sw_98",Me="_buttons_1y5sw_11",He="_modal_1y5sw_108",ze="_other_1y5sw_125",Fe="_options_1y5sw_131",V={subtitle:ke,header:ye,text:$e,productsBlock:Ie,buttonsBlock:we,top:Ne,itemsBlock:Ce,typeTexts:Be,block:Pe,active:Te,products:Se,product:Ae,button:Oe,image:De,info:Le,name:qe,buttons:Me,modal:He,other:ze,options:Fe},et=d=>{const{buttons:o,setButtons:n,deletable:i=!0,addable:c=!0}=d,[r,e]=p.useState(null),[s,l]=p.useState({top:0,left:0});p.useEffect(()=>{const m=()=>{e(null)};return document.body.addEventListener("click",m),e(null),()=>{e(null),document.body.removeEventListener("click",m)}},[]),p.useEffect(()=>{if(r){const m=[...o].map(f=>f.id===r.id?r:f);n(m)}},[r]);const R=(m,f)=>{m.stopPropagation();const u=m.target.getBoundingClientRect(),y=490,j=window.innerHeight;let _=u.top+window.scrollY;_+y>j&&(_=j-y-20),l({top:_,left:u.left-30}),e(f)};return t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Button Type"}),o.map(m=>t.jsxRuntimeExports.jsxs("div",{className:V.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const y=[...o].map(j=>j.id===m.id?{...m,type:f}:j);n(y)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>{R(f,m)}}),i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const f=o.filter(u=>u.id!==m.id);n(f)},width:20,height:20,fill:"#C12A2A"})]})]},m.id)),r&&t.jsxRuntimeExports.jsx(Ee,{activeButton:r,setActiveButton:e,popupPosition:s}),c&&t.jsxRuntimeExports.jsxs(t.Button,{className:V.button,size:"s",onClick:()=>{const m=[...o];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),n(m)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Ve=d=>{const{isActiveButtons:o,setIsActiveButtons:n,buttons:i,setButtons:c}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:q.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{className:q.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:r=>n(r)})]}),t.jsxRuntimeExports.jsx(et,{buttons:i,setButtons:c})]})})},Ge="_wrapper_tn7gb_1",Ue="_subtitle_tn7gb_7",Xe="_content_tn7gb_14",Ye="_range_tn7gb_21",Je="_track_tn7gb_26",Ke="_progress_tn7gb_35",Qe="_dots_tn7gb_45",We="_dot_tn7gb_45",Ze="_active_tn7gb_62",ts="_input_tn7gb_74",es="_countBlock_tn7gb_88",ss="_count_tn7gb_88",ns="_controls_tn7gb_103",os="_button_tn7gb_108",E={wrapper:Ge,subtitle:Ue,content:Xe,range:Ye,track:Je,progress:Ke,dots:Qe,dot:We,active:Ze,input:ts,countBlock:es,count:ss,controls:ns,button:os},st=d=>{const{label:o,min:n=1,max:i=4,step:c=1,count:r,setCount:e}=d,[s,l]=p.useState(!1),R=Array.from({length:(i-n)/c+1}),m=(r-n)/(i-n)*100,f=()=>{r<i&&e(r+c)},u=()=>{r>n&&e(r-c)},y=j=>{const _=n+j*c;e(_)};return t.jsxRuntimeExports.jsxs("div",{className:E.wrapper,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:E.subtitle,children:o}),t.jsxRuntimeExports.jsxs("div",{className:E.content,children:[t.jsxRuntimeExports.jsxs("div",{className:E.range,children:[t.jsxRuntimeExports.jsx("div",{className:E.track}),t.jsxRuntimeExports.jsx("div",{className:E.progress,style:{width:`${m}%`}}),t.jsxRuntimeExports.jsx("div",{className:E.dots,children:R.map((j,_)=>{const w=_<=(r-n)/c;return t.jsxRuntimeExports.jsx("button",{onClick:()=>y(_),className:t.clx(E.dot,{[E.active]:w,[E.inactive]:!w,[E.dragging]:s}),"aria-label":`Set value to ${n+_*c}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:n,max:i,step:c,value:r,onChange:j=>e(Number(j.target.value)),onMouseDown:()=>l(!0),onMouseUp:()=>l(!1),onTouchStart:()=>l(!0),onTouchEnd:()=>l(!1),className:E.input})]}),t.jsxRuntimeExports.jsxs("div",{className:E.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:n,max:i,paddingless:!0,onChange:j=>{const _=Number(j);_>i?e(i):_<n?e(n):e(_)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:E.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:f,disabled:r>=i,className:E.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:u,disabled:r<=n,className:E.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},is="_subtitle_1nl8x_1",cs="_header_1nl8x_8",rs="_text_1nl8x_9",as="_productsBlock_1nl8x_10",ls="_top_1nl8x_22",xs="_itemsBlock_1nl8x_29",us="_typeTexts_1nl8x_35",ds="_block_1nl8x_41",ms="_active_1nl8x_52",ps="_products_1nl8x_10",_s="_product_1nl8x_10",hs="_button_1nl8x_70",js="_image_1nl8x_80",gs="_info_1nl8x_87",bs="_name_1nl8x_98",fs="_buttons_1nl8x_102",Rs="_modal_1nl8x_108",vs="_link_1nl8x_126",Es="_modalOptions_1nl8x_132",I={subtitle:is,header:cs,text:rs,productsBlock:as,top:ls,itemsBlock:xs,typeTexts:us,block:ds,active:ms,products:ps,product:_s,button:hs,image:js,info:gs,name:bs,buttons:fs,modal:Rs,link:vs,modalOptions:Es},ks=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,setIsOpenModal:c}=d;return t.jsxRuntimeExports.jsxs("div",{className:I.modal,onClick:r=>{r.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{c(!1),n(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:I.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:r=>{const e={...o,images:r,imagePath:r[0]};n(e)}})})]})},ys=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${I.product} ${r?I.dragging:""}`,children:i})},$s=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsOptions:j}=d,[_,w]=p.useState(null),[G,U]=p.useState({top:0,left:0}),[M,B]=p.useState(!1),A=(x,g)=>{const N=[...i],[v]=N.splice(x,1);N.splice(g,0,v),c(N)};p.useEffect(()=>{const x=()=>{w(null),B(!1)};return document.body.addEventListener("click",x),w(null),B(!1),()=>{w(null),B(!1),document.body.removeEventListener("click",x)}},[]),p.useEffect(()=>{if(_){const x=[...i].map(g=>g.id===_.id?_:g);c(x)}},[_]);const O=(x,g)=>{x.stopPropagation();const N=x.target.getBoundingClientRect(),v=100,L=window.innerHeight;let P=N.top+window.scrollY;P+v>L&&(P=L-v-20),B(!0),U({top:P-80,left:N.left-30}),w(g)};function Y(x){if(m)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=(x,g)=>{const N=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const L=[...i],P=Number(v.split(" ")[1]),a=j.find(b=>b.id===P);if(!a)return;const $={...a.productData.stats,newPrice:a.productData.minPrice.amount,oldPrice:a.productData.compareAtPrice.amount},C=L.map(b=>b.id===x.id?{...x,name:v,listingId:P,stats:$}:b);w({...x,name:v,listingId:P}),c([...C])},value:x.name,options:[...j.map(v=>`Product ${v.id}`)],leftAddon:Y(x.images[0])}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>O(v,x)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(v=>v.id!==x.id))})]})]});return R?t.jsxRuntimeExports.jsx(ys,{product:x,index:g,moveProduct:A,children:N},x.id):t.jsxRuntimeExports.jsx("div",{className:I.product,children:N},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:I.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:I.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:x=>n==null?void 0:n(x)})]}),M&&_&&t.jsxRuntimeExports.jsx(ks,{activeItem:_,setActiveItem:w,setIsOpenModal:B,popupPosition:G}),t.jsxRuntimeExports.jsxs("div",{className:I.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((x,g)=>X(x,g))}):i.map((x,g)=>X(x,g)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:I.button,size:"s",onClick:()=>{const x=[...i],g=j[0].id;x.push({name:`Product ${g}`,id:t.v4(),listingId:g,imagePath:"",images:[],stats:{...j[0].productData.stats,newPrice:j[0].productData.minPrice.amount,oldPrice:j[0].productData.compareAtPrice.amount}}),c(x)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(Z,{items:r})]})},Is="_options_163bj_1",ws="_price_163bj_12",Ns="_oldPrice_163bj_18",Cs="_newPrice_163bj_26",Bs="_meta_163bj_33",Ps="_info_163bj_39",Ts="_infoRight_163bj_46",Ss="_buttons_163bj_52",As="_variants_163bj_59",Os="_variant_163bj_59",Ds="_stock_163bj_74",Ls="_variantInfo_163bj_81",qs="_quantity_163bj_87",Ms="_count_163bj_93",Hs="_button_163bj_52",zs="_activeVariant_163bj_110",Fs="_chargeTypes_163bj_114",Vs="_charge_163bj_114",Gs="_chargeActive_163bj_131",h={options:Is,price:ws,oldPrice:Ns,newPrice:Cs,meta:Bs,info:Ps,infoRight:Ts,buttons:Ss,variants:As,variant:Os,stock:Ds,variantInfo:Ls,quantity:qs,count:Ms,button:Hs,activeVariant:zs,chargeTypes:Fs,charge:Vs,chargeActive:Gs},Us=d=>{const{variants:o}=d,[n,i]=p.useState(o[0]),[c,r]=p.useState(1);function e(s){if(s>=864e5){const u=Math.floor(s/864e5);return`${u} ${u===1?"day":"days"}`}else if(s>=36e5){const u=Math.floor(s/36e5);return`${u} ${u===1?"hour":"hours"}`}else if(s>=6e4){const u=Math.floor(s/6e4);return`${u} ${u===1?"minute":"minutes"}`}else{const u=Math.floor(s/1e3);return`${u} ${u===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:h.options,children:[t.jsxRuntimeExports.jsx("div",{className:h.chargeTypes,children:n.chargeTypes?n.chargeTypes.map(s=>t.jsxRuntimeExports.jsx("div",{children:s})):t.jsxRuntimeExports.jsx("div",{className:t.clx(h.charge,h.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:h.variants,children:o.map(s=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(h.variant,{[h.activeVariant]:n.id===s.id}),onClick:()=>i(s),children:[t.jsxRuntimeExports.jsxs("div",{className:h.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:h.title,children:s.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",s.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:h.stock,children:[s.quantity.restrictions.max||0," in stock"]})})]}))}),t.jsxRuntimeExports.jsxs("div",{className:h.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c>0?r(s=>s-1):r(0)},className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:h.count,children:c}),t.jsxRuntimeExports.jsx("div",{onClick:()=>r(s=>s+1),className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:h.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:h.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:n.deliveryTime===0?"Instant":e(n.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:h.infoRight,children:n.compareAtPrice&&(n.compareAtPrice.amount||0)-(n.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:h.price,children:[t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]}),t.jsxRuntimeExports.jsxs("span",{className:h.oldPrice,children:["$ ",(n.compareAtPrice.amount||0)*c]})]}):t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",children:"Add to Cart"})]})]})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ve;exports.ItemsSettings=tt;exports.LayoutSettings=vt;exports.ListingSelector=$s;exports.ProductOptions=Us;exports.RangeSelector=st;exports.TextSettings=W;exports.TypesText=Q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Cr8kurIY.cjs"),p=require("react"),nt="_accordion_2tiiw_1",ot="_header_2tiiw_9",it="_icon_2tiiw_16",ct="_open_2tiiw_19",rt="_content_2tiiw_23",z={accordion:nt,header:ot,icon:it,open:ct,content:rt},at=({title:d,content:o})=>{const[n,i]=p.useState(!1),[c,r]=p.useState(0),e=p.useRef(null),s=()=>{i(!n)};return p.useEffect(()=>{e.current&&r(n?e.current.scrollHeight:0)},[n]),t.jsxRuntimeExports.jsxs("div",{className:z.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:z.header,onClick:s,children:[t.jsxRuntimeExports.jsx("h3",{children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(z.icon,{[z.open]:n}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:e,className:z.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{children:o})})]})},lt="_wrapper_1g82c_2",xt="_alignmentBlock_1g82c_8",ut="_title_1g82c_15",dt="_subtitle_1g82c_22",mt="_alignmentContent_1g82c_29",pt="_alignments_1g82c_35",_t="_alignment_1g82c_8",ht="_circle_1g82c_54",jt="_paddings_1g82c_61",gt="_padding_1g82c_61",bt="_input_1g82c_79",T={wrapper:lt,alignmentBlock:xt,title:ut,subtitle:dt,alignmentContent:mt,alignments:pt,alignment:_t,circle:ht,paddings:jt,padding:gt,input:bt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],vt=d=>{const{alignment:o,padding:n,setPadding:i,setAlignment:c}=d;function r(){switch(o){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function e(s){switch(s){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:T.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:T.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:T.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:T.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:T.alignments,children:ft.map(s=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{c(s)},className:T.alignment,children:[s!==o&&t.jsxRuntimeExports.jsx("div",{className:T.circle}),s===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},s))}),t.jsxRuntimeExports.jsx("div",{className:T.paddings,children:Rt.map(s=>t.jsxRuntimeExports.jsxs("label",{className:T.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:e(s),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(n[s]),onChange:l=>i({...n,[s]:Number(l)}),paddingless:!0,borderless:!0})]}))})]})]})]})},Et="_subtitle_2zbxx_1",kt="_header_2zbxx_8",yt="_text_2zbxx_9",$t="_top_2zbxx_16",It="_itemsBlock_2zbxx_23",F={subtitle:Et,header:kt,text:yt,top:$t,itemsBlock:It},wt="_typeTexts_3zlec_1",Nt="_block_3zlec_7",Ct="_active_3zlec_18",J={typeTexts:wt,block:Nt,active:Ct},Bt=["bold","italic","underline","strike-through","code"],Q=d=>{const{typesText:o,setTypesText:n}=d;function i(c){switch(c){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:J.typeTexts,children:Bt.map(c=>t.jsxRuntimeExports.jsx("div",{className:t.clx(J.block,{[J.active]:o.includes(c)}),onClick:()=>{const r=[...o];if(r.includes(c)){const e=r.filter(s=>s!==c);n(e)}else r.push(c),n(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(c),fill:o.includes(c)?"#252525":"#757575",width:20,height:20})},String(c)))})},W=d=>{const{typesText:o,isActiveText:n,setIsActiveText:i,text:c,setText:r,setTypesText:e,title:s,subtitle:l="Items"}=d;return t.jsxRuntimeExports.jsxs("div",{className:F.text,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:s}),n!==void 0&&i&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:R=>i(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:l}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>r(R),value:c,maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:o,setTypesText:e})]})]})},Pt="_subtitle_11qr1_1",Tt="_header_11qr1_8",St="_text_11qr1_9",At="_productsBlock_11qr1_10",Ot="_top_11qr1_22",Dt="_itemsBlock_11qr1_29",Lt="_typeTexts_11qr1_35",qt="_block_11qr1_41",Mt="_active_11qr1_52",Ht="_products_11qr1_10",zt="_product_11qr1_10",Ft="_button_11qr1_70",Vt="_disabled_11qr1_80",Gt="_image_11qr1_84",Ut="_info_11qr1_91",Xt="_name_11qr1_102",Yt="_buttons_11qr1_106",Jt="_modal_11qr1_112",Kt="_link_11qr1_130",Qt="_modalOptions_11qr1_136",k={subtitle:Pt,header:Tt,text:St,productsBlock:At,top:Ot,itemsBlock:Dt,typeTexts:Lt,block:qt,active:Mt,products:Ht,product:zt,button:Ft,disabled:Vt,image:Gt,info:Ut,name:Xt,buttons:Yt,modal:Jt,link:Kt,modalOptions:Qt},Wt=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,modalOptions:c,setIsOpenModal:r}=d;return t.jsxRuntimeExports.jsxs("div",{className:k.modal,onClick:e=>{e.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{n(null),r(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:k.modalOptions,children:c.map(e=>{if(e.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:s=>{const l={...o,[e.field]:s};n(l)}});if(e.type==="text")return t.jsxRuntimeExports.jsx(W,{typesText:o[e.field.type],setTypesText:s=>{const l={...o,[e.field.type]:s};n(l)},text:o[e.field.text]||"",setText:s=>{const l={...o,[e.field.text]:s};n(l)},subtitle:e.label});if(e.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field]:s};n(l)},value:o[e.field]||"",label:e.label,placeholder:e.placeholder});if(e.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:k.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>{const l={...o,[e.field.text]:s};n(l)},value:o[e.field.text]||"",label:e.inputLabel,placeholder:e.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!o[e.field.switch]||!1,label:e.switchLabel,onChange:s=>{const l={...o,[e.field.switch]:s};n(l)}})]});if(e.type==="list")return t.jsxRuntimeExports.jsx(tt,{items:o[e.field]||[],setItems:s=>{const l={...o,[e.field]:s};n(l)},itemsType:"select",draggable:e.draggable||!1,itemsOptions:e.itemsOptions,deletable:e.deletable||!1,editable:!1,subtitle:e.label});if(e.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:e.itemsOptions,onChange:s=>{const l={...o,[e.field]:s};n(l)},label:e.label,value:o[e.field]||"String",leftAddon:e.leftAddon&&e.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:o[e.field]})})})})]})},Zt="_other_1wtgi_1",te="_subtitle_1wtgi_7",ee="_items_1wtgi_14",K={other:Zt,subtitle:te,items:ee},Z=d=>{const{items:o,title:n="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:K.other,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:n}),t.jsxRuntimeExports.jsx("div",{className:K.items,children:o.map(i=>t.jsxRuntimeExports.jsx(t.Switch,{current:i.isItem,onChange:c=>i.setIsItem(c),label:i.label,hasBackground:!0,paddingless:!1}))})]})},se=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${k.product} ${r?k.dragging:""}`,children:i})},tt=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsPlaceholder:j="",itemsOptions:_,hasRangeSelector:w=!1,rangeSelectorOptions:G,modalOptions:U,addableOptions:M={},limit:B}=d,[A,O]=p.useState(null),[Y,X]=p.useState({top:0,left:0}),[x,g]=p.useState(!1),N=(a,$)=>{const C=[...i],[b]=C.splice(a,1);C.splice($,0,b),c(C)};p.useEffect(()=>{const a=()=>{O(null),g(!1)};return document.body.addEventListener("click",a),O(null),g(!1),()=>{O(null),g(!1),document.body.removeEventListener("click",a)}},[]),p.useEffect(()=>{if(A){const a=[...i].map($=>$.id===A.id?A:$);c(a)}},[A]);const v=(a,$)=>{a.stopPropagation(),g(!0);const C=a.target.getBoundingClientRect(),b=500,H=window.innerHeight;let S=C.top+window.scrollY;S+b>H&&(S=H-b-20),X({top:S-80,left:C.left-30}),O($)};function L(a){if(m)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=(a,$)=>{const C=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);O({...a,name:b}),c([...S])},value:a.name,options:_,leftAddon:L(a.images)}),y==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,name:b}:D);c([...S])},value:a.name,placeholder:j}),y==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:b=>{const S=[...i].map(D=>D.id===a.id?{...a,images:b}:D);c([...S])}}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>v(b,a)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(b=>b.id!==a.id))})]})]});return R?t.jsxRuntimeExports.jsx(se,{product:a,index:$,moveProduct:N,children:C},a.id):t.jsxRuntimeExports.jsx("div",{className:k.product,children:C},a.id)};return t.jsxRuntimeExports.jsxs("div",{className:k.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:k.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:a=>n==null?void 0:n(a)})]}),A&&l&&U&&x&&t.jsxRuntimeExports.jsx(Wt,{activeItem:A,setActiveItem:O,popupPosition:Y,modalOptions:U,setIsOpenModal:g}),w&&G&&t.jsxRuntimeExports.jsx(st,{...G}),t.jsxRuntimeExports.jsxs("div",{className:k.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:k.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((a,$)=>P(a,$))}):i.map((a,$)=>P(a,$)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx(k.button,{[k.disabled]:!!(B&&B<=i.length)}),size:"s",disabled:!!(B&&B<=i.length),onClick:()=>{const a=[...i];y==="select"?a.push({name:_[0]||`Product ${i.length+1}`,id:t.v4(),...M}):y==="input"?a.push({name:"",id:t.v4(),...M}):a.push({name:`Image ${i.length+1}`,id:t.v4(),...M}),c(a)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(Z,{items:r})]})},ne="_subtitle_41klp_1",oe="_header_41klp_8",ie="_text_41klp_9",ce="_productsBlock_41klp_10",re="_buttonsBlock_41klp_11",ae="_top_41klp_21",le="_itemsBlock_41klp_28",xe="_typeTexts_41klp_34",ue="_block_41klp_40",de="_active_41klp_51",me="_products_41klp_10",pe="_product_41klp_10",_e="_button_41klp_11",he="_image_41klp_79",je="_info_41klp_86",ge="_name_41klp_97",be="_buttons_41klp_11",fe="_modal_41klp_107",Re="_other_41klp_124",ve="_options_41klp_130",q={subtitle:ne,header:oe,text:ie,productsBlock:ce,buttonsBlock:re,top:ae,itemsBlock:le,typeTexts:xe,block:ue,active:de,products:me,product:pe,button:_e,image:he,info:je,name:ge,buttons:be,modal:fe,other:Re,options:ve},Ee=d=>{const{activeButton:o,setActiveButton:n,popupPosition:i}=d,[c,r]=p.useState(o.typesText),[e,s]=p.useState(o.destination),[l,R]=p.useState(o.link||""),[m,f]=p.useState(o.text||"");return p.useEffect(()=>{n({...o,...{text:m,link:l,destination:e,typesText:c}})},[c,e,l,m]),t.jsxRuntimeExports.jsxs("div",{className:q.modal,onClick:u=>{u.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>n(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:q.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:u=>s(u),options:["Go to Page","Open Link"],value:e}),e==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>R(u),value:l,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>f(u),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(Q,{typesText:c,setTypesText:r})]})]})},ke="_subtitle_1y5sw_1",ye="_header_1y5sw_8",$e="_text_1y5sw_9",Ie="_productsBlock_1y5sw_10",we="_buttonsBlock_1y5sw_11",Ne="_top_1y5sw_22",Ce="_itemsBlock_1y5sw_29",Be="_typeTexts_1y5sw_35",Pe="_block_1y5sw_41",Te="_active_1y5sw_52",Se="_products_1y5sw_10",Ae="_product_1y5sw_10",Oe="_button_1y5sw_11",De="_image_1y5sw_80",Le="_info_1y5sw_87",qe="_name_1y5sw_98",Me="_buttons_1y5sw_11",He="_modal_1y5sw_108",ze="_other_1y5sw_125",Fe="_options_1y5sw_131",V={subtitle:ke,header:ye,text:$e,productsBlock:Ie,buttonsBlock:we,top:Ne,itemsBlock:Ce,typeTexts:Be,block:Pe,active:Te,products:Se,product:Ae,button:Oe,image:De,info:Le,name:qe,buttons:Me,modal:He,other:ze,options:Fe},et=d=>{const{buttons:o,setButtons:n,deletable:i=!0,addable:c=!0}=d,[r,e]=p.useState(null),[s,l]=p.useState({top:0,left:0});p.useEffect(()=>{const m=()=>{e(null)};return document.body.addEventListener("click",m),e(null),()=>{e(null),document.body.removeEventListener("click",m)}},[]),p.useEffect(()=>{if(r){const m=[...o].map(f=>f.id===r.id?r:f);n(m)}},[r]);const R=(m,f)=>{m.stopPropagation();const u=m.target.getBoundingClientRect(),y=490,j=window.innerHeight;let _=u.top+window.scrollY;_+y>j&&(_=j-y-20),l({top:_,left:u.left-30}),e(f)};return t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Button Type"}),o.map(m=>t.jsxRuntimeExports.jsxs("div",{className:V.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:f=>{const y=[...o].map(j=>j.id===m.id?{...m,type:f}:j);n(y)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:f=>{R(f,m)}}),i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const f=o.filter(u=>u.id!==m.id);n(f)},width:20,height:20,fill:"#C12A2A"})]})]},m.id)),r&&t.jsxRuntimeExports.jsx(Ee,{activeButton:r,setActiveButton:e,popupPosition:s}),c&&t.jsxRuntimeExports.jsxs(t.Button,{className:V.button,size:"s",onClick:()=>{const m=[...o];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),n(m)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Ve=d=>{const{isActiveButtons:o,setIsActiveButtons:n,buttons:i,setButtons:c}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:q.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:q.top,children:[t.jsxRuntimeExports.jsx("h3",{className:q.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:r=>n(r)})]}),t.jsxRuntimeExports.jsx(et,{buttons:i,setButtons:c})]})})},Ge="_wrapper_tn7gb_1",Ue="_subtitle_tn7gb_7",Xe="_content_tn7gb_14",Ye="_range_tn7gb_21",Je="_track_tn7gb_26",Ke="_progress_tn7gb_35",Qe="_dots_tn7gb_45",We="_dot_tn7gb_45",Ze="_active_tn7gb_62",ts="_input_tn7gb_74",es="_countBlock_tn7gb_88",ss="_count_tn7gb_88",ns="_controls_tn7gb_103",os="_button_tn7gb_108",E={wrapper:Ge,subtitle:Ue,content:Xe,range:Ye,track:Je,progress:Ke,dots:Qe,dot:We,active:Ze,input:ts,countBlock:es,count:ss,controls:ns,button:os},st=d=>{const{label:o,min:n=1,max:i=4,step:c=1,count:r,setCount:e}=d,[s,l]=p.useState(!1),R=Array.from({length:(i-n)/c+1}),m=(r-n)/(i-n)*100,f=()=>{r<i&&e(r+c)},u=()=>{r>n&&e(r-c)},y=j=>{const _=n+j*c;e(_)};return t.jsxRuntimeExports.jsxs("div",{className:E.wrapper,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:E.subtitle,children:o}),t.jsxRuntimeExports.jsxs("div",{className:E.content,children:[t.jsxRuntimeExports.jsxs("div",{className:E.range,children:[t.jsxRuntimeExports.jsx("div",{className:E.track}),t.jsxRuntimeExports.jsx("div",{className:E.progress,style:{width:`${m}%`}}),t.jsxRuntimeExports.jsx("div",{className:E.dots,children:R.map((j,_)=>{const w=_<=(r-n)/c;return t.jsxRuntimeExports.jsx("button",{onClick:()=>y(_),className:t.clx(E.dot,{[E.active]:w,[E.inactive]:!w,[E.dragging]:s}),"aria-label":`Set value to ${n+_*c}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:n,max:i,step:c,value:r,onChange:j=>e(Number(j.target.value)),onMouseDown:()=>l(!0),onMouseUp:()=>l(!1),onTouchStart:()=>l(!0),onTouchEnd:()=>l(!1),className:E.input})]}),t.jsxRuntimeExports.jsxs("div",{className:E.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:n,max:i,paddingless:!0,onChange:j=>{const _=Number(j);_>i?e(i):_<n?e(n):e(_)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:E.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:f,disabled:r>=i,className:E.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:u,disabled:r<=n,className:E.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},is="_subtitle_1nl8x_1",cs="_header_1nl8x_8",rs="_text_1nl8x_9",as="_productsBlock_1nl8x_10",ls="_top_1nl8x_22",xs="_itemsBlock_1nl8x_29",us="_typeTexts_1nl8x_35",ds="_block_1nl8x_41",ms="_active_1nl8x_52",ps="_products_1nl8x_10",_s="_product_1nl8x_10",hs="_button_1nl8x_70",js="_image_1nl8x_80",gs="_info_1nl8x_87",bs="_name_1nl8x_98",fs="_buttons_1nl8x_102",Rs="_modal_1nl8x_108",vs="_link_1nl8x_126",Es="_modalOptions_1nl8x_132",I={subtitle:is,header:cs,text:rs,productsBlock:as,top:ls,itemsBlock:xs,typeTexts:us,block:ds,active:ms,products:ps,product:_s,button:hs,image:js,info:gs,name:bs,buttons:fs,modal:Rs,link:vs,modalOptions:Es},ks=d=>{const{activeItem:o,setActiveItem:n,popupPosition:i,setIsOpenModal:c}=d;return t.jsxRuntimeExports.jsxs("div",{className:I.modal,onClick:r=>{r.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{c(!1),n(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:I.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:r=>{const e={...o,images:r,imagePath:r[0]};n(e)}})})]})},ys=d=>{const{index:o,moveProduct:n,children:i}=d,[,c]=t.useDrop({accept:"product",hover(s){s.index!==o&&(n(s.index,o),s.index=o)}}),[{isDragging:r},e]=t.useDrag({type:"product",item:{index:o},collect:s=>({isDragging:s.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:s=>e(c(s)),className:`${I.product} ${r?I.dragging:""}`,children:i})},$s=d=>{const{isActiveItems:o,setIsActiveItems:n,items:i,setItems:c,other:r,title:e,subtitle:s,editable:l=!0,draggable:R=!1,withImage:m=!1,deletable:f=!0,addable:u=!0,itemsType:y,itemsOptions:j}=d,[_,w]=p.useState(null),[G,U]=p.useState({top:0,left:0}),[M,B]=p.useState(!1),A=(x,g)=>{const N=[...i],[v]=N.splice(x,1);N.splice(g,0,v),c(N)};p.useEffect(()=>{const x=()=>{w(null),B(!1)};return document.body.addEventListener("click",x),w(null),B(!1),()=>{w(null),B(!1),document.body.removeEventListener("click",x)}},[]),p.useEffect(()=>{if(_){const x=[...i].map(g=>g.id===_.id?_:g);c(x)}},[_]);const O=(x,g)=>{x.stopPropagation();const N=x.target.getBoundingClientRect(),v=100,L=window.innerHeight;let P=N.top+window.scrollY;P+v>L&&(P=L-v-20),B(!0),U({top:P-80,left:N.left-30}),w(g)};function Y(x){if(m)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=(x,g)=>{const N=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),y==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const L=[...i],P=Number(v.split(" ")[1]),a=j.find(b=>b.id===P);if(!a)return;const $={...a.productData.stats,newPrice:a.productData.minPrice.amount,oldPrice:a.productData.compareAtPrice.amount},C=L.map(b=>b.id===x.id?{...x,name:v,listingId:P,stats:$}:b);w({...x,name:v,listingId:P}),c([...C])},value:x.name,options:[...j.map(v=>`Product ${v.id}`)],leftAddon:Y(x.images[0])}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>O(v,x)}),f&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>c(i.filter(v=>v.id!==x.id))})]})]});return R?t.jsxRuntimeExports.jsx(ys,{product:x,index:g,moveProduct:A,children:N},x.id):t.jsxRuntimeExports.jsx("div",{className:I.product,children:N},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:I.productsBlock,children:[(e||o!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:I.top,children:[e&&t.jsxRuntimeExports.jsx("h3",{className:I.title,children:e}),o!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:x=>n==null?void 0:n(x)})]}),M&&_&&t.jsxRuntimeExports.jsx(ks,{activeItem:_,setActiveItem:w,setIsOpenModal:B,popupPosition:G}),t.jsxRuntimeExports.jsxs("div",{className:I.products,children:[s&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:s}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((x,g)=>X(x,g))}):i.map((x,g)=>X(x,g)),u&&t.jsxRuntimeExports.jsxs(t.Button,{className:I.button,size:"s",onClick:()=>{const x=[...i],g=j[0].id;x.push({name:`Product ${g}`,id:t.v4(),listingId:g,imagePath:"",images:[],stats:{...j[0].productData.stats,newPrice:j[0].productData.minPrice.amount,oldPrice:j[0].productData.compareAtPrice.amount}}),c(x)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(Z,{items:r})]})},Is="_options_163bj_1",ws="_price_163bj_12",Ns="_oldPrice_163bj_18",Cs="_newPrice_163bj_26",Bs="_meta_163bj_33",Ps="_info_163bj_39",Ts="_infoRight_163bj_46",Ss="_buttons_163bj_52",As="_variants_163bj_59",Os="_variant_163bj_59",Ds="_stock_163bj_74",Ls="_variantInfo_163bj_81",qs="_quantity_163bj_87",Ms="_count_163bj_93",Hs="_button_163bj_52",zs="_activeVariant_163bj_110",Fs="_chargeTypes_163bj_114",Vs="_charge_163bj_114",Gs="_chargeActive_163bj_131",h={options:Is,price:ws,oldPrice:Ns,newPrice:Cs,meta:Bs,info:Ps,infoRight:Ts,buttons:Ss,variants:As,variant:Os,stock:Ds,variantInfo:Ls,quantity:qs,count:Ms,button:Hs,activeVariant:zs,chargeTypes:Fs,charge:Vs,chargeActive:Gs},Us=d=>{const{variants:o}=d,[n,i]=p.useState(o[0]),[c,r]=p.useState(1);function e(s){if(s>=864e5){const u=Math.floor(s/864e5);return`${u} ${u===1?"day":"days"}`}else if(s>=36e5){const u=Math.floor(s/36e5);return`${u} ${u===1?"hour":"hours"}`}else if(s>=6e4){const u=Math.floor(s/6e4);return`${u} ${u===1?"minute":"minutes"}`}else{const u=Math.floor(s/1e3);return`${u} ${u===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:h.options,children:[t.jsxRuntimeExports.jsx("div",{className:h.chargeTypes,children:n.chargeTypes?n.chargeTypes.map(s=>t.jsxRuntimeExports.jsx("div",{children:s})):t.jsxRuntimeExports.jsx("div",{className:t.clx(h.charge,h.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:h.variants,children:o.map(s=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(h.variant,{[h.activeVariant]:n.id===s.id}),onClick:()=>i(s),children:[t.jsxRuntimeExports.jsxs("div",{className:h.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:h.title,children:s.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",s.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:h.stock,children:[s.quantity.restrictions.max||0," in stock"]})})]}))}),t.jsxRuntimeExports.jsxs("div",{className:h.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c>0?r(s=>s-1):r(0)},className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:h.count,children:c}),t.jsxRuntimeExports.jsx("div",{onClick:()=>r(s=>s+1),className:h.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:h.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:h.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:n.deliveryTime===0?"Instant":e(n.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:h.infoRight,children:n.compareAtPrice&&(n.compareAtPrice.amount||0)-(n.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:h.price,children:[t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]}),t.jsxRuntimeExports.jsxs("span",{className:h.oldPrice,children:["$ ",(n.compareAtPrice.amount||0)*c]})]}):t.jsxRuntimeExports.jsxs("span",{className:h.newPrice,children:["$ ",(n.price.amount||0)*c]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",children:"Add to Cart"})]})]})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ve;exports.ItemsSettings=tt;exports.LayoutSettings=vt;exports.ListingSelector=$s;exports.ProductOptions=Us;exports.RangeSelector=st;exports.TextSettings=W;exports.TypesText=Q;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as t, c as z, I as h, a as F, S as R, T as ct, C as ot, b as V, D as it, H as at, B as Q, v as K, u as lt, d as rt } from "./index-
|
|
2
|
-
import { h as un, i as _n, f as mn, L as hn, M as pn, P as gn, R as xn, e as bn, g as fn } from "./index-
|
|
1
|
+
import { j as t, c as z, I as h, a as F, S as R, T as ct, C as ot, b as V, D as it, H as at, B as Q, v as K, u as lt, d as rt } from "./index-D4jHAwqq.js";
|
|
2
|
+
import { h as un, i as _n, f as mn, L as hn, M as pn, P as gn, R as xn, e as bn, g as fn } from "./index-D4jHAwqq.js";
|
|
3
3
|
import p from "react";
|
|
4
4
|
const _t = "_accordion_2tiiw_1", mt = "_header_2tiiw_9", ht = "_icon_2tiiw_16", pt = "_open_2tiiw_19", gt = "_content_2tiiw_23", X = {
|
|
5
5
|
accordion: _t,
|