@billgangcom/theme-lib 1.4.0 → 1.6.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/abstractions/IBlock.d.ts +1 -0
- package/dist/builder/index.d.ts +3 -0
- package/dist/builder.cjs.js +5 -10
- package/dist/builder.es.js +1705 -3451
- package/dist/components/Preview/{RenderBlock → Render}/index.d.ts +2 -0
- package/dist/components/Sidebar/Layers/FooterLayer/index.d.ts +1 -0
- package/dist/components/Sidebar/Layers/HeaderLayer/index.d.ts +1 -0
- package/dist/components/Sidebar/Layers/index.d.ts +4 -0
- package/dist/drag-BmBJI4g2.js +5 -0
- package/dist/drag-CRprmRb-.cjs +1 -0
- package/dist/index-2iAZ7WmX.js +3955 -0
- package/dist/index-DSUcxVxJ.cjs +39 -0
- package/dist/shared/lib/api.d.ts +2 -0
- package/dist/shared/ui/Checkbox/index.d.ts +7 -0
- package/dist/shared/ui/Input/index.d.ts +1 -0
- package/dist/shared/ui/index.d.ts +1 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/useChooseImageStore.d.ts +6 -0
- package/dist/store/useLayersStore.d.ts +5 -0
- package/dist/ui/ButtonTypeSettings/index.d.ts +8 -0
- package/dist/ui/ChooseImage/index.d.ts +14 -0
- package/dist/ui/ItemsSettings/index.d.ts +41 -0
- package/dist/ui/ItemsSettings/popup.d.ts +12 -0
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +424 -334
- package/package.json +1 -1
- package/dist/index-DUXD-4un.cjs +0 -34
- package/dist/index-ohEJxZVF.js +0 -1940
- package/dist/ui/ProductSettings/index.d.ts +0 -18
- package/dist/ui/ProductSettings/popup.d.ts +0 -12
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";const B=require("react");function pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var at={exports:{}},_e={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Wt;function vr(){if(Wt)return _e;Wt=1;var e=B,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(c,f,l){var u,m={},S=null,E=null;l!==void 0&&(S=""+l),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(E=f.ref);for(u in f)r.call(f,u)&&!o.hasOwnProperty(u)&&(m[u]=f[u]);if(c&&c.defaultProps)for(u in f=c.defaultProps,f)m[u]===void 0&&(m[u]=f[u]);return{$$typeof:t,type:c,key:S,ref:E,props:m,_owner:s.current}}return _e.Fragment=n,_e.jsx=i,_e.jsxs=i,_e}var we={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Jt;function br(){return Jt||(Jt=1,process.env.NODE_ENV!=="production"&&function(){var e=B,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),g=Symbol.iterator,b="@@iterator";function v(a){if(a===null||typeof a!="object")return null;var h=g&&a[g]||a[b];return typeof h=="function"?h:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(a){{for(var h=arguments.length,y=new Array(h>1?h-1:0),x=1;x<h;x++)y[x-1]=arguments[x];P("error",a,y)}}function P(a,h,y){{var x=w.ReactDebugCurrentFrame,O=x.getStackAddendum();O!==""&&(h+="%s",y=y.concat([O]));var T=y.map(function(C){return String(C)});T.unshift("Warning: "+h),Function.prototype.apply.call(console[a],console,T)}}var F=!1,q=!1,U=!1,K=!1,te=!1,se;se=Symbol.for("react.module.reference");function G(a){return!!(typeof a=="string"||typeof a=="function"||a===r||a===o||te||a===s||a===l||a===u||K||a===E||F||q||U||typeof a=="object"&&a!==null&&(a.$$typeof===S||a.$$typeof===m||a.$$typeof===i||a.$$typeof===c||a.$$typeof===f||a.$$typeof===se||a.getModuleId!==void 0))}function X(a,h,y){var x=a.displayName;if(x)return x;var O=h.displayName||h.name||"";return O!==""?y+"("+O+")":y}function Ve(a){return a.displayName||"Context"}function Z(a){if(a==null)return null;if(typeof a.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var h=a;return Ve(h)+".Consumer";case i:var y=a;return Ve(y._context)+".Provider";case f:return X(a,a.render,"ForwardRef");case m:var x=a.displayName||null;return x!==null?x:Z(a.type)||"Memo";case S:{var O=a,T=O._payload,C=O._init;try{return Z(C(T))}catch{return null}}}return null}var oe=Object.assign,ve=0,xt,Rt,kt,Pt,Ct,Ot,Tt;function jt(){}jt.__reactDisabledLog=!0;function zn(){{if(ve===0){xt=console.log,Rt=console.info,kt=console.warn,Pt=console.error,Ct=console.group,Ot=console.groupCollapsed,Tt=console.groupEnd;var a={configurable:!0,enumerable:!0,value:jt,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}ve++}}function Vn(){{if(ve--,ve===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:oe({},a,{value:xt}),info:oe({},a,{value:Rt}),warn:oe({},a,{value:kt}),error:oe({},a,{value:Pt}),group:oe({},a,{value:Ct}),groupCollapsed:oe({},a,{value:Ot}),groupEnd:oe({},a,{value:Tt})})}ve<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var We=w.ReactCurrentDispatcher,Je;function Pe(a,h,y){{if(Je===void 0)try{throw Error()}catch(O){var x=O.stack.trim().match(/\n( *(at )?)/);Je=x&&x[1]||""}return`
|
|
18
|
+
`+Je+a}}var Ke=!1,Ce;{var Wn=typeof WeakMap=="function"?WeakMap:Map;Ce=new Wn}function At(a,h){if(!a||Ke)return"";{var y=Ce.get(a);if(y!==void 0)return y}var x;Ke=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var T;T=We.current,We.current=null,zn();try{if(h){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(M){x=M}Reflect.construct(a,[],C)}else{try{C.call()}catch(M){x=M}a.call(C.prototype)}}else{try{throw Error()}catch(M){x=M}a()}}catch(M){if(M&&x&&typeof M.stack=="string"){for(var k=M.stack.split(`
|
|
19
|
+
`),L=x.stack.split(`
|
|
20
|
+
`),N=k.length-1,I=L.length-1;N>=1&&I>=0&&k[N]!==L[I];)I--;for(;N>=1&&I>=0;N--,I--)if(k[N]!==L[I]){if(N!==1||I!==1)do if(N--,I--,I<0||k[N]!==L[I]){var J=`
|
|
21
|
+
`+k[N].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),typeof a=="function"&&Ce.set(a,J),J}while(N>=1&&I>=0);break}}}finally{Ke=!1,We.current=T,Vn(),Error.prepareStackTrace=O}var he=a?a.displayName||a.name:"",ie=he?Pe(he):"";return typeof a=="function"&&Ce.set(a,ie),ie}function Jn(a,h,y){return At(a,!1)}function Kn(a){var h=a.prototype;return!!(h&&h.isReactComponent)}function Oe(a,h,y){if(a==null)return"";if(typeof a=="function")return At(a,Kn(a));if(typeof a=="string")return Pe(a);switch(a){case l:return Pe("Suspense");case u:return Pe("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case f:return Jn(a.render);case m:return Oe(a.type,h,y);case S:{var x=a,O=x._payload,T=x._init;try{return Oe(T(O),h,y)}catch{}}}return""}var be=Object.prototype.hasOwnProperty,Nt={},Bt=w.ReactDebugCurrentFrame;function Te(a){if(a){var h=a._owner,y=Oe(a.type,a._source,h?h.type:null);Bt.setExtraStackFrame(y)}else Bt.setExtraStackFrame(null)}function Yn(a,h,y,x,O){{var T=Function.call.bind(be);for(var C in a)if(T(a,C)){var k=void 0;try{if(typeof a[C]!="function"){var L=Error((x||"React class")+": "+y+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw L.name="Invariant Violation",L}k=a[C](h,C,x,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(N){k=N}k&&!(k instanceof Error)&&(Te(O),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",x||"React class",y,C,typeof k),Te(null)),k instanceof Error&&!(k.message in Nt)&&(Nt[k.message]=!0,Te(O),_("Failed %s type: %s",y,k.message),Te(null))}}}var Gn=Array.isArray;function Ye(a){return Gn(a)}function Xn(a){{var h=typeof Symbol=="function"&&Symbol.toStringTag,y=h&&a[Symbol.toStringTag]||a.constructor.name||"Object";return y}}function Zn(a){try{return qt(a),!1}catch{return!0}}function qt(a){return""+a}function It(a){if(Zn(a))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xn(a)),qt(a)}var ye=w.ReactCurrentOwner,Qn={key:!0,ref:!0,__self:!0,__source:!0},Ft,Dt,Ge;Ge={};function er(a){if(be.call(a,"ref")){var h=Object.getOwnPropertyDescriptor(a,"ref").get;if(h&&h.isReactWarning)return!1}return a.ref!==void 0}function tr(a){if(be.call(a,"key")){var h=Object.getOwnPropertyDescriptor(a,"key").get;if(h&&h.isReactWarning)return!1}return a.key!==void 0}function nr(a,h){if(typeof a.ref=="string"&&ye.current&&h&&ye.current.stateNode!==h){var y=Z(ye.current.type);Ge[y]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Z(ye.current.type),a.ref),Ge[y]=!0)}}function rr(a,h){{var y=function(){Ft||(Ft=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};y.isReactWarning=!0,Object.defineProperty(a,"key",{get:y,configurable:!0})}}function sr(a,h){{var y=function(){Dt||(Dt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};y.isReactWarning=!0,Object.defineProperty(a,"ref",{get:y,configurable:!0})}}var or=function(a,h,y,x,O,T,C){var k={$$typeof:t,type:a,key:h,ref:y,props:C,_owner:T};return k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(k,"_self",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.defineProperty(k,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function ir(a,h,y,x,O){{var T,C={},k=null,L=null;y!==void 0&&(It(y),k=""+y),tr(h)&&(It(h.key),k=""+h.key),er(h)&&(L=h.ref,nr(h,O));for(T in h)be.call(h,T)&&!Qn.hasOwnProperty(T)&&(C[T]=h[T]);if(a&&a.defaultProps){var N=a.defaultProps;for(T in N)C[T]===void 0&&(C[T]=N[T])}if(k||L){var I=typeof a=="function"?a.displayName||a.name||"Unknown":a;k&&rr(C,I),L&&sr(C,I)}return or(a,k,L,O,x,ye.current,C)}}var Xe=w.ReactCurrentOwner,Lt=w.ReactDebugCurrentFrame;function fe(a){if(a){var h=a._owner,y=Oe(a.type,a._source,h?h.type:null);Lt.setExtraStackFrame(y)}else Lt.setExtraStackFrame(null)}var Ze;Ze=!1;function Qe(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function Ut(){{if(Xe.current){var a=Z(Xe.current.type);if(a)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+a+"`."}return""}}function ar(a){return""}var Mt={};function cr(a){{var h=Ut();if(!h){var y=typeof a=="string"?a:a.displayName||a.name;y&&(h=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+y+">.")}return h}}function $t(a,h){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var y=cr(h);if(Mt[y])return;Mt[y]=!0;var x="";a&&a._owner&&a._owner!==Xe.current&&(x=" It was passed a child from "+Z(a._owner.type)+"."),fe(a),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,x),fe(null)}}function Ht(a,h){{if(typeof a!="object")return;if(Ye(a))for(var y=0;y<a.length;y++){var x=a[y];Qe(x)&&$t(x,h)}else if(Qe(a))a._store&&(a._store.validated=!0);else if(a){var O=v(a);if(typeof O=="function"&&O!==a.entries)for(var T=O.call(a),C;!(C=T.next()).done;)Qe(C.value)&&$t(C.value,h)}}}function lr(a){{var h=a.type;if(h==null||typeof h=="string")return;var y;if(typeof h=="function")y=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===f||h.$$typeof===m))y=h.propTypes;else return;if(y){var x=Z(h);Yn(y,a.props,"prop",x,a)}else if(h.PropTypes!==void 0&&!Ze){Ze=!0;var O=Z(h);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(a){{for(var h=Object.keys(a.props),y=0;y<h.length;y++){var x=h[y];if(x!=="children"&&x!=="key"){fe(a),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",x),fe(null);break}}a.ref!==null&&(fe(a),_("Invalid attribute `ref` supplied to `React.Fragment`."),fe(null))}}var zt={};function Vt(a,h,y,x,O,T){{var C=G(a);if(!C){var k="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var L=ar();L?k+=L:k+=Ut();var N;a===null?N="null":Ye(a)?N="array":a!==void 0&&a.$$typeof===t?(N="<"+(Z(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):N=typeof a,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",N,k)}var I=ir(a,h,y,O,T);if(I==null)return I;if(C){var J=h.children;if(J!==void 0)if(x)if(Ye(J)){for(var he=0;he<J.length;he++)Ht(J[he],a);Object.freeze&&Object.freeze(J)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ht(J,a)}if(be.call(h,"key")){var ie=Z(a),M=Object.keys(h).filter(function(gr){return gr!=="key"}),et=M.length>0?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}";if(!zt[ie+et]){var mr=M.length>0?"{"+M.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,et,ie,mr,ie),zt[ie+et]=!0}}return a===r?ur(I):lr(I),I}}function dr(a,h,y){return Vt(a,h,y,!0)}function fr(a,h,y){return Vt(a,h,y,!1)}var hr=fr,pr=dr;we.Fragment=r,we.jsx=hr,we.jsxs=pr}()),we}process.env.NODE_ENV==="production"?at.exports=vr():at.exports=br();var p=at.exports;const Kt=e=>{let t;const n=new Set,r=(l,u)=>{const m=typeof l=="function"?l(t):l;if(!Object.is(m,t)){const S=t;t=u??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(E=>E(t,S))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:l=>(n.add(l),()=>n.delete(l))},f=t=e(r,s,c);return c},yr=e=>e?Kt(e):Kt,_r=e=>e;function wr(e,t=_r){const n=B.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return B.useDebugValue(n),n}const Yt=e=>{const t=yr(e),n=r=>wr(t,r);return Object.assign(n,t),n},W=e=>e?Yt(e):Yt,Sr=W(e=>({blocks:{},setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t}))})),Er=W(e=>({currentDevice:"desktop",setCurrentDevice:t=>e(()=>({currentDevice:t}))}));W(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const mn=[{icon:"layers",name:"Layers"},{icon:"plus",name:"Add"},{icon:"palette",name:"Theme"},{icon:"settings",name:"Settings"}],xr=Array.from({length:122/2+1},(e,t)=>String(6+t*2)),Rr=["100","200","300","400","500","600","700","800","900"],kr=["home","reviews","faqs","contact","product","ticket","login"],Pr={home:{path:"/",name:"home",icon:"house",seo:{description:"",title:""},visibility:"public"},product:{path:"/product",name:"product",icon:"squares",seo:{description:"",title:""},visibility:"public"},faqs:{path:"/faqs",name:"faqs",icon:"faqs",seo:{description:"",title:""},visibility:"public"},reviews:{path:"/reviews",name:"reviews",icon:"star",seo:{description:"",title:""},visibility:"public"},contact:{path:"/contact",name:"contact",icon:"chat",seo:{description:"",title:""},visibility:"public"},ticket:{path:"/ticket",name:"ticket",icon:"ticket",seo:{description:"",title:""},visibility:"public"},login:{path:"/login",name:"login",icon:"user-circle-gear",seo:{description:"",title:""},visibility:"public"}},Cr=W(e=>({activeBlock:mn[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function Or(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=f=>f===null?null:JSON.parse(f,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const ct=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ct(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ct(r)(n)}}}},Tr=(e,t)=>(n,r,s)=>{let o={storage:Or(()=>localStorage),partialize:b=>b,version:0,merge:(b,v)=>({...v,...b}),...t},i=!1;const c=new Set,f=new Set;let l=o.storage;if(!l)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...b)},r,s);const u=()=>{const b=o.partialize({...r()});return l.setItem(o.name,{state:b,version:o.version})},m=s.setState;s.setState=(b,v)=>{m(b,v),u()};const S=e((...b)=>{n(...b),u()},r,s);s.getInitialState=()=>S;let E;const g=()=>{var b,v;if(!l)return;i=!1,c.forEach(_=>{var P;return _((P=r())!=null?P:S)});const w=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(b=r())!=null?b:S))||void 0;return ct(l.getItem.bind(l))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var P;const[F,q]=_;if(E=o.merge(q,(P=r())!=null?P:S),n(E,!0),F)return u()}).then(()=>{w==null||w(E,void 0),E=r(),i=!0,f.forEach(_=>_(E))}).catch(_=>{w==null||w(void 0,_)})};return s.persist={setOptions:b=>{o={...o,...b},b.storage&&(l=b.storage)},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:b=>(c.add(b),()=>{c.delete(b)}),onFinishHydration:b=>(f.add(b),()=>{f.delete(b)})},o.skipHydration||g(),E||S},Le=Tr,jr=W(Le(e=>({onPreview:!1,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var D=[];for(var tt=0;tt<256;++tt)D.push((tt+256).toString(16).slice(1));function Ar(e,t=0){return(D[e[t+0]]+D[e[t+1]]+D[e[t+2]]+D[e[t+3]]+"-"+D[e[t+4]]+D[e[t+5]]+"-"+D[e[t+6]]+D[e[t+7]]+"-"+D[e[t+8]]+D[e[t+9]]+"-"+D[e[t+10]]+D[e[t+11]]+D[e[t+12]]+D[e[t+13]]+D[e[t+14]]+D[e[t+15]]).toLowerCase()}var je,Nr=new Uint8Array(16);function Br(){if(!je&&(je=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!je))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return je(Nr)}var qr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Gt={randomUUID:qr};function Ie(e,t,n){if(Gt.randomUUID&&!t&&!e)return Gt.randomUUID();e=e||{};var r=e.random||(e.rng||Br)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ar(r)}const Ir=W(Le((e,t)=>({header:null,blocks:{home:{},contact:{},product:{},faqs:{},reviews:{},ticket:{},login:{}},footer:null,currentBlock:null,positionBlock:null,setHeader:n=>{e({header:n})},setFooter:n=>{e({footer:n})},createPage:n=>{const r=t().blocks;r[n]={},e({blocks:r})},deletePage:n=>{const r=t().blocks;delete r[n],e({blocks:r})},updatePage:(n,r)=>{const s=t().blocks;if(s[r])return;const o=s[n];delete s[n],s[r]=o,e({blocks:s})},setCurrentBlock:n=>{e({currentBlock:n})},setPositionBlock:n=>{e({positionBlock:n})},addBlock:(n,r)=>{const s=t().blocks,o=s[n]||{},i=t().positionBlock,c=Ie(),f=Object.keys(o);if(i===null||i>=f.length)o[c]={name:r.name,value:{...r.value}},e({blocks:{...s,[n]:o}});else{const l={name:r.name,value:{...r.value}},u=f.slice(0,i),m=f.slice(i),S={...u.reduce((E,g)=>(E[g]=o[g],E),{}),[c]:l,...m.reduce((E,g)=>(E[g]=o[g],E),{})};e({blocks:{...s,[n]:S}})}},editBlock:(n,r,s)=>{const o=t().blocks,i=o[n]||{};i[r]={name:s.name,value:{...s.value}},e({blocks:{...o,[n]:i}})},removeBlock:(n,r)=>{const s=t().blocks,o=s[n]||{};delete o[r],e({blocks:{...s,[n]:o}})},moveBlock:(n,r,s)=>e(o=>{const i={...o.blocks[n]},c=Object.keys(i),[f]=c.splice(r,1);c.splice(s,0,f);const l=c.reduce((u,m)=>(u[m]=i[m],u),{});return{blocks:{...o.blocks,[n]:l}}}),duplicateBlock:(n,r)=>{const{blocks:s}=t(),o=s[n],i=o[r],c=Ie(),f={name:i.name,value:{...i.value}},l=Object.keys(o),u=l.indexOf(r),m=l.slice(0,u+1),S=l.slice(u+1),E={...m.reduce((g,b)=>(g[b]=o[b],g),{}),[c]:f,...S.reduce((g,b)=>(g[b]=o[b],g),{})};e({blocks:{...s,[n]:E}})}}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:n,footer:r}=e;return{blocks:t,header:n,footer:r}}})),gn=W((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,showModal:n=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,hoverBlockId:n})},hideModal:()=>{e({isModalVisible:!1,hoverBlockId:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const n=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null})},500);e({hideTimeout:n})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:n=>{e({isMouseOverModal:n})},isPreviewVisible:!1,showPreview:n=>{e({isPreviewVisible:!0,hoverBlockId:n})},hidePreview:()=>{e({isPreviewVisible:!1,hoverBlockId:null})}})),Fr=W(e=>({activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),activeFont:null,setActiveFont:t=>e(()=>({activeFont:t})),themeSettings:{colors:{brand:{primary:"#fefefe",secondary:"#fefefe",toner:"#ffffff"},background:{primary:"#fefefe",secondary:"#000000"},text_icons:{primary:"#000000",secondary:"#fefefe",tertiary:"#fefefe",disabled:"#ffffff"},lines:{divider:"#000000",border:"#fefefe"},others:{link:"#000000"}},fonts:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:48,weight:"400"}}},borders:{radius:52,thickness:52},buttons:{size:26,alignment:"left",radius:32,height:40},inputs:{general:{height:48,name:"Style Name",size:48,color:"black"},field:{active:!0,color:"black",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"black"},label:{height:48,size:48,color:"black",alignment:"left"}}},updateColor:(t,n,r)=>e(s=>{const o={...s.themeSettings.colors,[t]:{...s.themeSettings.colors[t],[n]:r}};return{themeSettings:{...s.themeSettings,colors:o}}}),updateFont:(t,n,r,s)=>e(o=>{const i={...o.themeSettings.fonts,[t]:{...o.themeSettings.fonts[t],[n]:{...o.themeSettings.fonts[t][n],[r]:s}}};return{themeSettings:{...o.themeSettings,fonts:i}}}),updateBorder:(t,n)=>e(r=>{const s={...r.themeSettings.borders,[t]:n};return{themeSettings:{...r.themeSettings,borders:s}}}),updateButton:(t,n)=>e(r=>{const s={...r.themeSettings.buttons,[t]:n};return{themeSettings:{...r.themeSettings,buttons:s}}}),updateInput:(t,n,r)=>e(s=>({themeSettings:{...s.themeSettings,inputs:{...s.themeSettings.inputs,[t]:{...s.themeSettings.inputs[t],[r]:n}}}}))})),Dr=W(Le(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Lr=W(e=>({settings:null,setSettings:t=>e(()=>({settings:t}))})),vn=W()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t}))})),Ur=W(Le((e,t)=>({pages:Pr,currentPage:"home",pageContext:{listings:void 0,products:void 0,reviews:void 0,categories:void 0,faqs:void 0,general:void 0},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:n=>e(()=>({editedPage:n})),setCurrentPage:n=>e(()=>({currentPage:n})),setPageContext:n=>e(()=>({pageContext:n})),setIsOpenModal:n=>e(()=>({isOpenModal:n})),setIsOpenSelectModal:n=>e(()=>({isOpenSelectModal:n})),setIsEdit:n=>e(()=>({isEdit:n})),createPage:n=>{const r=t().pages,s=Ie();r[s]=n,e({pages:r})},updatePage:(n,r)=>{const s=t().pages;s[n]={...r},e({pages:s})},deletePage:n=>{const r=t().pages;delete r[n],e({pages:r})}}),{name:"pages-storage",partialize:e=>{const{pages:t}=e;return{pages:t}}})),vt=W(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t}))})),Mr=(e,t,n)=>{const r=e[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},$r="_icon_21b8w_1",Hr="_hoverable_21b8w_5",Xt={icon:$r,hoverable:Hr};var bn={exports:{}};/*!
|
|
31
|
+
Copyright (c) 2018 Jed Watson.
|
|
32
|
+
Licensed under the MIT License (MIT), see
|
|
33
|
+
http://jedwatson.github.io/classnames
|
|
34
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(o=s(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var c in o)t.call(o,c)&&o[c]&&(i=s(i,c));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(bn);var zr=bn.exports;const z=pn(zr),ee=e=>{const{name:t,fill:n="currentColor",hoverable:r=!1,onClick:s,className:o,width:i,height:c}=e,[f,l]=B.useState(null);return B.useEffect(()=>{(async()=>{try{const{default:m}=await Mr(Object.assign({"../../../assets/icons/align-bottom.svg":()=>Promise.resolve().then(()=>require("./align-bottom-BNcdAnw9.cjs")),"../../../assets/icons/align-center.svg":()=>Promise.resolve().then(()=>require("./align-center-DEANXdAS.cjs")),"../../../assets/icons/align-left.svg":()=>Promise.resolve().then(()=>require("./align-left-Cm-uab8B.cjs")),"../../../assets/icons/align-right.svg":()=>Promise.resolve().then(()=>require("./align-right-3l34PJVv.cjs")),"../../../assets/icons/align-top.svg":()=>Promise.resolve().then(()=>require("./align-top-BGk9vlUd.cjs")),"../../../assets/icons/arrow-down.svg":()=>Promise.resolve().then(()=>require("./arrow-down-BVZ1P_L9.cjs")),"../../../assets/icons/arrow-left.svg":()=>Promise.resolve().then(()=>require("./arrow-left-CXb5pfjn.cjs")),"../../../assets/icons/arrow-preview-down.svg":()=>Promise.resolve().then(()=>require("./arrow-preview-down-DaEiSgZ5.cjs")),"../../../assets/icons/arrow-preview-up.svg":()=>Promise.resolve().then(()=>require("./arrow-preview-up-DaNjYolK.cjs")),"../../../assets/icons/arrow-right.svg":()=>Promise.resolve().then(()=>require("./arrow-right-QxBPnNiY.cjs")),"../../../assets/icons/arrow-square.svg":()=>Promise.resolve().then(()=>require("./arrow-square-BQEpI5Xn.cjs")),"../../../assets/icons/arrow-up-right.svg":()=>Promise.resolve().then(()=>require("./arrow-up-right-BAHL0rjI.cjs")),"../../../assets/icons/border-dashed.svg":()=>Promise.resolve().then(()=>require("./border-dashed-hzn9HgjT.cjs")),"../../../assets/icons/border-solid.svg":()=>Promise.resolve().then(()=>require("./border-solid-7GLUyhD0.cjs")),"../../../assets/icons/cards.svg":()=>Promise.resolve().then(()=>require("./cards-DsOTH3J4.cjs")),"../../../assets/icons/chat.svg":()=>Promise.resolve().then(()=>require("./chat-B_av70HO.cjs")),"../../../assets/icons/check.svg":()=>Promise.resolve().then(()=>require("./check-b4m73KG0.cjs")),"../../../assets/icons/copy.svg":()=>Promise.resolve().then(()=>require("./copy-D4o494-8.cjs")),"../../../assets/icons/corners-out.svg":()=>Promise.resolve().then(()=>require("./corners-out-4-FEW-w_.cjs")),"../../../assets/icons/desktop.svg":()=>Promise.resolve().then(()=>require("./desktop-BaS7MtSb.cjs")),"../../../assets/icons/drag.svg":()=>Promise.resolve().then(()=>require("./drag-CRprmRb-.cjs")),"../../../assets/icons/faqs.svg":()=>Promise.resolve().then(()=>require("./faqs-BqOuvjUH.cjs")),"../../../assets/icons/file.svg":()=>Promise.resolve().then(()=>require("./file-8wBLPxbL.cjs")),"../../../assets/icons/font.svg":()=>Promise.resolve().then(()=>require("./font-DkMBoXe1.cjs")),"../../../assets/icons/globe.svg":()=>Promise.resolve().then(()=>require("./globe-Dc76Xp4l.cjs")),"../../../assets/icons/heading.svg":()=>Promise.resolve().then(()=>require("./heading-CPq36T7M.cjs")),"../../../assets/icons/house.svg":()=>Promise.resolve().then(()=>require("./house-CZ2u4ZpK.cjs")),"../../../assets/icons/image.svg":()=>Promise.resolve().then(()=>require("./image-Bx3xvWOB.cjs")),"../../../assets/icons/info-circle.svg":()=>Promise.resolve().then(()=>require("./info-circle-DxyEtmA8.cjs")),"../../../assets/icons/layers.svg":()=>Promise.resolve().then(()=>require("./layers-D-nS2yjm.cjs")),"../../../assets/icons/lock.svg":()=>Promise.resolve().then(()=>require("./lock-BmgYa3ZA.cjs")),"../../../assets/icons/mobile.svg":()=>Promise.resolve().then(()=>require("./mobile-jT12AeF2.cjs")),"../../../assets/icons/paint.svg":()=>Promise.resolve().then(()=>require("./paint-onR-PyLb.cjs")),"../../../assets/icons/palette.svg":()=>Promise.resolve().then(()=>require("./palette-BOR3Eq6r.cjs")),"../../../assets/icons/paragraph.svg":()=>Promise.resolve().then(()=>require("./paragraph-BYRArpHX.cjs")),"../../../assets/icons/plus.svg":()=>Promise.resolve().then(()=>require("./plus-7zIw2qu6.cjs")),"../../../assets/icons/radius.svg":()=>Promise.resolve().then(()=>require("./radius-CRLmETG0.cjs")),"../../../assets/icons/redo.svg":()=>Promise.resolve().then(()=>require("./redo-C-M_xJyP.cjs")),"../../../assets/icons/search.svg":()=>Promise.resolve().then(()=>require("./search-kPFRd0TJ.cjs")),"../../../assets/icons/settings.svg":()=>Promise.resolve().then(()=>require("./settings-BqG-9m9d.cjs")),"../../../assets/icons/sign-out.svg":()=>Promise.resolve().then(()=>require("./sign-out-vR-y-Fk7.cjs")),"../../../assets/icons/sliders.svg":()=>Promise.resolve().then(()=>require("./sliders-CsvSCMlf.cjs")),"../../../assets/icons/squares.svg":()=>Promise.resolve().then(()=>require("./squares-BaUyzSBO.cjs")),"../../../assets/icons/star.svg":()=>Promise.resolve().then(()=>require("./star-DX6bHsl_.cjs")),"../../../assets/icons/tablet.svg":()=>Promise.resolve().then(()=>require("./tablet-BvEDp-eu.cjs")),"../../../assets/icons/text-align-left.svg":()=>Promise.resolve().then(()=>require("./text-align-left-BLq4Pvg1.cjs")),"../../../assets/icons/text-bold.svg":()=>Promise.resolve().then(()=>require("./text-bold-BqCslwM8.cjs")),"../../../assets/icons/text-code.svg":()=>Promise.resolve().then(()=>require("./text-code-CdpLXZEo.cjs")),"../../../assets/icons/text-italic.svg":()=>Promise.resolve().then(()=>require("./text-italic-DgM86CDI.cjs")),"../../../assets/icons/text-strike-through.svg":()=>Promise.resolve().then(()=>require("./text-strike-through-DUrcRZUF.cjs")),"../../../assets/icons/text-underline.svg":()=>Promise.resolve().then(()=>require("./text-underline-CwR9adlS.cjs")),"../../../assets/icons/textbox.svg":()=>Promise.resolve().then(()=>require("./textbox-CeYJQP_1.cjs")),"../../../assets/icons/thickness.svg":()=>Promise.resolve().then(()=>require("./thickness-DSnQHY5N.cjs")),"../../../assets/icons/ticket.svg":()=>Promise.resolve().then(()=>require("./ticket-BFI6P_1c.cjs")),"../../../assets/icons/trash.svg":()=>Promise.resolve().then(()=>require("./trash-Cy0hsvys.cjs")),"../../../assets/icons/undo.svg":()=>Promise.resolve().then(()=>require("./undo-D2eH1UgJ.cjs")),"../../../assets/icons/user-circle-gear.svg":()=>Promise.resolve().then(()=>require("./user-circle-gear-DeMV7Apx.cjs")),"../../../assets/icons/x.svg":()=>Promise.resolve().then(()=>require("./x-DW1UBLIF.cjs")),"../../../assets/icons/zoom-minus.svg":()=>Promise.resolve().then(()=>require("./zoom-minus-TiFzxDhk.cjs"))}),`../../../assets/icons/${t}.svg`,6);l(()=>m)}catch{console.error(`Icon "${t}" not found in assets.`),l(null)}})()},[t]),f?p.jsx(f,{fill:n,style:{"--icon-fill":n},className:z(Xt.icon,o,{[Xt.hoverable]:r}),onClick:s,width:i||"24",height:c||"24"}):null},Vr="_button_rcjso_1",Wr={button:Vr},lt=e=>{const{children:t,onClick:n,style:r,className:s,disabled:o=!1,size:i="m"}=e;return p.jsx("button",{className:z(Wr.button,s),onClick:n,style:{...r,fontSize:i==="m"?14:i==="s"?12:16},disabled:o,children:t})},Jr="_wrapper_1q8v6_1",Kr="_label_1q8v6_9",Yr="_input_1q8v6_17",Gr="_required_1q8v6_36",Xr="_paddingless_1q8v6_40",Zr="_content_1q8v6_44",pe={wrapper:Jr,label:Kr,input:Yr,required:Gr,paddingless:Xr,content:Zr},Qr=e=>{const{onChange:t,label:n,value:r,type:s,min:o,placeholder:i,disabled:c=!1,required:f=!1,regex:l,paddingless:u=!1,editable:m=!1}=e,[S,E]=B.useState(!1);function g(v){return Number(v)<0?"0":v}function b(v){return!f||!l?!0:new RegExp(l).test(v)}return p.jsxs("div",{className:pe.wrapper,children:[n&&p.jsx("label",{className:pe.label,htmlFor:n,children:n}),p.jsxs("div",{className:pe.content,children:[p.jsx("input",{id:n,type:s||"text",onChange:v=>{if(s==="text")t(v.target.value);else{const w=g(v.target.value);t(w)}},value:r,autoComplete:"off",placeholder:i,className:z(pe.input,{[pe.required]:S&&f&&!b(r),[pe.paddingless]:u}),min:s==="number"?o:void 0,disabled:c,onFocus:()=>E(!0)}),m&&p.jsx("div",{children:p.jsx(ee,{name:"sliders",width:20,height:20,hoverable:!0})})]})]})},es="_wrapper_1v1ye_1",ts="_label_1v1ye_9",ns="_select_1v1ye_17",rs="_icon_1v1ye_30",ss="_rotate_1v1ye_34",os="_content_1v1ye_38",is="_options_1v1ye_42",as="_option_1v1ye_42",cs="_addon_1v1ye_66",ne={wrapper:es,label:ts,select:ns,icon:rs,rotate:ss,content:os,options:is,option:as,addon:cs},ls=e=>{const{leftAddon:t,onChange:n,label:r,value:s,options:o,style:i}=e,[c,f]=B.useState(!1);function l(u){n(u),f(!1)}return B.useEffect(()=>{const u=()=>{f(!1)};return u(),document.body.addEventListener("click",u),()=>{document.body.removeEventListener("click",u)}},[]),p.jsxs("div",{className:ne.wrapper,style:{...i},children:[r&&p.jsx("label",{className:ne.label,htmlFor:r,children:r}),p.jsxs("div",{className:ne.content,onClick:u=>u.stopPropagation(),children:[p.jsxs("div",{className:ne.select,onClick:()=>f(u=>!u),children:[p.jsxs("div",{className:ne.addon,children:[t,p.jsx("span",{children:s})]}),p.jsx(ee,{name:"arrow-down",className:z(ne.icon,{[ne.rotate]:c})})]}),c&&p.jsx("div",{className:ne.options,onClick:()=>f(!1),children:o.filter(u=>u!==s).map(u=>p.jsx("div",{className:ne.option,onClick:()=>l(u),children:u},u))})]})]})},us="_wrapper_3w2ni_1",ds="_active_3w2ni_24",fs="_toggle_3w2ni_27",hs="_background_3w2ni_39",ps="_padding_3w2ni_43",Q={wrapper:us,switch:"_switch_3w2ni_13",active:ds,toggle:fs,background:hs,padding:ps},ms=e=>{const{onChange:t,style:n,current:r,label:s,hasBackground:o=!1,paddingless:i=!0}=e,[c,f]=B.useState(r),l=()=>{f(u=>!u),t==null||t(!c)};return p.jsx(p.Fragment,{children:s?p.jsxs("div",{className:z(Q.wrapper,{[Q.background]:o,[Q.padding]:!i}),children:[p.jsx("div",{className:z(Q.switch,{[Q.active]:c}),onClick:l,style:n,children:p.jsx("div",{className:Q.toggle})}),p.jsx("span",{className:Q.value,children:s})]}):p.jsx("div",{className:z(Q.switch,{[Q.active]:c}),onClick:l,style:n,children:p.jsx("div",{className:Q.toggle})})})},gs="_wrapper_1inu5_1",vs={wrapper:gs},bs=({children:e})=>{const{hoverBlockId:t,startHideTimeout:n,clearHideTimeout:r,setMouseOverModal:s}=gn();return t?p.jsx("div",{className:vs.wrapper,onMouseEnter:()=>{r(),s(!0)},onMouseLeave:()=>{s(!1),n()},children:e}):null},ys="_blocks_1op3c_1",_s="_block_1op3c_1",ws="_active_1op3c_18",nt={blocks:ys,block:_s,active:ws},Ss=e=>{const{items:t,selectedItem:n,onSelect:r,getIconName:s}=e;return p.jsx("div",{className:nt.blocks,children:t.map(o=>p.jsx("div",{className:z(nt.block,{[nt.active]:n===o}),onClick:()=>r(o),children:p.jsx(ee,{name:s(o),fill:n===o?"#252525":"#757575"})},String(o)))})},Es="_applyButton_1cqw4_2",xs="_cancelButton_1cqw4_7",Rs="_content_1cqw4_12",ks="_label_1cqw4_18",Ps="_colorValue_1cqw4_30",Cs="_modal_1cqw4_37",Os="_colorMap_1cqw4_56",Ts="_indicator_1cqw4_64",js="_hueSlider_1cqw4_73",As="_slider_1cqw4_102",Ns="_buttons_1cqw4_107",Bs="_name_1cqw4_113",qs="_secondary_1cqw4_118",Is="_input_1cqw4_126",ce={applyButton:Es,cancelButton:xs,content:Rs,label:ks,colorValue:Ps,modal:Cs,colorMap:Os,indicator:Ts,hueSlider:js,slider:As,buttons:Ns,name:Bs,secondary:qs,input:Is},Fs=e=>{const{initialColor:t,onChange:n,title:r,labelStyle:s="primary"}=e,[o,i]=B.useState(t),{setActiveLabel:c,setModalPosition:f,setInitialColor:l,setShowModal:u,setUpdate:m,setColor:S,setColorChange:E,colorChange:g}=vn();B.useEffect(()=>{const v=()=>{u(!1),c(null),l(t),m(()=>{}),S(t),E(()=>{})};return document.body.addEventListener("click",v),()=>{document.body.removeEventListener("click",v)}},[]);const b=v=>{v.stopPropagation(),u(!0),E(i),m(n),l(t),S(o);const w=v.currentTarget.getBoundingClientRect(),_=400,P=288,F=10,q=20,U=window.innerHeight-w.bottom,K=w.top,te=window.innerWidth-w.right,se=w.left;let G,X;G=w.bottom+F+window.scrollY,X=w.left,(U<_||U<q)&&(K>=_?G=w.top-_-F+window.scrollY:G=window.scrollY+(window.innerHeight-_)/2),te<P&&(se>=P?X=w.right-P:X=(window.innerWidth-P)/2),X<w.right&&X+P>w.left&&G<w.bottom&&G+_>w.top&&(te>=P?X=w.right+F+100:U>=_?G=w.bottom+F+window.scrollY:(G=window.scrollY+(window.innerHeight-_)/2,X=(window.innerWidth-P)/2)),f({top:G,left:X})};return p.jsxs("div",{className:ce.content,children:[p.jsx("span",{className:z(ce.name,{[ce.secondary]:s==="secondary"}),children:r}),p.jsxs("label",{htmlFor:"color",className:ce.label,children:[p.jsx("div",{className:ce.colorValue,style:{background:o},onClick:b}),p.jsx("input",{type:"text",defaultValue:o,value:o,onChange:v=>{const w=v.target.value;n(w),S(w),i(w),g(w)},className:ce.input})]})]})},Ds="_modal_1qb2a_1",Ls={modal:Ds},Us=e=>{const{close:t,children:n}=e;return B.useEffect(()=>{const r=()=>{t(!1)};return document.body.addEventListener("click",r),()=>{document.body.removeEventListener("click",r)}},[]),p.jsx("div",{className:Ls.modal,children:n})},Ms="_wrapper_1qvfi_1",$s="_label_1qvfi_10",Hs="_textarea_1qvfi_18",zs="_length_1qvfi_33",Ae={wrapper:Ms,label:$s,textarea:Hs,length:zs},Vs=e=>{const{onChange:t,label:n,value:r,maxLength:s,placeholder:o}=e,[i,c]=B.useState(r.length);return p.jsxs("div",{className:Ae.wrapper,children:[n&&p.jsx("label",{className:Ae.label,htmlFor:n,children:n}),p.jsx("textarea",{id:n,defaultValue:r,onChange:f=>{c(f.target.value.length),t(f.target.value)},placeholder:o,className:Ae.textarea,maxLength:s}),s&&p.jsxs("div",{className:Ae.length,children:[i,"/",s]})]})},Ws="_wrapper_1fcne_2",Js="_label_1fcne_10",Ks="_options_1fcne_18",Ys="_radioLabel_1fcne_23",Gs="_radio_1fcne_23",Xs="_custom_1fcne_36",Zs="_option_1fcne_18",ae={wrapper:Ws,label:Js,options:Ks,radioLabel:Ys,radio:Gs,custom:Xs,option:Zs},Qs=e=>{const{defaultValue:t,options:n,onChange:r,label:s}=e,[o,i]=B.useState(t),c=f=>{const l=f.target.value;i(l),r(l)};return p.jsxs("div",{className:ae.wrapper,children:[p.jsx("span",{className:ae.label,children:s}),p.jsx("div",{className:ae.options,children:n.map(f=>p.jsxs("label",{className:ae.radioLabel,children:[p.jsx("input",{type:"radio",value:f.value,checked:o===f.value,onChange:c,className:ae.radio}),p.jsx("span",{className:ae.custom}),p.jsx("span",{className:ae.option,children:f.label})]},f.value))})]})},eo="_tip_pl6k0_1",to="_text_pl6k0_9",no="_warning_pl6k0_15",ro="_error_pl6k0_20",so="_hide_pl6k0_25",Se={tip:eo,text:to,warning:no,error:ro,hide:so},oo=e=>{const{type:t,message:n,style:r}=e,[s,o]=B.useState(!1);return p.jsxs("div",{className:z(Se.tip,{[Se.warning]:t==="warning",[Se.error]:t==="error",[Se.hide]:s}),style:r,children:[p.jsx("div",{children:p.jsx(ee,{name:"info-circle",fill:t==="warning"?"#C1972A":"#FF3F19",width:20,height:20})}),p.jsx("div",{className:Se.text,children:n}),p.jsx("div",{children:p.jsx(ee,{name:"x",fill:t==="warning"?"#C1972A":"#FF3F19",width:20,height:20,hoverable:!0,onClick:()=>o(!0)})})]})},io="_customCheckbox_1b69m_1",ao="_checkboxBox_1b69m_7",co="_checked_1b69m_16",lo="_icon_1b69m_21",Ne={customCheckbox:io,checkboxBox:ao,checked:co,icon:lo},yn=e=>{const{value:t,onChange:n}=e,[r,s]=B.useState(t),o=()=>{s(!r),n(!r)};return p.jsxs("label",{className:Ne.customCheckbox,children:[p.jsx("input",{type:"checkbox",checked:r,onChange:o,style:{display:"none"}}),p.jsx("span",{className:z(Ne.checkboxBox,{[Ne.checked]:r})}),r&&p.jsx("div",{className:Ne.icon,children:p.jsx(ee,{name:"check",width:14,height:14,fill:"#ff3f19"})})]})};function _n(e,t){return function(){return e.apply(t,arguments)}}const{toString:uo}=Object.prototype,{getPrototypeOf:bt}=Object,Ue=(e=>t=>{const n=uo.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Y=e=>(e=e.toLowerCase(),t=>Ue(t)===e),Me=e=>t=>typeof t===e,{isArray:me}=Array,xe=Me("undefined");function fo(e){return e!==null&&!xe(e)&&e.constructor!==null&&!xe(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wn=Y("ArrayBuffer");function ho(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wn(e.buffer),t}const po=Me("string"),V=Me("function"),Sn=Me("number"),$e=e=>e!==null&&typeof e=="object",mo=e=>e===!0||e===!1,Be=e=>{if(Ue(e)!=="object")return!1;const t=bt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},go=Y("Date"),vo=Y("File"),bo=Y("Blob"),yo=Y("FileList"),_o=e=>$e(e)&&V(e.pipe),wo=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||V(e.append)&&((t=Ue(e))==="formdata"||t==="object"&&V(e.toString)&&e.toString()==="[object FormData]"))},So=Y("URLSearchParams"),[Eo,xo,Ro,ko]=["ReadableStream","Request","Response","Headers"].map(Y),Po=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Re(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),me(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function En(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xn=e=>!xe(e)&&e!==le;function ut(){const{caseless:e}=xn(this)&&this||{},t={},n=(r,s)=>{const o=e&&En(t,s)||s;Be(t[o])&&Be(r)?t[o]=ut(t[o],r):Be(r)?t[o]=ut({},r):me(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Re(arguments[r],n);return t}const Co=(e,t,n,{allOwnKeys:r}={})=>(Re(t,(s,o)=>{n&&V(s)?e[o]=_n(s,n):e[o]=s},{allOwnKeys:r}),e),Oo=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),To=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},jo=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&bt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ao=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},No=e=>{if(!e)return null;if(me(e))return e;let t=e.length;if(!Sn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Bo=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&bt(Uint8Array)),qo=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Io=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Fo=Y("HTMLFormElement"),Do=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Zt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Lo=Y("RegExp"),Rn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Re(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Uo=e=>{Rn(e,(t,n)=>{if(V(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(V(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Mo=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return me(e)?r(e):r(String(e).split(t)),n},$o=()=>{},Ho=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,rt="abcdefghijklmnopqrstuvwxyz",Qt="0123456789",kn={DIGIT:Qt,ALPHA:rt,ALPHA_DIGIT:rt+rt.toUpperCase()+Qt},zo=(e=16,t=kn.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Vo(e){return!!(e&&V(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Wo=e=>{const t=new Array(10),n=(r,s)=>{if($e(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=me(r)?[]:{};return Re(r,(i,c)=>{const f=n(i,s+1);!xe(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Jo=Y("AsyncFunction"),Ko=e=>e&&($e(e)||V(e))&&V(e.then)&&V(e.catch),Pn=((e,t)=>e?setImmediate:t?((n,r)=>(le.addEventListener("message",({source:s,data:o})=>{s===le&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),le.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",V(le.postMessage)),Yo=typeof queueMicrotask<"u"?queueMicrotask.bind(le):typeof process<"u"&&process.nextTick||Pn,d={isArray:me,isArrayBuffer:wn,isBuffer:fo,isFormData:wo,isArrayBufferView:ho,isString:po,isNumber:Sn,isBoolean:mo,isObject:$e,isPlainObject:Be,isReadableStream:Eo,isRequest:xo,isResponse:Ro,isHeaders:ko,isUndefined:xe,isDate:go,isFile:vo,isBlob:bo,isRegExp:Lo,isFunction:V,isStream:_o,isURLSearchParams:So,isTypedArray:Bo,isFileList:yo,forEach:Re,merge:ut,extend:Co,trim:Po,stripBOM:Oo,inherits:To,toFlatObject:jo,kindOf:Ue,kindOfTest:Y,endsWith:Ao,toArray:No,forEachEntry:qo,matchAll:Io,isHTMLForm:Fo,hasOwnProperty:Zt,hasOwnProp:Zt,reduceDescriptors:Rn,freezeMethods:Uo,toObjectSet:Mo,toCamelCase:Do,noop:$o,toFiniteNumber:Ho,findKey:En,global:le,isContextDefined:xn,ALPHABET:kn,generateString:zo,isSpecCompliantForm:Vo,toJSONObject:Wo,isAsyncFn:Jo,isThenable:Ko,setImmediate:Pn,asap:Yo};function R(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}d.inherits(R,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}});const Cn=R.prototype,On={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{On[e]={value:e}});Object.defineProperties(R,On);Object.defineProperty(Cn,"isAxiosError",{value:!0});R.from=(e,t,n,r,s,o)=>{const i=Object.create(Cn);return d.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),R.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Go=null;function dt(e){return d.isPlainObject(e)||d.isArray(e)}function Tn(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function en(e,t,n){return e?e.concat(t).map(function(s,o){return s=Tn(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Xo(e){return d.isArray(e)&&!e.some(dt)}const Zo=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function He(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,v){return!d.isUndefined(v[b])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(s))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(d.isDate(g))return g.toISOString();if(!f&&d.isBlob(g))throw new R("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(g)||d.isTypedArray(g)?f&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,b,v){let w=g;if(g&&!v&&typeof g=="object"){if(d.endsWith(b,"{}"))b=r?b:b.slice(0,-2),g=JSON.stringify(g);else if(d.isArray(g)&&Xo(g)||(d.isFileList(g)||d.endsWith(b,"[]"))&&(w=d.toArray(g)))return b=Tn(b),w.forEach(function(P,F){!(d.isUndefined(P)||P===null)&&t.append(i===!0?en([b],F,o):i===null?b:b+"[]",l(P))}),!1}return dt(g)?!0:(t.append(en(v,b,o),l(g)),!1)}const m=[],S=Object.assign(Zo,{defaultVisitor:u,convertValue:l,isVisitable:dt});function E(g,b){if(!d.isUndefined(g)){if(m.indexOf(g)!==-1)throw Error("Circular reference detected in "+b.join("."));m.push(g),d.forEach(g,function(w,_){(!(d.isUndefined(w)||w===null)&&s.call(t,w,d.isString(_)?_.trim():_,b,S))===!0&&E(w,b?b.concat(_):[_])}),m.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return E(e),t}function tn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function yt(e,t){this._pairs=[],e&&He(e,this,t)}const jn=yt.prototype;jn.append=function(t,n){this._pairs.push([t,n])};jn.toString=function(t){const n=t?function(r){return t.call(this,r,tn)}:tn;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Qo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function An(e,t,n){if(!t)return e;const r=n&&n.encode||Qo,s=n&&n.serialize;let o;if(s?o=s(t,n):o=d.isURLSearchParams(t)?t.toString():new yt(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class nn{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Nn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ei=typeof URLSearchParams<"u"?URLSearchParams:yt,ti=typeof FormData<"u"?FormData:null,ni=typeof Blob<"u"?Blob:null,ri={isBrowser:!0,classes:{URLSearchParams:ei,FormData:ti,Blob:ni},protocols:["http","https","file","blob","url","data"]},_t=typeof window<"u"&&typeof document<"u",ft=typeof navigator=="object"&&navigator||void 0,si=_t&&(!ft||["ReactNative","NativeScript","NS"].indexOf(ft.product)<0),oi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ii=_t&&window.location.href||"http://localhost",ai=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_t,hasStandardBrowserEnv:si,hasStandardBrowserWebWorkerEnv:oi,navigator:ft,origin:ii},Symbol.toStringTag,{value:"Module"})),$={...ai,...ri};function ci(e,t){return He(e,new $.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return $.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function li(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ui(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Bn(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&d.isArray(s)?s.length:i,f?(d.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!d.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&d.isArray(s[i])&&(s[i]=ui(s[i])),!c)}if(d.isFormData(e)&&d.isFunction(e.entries)){const n={};return d.forEachEntry(e,(r,s)=>{t(li(r),s,n,0)}),n}return null}function di(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const ke={transitional:Nn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=d.isObject(t);if(o&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return s?JSON.stringify(Bn(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ci(t,this.formSerializer).toString();if((c=d.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return He(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),di(t)):t}],transformResponse:[function(t){const n=this.transitional||ke.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?R.from(c,R.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{ke.headers[e]={}});const fi=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hi=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
35
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&fi[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},rn=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function qe(e){return e===!1||e==null?e:d.isArray(e)?e.map(qe):String(e)}function pi(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const mi=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function st(e,t,n,r,s){if(d.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!d.isString(t)){if(d.isString(r))return t.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(t)}}function gi(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function vi(e,t){const n=d.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class H{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,l){const u=Ee(f);if(!u)throw new Error("header name must be a non-empty string");const m=d.findKey(s,u);(!m||s[m]===void 0||l===!0||l===void 0&&s[m]!==!1)&&(s[m||f]=qe(c))}const i=(c,f)=>d.forEach(c,(l,u)=>o(l,u,f));if(d.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(d.isString(t)&&(t=t.trim())&&!mi(t))i(hi(t),n);else if(d.isHeaders(t))for(const[c,f]of t.entries())o(f,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Ee(t),t){const r=d.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return pi(s);if(d.isFunction(n))return n.call(this,s,r);if(d.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ee(t),t){const r=d.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||st(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=Ee(i),i){const c=d.findKey(r,i);c&&(!n||st(r,r[c],c,n))&&(delete r[c],s=!0)}}return d.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||st(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return d.forEach(this,(s,o)=>{const i=d.findKey(r,o);if(i){n[i]=qe(s),delete n[o];return}const c=t?gi(o):String(o).trim();c!==o&&delete n[o],n[c]=qe(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return d.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
36
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[rn]=this[rn]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=Ee(i);r[c]||(vi(s,i),r[c]=!0)}return d.isArray(t)?t.forEach(o):o(t),this}}H.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(H.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});d.freezeMethods(H);function ot(e,t){const n=this||ke,r=t||n,s=H.from(r.headers);let o=r.data;return d.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function qn(e){return!!(e&&e.__CANCEL__)}function ge(e,t,n){R.call(this,e??"canceled",R.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(ge,R,{__CANCEL__:!0});function In(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new R("Request failed with status code "+n.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bi(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yi(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),u=r[o];i||(i=l),n[s]=f,r[s]=l;let m=o,S=0;for(;m!==s;)S+=n[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const E=u&&l-u;return E?Math.round(S*1e3/E):void 0}}function _i(e,t){let n=0,r=1e3/t,s,o;const i=(l,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),m=u-n;m>=r?i(l,u):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-m)))},()=>s&&i(s)]}const Fe=(e,t,n=3)=>{let r=0;const s=yi(50,250);return _i(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),u=i<=c;r=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-i)/l:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},sn=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},on=e=>(...t)=>d.asap(()=>e(...t)),wi=$.hasStandardBrowserEnv?function(){const t=$.navigator&&/(msie|trident)/i.test($.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=d.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),Si=$.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),d.isString(r)&&i.push("path="+r),d.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ei(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xi(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Fn(e,t){return e&&!Ei(t)?xi(e,t):t}const an=e=>e instanceof H?{...e}:e;function de(e,t){t=t||{};const n={};function r(l,u,m){return d.isPlainObject(l)&&d.isPlainObject(u)?d.merge.call({caseless:m},l,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function s(l,u,m){if(d.isUndefined(u)){if(!d.isUndefined(l))return r(void 0,l,m)}else return r(l,u,m)}function o(l,u){if(!d.isUndefined(u))return r(void 0,u)}function i(l,u){if(d.isUndefined(u)){if(!d.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,m){if(m in t)return r(l,u);if(m in e)return r(void 0,l)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(l,u)=>s(an(l),an(u),!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(u){const m=f[u]||s,S=m(e[u],t[u],u);d.isUndefined(S)&&m!==c||(n[u]=S)}),n}const Dn=e=>{const t=de({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=H.from(i),t.url=An(Fn(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(d.isFormData(n)){if($.hasStandardBrowserEnv||$.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...u]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...u].join("; "))}}if($.hasStandardBrowserEnv&&(r&&d.isFunction(r)&&(r=r(t)),r||r!==!1&&wi(t.url))){const l=s&&o&&Si.read(o);l&&i.set(s,l)}return t},Ri=typeof XMLHttpRequest<"u",ki=Ri&&function(e){return new Promise(function(n,r){const s=Dn(e);let o=s.data;const i=H.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,m,S,E,g;function b(){E&&E(),g&&g(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function w(){if(!v)return;const P=H.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),q={data:!c||c==="text"||c==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:P,config:e,request:v};In(function(K){n(K),b()},function(K){r(K),b()},q),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(r(new R("Request aborted",R.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new R("Network Error",R.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let F=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const q=s.transitional||Nn;s.timeoutErrorMessage&&(F=s.timeoutErrorMessage),r(new R(F,q.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,v)),v=null},o===void 0&&i.setContentType(null),"setRequestHeader"in v&&d.forEach(i.toJSON(),function(F,q){v.setRequestHeader(q,F)}),d.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),c&&c!=="json"&&(v.responseType=s.responseType),l&&([S,g]=Fe(l,!0),v.addEventListener("progress",S)),f&&v.upload&&([m,E]=Fe(f),v.upload.addEventListener("progress",m),v.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(u=P=>{v&&(r(!P||P.type?new ge(null,e,v):P),v.abort(),v=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const _=bi(s.url);if(_&&$.protocols.indexOf(_)===-1){r(new R("Unsupported protocol "+_+":",R.ERR_BAD_REQUEST,e));return}v.send(o||null)})},Pi=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof R?u:new ge(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new R(`timeout ${t} of ms exceeded`,R.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>d.asap(c),f}},Ci=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Oi=async function*(e,t){for await(const n of Ti(e))yield*Ci(n,t)},Ti=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},cn=(e,t,n,r)=>{const s=Oi(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let m=u.byteLength;if(n){let S=o+=m;n(S)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ze=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ln=ze&&typeof ReadableStream=="function",ji=ze&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Un=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ai=Ln&&Un(()=>{let e=!1;const t=new Request($.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ln=64*1024,ht=Ln&&Un(()=>d.isReadableStream(new Response("").body)),De={stream:ht&&(e=>e.body)};ze&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!De[t]&&(De[t]=d.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new R(`Response type '${t}' is not supported`,R.ERR_NOT_SUPPORT,r)})})})(new Response);const Ni=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request($.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await ji(e)).byteLength},Bi=async(e,t)=>{const n=d.toFiniteNumber(e.getContentLength());return n??Ni(t)},qi=ze&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:l,headers:u,withCredentials:m="same-origin",fetchOptions:S}=Dn(e);l=l?(l+"").toLowerCase():"text";let E=Pi([s,o&&o.toAbortSignal()],i),g;const b=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let v;try{if(f&&Ai&&n!=="get"&&n!=="head"&&(v=await Bi(u,r))!==0){let q=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(d.isFormData(r)&&(U=q.headers.get("content-type"))&&u.setContentType(U),q.body){const[K,te]=sn(v,Fe(on(f)));r=cn(q.body,ln,K,te)}}d.isString(m)||(m=m?"include":"omit");const w="credentials"in Request.prototype;g=new Request(t,{...S,signal:E,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:w?m:void 0});let _=await fetch(g);const P=ht&&(l==="stream"||l==="response");if(ht&&(c||P&&b)){const q={};["status","statusText","headers"].forEach(se=>{q[se]=_[se]});const U=d.toFiniteNumber(_.headers.get("content-length")),[K,te]=c&&sn(U,Fe(on(c),!0))||[];_=new Response(cn(_.body,ln,K,()=>{te&&te(),b&&b()}),q)}l=l||"text";let F=await De[d.findKey(De,l)||"text"](_,e);return!P&&b&&b(),await new Promise((q,U)=>{In(q,U,{data:F,headers:H.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:g})})}catch(w){throw b&&b(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,e,g),{cause:w.cause||w}):R.from(w,w&&w.code,e,g)}}),pt={http:Go,xhr:ki,fetch:qi};d.forEach(pt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const un=e=>`- ${e}`,Ii=e=>d.isFunction(e)||e===null||e===!1,Mn={getAdapter:e=>{e=d.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Ii(n)&&(r=pt[(i=String(n)).toLowerCase()],r===void 0))throw new R(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
37
|
+
`+o.map(un).join(`
|
|
38
|
+
`):" "+un(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:pt};function it(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ge(null,e)}function dn(e){return it(e),e.headers=H.from(e.headers),e.data=ot.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Mn.getAdapter(e.adapter||ke.adapter)(e).then(function(r){return it(e),r.data=ot.call(e,e.transformResponse,r),r.headers=H.from(r.headers),r},function(r){return qn(r)||(it(e),r&&r.response&&(r.response.data=ot.call(e,e.transformResponse,r.response),r.response.headers=H.from(r.response.headers))),Promise.reject(r)})}const $n="1.7.7",wt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fn={};wt.transitional=function(t,n,r){function s(o,i){return"[Axios v"+$n+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new R(s(i," has been removed"+(n?" in "+n:"")),R.ERR_DEPRECATED);return n&&!fn[i]&&(fn[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Fi(e,t,n){if(typeof e!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new R("option "+o+" must be "+f,R.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new R("Unknown option "+o,R.ERR_BAD_OPTION)}}const mt={assertOptions:Fi,validators:wt},re=mt.validators;class ue{constructor(t){this.defaults=t,this.interceptors={request:new nn,response:new nn}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
39
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=de(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&mt.assertOptions(r,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),s!=null&&(d.isFunction(s)?n.paramsSerializer={serialize:s}:mt.assertOptions(s,{encode:re.function,serialize:re.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&d.merge(o.common,o[n.method]);o&&d.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=H.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(f=f&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,m=0,S;if(!f){const g=[dn.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,l),S=g.length,u=Promise.resolve(n);m<S;)u=u.then(g[m++],g[m++]);return u}S=c.length;let E=n;for(m=0;m<S;){const g=c[m++],b=c[m++];try{E=g(E)}catch(v){b.call(this,v);break}}try{u=dn.call(this,E)}catch(g){return Promise.reject(g)}for(m=0,S=l.length;m<S;)u=u.then(l[m++],l[m++]);return u}getUri(t){t=de(this.defaults,t);const n=Fn(t.baseURL,t.url);return An(n,t.params,t.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(t){ue.prototype[t]=function(n,r){return this.request(de(r||{},{method:t,url:n,data:(r||{}).data}))}});d.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(de(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ue.prototype[t]=n(),ue.prototype[t+"Form"]=n(!0)});class St{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new ge(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new St(function(s){t=s}),cancel:t}}}function Di(e){return function(n){return e.apply(null,n)}}function Li(e){return d.isObject(e)&&e.isAxiosError===!0}const gt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gt).forEach(([e,t])=>{gt[t]=e});function Hn(e){const t=new ue(e),n=_n(ue.prototype.request,t);return d.extend(n,ue.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Hn(de(e,s))},n}const j=Hn(ke);j.Axios=ue;j.CanceledError=ge;j.CancelToken=St;j.isCancel=qn;j.VERSION=$n;j.toFormData=He;j.AxiosError=R;j.Cancel=j.CanceledError;j.all=function(t){return Promise.all(t)};j.spread=Di;j.isAxiosError=Li;j.mergeConfig=de;j.AxiosHeaders=H;j.formToJSON=e=>Bn(d.isHTMLForm(e)?new FormData(e):e);j.getAdapter=Mn.getAdapter;j.HttpStatusCode=gt;j.default=j;const Et="https://g-api.billgang.com",Ui=async(e="get",t,n)=>{const r=localStorage.getItem("shopId")||void 0,s=`${Et}/v2/builder/shops/${r}/${t}`,o=localStorage.getItem("accessToken")||void 0;if(e.toUpperCase()==="GET")return(await j.get(s,{headers:{Authorization:`Bearer ${o}`}})).data;e.toUpperCase()==="POST"&&await j.post(s,{...n},{headers:{Authorization:`Bearer ${o}`}}),e.toUpperCase()==="PUT"&&await j.put(s,{...n},{headers:{Authorization:`Bearer ${o}`}})},Mi=async()=>{const e=localStorage.getItem("shopId")||void 0,t=`${Et}/v1/dash/shops/${e}/images`,n=localStorage.getItem("accessToken")||void 0;return(await j.get(t,{headers:{Authorization:`Bearer ${n}`}})).data},$i=async e=>{const t=localStorage.getItem("shopId")||void 0,n=`${Et}/v1/dash/shops/${t}/images`,r=localStorage.getItem("accessToken")||void 0;return(await j.post(n,e,{headers:{Authorization:`Bearer ${r}`,"Content-Type":"multipart/form-data"}})).data},Hi="_wrapper_tm686_2",zi="_label_tm686_9",Vi="_icon_tm686_16",Wi="_text_tm686_26",Ji="_content_tm686_33",Ki="_modal_tm686_43",Yi="_top_tm686_51",Gi="_title_tm686_58",Xi="_modalContent_tm686_65",Zi="_images_tm686_74",Qi="_add_tm686_83",ea="_description_tm686_95",ta="_bottom_tm686_105",na="_cancel_tm686_117",ra="_highlight_tm686_122",sa="_accent_tm686_127",oa="_image_tm686_74",ia="_selected_tm686_141",aa="_checkbox_tm686_145",ca="_loading_tm686_151",la="_spinner_tm686_163",ua="_spin_tm686_163",A={wrapper:Hi,label:zi,icon:Vi,text:Wi,content:Ji,modal:Ki,top:Yi,title:Gi,modalContent:Xi,images:Zi,add:Qi,description:ea,bottom:ta,cancel:na,highlight:ra,accent:sa,image:oa,selected:ia,checkbox:aa,loading:ca,spinner:la,spin:ua},da=e=>{const{label:t}=e,{setOpenModal:n}=vt();return p.jsx(p.Fragment,{children:p.jsxs("div",{className:A.wrapper,onClick:r=>r.stopPropagation(),children:[t&&p.jsx("h4",{className:A.label,children:t}),p.jsxs("div",{onClick:()=>{n(!0)},className:A.content,children:[p.jsx("div",{className:A.icon,children:p.jsx(ee,{name:"plus",width:20,height:20,fill:"#757575"})}),p.jsx("span",{className:A.text,children:"Choose image"})]})]})})},fa=()=>{const{setOpenModal:e}=vt(),t=()=>{var l;(l=n.current)==null||l.click()},n=B.useRef(null),[r,s]=B.useState([]),[o,i]=B.useState(!1),c=async l=>{var g;const u=((g=l.target.files)==null?void 0:g[0])||null;if(!u)return;const m=new FormData;m.append("file",u),i(!0);const{data:S}=await $i(m),E=[...r];E.unshift({...S,cfId:S.path}),s([...E]),i(!1)},f=l=>{const m=[...r].map(S=>S.id===l.id?{...l}:S);s([...m])};return B.useEffect(()=>{(async()=>{const{data:u}=await Mi(),m=u.map(S=>({...S,isSelected:!1}));s(m)})()},[]),p.jsxs("div",{onClick:l=>l.stopPropagation(),className:A.modal,children:[p.jsxs("div",{className:A.top,children:[p.jsx("h4",{className:A.title,children:"Select Image"}),p.jsx(ee,{name:"x",width:20,height:20,hoverable:!0,onClick:()=>e(!1)})]}),p.jsxs("div",{className:A.modalContent,children:[p.jsxs("div",{className:A.top,children:[p.jsx("div",{children:"Search"}),p.jsxs("div",{children:["Selected: ",r.filter(l=>l.isSelected).length," images"]})]}),p.jsxs("div",{className:A.images,children:[p.jsxs("div",{className:A.input,children:[p.jsxs("div",{onClick:t,className:A.add,children:[p.jsx("div",{className:A.icon,children:p.jsx(ee,{name:"plus",width:20,height:20,fill:"#757575"})}),p.jsxs("div",{className:A.description,children:[p.jsx("span",{children:"Drag and drop images here, or "}),p.jsx("span",{className:A.highlight,children:"click to browse"}),p.jsx("br",{}),p.jsx("span",{className:A.accent,children:"up to 10MB."})]})]}),p.jsx("input",{type:"file",ref:n,style:{display:"none"},onChange:c})]}),o&&p.jsx(hn,{}),r.map(l=>p.jsxs("div",{className:z(A.image,{[A.selected]:l.isSelected}),children:[p.jsx("div",{className:A.checkbox,children:p.jsx(yn,{value:l.isSelected,onChange:u=>{f({...l,isSelected:u})}})}),p.jsx("img",{src:`https://imagedelivery.net/${l.cfId}/w=500`,alt:"image",width:"100%",height:"100%"})]},l.id)),r.length===0&&[...new Array(5)].map(()=>p.jsx(hn,{}))]})]}),p.jsxs("div",{className:A.bottom,children:[p.jsx(lt,{className:A.cancel,onClick:()=>e(!1),children:"Cancel"}),p.jsx(lt,{children:"Select"})]})]})},hn=()=>p.jsx("div",{className:A.loading,children:p.jsx("div",{className:A.spinner})});exports.Button=lt;exports.Checkbox=yn;exports.ChooseImage=da;exports.ChooseImageModal=fa;exports.ColorPicker=Fs;exports.Icon=ee;exports.Input=Qr;exports.Modal=Us;exports.Picker=Ss;exports.Radio=Qs;exports.Select=ls;exports.Submodal=bs;exports.Switch=ms;exports.Textarea=Vs;exports.Tip=oo;exports.axios=j;exports.clx=z;exports.defaultPageNames=kr;exports.getDefaultExportFromCjs=pn;exports.jsxRuntimeExports=p;exports.navbarBlocks=mn;exports.sizeOptions=xr;exports.styles=ce;exports.updateSettings=Ui;exports.useBlocksStore=Sr;exports.useChooseImageStore=vt;exports.useColorPickerStore=vn;exports.useDeviceStore=Er;exports.useFontsStore=Dr;exports.useLayersStore=Ir;exports.useNavbarStore=Cr;exports.usePagesStore=Ur;exports.usePreviewStore=jr;exports.useSettingsStore=Lr;exports.useSubmodalStore=gn;exports.useThemeSettingsStore=Fr;exports.v4=Ie;exports.weightOptions=Rr;
|
package/dist/shared/lib/api.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { Method } from 'axios';
|
|
2
2
|
export declare const API_URL = "https://g-api.billgang.com";
|
|
3
3
|
export declare const updateSettings: (method: Method | undefined, endpoint: string, data?: Record<string, any>) => Promise<any>;
|
|
4
|
+
export declare const getImages: () => Promise<any>;
|
|
5
|
+
export declare const updateImages: (formData: FormData) => Promise<any>;
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { IBlock } from '../abstractions';
|
|
1
2
|
interface Block {
|
|
2
3
|
name: string;
|
|
3
4
|
value: any;
|
|
4
5
|
}
|
|
5
6
|
interface Options {
|
|
7
|
+
header: IBlock | null;
|
|
8
|
+
footer: IBlock | null;
|
|
6
9
|
blocks: Record<string, Record<string, Block>>;
|
|
7
10
|
currentBlock: string | null;
|
|
8
11
|
positionBlock: number | null;
|
|
12
|
+
setHeader: (header: IBlock) => void;
|
|
13
|
+
setFooter: (footer: IBlock) => void;
|
|
9
14
|
createPage: (name: string) => void;
|
|
10
15
|
deletePage: (name: string) => void;
|
|
11
16
|
updatePage: (oldName: string, newName: string) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
label?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const ChooseImage: React.FC<Props>;
|
|
6
|
+
export interface Image {
|
|
7
|
+
cfId: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
fileName: string;
|
|
10
|
+
id: number;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const ChooseImageModal: React.FC;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ItemBase {
|
|
3
|
+
image?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Product extends ItemBase {
|
|
8
|
+
}
|
|
9
|
+
export interface Pages extends ItemBase {
|
|
10
|
+
}
|
|
11
|
+
interface CommomPropsBase<T extends ItemBase> {
|
|
12
|
+
isActiveItems: boolean;
|
|
13
|
+
setIsActiveItems: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
|
+
items: T[];
|
|
15
|
+
setItems: React.Dispatch<React.SetStateAction<T[]>>;
|
|
16
|
+
isProductStats?: boolean;
|
|
17
|
+
setIsProductStats?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
+
title?: string;
|
|
19
|
+
subtitle?: string;
|
|
20
|
+
editable?: boolean;
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
withImage?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface SelectProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
25
|
+
itemsType: 'select';
|
|
26
|
+
itemsPlaceholder?: never;
|
|
27
|
+
itemsOptions: string[];
|
|
28
|
+
}
|
|
29
|
+
interface InputProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
30
|
+
itemsType: 'input';
|
|
31
|
+
itemsPlaceholder?: string;
|
|
32
|
+
itemsOptions?: never;
|
|
33
|
+
}
|
|
34
|
+
interface ImageProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
35
|
+
itemsType: 'image';
|
|
36
|
+
itemsPlaceholder?: never;
|
|
37
|
+
itemsOptions?: never;
|
|
38
|
+
}
|
|
39
|
+
type Props<T extends ItemBase> = SelectProps<T> | InputProps<T> | ImageProps<T>;
|
|
40
|
+
export declare const ItemsSettings: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ItemBase } from '.';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface Props<T extends ItemBase> {
|
|
4
|
+
activeItem: T;
|
|
5
|
+
setActiveItem: React.Dispatch<React.SetStateAction<T | null>>;
|
|
6
|
+
popupPosition: {
|
|
7
|
+
top: number;
|
|
8
|
+
left: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const ProductPopup: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from '../shared/ui';
|
|
2
2
|
export * from './LayoutSettings';
|
|
3
3
|
export * from './TextSettings';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './ItemsSettings';
|
|
5
5
|
export * from './ButtonsSettings';
|
|
6
6
|
export * from './TypeTexts';
|
|
7
|
+
export * from './ChooseImage';
|
|
8
|
+
export * from './ButtonTypeSettings';
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DUXD-4un.cjs"),h=require("react"),f="_wrapper_o1bnv_2",P="_alignmentBlock_o1bnv_8",T="_title_o1bnv_16",$="_subtitle_o1bnv_23",C="_alignmentContent_o1bnv_30",S="_alignments_o1bnv_37",I="_alignment_o1bnv_8",A="_circle_o1bnv_56",L="_paddings_o1bnv_63",z="_padding_o1bnv_63",O="_input_o1bnv_81",_={wrapper:f,alignmentBlock:P,title:T,subtitle:$,alignmentContent:C,alignments:S,alignment:I,circle:A,paddings:L,padding:z,input:O},H=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],F=["left","top","right","bottom"],G=a=>{const{alignment:o,padding:u,setPadding:n,setAlignment:x}=a;return t.jsxRuntimeExports.jsxs("div",{className:_.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:_.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:_.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:_.alignments,children:H.map(i=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{x(c=>i)},className:_.alignment,children:[i!==o&&t.jsxRuntimeExports.jsx("div",{className:_.circle}),i===o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},i))}),t.jsxRuntimeExports.jsx("div",{className:_.paddings,children:F.map(i=>t.jsxRuntimeExports.jsxs("label",{className:_.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${i}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(u[i]),onChange:c=>n(j=>({...j,[i]:Number(c)})),paddingless:!0})]}))})]})]})]})},M="_subtitle_2zbxx_1",q="_header_2zbxx_8",D="_text_2zbxx_9",Y="_top_2zbxx_16",J="_itemsBlock_2zbxx_23",v={subtitle:M,header:q,text:D,top:Y,itemsBlock:J},K="_typeTexts_3zlec_1",Q="_block_3zlec_7",U="_active_3zlec_18",k={typeTexts:K,block:Q,active:U},V=["bold","italic","underline","strike-through","code"],w=a=>{const{typeText:o,setTypeText:u}=a;return t.jsxRuntimeExports.jsx("div",{className:k.typeTexts,children:V.map(n=>t.jsxRuntimeExports.jsx("div",{className:t.clx(k.block,{[k.active]:o===n}),onClick:()=>u(x=>n),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${n}`,fill:o===n?"#252525":"#757575",width:20,height:20})},String(n)))})},W=a=>{const{typeText:o,isActiveText:u,setIsActiveText:n,text:x,setText:i,setTypeText:c,title:j,subtitle:g="Items"}=a;return t.jsxRuntimeExports.jsxs("div",{className:v.text,children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{className:v.title,children:j}),t.jsxRuntimeExports.jsx(t.Switch,{current:u,onChange:m=>n(s=>m)})]}),t.jsxRuntimeExports.jsxs("div",{className:v.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:v.subtitle,children:g}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:m=>i(s=>m),value:x,maxLength:150}),t.jsxRuntimeExports.jsx(w,{typeText:o,setTypeText:c})]})]})},X="_subtitle_2l7ty_1",Z="_header_2l7ty_8",tt="_text_2l7ty_9",st="_productsBlock_2l7ty_10",et="_top_2l7ty_22",nt="_itemsBlock_2l7ty_29",ot="_typeTexts_2l7ty_35",it="_block_2l7ty_41",ct="_active_2l7ty_52",lt="_products_2l7ty_10",xt="_product_2l7ty_10",rt="_button_2l7ty_70",at="_image_2l7ty_80",ut="_info_2l7ty_87",pt="_name_2l7ty_98",dt="_buttons_2l7ty_102",mt="_modal_2l7ty_108",_t="_other_2l7ty_125",l={subtitle:X,header:Z,text:tt,productsBlock:st,top:et,itemsBlock:nt,typeTexts:ot,block:it,active:ct,products:lt,product:xt,button:rt,image:at,info:ut,name:pt,buttons:dt,modal:mt,other:_t},jt=a=>{const{activeProduct:o,setActiveProduct:u,popupPosition:n}=a;return t.jsxRuntimeExports.jsxs("div",{className:l.modal,onClick:x=>{x.stopPropagation()},style:{top:`${n.top}px`,left:`${n.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>u(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},ht=a=>{const{isActiveProducts:o,setIsActiveProducts:u,products:n,setProducts:x,isProductStats:i,setIsProductStats:c,title:j="Product",subtitle:g="Products will appear in this section"}=a,[m,s]=h.useState(null),[d,b]=h.useState({top:0,left:0});h.useEffect(()=>{const e=()=>{s(null)};return document.body.addEventListener("click",e),s(null),()=>{s(null),document.body.removeEventListener("click",e)}},[]);const R=(e,r)=>{e.stopPropagation();const E=e.target.getBoundingClientRect(),N=100,B=window.innerHeight;let y=E.top+window.scrollY;y+N>B&&(y=B-N-20),b({top:y-80,left:E.left-30}),s(r)};return t.jsxRuntimeExports.jsxs("div",{className:l.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[t.jsxRuntimeExports.jsx("h3",{className:l.title,children:j}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:e=>u(r=>e)})]}),m&&t.jsxRuntimeExports.jsx(jt,{activeProduct:m,setActiveProduct:s,popupPosition:d}),t.jsxRuntimeExports.jsxs("div",{className:l.products,children:[t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:g}),n.map(e=>t.jsxRuntimeExports.jsxs("div",{className:l.product,children:[t.jsxRuntimeExports.jsxs("div",{className:l.info,children:[t.jsxRuntimeExports.jsx("div",{className:l.image,children:e.image?t.jsxRuntimeExports.jsx("img",{src:e.image}):t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}),t.jsxRuntimeExports.jsx("span",{className:l.name,children:e.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:l.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:r=>{R(r,e)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>x(r=>r.filter(E=>E.id!==e.id)),width:20,height:20,fill:"#C12A2A"})]})]},e.id)),t.jsxRuntimeExports.jsxs(t.Button,{className:l.button,size:"s",onClick:()=>x(e=>{const r=[...e];return r.push({name:"Product 1",id:t.v4()}),r}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),i!==void 0&&t.jsxRuntimeExports.jsxs("div",{className:l.other,children:[t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:"Other"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:e=>c==null?void 0:c(r=>e),label:"Product Stats",hasBackground:!0,paddingless:!1})]})]})},gt="_subtitle_1y5sw_1",bt="_header_1y5sw_8",vt="_text_1y5sw_9",Rt="_productsBlock_1y5sw_10",Et="_buttonsBlock_1y5sw_11",yt="_top_1y5sw_22",kt="_itemsBlock_1y5sw_29",wt="_typeTexts_1y5sw_35",Nt="_block_1y5sw_41",Bt="_active_1y5sw_52",ft="_products_1y5sw_10",Pt="_product_1y5sw_10",Tt="_button_1y5sw_11",$t="_image_1y5sw_80",Ct="_info_1y5sw_87",St="_name_1y5sw_98",It="_buttons_1y5sw_11",At="_modal_1y5sw_108",Lt="_other_1y5sw_125",zt="_options_1y5sw_131",p={subtitle:gt,header:bt,text:vt,productsBlock:Rt,buttonsBlock:Et,top:yt,itemsBlock:kt,typeTexts:wt,block:Nt,active:Bt,products:ft,product:Pt,button:Tt,image:$t,info:Ct,name:St,buttons:It,modal:At,other:Lt,options:zt},Ot=a=>{const{activeButton:o,setActiveButton:u,popupPosition:n}=a,[x,i]=h.useState(o.typeText),[c,j]=h.useState(o.destination),[g,m]=h.useState(o.link||"");return t.jsxRuntimeExports.jsxs("div",{className:p.modal,onClick:s=>{s.stopPropagation()},style:{top:`${n.top}px`,left:`${n.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:p.top,children:[t.jsxRuntimeExports.jsx("h3",{children:o.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>u(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:p.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:s=>j(s),options:["Go to Page","Open Link"],value:c}),c==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>m(s),value:g,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:()=>{},value:"Lorem ipsum dolor sit amet com",label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(w,{typeText:x,setTypeText:i})]})]})},Ht=a=>{const{isActiveButtons:o,setIsActiveButtons:u,buttons:n,setButtons:x}=a,[i,c]=h.useState(null),[j,g]=h.useState({top:0,left:0});h.useEffect(()=>{const s=()=>{c(null)};return document.body.addEventListener("click",s),c(null),()=>{c(null),document.body.removeEventListener("click",s)}},[]);const m=(s,d)=>{s.stopPropagation();const b=s.target.getBoundingClientRect(),R=490,e=window.innerHeight;let r=b.top+window.scrollY;r+R>e&&(r=e-R-20),g({top:r,left:b.left-30}),c(d)};return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:p.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:p.top,children:[t.jsxRuntimeExports.jsx("h3",{className:p.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:s=>u(d=>s)})]}),t.jsxRuntimeExports.jsxs("div",{className:p.products,children:[t.jsxRuntimeExports.jsx("h5",{className:p.subtitle,children:"Button Type"}),n.map(s=>t.jsxRuntimeExports.jsxs("div",{className:p.product,children:[t.jsxRuntimeExports.jsxs("div",{className:p.info,children:[t.jsxRuntimeExports.jsx("span",{className:p.name,children:s.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:p.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:d=>{m(d,s)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>x(d=>d.filter(b=>b.id!==s.id)),width:20,height:20,fill:"#C12A2A"})]})]},s.id)),i&&t.jsxRuntimeExports.jsx(Ot,{activeButton:i,setActiveButton:c,popupPosition:j}),t.jsxRuntimeExports.jsxs(t.Button,{className:p.button,size:"s",onClick:()=>x(s=>{const d=[...s];return d.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),d}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})]})})};exports.Button=t.Button;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;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.ButtonsSettings=Ht;exports.LayoutSettings=G;exports.ProductSettings=ht;exports.TextSettings=W;exports.TypeTexts=w;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DSUcxVxJ.cjs"),g=require("react"),z="_wrapper_o1bnv_2",O="_alignmentBlock_o1bnv_8",H="_title_o1bnv_16",M="_subtitle_o1bnv_23",F="_alignmentContent_o1bnv_30",G="_alignments_o1bnv_37",q="_alignment_o1bnv_8",D="_circle_o1bnv_56",Y="_paddings_o1bnv_63",J="_padding_o1bnv_63",K="_input_o1bnv_81",_={wrapper:z,alignmentBlock:O,title:H,subtitle:M,alignmentContent:F,alignments:G,alignment:q,circle:D,paddings:Y,padding:J,input:K},Q=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],U=["left","top","right","bottom"],V=u=>{const{alignment:i,padding:a,setPadding:e,setAlignment:n}=u;return t.jsxRuntimeExports.jsxs("div",{className:_.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:_.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:_.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:_.alignments,children:Q.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(p=>c)},className:_.alignment,children:[c!==i&&t.jsxRuntimeExports.jsx("div",{className:_.circle}),c===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},c))}),t.jsxRuntimeExports.jsx("div",{className:_.paddings,children:U.map(c=>t.jsxRuntimeExports.jsxs("label",{className:_.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${c}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(a[c]),onChange:p=>e(d=>({...d,[c]:Number(p)})),paddingless:!0})]}))})]})]})]})},W="_subtitle_2zbxx_1",X="_header_2zbxx_8",Z="_text_2zbxx_9",tt="_top_2zbxx_16",st="_itemsBlock_2zbxx_23",k={subtitle:W,header:X,text:Z,top:tt,itemsBlock:st},et="_typeTexts_3zlec_1",nt="_block_3zlec_7",ot="_active_3zlec_18",B={typeTexts:et,block:nt,active:ot},it=["bold","italic","underline","strike-through","code"],I=u=>{const{typeText:i,setTypeText:a}=u;return t.jsxRuntimeExports.jsx("div",{className:B.typeTexts,children:it.map(e=>t.jsxRuntimeExports.jsx("div",{className:t.clx(B.block,{[B.active]:i===e}),onClick:()=>a(n=>e),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${e}`,fill:i===e?"#252525":"#757575",width:20,height:20})},String(e)))})},ct=u=>{const{typeText:i,isActiveText:a,setIsActiveText:e,text:n,setText:c,setTypeText:p,title:d,subtitle:o="Items"}=u;return t.jsxRuntimeExports.jsxs("div",{className:k.text,children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{className:k.title,children:d}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:l=>e(r=>l)})]}),t.jsxRuntimeExports.jsxs("div",{className:k.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:k.subtitle,children:o}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:l=>c(r=>l),value:n,maxLength:150}),t.jsxRuntimeExports.jsx(I,{typeText:i,setTypeText:p})]})]})},lt="_subtitle_2l7ty_1",at="_header_2l7ty_8",rt="_text_2l7ty_9",xt="_productsBlock_2l7ty_10",ut="_top_2l7ty_22",pt="_itemsBlock_2l7ty_29",mt="_typeTexts_2l7ty_35",dt="_block_2l7ty_41",_t="_active_2l7ty_52",ht="_products_2l7ty_10",jt="_product_2l7ty_10",gt="_button_2l7ty_70",bt="_image_2l7ty_80",yt="_info_2l7ty_87",vt="_name_2l7ty_98",Rt="_buttons_2l7ty_102",Et="_modal_2l7ty_108",kt="_other_2l7ty_125",m={subtitle:lt,header:at,text:rt,productsBlock:xt,top:ut,itemsBlock:pt,typeTexts:mt,block:dt,active:_t,products:ht,product:jt,button:gt,image:bt,info:yt,name:vt,buttons:Rt,modal:Et,other:kt},wt=u=>{const{activeItem:i,setActiveItem:a,popupPosition:e}=u;return t.jsxRuntimeExports.jsxs("div",{className:m.modal,onClick:n=>{n.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:m.top,children:[t.jsxRuntimeExports.jsx("h3",{children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>a(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},ft=u=>{const{isActiveItems:i,setIsActiveItems:a,items:e,setItems:n,isProductStats:c,setIsProductStats:p,title:d,subtitle:o,editable:l=!0,draggable:r=!1,withImage:R=!0,itemsType:h,itemsPlaceholder:b="",itemsOptions:T}=u,[C,E]=g.useState(null),[S,P]=g.useState({top:0,left:0});g.useEffect(()=>{const s=()=>{E(null)};return document.body.addEventListener("click",s),E(null),()=>{E(null),document.body.removeEventListener("click",s)}},[]);const A=(s,x)=>{s.stopPropagation();const y=s.target.getBoundingClientRect(),f=100,$=window.innerHeight;let j=y.top+window.scrollY;j+f>$&&(j=$-f-20),P({top:j-80,left:y.left-30}),E(x)};function L(s){if(R&&!s)return t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}return t.jsxRuntimeExports.jsxs("div",{className:m.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:m.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:m.title,children:d}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:s=>a(x=>s)})]}),C&&l&&t.jsxRuntimeExports.jsx(wt,{activeItem:C,setActiveItem:E,popupPosition:S}),t.jsxRuntimeExports.jsxs("div",{className:m.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:m.subtitle,children:o}),e.map(s=>t.jsxRuntimeExports.jsxs("div",{className:m.product,children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"drag",hoverable:!0,width:20,height:20})}),h==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:x=>{n(y=>[...y].map(j=>j.id===s.id?{...s,name:x}:j))},value:s.name,options:T,leftAddon:L(s.image)}),h==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>{n(y=>[...y].map(j=>j.id===s.id?{...s,name:x}:j))},value:s.name,placeholder:b}),h==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{}),t.jsxRuntimeExports.jsxs("div",{className:m.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:x=>{A(x,s)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>n(x=>x.filter(y=>y.id!==s.id)),width:20,height:20,fill:"#C12A2A"})]})]},s.id)),t.jsxRuntimeExports.jsxs(t.Button,{className:m.button,size:"s",onClick:()=>n(s=>{const x=[...s];return h==="select"?x.push({name:T[0]||"",id:t.v4()}):h==="input"?x.push({name:"",id:t.v4()}):x.push({id:t.v4()}),x}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),c!==void 0&&t.jsxRuntimeExports.jsxs("div",{className:m.other,children:[t.jsxRuntimeExports.jsx("h5",{className:m.subtitle,children:"Other"}),t.jsxRuntimeExports.jsx(t.Switch,{current:c,onChange:s=>p==null?void 0:p(x=>s),label:"Product Stats",hasBackground:!0,paddingless:!1})]})]})},$t="_subtitle_1y5sw_1",Bt="_header_1y5sw_8",It="_text_1y5sw_9",Tt="_productsBlock_1y5sw_10",Ct="_buttonsBlock_1y5sw_11",Nt="_top_1y5sw_22",St="_itemsBlock_1y5sw_29",Pt="_typeTexts_1y5sw_35",At="_block_1y5sw_41",Lt="_active_1y5sw_52",zt="_products_1y5sw_10",Ot="_product_1y5sw_10",Ht="_button_1y5sw_11",Mt="_image_1y5sw_80",Ft="_info_1y5sw_87",Gt="_name_1y5sw_98",qt="_buttons_1y5sw_11",Dt="_modal_1y5sw_108",Yt="_other_1y5sw_125",Jt="_options_1y5sw_131",v={subtitle:$t,header:Bt,text:It,productsBlock:Tt,buttonsBlock:Ct,top:Nt,itemsBlock:St,typeTexts:Pt,block:At,active:Lt,products:zt,product:Ot,button:Ht,image:Mt,info:Ft,name:Gt,buttons:qt,modal:Dt,other:Yt,options:Jt},Kt=u=>{const{activeButton:i,setActiveButton:a,popupPosition:e}=u,[n,c]=g.useState(i.typeText),[p,d]=g.useState(i.destination),[o,l]=g.useState(i.link||"");return t.jsxRuntimeExports.jsxs("div",{className:v.modal,onClick:r=>{r.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{children:i.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>a(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:v.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:r=>d(r),options:["Go to Page","Open Link"],value:p}),p==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>l(r),value:o,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:()=>{},value:"Lorem ipsum dolor sit amet com",label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(I,{typeText:n,setTypeText:c})]})]})},Qt="_subtitle_1y5sw_1",Ut="_header_1y5sw_8",Vt="_text_1y5sw_9",Wt="_productsBlock_1y5sw_10",Xt="_buttonsBlock_1y5sw_11",Zt="_top_1y5sw_22",ts="_itemsBlock_1y5sw_29",ss="_typeTexts_1y5sw_35",es="_block_1y5sw_41",ns="_active_1y5sw_52",os="_products_1y5sw_10",is="_product_1y5sw_10",cs="_button_1y5sw_11",ls="_image_1y5sw_80",as="_info_1y5sw_87",rs="_name_1y5sw_98",xs="_buttons_1y5sw_11",us="_modal_1y5sw_108",ps="_other_1y5sw_125",ms="_options_1y5sw_131",w={subtitle:Qt,header:Ut,text:Vt,productsBlock:Wt,buttonsBlock:Xt,top:Zt,itemsBlock:ts,typeTexts:ss,block:es,active:ns,products:os,product:is,button:cs,image:ls,info:as,name:rs,buttons:xs,modal:us,other:ps,options:ms},N=u=>{const{buttons:i,setButtons:a}=u,[e,n]=g.useState(null),[c,p]=g.useState({top:0,left:0});g.useEffect(()=>{const o=()=>{n(null)};return document.body.addEventListener("click",o),n(null),()=>{n(null),document.body.removeEventListener("click",o)}},[]);const d=(o,l)=>{o.stopPropagation();const r=o.target.getBoundingClientRect(),R=490,h=window.innerHeight;let b=r.top+window.scrollY;b+R>h&&(b=h-R-20),p({top:b,left:r.left-30}),n(l)};return t.jsxRuntimeExports.jsxs("div",{className:w.products,children:[t.jsxRuntimeExports.jsx("h5",{className:w.subtitle,children:"Button Type"}),i.map(o=>t.jsxRuntimeExports.jsxs("div",{className:w.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{a(r=>[...r].map(b=>b.id===o.id?{...o,type:l}:b))},value:o.type,options:["Primary","Secondary"]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:l=>{d(l,o)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(l=>l.filter(r=>r.id!==o.id)),width:20,height:20,fill:"#C12A2A"})]})]},o.id)),e&&t.jsxRuntimeExports.jsx(Kt,{activeButton:e,setActiveButton:n,popupPosition:c}),t.jsxRuntimeExports.jsxs(t.Button,{className:w.button,size:"s",onClick:()=>a(o=>{const l=[...o];return l.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),l}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})},ds=u=>{const{isActiveButtons:i,setIsActiveButtons:a,buttons:e,setButtons:n}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:v.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{className:v.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:c=>a(p=>c)})]}),t.jsxRuntimeExports.jsx(N,{buttons:e,setButtons:n})]})})};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.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.ButtonTypeSettings=N;exports.ButtonsSettings=ds;exports.ItemsSettings=ft;exports.LayoutSettings=V;exports.TextSettings=ct;exports.TypeTexts=I;
|