@openlettermarketing/olc-react-sdk 0.0.14 → 0.0.16
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/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TemplateBuilder/index.tsx +29 -21
package/build/index.js
CHANGED
|
@@ -544,5 +544,5 @@ function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t
|
|
|
544
544
|
* @copyright ReactTooltip Team
|
|
545
545
|
* @license MIT
|
|
546
546
|
*/
|
|
547
|
-
const eA="react-tooltip-core-styles",tA="react-tooltip-base-styles",nA={core:!1,base:!1};function rA({css:e,id:t=tA,type:n="base",ref:r}){var a,o;if(!e||"undefined"==typeof document||nA[n])return;if("core"===n&&"undefined"!=typeof process&&(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==n&&"undefined"!=typeof process&&(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===n&&(t=eA),r||(r={});const{insertAt:i}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),nA[n]=!0}const aA=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:a=10,strategy:o="absolute",middlewares:i=[Xu(Number(a)),Ju({fallbackAxisSideDirection:"start"}),Ku({padding:5})],border:l})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=i;return n?(s.push(_u({element:n,padding:5})),$u(e,t,{placement:r,strategy:o,middleware:s}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var a,o;const i={left:`${e}px`,top:`${t}px`,border:l},{x:s,y:c}=null!==(a=r.arrow)&&void 0!==a?a:{x:0,y:0},u=null!==(o={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==o?o:"bottom",d=l&&{borderBottom:l,borderRight:l};let f=0;if(l){const e=`${l}`.match(/(\d+)px/);f=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:i,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+f}px`},place:n}}))):$u(e,t,{placement:"bottom",strategy:o,middleware:s}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})))},oA=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),iA=(e,t,n)=>{let r=null;const a=function(...a){const o=()=>{r=null,n||e.apply(this,a)};n&&!r&&(e.apply(this,a),r=setTimeout(o,t)),n||(r&&clearTimeout(r),r=setTimeout(o,t))};return a.cancel=()=>{r&&(clearTimeout(r),r=null)},a},lA=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,sA=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>sA(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!lA(e)||!lA(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>sA(e[n],t[n])))},cA=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n}))},uA=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(cA(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},dA="undefined"!=typeof window?l.useLayoutEffect:l.useEffect,fA="DEFAULT_TOOLTIP_ID",pA={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},hA=(0,l.createContext)({getTooltipData:()=>pA});function CA(e=fA){return(0,l.useContext)(hA).getTooltipData(e)}var AA={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},mA={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const vA=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:a="dark",anchorId:o,anchorSelect:i,place:s="top",offset:c=10,events:u=["hover"],openOnClick:d=!1,positionStrategy:f="absolute",middlewares:p,wrapper:h,delayShow:C=0,delayHide:A=0,float:m=!1,hidden:v=!1,noArrow:g=!1,clickable:y=!1,closeOnEsc:b=!1,closeOnScroll:L=!1,closeOnResize:E=!1,openEvents:w,closeEvents:z,globalCloseEvents:M,imperativeModeOnly:S,style:H,position:R,afterShow:x,afterHide:V,content:T,contentWrapperRef:N,isOpen:O,defaultIsOpen:P=!1,setIsOpen:k,activeAnchor:D,setActiveAnchor:B,border:I,opacity:F,arrowColor:G,role:j="tooltip"})=>{var U;const q=(0,l.useRef)(null),W=(0,l.useRef)(null),Q=(0,l.useRef)(null),Y=(0,l.useRef)(null),Z=(0,l.useRef)(null),[X,K]=(0,l.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[J,_]=(0,l.useState)(!1),[$,ee]=(0,l.useState)(!1),[te,ne]=(0,l.useState)(null),re=(0,l.useRef)(!1),ae=(0,l.useRef)(null),{anchorRefs:oe,setActiveAnchor:ie}=CA(t),le=(0,l.useRef)(!1),[se,ce]=(0,l.useState)([]),ue=(0,l.useRef)(!1),de=d||u.includes("click"),fe=de||(null==w?void 0:w.click)||(null==w?void 0:w.dblclick)||(null==w?void 0:w.mousedown),pe=w?{...w}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!w&&de&&Object.assign(pe,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const he=z?{...z}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!z&&de&&Object.assign(he,{mouseleave:!1,blur:!1,mouseout:!1});const Ce=M?{...M}:{escape:b||!1,scroll:L||!1,resize:E||!1,clickOutsideAnchor:fe||!1};S&&(Object.assign(pe,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(he,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ce,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),dA((()=>(ue.current=!0,()=>{ue.current=!1})),[]);const Ae=e=>{ue.current&&(e&&ee(!0),setTimeout((()=>{ue.current&&(null==k||k(e),void 0===O&&_(e))}),10))};(0,l.useEffect)((()=>{if(void 0===O)return()=>null;O&&ee(!0);const e=setTimeout((()=>{_(O)}),10);return()=>{clearTimeout(e)}}),[O]),(0,l.useEffect)((()=>{if(J!==re.current)if(Z.current&&clearTimeout(Z.current),re.current=J,J)null==x||x();else{const e=(e=>{const t=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,n,r]=t;return Number(n)*("ms"===r?1:1e3)})();Z.current=setTimeout((()=>{ee(!1),ne(null),null==V||V()}),e+25)}}),[J]);const me=e=>{K((t=>sA(t,e)?t:e))},ve=(e=C)=>{Q.current&&clearTimeout(Q.current),$?Ae(!0):Q.current=setTimeout((()=>{Ae(!0)}),e)},ge=(e=A)=>{Y.current&&clearTimeout(Y.current),Y.current=setTimeout((()=>{le.current||Ae(!1)}),e)},ye=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return B(null),void ie({current:null});C?ve():Ae(!0),B(n),ie({current:n}),Y.current&&clearTimeout(Y.current)},be=()=>{y?ge(A||100):A?ge():Ae(!1),Q.current&&clearTimeout(Q.current)},Le=({x:e,y:t})=>{var n;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};aA({place:null!==(n=null==te?void 0:te.place)&&void 0!==n?n:s,offset:c,elementReference:r,tooltipReference:q.current,tooltipArrowReference:W.current,strategy:f,middlewares:p,border:I}).then((e=>{me(e)}))},Ee=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};Le(n),ae.current=n},we=e=>{var t;if(!J)return;const n=e.target;n.isConnected&&((null===(t=q.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${o}']`),...se].some((e=>null==e?void 0:e.contains(n)))||(Ae(!1),Q.current&&clearTimeout(Q.current)))},ze=iA(ye,50,!0),Me=iA(be,50,!0),Se=e=>{Me.cancel(),ze(e)},He=()=>{ze.cancel(),Me()},Re=(0,l.useCallback)((()=>{var e,t;const n=null!==(e=null==te?void 0:te.position)&&void 0!==e?e:R;n?Le(n):m?ae.current&&Le(ae.current):(null==D?void 0:D.isConnected)&&aA({place:null!==(t=null==te?void 0:te.place)&&void 0!==t?t:s,offset:c,elementReference:D,tooltipReference:q.current,tooltipArrowReference:W.current,strategy:f,middlewares:p,border:I}).then((e=>{ue.current&&me(e)}))}),[J,D,T,H,s,null==te?void 0:te.place,c,f,R,null==te?void 0:te.position,m]);(0,l.useEffect)((()=>{var e,t;const n=new Set(oe);se.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${o}']`);r&&n.add({current:r});const a=()=>{Ae(!1)},i=uA(D),l=uA(q.current);Ce.scroll&&(window.addEventListener("scroll",a),null==i||i.addEventListener("scroll",a),null==l||l.addEventListener("scroll",a));let s=null;Ce.resize?window.addEventListener("resize",a):D&&q.current&&(s=Zu(D,q.current,Re,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Ae(!1)};Ce.escape&&window.addEventListener("keydown",c),Ce.clickOutsideAnchor&&window.addEventListener("click",we);const u=[],d=e=>{J&&(null==e?void 0:e.target)===D||ye(e)},f=e=>{J&&(null==e?void 0:e.target)===D&&be()},p=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],h=["click","dblclick","mousedown","mouseup"];Object.entries(pe).forEach((([e,t])=>{t&&(p.includes(e)?u.push({event:e,listener:Se}):h.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(he).forEach((([e,t])=>{t&&(p.includes(e)?u.push({event:e,listener:He}):h.includes(e)&&u.push({event:e,listener:f}))})),m&&u.push({event:"pointermove",listener:Ee});const C=()=>{le.current=!0},A=()=>{le.current=!1,be()};return y&&!fe&&(null===(e=q.current)||void 0===e||e.addEventListener("mouseenter",C),null===(t=q.current)||void 0===t||t.addEventListener("mouseleave",A)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;Ce.scroll&&(window.removeEventListener("scroll",a),null==i||i.removeEventListener("scroll",a),null==l||l.removeEventListener("scroll",a)),Ce.resize?window.removeEventListener("resize",a):null==s||s(),Ce.clickOutsideAnchor&&window.removeEventListener("click",we),Ce.escape&&window.removeEventListener("keydown",c),y&&!fe&&(null===(e=q.current)||void 0===e||e.removeEventListener("mouseenter",C),null===(t=q.current)||void 0===t||t.removeEventListener("mouseleave",A)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[D,Re,$,oe,se,w,z,M,de,C,A]),(0,l.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==te?void 0:te.anchorSelect)&&void 0!==e?e:i)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const a=new MutationObserver((e=>{const n=[],a=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===t?n.push(e.target):e.oldValue===t&&a.push(e.target)),"childList"===e.type){if(D){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(r)try{a.push(...t.filter((e=>e.matches(r)))),a.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,D))&&(ee(!1),Ae(!1),B(null),Q.current&&clearTimeout(Q.current),Y.current&&clearTimeout(Y.current),!0)}))}if(r)try{const t=[...e.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((e=>e.matches(r)))),n.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}}})),(n.length||a.length)&&ce((e=>[...e.filter((e=>!a.includes(e))),...n]))}));return a.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{a.disconnect()}}),[t,i,null==te?void 0:te.anchorSelect,D]),(0,l.useEffect)((()=>{Re()}),[Re]),(0,l.useEffect)((()=>{if(!(null==N?void 0:N.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Re()))}));return e.observe(N.current),()=>{e.disconnect()}}),[T,null==N?void 0:N.current]),(0,l.useEffect)((()=>{var e;const t=document.querySelector(`[id='${o}']`),n=[...se,t];D&&n.includes(D)||B(null!==(e=se[0])&&void 0!==e?e:t)}),[o,se,D]),(0,l.useEffect)((()=>(P&&Ae(!0),()=>{Q.current&&clearTimeout(Q.current),Y.current&&clearTimeout(Y.current)})),[]),(0,l.useEffect)((()=>{var e;let n=null!==(e=null==te?void 0:te.anchorSelect)&&void 0!==e?e:i;if(!n&&t&&(n=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),n)try{const e=Array.from(document.querySelectorAll(n));ce(e)}catch(e){ce([])}}),[t,i,null==te?void 0:te.anchorSelect]),(0,l.useEffect)((()=>{Q.current&&(clearTimeout(Q.current),ve(C))}),[C]);const xe=null!==(U=null==te?void 0:te.content)&&void 0!==U?U:T,Ve=J&&Object.keys(X.tooltipStyles).length>0;return(0,l.useImperativeHandle)(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ne(null!=e?e:null),(null==e?void 0:e.delay)?ve(e.delay):Ae(!0)},close:e=>{(null==e?void 0:e.delay)?ge(e.delay):Ae(!1)},activeAnchor:D,place:X.place,isOpen:Boolean($&&!v&&xe&&Ve)}))),$&&!v&&xe?l.createElement(h,{id:t,role:j,className:$C("react-tooltip",AA.tooltip,mA.tooltip,mA[a],n,`react-tooltip__place-${X.place}`,AA[Ve?"show":"closing"],Ve?"react-tooltip__show":"react-tooltip__closing","fixed"===f&&AA.fixed,y&&AA.clickable),onTransitionEnd:e=>{Z.current&&clearTimeout(Z.current),J||"opacity"!==e.propertyName||(ee(!1),ne(null),null==V||V())},style:{...H,...X.tooltipStyles,opacity:void 0!==F&&Ve?F:void 0},ref:q},xe,l.createElement(h,{className:$C("react-tooltip-arrow",AA.arrow,mA.arrow,r,g&&AA.noArrow),style:{...X.tooltipArrowStyles,background:G?`linear-gradient(to right bottom, transparent 50%, ${G} 50%)`:void 0},ref:W})):null},gA=({content:e})=>l.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),yA=l.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:a,render:o,className:i,classNameArrow:s,variant:c="dark",place:u="top",offset:d=10,wrapper:f="div",children:p=null,events:h=["hover"],openOnClick:C=!1,positionStrategy:A="absolute",middlewares:m,delayShow:v=0,delayHide:g=0,float:y=!1,hidden:b=!1,noArrow:L=!1,clickable:E=!1,closeOnEsc:w=!1,closeOnScroll:z=!1,closeOnResize:M=!1,openEvents:S,closeEvents:H,globalCloseEvents:R,imperativeModeOnly:x=!1,style:V,position:T,isOpen:N,defaultIsOpen:O=!1,disableStyleInjection:P=!1,border:k,opacity:D,arrowColor:B,setIsOpen:I,afterShow:F,afterHide:G,role:j="tooltip"},U)=>{const[q,W]=(0,l.useState)(r),[Q,Y]=(0,l.useState)(a),[Z,X]=(0,l.useState)(u),[K,J]=(0,l.useState)(c),[_,$]=(0,l.useState)(d),[ee,te]=(0,l.useState)(v),[ne,re]=(0,l.useState)(g),[ae,oe]=(0,l.useState)(y),[ie,le]=(0,l.useState)(b),[se,ce]=(0,l.useState)(f),[ue,de]=(0,l.useState)(h),[fe,pe]=(0,l.useState)(A),[he,Ce]=(0,l.useState)(null),[Ae,me]=(0,l.useState)(null),ve=(0,l.useRef)(P),{anchorRefs:ge,activeAnchor:ye}=CA(e),be=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null),t}),{}),Le=e=>{const t={place:e=>{var t;X(null!==(t=e)&&void 0!==t?t:u)},content:e=>{W(null!=e?e:r)},html:e=>{Y(null!=e?e:a)},variant:e=>{var t;J(null!==(t=e)&&void 0!==t?t:c)},offset:e=>{$(null===e?d:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:h)},"position-strategy":e=>{var t;pe(null!==(t=e)&&void 0!==t?t:A)},"delay-show":e=>{te(null===e?v:Number(e))},"delay-hide":e=>{re(null===e?g:Number(e))},float:e=>{oe(null===e?y:"true"===e)},hidden:e=>{le(null===e?b:"true"===e)},"class-name":e=>{Ce(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};(0,l.useEffect)((()=>{W(r)}),[r]),(0,l.useEffect)((()=>{Y(a)}),[a]),(0,l.useEffect)((()=>{X(u)}),[u]),(0,l.useEffect)((()=>{J(c)}),[c]),(0,l.useEffect)((()=>{$(d)}),[d]),(0,l.useEffect)((()=>{te(v)}),[v]),(0,l.useEffect)((()=>{re(g)}),[g]),(0,l.useEffect)((()=>{oe(y)}),[y]),(0,l.useEffect)((()=>{le(b)}),[b]),(0,l.useEffect)((()=>{pe(A)}),[A]),(0,l.useEffect)((()=>{ve.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[P]),(0,l.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}))}),[]),(0,l.useEffect)((()=>{var r;const a=new Set(ge);let o=n;if(!o&&e&&(o=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),o)try{document.querySelectorAll(o).forEach((e=>{a.add({current:e})}))}catch(r){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}const i=document.querySelector(`[id='${t}']`);if(i&&a.add({current:i}),!a.size)return()=>null;const l=null!==(r=null!=Ae?Ae:i)&&void 0!==r?r:ye.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!l||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=be(l);Le(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(l){const e=be(l);Le(e),s.observe(l,c)}return()=>{s.disconnect()}}),[ge,ye,Ae,t,n]),(0,l.useEffect)((()=>{(null==V?void 0:V.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),k&&!oA("border",`${k}`)&&console.warn(`[react-tooltip] "${k}" is not a valid \`border\`.`),(null==V?void 0:V.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),D&&!oA("opacity",`${D}`)&&console.warn(`[react-tooltip] "${D}" is not a valid \`opacity\`.`)}),[]);let Ee=p;const we=(0,l.useRef)(null);if(o){const e=o({content:(null==Ae?void 0:Ae.getAttribute("data-tooltip-content"))||q||null,activeAnchor:Ae});Ee=e?l.createElement("div",{ref:we,className:"react-tooltip-content-wrapper"},e):null}else q&&(Ee=q);Q&&(Ee=l.createElement(gA,{content:Q}));const ze={forwardRef:U,id:e,anchorId:t,anchorSelect:n,className:$C(i,he),classNameArrow:s,content:Ee,contentWrapperRef:we,place:Z,variant:K,offset:_,wrapper:se,events:ue,openOnClick:C,positionStrategy:fe,middlewares:m,delayShow:ee,delayHide:ne,float:ae,hidden:ie,noArrow:L,clickable:E,closeOnEsc:w,closeOnScroll:z,closeOnResize:M,openEvents:S,closeEvents:H,globalCloseEvents:R,imperativeModeOnly:x,style:V,position:T,isOpen:N,defaultIsOpen:O,border:k,opacity:D,arrowColor:B,setIsOpen:I,afterShow:F,afterHide:G,activeAnchor:Ae,setActiveAnchor:e=>me(e),role:j};return l.createElement(vA,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||rA({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||rA({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})}));var bA=a(27455),LA={};LA.styleTagTransform=rs(),LA.setAttributes=$l(),LA.insert=Jl().bind(null,"head"),LA.domAPI=Xl(),LA.insertStyleElement=ts();Yl()(bA.A,LA);bA.A&&bA.A.locals&&bA.A.locals;var EA=a(99197),wA={};wA.styleTagTransform=rs(),wA.setAttributes=$l(),wA.insert=Jl().bind(null,"head"),wA.domAPI=Xl(),wA.insertStyleElement=ts();Yl()(EA.A,wA);EA.A&&EA.A.locals&&EA.A.locals;const zA=function(e){var t=e.anchorSelect,n=e.place,r=e.title;return l.createElement(yA,{className:"basic-tooltip",anchorSelect:t,place:n},r)};const MA=function(e){var t=e.className,n=void 0===t?{}:t,r=e.fill;return l.createElement("svg",{width:"12",className:n,height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_1555_2219)"},l.createElement("path",{d:"M6.80169 8.45472C6.67902 8.46615 6.55586 8.43847 6.44987 8.37562C6.37243 8.29612 6.33531 8.18575 6.34897 8.07562C6.35183 7.98393 6.36278 7.89266 6.38169 7.8029C6.4 7.69991 6.42364 7.59796 6.45259 7.49744L6.77441 6.39015C6.8076 6.28087 6.82954 6.16846 6.83987 6.05469C6.83987 5.93197 6.85623 5.84741 6.85623 5.79833C6.86307 5.57959 6.76968 5.36969 6.60259 5.22833C6.39707 5.07055 6.14113 4.993 5.88259 5.01015C5.69732 5.01294 5.51347 5.04327 5.33713 5.10015C5.1444 5.16015 4.94167 5.23197 4.72895 5.31562L4.63623 5.67561C4.69895 5.65379 4.77533 5.62926 4.86259 5.60197C4.94584 5.57732 5.03214 5.56445 5.11895 5.56379C5.24073 5.5506 5.36331 5.58051 5.46531 5.64833C5.53459 5.731 5.5671 5.83839 5.55531 5.94562C5.555 6.03733 5.54495 6.12876 5.52531 6.21833C5.50621 6.3138 5.48167 6.41469 5.45167 6.52105L5.12713 7.63377C5.10097 7.7372 5.08004 7.84187 5.06441 7.94741C5.05166 8.03776 5.04529 8.12889 5.04531 8.22013C5.04397 8.44037 5.14468 8.64883 5.31803 8.78467C5.52672 8.94491 5.78631 9.02434 6.04893 9.00831C6.23385 9.01211 6.41814 8.98539 6.59439 8.92921C6.74893 8.87647 6.9553 8.80103 7.21349 8.70285L7.30077 8.35921C7.23083 8.38822 7.15881 8.41192 7.08531 8.43011C6.99236 8.45134 6.89692 8.45959 6.80169 8.45472Z",fill:r}),l.createElement("path",{d:"M7.14277 3.20479C6.99434 3.06848 6.79878 2.99514 6.59731 3.00025C6.39596 2.9957 6.20059 3.06897 6.05185 3.20479C5.77923 3.43987 5.74878 3.85145 5.98388 4.1241C6.00484 4.14841 6.02755 4.17112 6.05185 4.19207C6.36244 4.46988 6.83218 4.46988 7.14275 4.19207C7.41537 3.95467 7.44394 3.54123 7.20655 3.26861C7.18681 3.2459 7.16548 3.22457 7.14277 3.20479Z",fill:r}),l.createElement("path",{d:"M6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0ZM6 11.4545C2.98753 11.4545 0.545461 9.01247 0.545461 6C0.545461 2.98753 2.98753 0.545461 6 0.545461C9.01247 0.545461 11.4545 2.98753 11.4545 6C11.4545 9.01247 9.01247 11.4545 6 11.4545Z",fill:r})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_1555_2219"},l.createElement("rect",{width:"12",height:"12",fill:"white"}))))};const SA=function(e){var t=e.className,n=void 0===t?{}:t;return l.createElement("svg",{width:"19",className:n,height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M3.5 15.025H3.975V15.5C3.975 16.1697 4.24103 16.8119 4.71456 17.2854C5.18809 17.759 5.83033 18.025 6.5 18.025H15.5C16.1697 18.025 16.8119 17.759 17.2854 17.2854C17.759 16.8119 18.025 16.1697 18.025 15.5V6.5C18.025 5.83033 17.759 5.18809 17.2854 4.71456C16.8119 4.24103 16.1697 3.975 15.5 3.975H15.025V3.5C15.025 2.83033 14.759 2.18808 14.2854 1.71456C13.8119 1.24103 13.1697 0.975 12.5 0.975H3.5C2.83033 0.975 2.18808 1.24103 1.71456 1.71456C1.24103 2.18808 0.975 2.83033 0.975 3.5V12.5C0.975 13.1697 1.24103 13.8119 1.71456 14.2854C2.18808 14.759 2.83033 15.025 3.5 15.025ZM15.5 5.025C15.8912 5.025 16.2664 5.1804 16.543 5.45702C16.8196 5.73363 16.975 6.10881 16.975 6.5V15.5C16.975 15.8912 16.8196 16.2664 16.543 16.543C16.2664 16.8196 15.8912 16.975 15.5 16.975H6.5C6.10881 16.975 5.73363 16.8196 5.45702 16.543C5.1804 16.2664 5.025 15.8912 5.025 15.5V15.025H12.5C13.1697 15.025 13.8119 14.759 14.2854 14.2854C14.759 13.8119 15.025 13.1697 15.025 12.5V5.025H15.5ZM2.025 3.5C2.025 3.10881 2.1804 2.73363 2.45702 2.45702C2.73363 2.1804 3.10881 2.025 3.5 2.025H12.5C12.8912 2.025 13.2664 2.1804 13.543 2.45702C13.8196 2.73363 13.975 3.10881 13.975 3.5V12.5C13.975 12.8912 13.8196 13.2664 13.543 13.543C13.2664 13.8196 12.8912 13.975 12.5 13.975H3.5C3.10881 13.975 2.73363 13.8196 2.45702 13.543C2.1804 13.2664 2.025 12.8912 2.025 12.5V3.5Z",fill:"",stroke:"",strokeWidth:"0.05"}))};const HA=function(e){var t=e.stroke;return l.createElement(l.Fragment,null,l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Capa_1",x:"0px",y:"0px",viewBox:"0 0 512 512",style:{width:"18px",height:"18px"},xmlSpace:"preserve",width:"512",height:"512"},l.createElement("g",null,l.createElement("path",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},d:"M412,136h40c22.091,0,40,17.909,40,40v160c0,22.091-17.909,40-40,40h-40"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"100",y1:"216",x2:"180",y2:"216"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"140",y1:"296",x2:"140",y2:"216"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"332",y1:"456",x2:"332",y2:"56"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"292",y1:"56",x2:"372",y2:"56"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"292",y1:"456",x2:"372",y2:"456"}),l.createElement("path",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},d:"M332,376H60c-22.091,0-40-17.909-40-40V176c0-22.091,17.909-40,40-40h272"}))))};function RA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VA(){return VA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VA.apply(null,arguments)}var TA={backgroundColor:"transparent"},NA={name:"Fields",Tab:(0,xC.observer)((function(e){return l.createElement(RC.SectionTab,VA({name:"Fields"},e),l.createElement(HA,{stroke:"var(--sidepanelSVGColor)"}))})),Panel:(0,xC.observer)((function(e){var t,n=e.store,r=RA((0,l.useState)(!1),2),a=(r[0],r[1]),o=ct(),i=et((function(e){return e.customFields.customFields})),s=et((function(e){return e.customFields.defaultDynamicFields})),c=et((function(e){return e.templates.product})),u=null==c?void 0:c.productType;(0,l.useEffect)((function(){o(Wr())}),[o]);var f=function(e,t,r){if(e.preventDefault(),"Real Penned Letter"===u)return d(t),void o(Gp("".concat(t," Copied")));var a,i;if("drag"===r){var l=e.currentTarget.getBoundingClientRect();a=e.clientX-l.left,i=e.clientY-l.top}else a=n.width/2-200,i=300;a/=n.activePage.scale,i/=n.activePage.scale,n.activePage.addElement({type:"text",x:a,y:i,text:t,width:t.length>15?10*t.length:150,contentEditable:!1})};return l.createElement("div",{className:"dynamic-content"},l.createElement("div",{className:"dynamic-content__top"},l.createElement("div",null,l.createElement("span",{className:"title"},"Contact Fields"),l.createElement(MA,{fill:"var(--primaryColor)",className:"infoIcon"}),l.createElement(zA,{anchorSelect:".infoIcon",place:"bottom",title:"Merge fields allow you to personalize your mailer with contact information."}))),s.map((function(e,t){var n=e.key,r=e.value;return l.createElement("div",{style:{display:"flex",alignItems:"center"},key:t},l.createElement("span",{className:"contact-element",onClick:function(e){return f(e,n,"click")}},r),l.createElement(cs,{style:TA,onClick:function(){return d(n)}},l.createElement(SA,{className:"copy"})))})),l.createElement(zA,{anchorSelect:".copy",place:"bottom",title:"Copy"}),l.createElement("hr",{className:"divider"}),l.createElement("div",{className:"dynamic-content__top"},l.createElement("div",null,l.createElement("span",{className:"title"},"Custom Fields"),l.createElement(MA,{fill:"var(--primaryColor)",className:"custom"}),l.createElement(zA,{anchorSelect:".custom",place:"bottom",title:"You can add custom fields to your template."})),l.createElement(cs,{onClick:function(){a((function(e){return!e}))}})),null===(t=i.data)||void 0===t?void 0:t.map((function(e,t){var n=e.key,r=e.value;return l.createElement("div",{style:{display:"flex",alignItems:"center"},key:t},l.createElement("span",{className:"contact-element",onClick:function(e){return f(e,n,"click")}},r),l.createElement(cs,{style:TA,onClick:function(){return d(n)}},l.createElement(SA,{className:"copy"})))})))}))};const OA=NA;function PA(e){return function(e){if(Array.isArray(e))return kA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return kA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kA(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const DA=function(e){var t=RC.DEFAULT_SECTIONS.filter((function(e){return!["photos","size","templates"].includes(e.name)}));return l.createElement(Eh.SidePanelWrap,null,l.createElement(RC.SidePanel,{store:e.store,sections:[KC].concat(PA(t),[OA]),defaultSection:"text"}))};var BA=a(22995),IA={};IA.styleTagTransform=rs(),IA.setAttributes=$l(),IA.insert=Jl().bind(null,"head"),IA.domAPI=Xl(),IA.insertStyleElement=ts();Yl()(BA.A,IA);BA.A&&BA.A.locals&&BA.A.locals;function FA(e){return FA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FA(e)}function GA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */GA=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),l=new x(r||[]);return a(i,"_invoke",{value:M(e,n,l)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",C="completed",A={};function m(){}function v(){}function g(){}var y={};c(y,i,(function(){return this}));var b=Object.getPrototypeOf,L=b&&b(b(V([])));L&&L!==n&&r.call(L,i)&&(y=L);var E=g.prototype=m.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function z(e,t){function n(a,o,i,l){var s=d(e[a],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==FA(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function M(t,n,r){var a=f;return function(o,i){if(a===h)throw Error("Generator is already running");if(a===C){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var l=r.delegate;if(l){var s=S(l,r);if(s){if(s===A)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=C,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=h;var c=d(t,n,r);if("normal"===c.type){if(a=r.done?C:p,c.arg===A)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=C,r.method="throw",r.arg=c.arg)}}}function S(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),A;var o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,A):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function H(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(H,this),this.reset(!0)}function V(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(FA(t)+" is not iterable")}return v.prototype=g,a(E,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},w(z.prototype),c(z.prototype,l,(function(){return this})),t.AsyncIterator=z,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new z(u(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=V,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return l.type="throw",l.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,A):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;R(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:V(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),A}},t}function jA(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,a)}function UA(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){jA(o,r,a,i,l,"next",e)}function l(e){jA(o,r,a,i,l,"throw",e)}i(void 0)}))}}function qA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return WA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function WA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,wh.Ut)(Ca);const QA=function(e){var t=e.store,n=e.styles,r=e.returnRoute,a=qA((0,l.useState)(!1),2),o=a[0],i=a[1],s=qA((0,l.useState)(1),2),c=s[0],u=s[1],d=ce().id,f=ct(),p=se(),h=et((function(e){return e.templates.template})),C=et((function(e){return e.templates.product})),A=et((function(e){return e.templates.envelopeType})),m=null==C?void 0:C.productType,v=Rh()({width:"100vw",height:"90vh",position:"relative",backgroundColor:"var(--mainBackgroundColor) !important"},n||{});(0,l.useEffect)((function(){b()}),[h]),(0,l.useEffect)((function(){var e=function(){document.hidden&&u((function(e){return e+1}))};return document.addEventListener("visibilitychange",e),function(){document.removeEventListener("visibilitychange",e)}}),[]),(0,l.useEffect)((function(){C||p("/create-template"),(0,wh.O3)(Vh),d?f(ua(d)):0===t.pages.length&&g(),f(function(){var e=ca(la().mark((function e(t){var n,r,a;return la().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Dr("custom-fields");case 3:200===(null==(n=e.sent)?void 0:n.status)&&(a=null==n||null===(r=n.data)||void 0===r?void 0:r.data.reduce((function(e,t){return e[t.key.replace(/{{|}}/g,"")]=t,e}),{}),t({type:pr,payload:{data:a}})),e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",e.t0.response);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}());var e=t.on("change",(function(){o||i(!0)}));return function(){t.history.clear(),t.clear(),e()}}),[]),(0,l.useEffect)((function(){!d&&C&&0===t.pages.length&&g()}),[C]),(0,l.useEffect)((function(){var e=function(e){var t="Are you sure you want to leave?";return e.returnValue=t,t};return o&&(window.removeEventListener("beforeunload",e),window.addEventListener("beforeunload",e)),function(){window.removeEventListener("beforeunload",e)}}),[o]);var g=function(){var e=UA(GA().mark((function e(){var n,r;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C&&(t.addPage(),r=null==C||null===(n=C.selectedSize)||void 0===n?void 0:n.split("x"),t.setUnit({unit:"in",dpi:ba}),t.setSize(+r[1]*ba,+r[0]*ba),Ea.includes(C.productType)&&(t.addPage(),t.selectPage(t.pages[0].id)),Ba(t,C,A),"Real Penned Letter"===m&&y(),t.history.clear()),i(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=UA(GA().mark((function e(){var n,r,a;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.addFont({fontFamily:"lexi Regular",url:Th}),xh(t),e.next=5,fetch(Th);case 5:return n=e.sent,e.next=8,n.blob();case 8:r=e.sent,(a=new FileReader).onloadend=function(){t.addFont({fontFamily:"lexi Regular",url:a.result})},a.readAsDataURL(r),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.error("Error loading the font file:",e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=UA(GA().mark((function e(){var n,r,a,o;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=15;break}return(r=document.querySelector(".polotno-workspace-container"))&&r.classList.add("show-loader"),a=null==h||null===(n=h.product)||void 0===n?void 0:n.paperSize.split("x"),t.setUnit({unit:"in",dpi:96}),t.setSize(+a[1]*ba,+a[0]*ba),e.next=8,Oa(null==h?void 0:h.templateUrl);case 8:return o=e.sent,t.loadJSON(o),e.next=12,t.waitLoading();case 12:i(!1),f({type:cr,payload:!1}),r&&r.classList.add("hide-loader");case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return l.createElement("div",{className:"polotno-container"},c>0&&l.createElement("div",{className:"builder-wrapper"},l.createElement(HC,{store:t,isStoreUpdated:o,returnRoute:r}),l.createElement(Eh.PolotnoContainer,{style:v},"Real Penned Letter"!==m&&l.createElement(DA,{store:t}),l.createElement(Eh.WorkspaceWrap,null,"Real Penned Letter"!==m&&l.createElement(zh.Toolbar,{store:t,downloadButtonEnabled:!1}),"Real Penned Letter"!==m?l.createElement(Sh.Workspace,{store:t,pageControlsEnabled:!1}):l.createElement(Sh.Workspace,{store:t,pageControlsEnabled:!1,components:{Tooltip:function(){return null}}}),l.createElement(Mh.ZoomButtons,{store:t})))))};var YA,ZA;function XA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function KA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return JA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _A=function(e){return(0,oa.createStore)({key:e,showCredit:!1})};const $A=function(e){var t,n=e.secretKey,r=e.returnRoute,a=e.styles,o=KA((0,l.useState)(_A(n)),2),i=o[0],s=o[1],c=null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.pathname;(0,l.useEffect)((function(){if("/create-template"===c){var e=_A(n);s(e)}}),[c]);var u=a&&Object.keys(a).length?Ol(YA||(YA=XA(["\n :root {\n ","\n }\n body { background-color: var(--mainBackgroundColor);}"])),a?Object.entries(a.root).map((function(e){var t=KA(e,2),n=t[0],r=t[1];return"".concat(n,": ").concat(r,";")})).join(" "):""):Ol(ZA||(ZA=XA(["<></>"])));return l.createElement(l.Fragment,null,l.createElement(u,null),l.createElement(ze,null,l.createElement(Ee,{path:"/create-template",element:l.createElement(Lh,{returnRoute:r})}),l.createElement(Ee,{path:"/template-builder",element:l.createElement(QA,{store:i,returnRoute:r})})))};var em=a(10002),tm={};tm.styleTagTransform=rs(),tm.setAttributes=$l(),tm.insert=Jl().bind(null,"head"),tm.domAPI=Xl(),tm.insertStyleElement=ts();Yl()(em.A,tm);em.A&&em.A.locals&&em.A.locals;var nm=a(90330),rm={};rm.styleTagTransform=rs(),rm.setAttributes=$l(),rm.insert=Jl().bind(null,"head"),rm.domAPI=Xl(),rm.insertStyleElement=ts();Yl()(nm.A,rm);nm.A&&nm.A.locals&&nm.A.locals;var am=a(91729),om={};om.styleTagTransform=rs(),om.setAttributes=$l(),om.insert=Jl().bind(null,"head"),om.domAPI=Xl(),om.insertStyleElement=ts();Yl()(am.A,om);am.A&&am.A.locals&&am.A.locals;var im=a(68300),lm={};lm.styleTagTransform=rs(),lm.setAttributes=$l(),lm.insert=Jl().bind(null,"head"),lm.domAPI=Xl(),lm.insertStyleElement=ts();Yl()(im.A,lm);im.A&&im.A.locals&&im.A.locals;var sm=a(39719),cm={};cm.styleTagTransform=rs(),cm.setAttributes=$l(),cm.insert=Jl().bind(null,"head"),cm.domAPI=Xl(),cm.insertStyleElement=ts();Yl()(sm.A,cm);sm.A&&sm.A.locals&&sm.A.locals;const um=function(e){var t=e.container,n=e.apiKey,r=e.secretKey,a=e.mode,o=e.returnRoute,i=e.styles;if(!t)throw new Error("Root element not found");if(!n)throw new Error("apiKey not found");if(!r)throw new Error("secretKey not found");f(n),function(e){e}(a),c.createRoot(t).render(l.createElement(l.StrictMode,null,l.createElement(Ne,null,l.createElement(ot,{store:aa},l.createElement($A,{secretKey:r,styles:i,returnRoute:o})))))};var dm=o.A;export{dm as default};
|
|
547
|
+
const eA="react-tooltip-core-styles",tA="react-tooltip-base-styles",nA={core:!1,base:!1};function rA({css:e,id:t=tA,type:n="base",ref:r}){var a,o;if(!e||"undefined"==typeof document||nA[n])return;if("core"===n&&"undefined"!=typeof process&&(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==n&&"undefined"!=typeof process&&(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===n&&(t=eA),r||(r={});const{insertAt:i}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),nA[n]=!0}const aA=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:a=10,strategy:o="absolute",middlewares:i=[Xu(Number(a)),Ju({fallbackAxisSideDirection:"start"}),Ku({padding:5})],border:l})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const s=i;return n?(s.push(_u({element:n,padding:5})),$u(e,t,{placement:r,strategy:o,middleware:s}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var a,o;const i={left:`${e}px`,top:`${t}px`,border:l},{x:s,y:c}=null!==(a=r.arrow)&&void 0!==a?a:{x:0,y:0},u=null!==(o={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==o?o:"bottom",d=l&&{borderBottom:l,borderRight:l};let f=0;if(l){const e=`${l}`.match(/(\d+)px/);f=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:i,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+f}px`},place:n}}))):$u(e,t,{placement:"bottom",strategy:o,middleware:s}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})))},oA=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),iA=(e,t,n)=>{let r=null;const a=function(...a){const o=()=>{r=null,n||e.apply(this,a)};n&&!r&&(e.apply(this,a),r=setTimeout(o,t)),n||(r&&clearTimeout(r),r=setTimeout(o,t))};return a.cancel=()=>{r&&(clearTimeout(r),r=null)},a},lA=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,sA=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>sA(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!lA(e)||!lA(t))return e===t;const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>sA(e[n],t[n])))},cA=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n}))},uA=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(cA(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},dA="undefined"!=typeof window?l.useLayoutEffect:l.useEffect,fA="DEFAULT_TOOLTIP_ID",pA={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},hA=(0,l.createContext)({getTooltipData:()=>pA});function CA(e=fA){return(0,l.useContext)(hA).getTooltipData(e)}var AA={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},mA={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const vA=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:a="dark",anchorId:o,anchorSelect:i,place:s="top",offset:c=10,events:u=["hover"],openOnClick:d=!1,positionStrategy:f="absolute",middlewares:p,wrapper:h,delayShow:C=0,delayHide:A=0,float:m=!1,hidden:v=!1,noArrow:g=!1,clickable:y=!1,closeOnEsc:b=!1,closeOnScroll:L=!1,closeOnResize:E=!1,openEvents:w,closeEvents:z,globalCloseEvents:M,imperativeModeOnly:S,style:H,position:R,afterShow:x,afterHide:V,content:T,contentWrapperRef:N,isOpen:O,defaultIsOpen:P=!1,setIsOpen:k,activeAnchor:D,setActiveAnchor:B,border:I,opacity:F,arrowColor:G,role:j="tooltip"})=>{var U;const q=(0,l.useRef)(null),W=(0,l.useRef)(null),Q=(0,l.useRef)(null),Y=(0,l.useRef)(null),Z=(0,l.useRef)(null),[X,K]=(0,l.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[J,_]=(0,l.useState)(!1),[$,ee]=(0,l.useState)(!1),[te,ne]=(0,l.useState)(null),re=(0,l.useRef)(!1),ae=(0,l.useRef)(null),{anchorRefs:oe,setActiveAnchor:ie}=CA(t),le=(0,l.useRef)(!1),[se,ce]=(0,l.useState)([]),ue=(0,l.useRef)(!1),de=d||u.includes("click"),fe=de||(null==w?void 0:w.click)||(null==w?void 0:w.dblclick)||(null==w?void 0:w.mousedown),pe=w?{...w}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!w&&de&&Object.assign(pe,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const he=z?{...z}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!z&&de&&Object.assign(he,{mouseleave:!1,blur:!1,mouseout:!1});const Ce=M?{...M}:{escape:b||!1,scroll:L||!1,resize:E||!1,clickOutsideAnchor:fe||!1};S&&(Object.assign(pe,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(he,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ce,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),dA((()=>(ue.current=!0,()=>{ue.current=!1})),[]);const Ae=e=>{ue.current&&(e&&ee(!0),setTimeout((()=>{ue.current&&(null==k||k(e),void 0===O&&_(e))}),10))};(0,l.useEffect)((()=>{if(void 0===O)return()=>null;O&&ee(!0);const e=setTimeout((()=>{_(O)}),10);return()=>{clearTimeout(e)}}),[O]),(0,l.useEffect)((()=>{if(J!==re.current)if(Z.current&&clearTimeout(Z.current),re.current=J,J)null==x||x();else{const e=(e=>{const t=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!t)return 0;const[,n,r]=t;return Number(n)*("ms"===r?1:1e3)})();Z.current=setTimeout((()=>{ee(!1),ne(null),null==V||V()}),e+25)}}),[J]);const me=e=>{K((t=>sA(t,e)?t:e))},ve=(e=C)=>{Q.current&&clearTimeout(Q.current),$?Ae(!0):Q.current=setTimeout((()=>{Ae(!0)}),e)},ge=(e=A)=>{Y.current&&clearTimeout(Y.current),Y.current=setTimeout((()=>{le.current||Ae(!1)}),e)},ye=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return B(null),void ie({current:null});C?ve():Ae(!0),B(n),ie({current:n}),Y.current&&clearTimeout(Y.current)},be=()=>{y?ge(A||100):A?ge():Ae(!1),Q.current&&clearTimeout(Q.current)},Le=({x:e,y:t})=>{var n;const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};aA({place:null!==(n=null==te?void 0:te.place)&&void 0!==n?n:s,offset:c,elementReference:r,tooltipReference:q.current,tooltipArrowReference:W.current,strategy:f,middlewares:p,border:I}).then((e=>{me(e)}))},Ee=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};Le(n),ae.current=n},we=e=>{var t;if(!J)return;const n=e.target;n.isConnected&&((null===(t=q.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${o}']`),...se].some((e=>null==e?void 0:e.contains(n)))||(Ae(!1),Q.current&&clearTimeout(Q.current)))},ze=iA(ye,50,!0),Me=iA(be,50,!0),Se=e=>{Me.cancel(),ze(e)},He=()=>{ze.cancel(),Me()},Re=(0,l.useCallback)((()=>{var e,t;const n=null!==(e=null==te?void 0:te.position)&&void 0!==e?e:R;n?Le(n):m?ae.current&&Le(ae.current):(null==D?void 0:D.isConnected)&&aA({place:null!==(t=null==te?void 0:te.place)&&void 0!==t?t:s,offset:c,elementReference:D,tooltipReference:q.current,tooltipArrowReference:W.current,strategy:f,middlewares:p,border:I}).then((e=>{ue.current&&me(e)}))}),[J,D,T,H,s,null==te?void 0:te.place,c,f,R,null==te?void 0:te.position,m]);(0,l.useEffect)((()=>{var e,t;const n=new Set(oe);se.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${o}']`);r&&n.add({current:r});const a=()=>{Ae(!1)},i=uA(D),l=uA(q.current);Ce.scroll&&(window.addEventListener("scroll",a),null==i||i.addEventListener("scroll",a),null==l||l.addEventListener("scroll",a));let s=null;Ce.resize?window.addEventListener("resize",a):D&&q.current&&(s=Zu(D,q.current,Re,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Ae(!1)};Ce.escape&&window.addEventListener("keydown",c),Ce.clickOutsideAnchor&&window.addEventListener("click",we);const u=[],d=e=>{J&&(null==e?void 0:e.target)===D||ye(e)},f=e=>{J&&(null==e?void 0:e.target)===D&&be()},p=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],h=["click","dblclick","mousedown","mouseup"];Object.entries(pe).forEach((([e,t])=>{t&&(p.includes(e)?u.push({event:e,listener:Se}):h.includes(e)&&u.push({event:e,listener:d}))})),Object.entries(he).forEach((([e,t])=>{t&&(p.includes(e)?u.push({event:e,listener:He}):h.includes(e)&&u.push({event:e,listener:f}))})),m&&u.push({event:"pointermove",listener:Ee});const C=()=>{le.current=!0},A=()=>{le.current=!1,be()};return y&&!fe&&(null===(e=q.current)||void 0===e||e.addEventListener("mouseenter",C),null===(t=q.current)||void 0===t||t.addEventListener("mouseleave",A)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;Ce.scroll&&(window.removeEventListener("scroll",a),null==i||i.removeEventListener("scroll",a),null==l||l.removeEventListener("scroll",a)),Ce.resize?window.removeEventListener("resize",a):null==s||s(),Ce.clickOutsideAnchor&&window.removeEventListener("click",we),Ce.escape&&window.removeEventListener("keydown",c),y&&!fe&&(null===(e=q.current)||void 0===e||e.removeEventListener("mouseenter",C),null===(t=q.current)||void 0===t||t.removeEventListener("mouseleave",A)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[D,Re,$,oe,se,w,z,M,de,C,A]),(0,l.useEffect)((()=>{var e,n;let r=null!==(n=null!==(e=null==te?void 0:te.anchorSelect)&&void 0!==e?e:i)&&void 0!==n?n:"";!r&&t&&(r=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const a=new MutationObserver((e=>{const n=[],a=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===t?n.push(e.target):e.oldValue===t&&a.push(e.target)),"childList"===e.type){if(D){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(r)try{a.push(...t.filter((e=>e.matches(r)))),a.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,D))&&(ee(!1),Ae(!1),B(null),Q.current&&clearTimeout(Q.current),Y.current&&clearTimeout(Y.current),!0)}))}if(r)try{const t=[...e.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((e=>e.matches(r)))),n.push(...t.flatMap((e=>[...e.querySelectorAll(r)])))}catch(e){}}})),(n.length||a.length)&&ce((e=>[...e.filter((e=>!a.includes(e))),...n]))}));return a.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{a.disconnect()}}),[t,i,null==te?void 0:te.anchorSelect,D]),(0,l.useEffect)((()=>{Re()}),[Re]),(0,l.useEffect)((()=>{if(!(null==N?void 0:N.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Re()))}));return e.observe(N.current),()=>{e.disconnect()}}),[T,null==N?void 0:N.current]),(0,l.useEffect)((()=>{var e;const t=document.querySelector(`[id='${o}']`),n=[...se,t];D&&n.includes(D)||B(null!==(e=se[0])&&void 0!==e?e:t)}),[o,se,D]),(0,l.useEffect)((()=>(P&&Ae(!0),()=>{Q.current&&clearTimeout(Q.current),Y.current&&clearTimeout(Y.current)})),[]),(0,l.useEffect)((()=>{var e;let n=null!==(e=null==te?void 0:te.anchorSelect)&&void 0!==e?e:i;if(!n&&t&&(n=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),n)try{const e=Array.from(document.querySelectorAll(n));ce(e)}catch(e){ce([])}}),[t,i,null==te?void 0:te.anchorSelect]),(0,l.useEffect)((()=>{Q.current&&(clearTimeout(Q.current),ve(C))}),[C]);const xe=null!==(U=null==te?void 0:te.content)&&void 0!==U?U:T,Ve=J&&Object.keys(X.tooltipStyles).length>0;return(0,l.useImperativeHandle)(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ne(null!=e?e:null),(null==e?void 0:e.delay)?ve(e.delay):Ae(!0)},close:e=>{(null==e?void 0:e.delay)?ge(e.delay):Ae(!1)},activeAnchor:D,place:X.place,isOpen:Boolean($&&!v&&xe&&Ve)}))),$&&!v&&xe?l.createElement(h,{id:t,role:j,className:$C("react-tooltip",AA.tooltip,mA.tooltip,mA[a],n,`react-tooltip__place-${X.place}`,AA[Ve?"show":"closing"],Ve?"react-tooltip__show":"react-tooltip__closing","fixed"===f&&AA.fixed,y&&AA.clickable),onTransitionEnd:e=>{Z.current&&clearTimeout(Z.current),J||"opacity"!==e.propertyName||(ee(!1),ne(null),null==V||V())},style:{...H,...X.tooltipStyles,opacity:void 0!==F&&Ve?F:void 0},ref:q},xe,l.createElement(h,{className:$C("react-tooltip-arrow",AA.arrow,mA.arrow,r,g&&AA.noArrow),style:{...X.tooltipArrowStyles,background:G?`linear-gradient(to right bottom, transparent 50%, ${G} 50%)`:void 0},ref:W})):null},gA=({content:e})=>l.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),yA=l.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:a,render:o,className:i,classNameArrow:s,variant:c="dark",place:u="top",offset:d=10,wrapper:f="div",children:p=null,events:h=["hover"],openOnClick:C=!1,positionStrategy:A="absolute",middlewares:m,delayShow:v=0,delayHide:g=0,float:y=!1,hidden:b=!1,noArrow:L=!1,clickable:E=!1,closeOnEsc:w=!1,closeOnScroll:z=!1,closeOnResize:M=!1,openEvents:S,closeEvents:H,globalCloseEvents:R,imperativeModeOnly:x=!1,style:V,position:T,isOpen:N,defaultIsOpen:O=!1,disableStyleInjection:P=!1,border:k,opacity:D,arrowColor:B,setIsOpen:I,afterShow:F,afterHide:G,role:j="tooltip"},U)=>{const[q,W]=(0,l.useState)(r),[Q,Y]=(0,l.useState)(a),[Z,X]=(0,l.useState)(u),[K,J]=(0,l.useState)(c),[_,$]=(0,l.useState)(d),[ee,te]=(0,l.useState)(v),[ne,re]=(0,l.useState)(g),[ae,oe]=(0,l.useState)(y),[ie,le]=(0,l.useState)(b),[se,ce]=(0,l.useState)(f),[ue,de]=(0,l.useState)(h),[fe,pe]=(0,l.useState)(A),[he,Ce]=(0,l.useState)(null),[Ae,me]=(0,l.useState)(null),ve=(0,l.useRef)(P),{anchorRefs:ge,activeAnchor:ye}=CA(e),be=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null),t}),{}),Le=e=>{const t={place:e=>{var t;X(null!==(t=e)&&void 0!==t?t:u)},content:e=>{W(null!=e?e:r)},html:e=>{Y(null!=e?e:a)},variant:e=>{var t;J(null!==(t=e)&&void 0!==t?t:c)},offset:e=>{$(null===e?d:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:h)},"position-strategy":e=>{var t;pe(null!==(t=e)&&void 0!==t?t:A)},"delay-show":e=>{te(null===e?v:Number(e))},"delay-hide":e=>{re(null===e?g:Number(e))},float:e=>{oe(null===e?y:"true"===e)},hidden:e=>{le(null===e?b:"true"===e)},"class-name":e=>{Ce(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};(0,l.useEffect)((()=>{W(r)}),[r]),(0,l.useEffect)((()=>{Y(a)}),[a]),(0,l.useEffect)((()=>{X(u)}),[u]),(0,l.useEffect)((()=>{J(c)}),[c]),(0,l.useEffect)((()=>{$(d)}),[d]),(0,l.useEffect)((()=>{te(v)}),[v]),(0,l.useEffect)((()=>{re(g)}),[g]),(0,l.useEffect)((()=>{oe(y)}),[y]),(0,l.useEffect)((()=>{le(b)}),[b]),(0,l.useEffect)((()=>{pe(A)}),[A]),(0,l.useEffect)((()=>{ve.current!==P&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[P]),(0,l.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===P,disableBase:P}}))}),[]),(0,l.useEffect)((()=>{var r;const a=new Set(ge);let o=n;if(!o&&e&&(o=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),o)try{document.querySelectorAll(o).forEach((e=>{a.add({current:e})}))}catch(r){console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`)}const i=document.querySelector(`[id='${t}']`);if(i&&a.add({current:i}),!a.size)return()=>null;const l=null!==(r=null!=Ae?Ae:i)&&void 0!==r?r:ye.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!l||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=be(l);Le(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(l){const e=be(l);Le(e),s.observe(l,c)}return()=>{s.disconnect()}}),[ge,ye,Ae,t,n]),(0,l.useEffect)((()=>{(null==V?void 0:V.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),k&&!oA("border",`${k}`)&&console.warn(`[react-tooltip] "${k}" is not a valid \`border\`.`),(null==V?void 0:V.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),D&&!oA("opacity",`${D}`)&&console.warn(`[react-tooltip] "${D}" is not a valid \`opacity\`.`)}),[]);let Ee=p;const we=(0,l.useRef)(null);if(o){const e=o({content:(null==Ae?void 0:Ae.getAttribute("data-tooltip-content"))||q||null,activeAnchor:Ae});Ee=e?l.createElement("div",{ref:we,className:"react-tooltip-content-wrapper"},e):null}else q&&(Ee=q);Q&&(Ee=l.createElement(gA,{content:Q}));const ze={forwardRef:U,id:e,anchorId:t,anchorSelect:n,className:$C(i,he),classNameArrow:s,content:Ee,contentWrapperRef:we,place:Z,variant:K,offset:_,wrapper:se,events:ue,openOnClick:C,positionStrategy:fe,middlewares:m,delayShow:ee,delayHide:ne,float:ae,hidden:ie,noArrow:L,clickable:E,closeOnEsc:w,closeOnScroll:z,closeOnResize:M,openEvents:S,closeEvents:H,globalCloseEvents:R,imperativeModeOnly:x,style:V,position:T,isOpen:N,defaultIsOpen:O,border:k,opacity:D,arrowColor:B,setIsOpen:I,afterShow:F,afterHide:G,activeAnchor:Ae,setActiveAnchor:e=>me(e),role:j};return l.createElement(vA,{...ze})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||rA({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||rA({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})}));var bA=a(27455),LA={};LA.styleTagTransform=rs(),LA.setAttributes=$l(),LA.insert=Jl().bind(null,"head"),LA.domAPI=Xl(),LA.insertStyleElement=ts();Yl()(bA.A,LA);bA.A&&bA.A.locals&&bA.A.locals;var EA=a(99197),wA={};wA.styleTagTransform=rs(),wA.setAttributes=$l(),wA.insert=Jl().bind(null,"head"),wA.domAPI=Xl(),wA.insertStyleElement=ts();Yl()(EA.A,wA);EA.A&&EA.A.locals&&EA.A.locals;const zA=function(e){var t=e.anchorSelect,n=e.place,r=e.title;return l.createElement(yA,{className:"basic-tooltip",anchorSelect:t,place:n},r)};const MA=function(e){var t=e.className,n=void 0===t?{}:t,r=e.fill;return l.createElement("svg",{width:"12",className:n,height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("g",{clipPath:"url(#clip0_1555_2219)"},l.createElement("path",{d:"M6.80169 8.45472C6.67902 8.46615 6.55586 8.43847 6.44987 8.37562C6.37243 8.29612 6.33531 8.18575 6.34897 8.07562C6.35183 7.98393 6.36278 7.89266 6.38169 7.8029C6.4 7.69991 6.42364 7.59796 6.45259 7.49744L6.77441 6.39015C6.8076 6.28087 6.82954 6.16846 6.83987 6.05469C6.83987 5.93197 6.85623 5.84741 6.85623 5.79833C6.86307 5.57959 6.76968 5.36969 6.60259 5.22833C6.39707 5.07055 6.14113 4.993 5.88259 5.01015C5.69732 5.01294 5.51347 5.04327 5.33713 5.10015C5.1444 5.16015 4.94167 5.23197 4.72895 5.31562L4.63623 5.67561C4.69895 5.65379 4.77533 5.62926 4.86259 5.60197C4.94584 5.57732 5.03214 5.56445 5.11895 5.56379C5.24073 5.5506 5.36331 5.58051 5.46531 5.64833C5.53459 5.731 5.5671 5.83839 5.55531 5.94562C5.555 6.03733 5.54495 6.12876 5.52531 6.21833C5.50621 6.3138 5.48167 6.41469 5.45167 6.52105L5.12713 7.63377C5.10097 7.7372 5.08004 7.84187 5.06441 7.94741C5.05166 8.03776 5.04529 8.12889 5.04531 8.22013C5.04397 8.44037 5.14468 8.64883 5.31803 8.78467C5.52672 8.94491 5.78631 9.02434 6.04893 9.00831C6.23385 9.01211 6.41814 8.98539 6.59439 8.92921C6.74893 8.87647 6.9553 8.80103 7.21349 8.70285L7.30077 8.35921C7.23083 8.38822 7.15881 8.41192 7.08531 8.43011C6.99236 8.45134 6.89692 8.45959 6.80169 8.45472Z",fill:r}),l.createElement("path",{d:"M7.14277 3.20479C6.99434 3.06848 6.79878 2.99514 6.59731 3.00025C6.39596 2.9957 6.20059 3.06897 6.05185 3.20479C5.77923 3.43987 5.74878 3.85145 5.98388 4.1241C6.00484 4.14841 6.02755 4.17112 6.05185 4.19207C6.36244 4.46988 6.83218 4.46988 7.14275 4.19207C7.41537 3.95467 7.44394 3.54123 7.20655 3.26861C7.18681 3.2459 7.16548 3.22457 7.14277 3.20479Z",fill:r}),l.createElement("path",{d:"M6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0ZM6 11.4545C2.98753 11.4545 0.545461 9.01247 0.545461 6C0.545461 2.98753 2.98753 0.545461 6 0.545461C9.01247 0.545461 11.4545 2.98753 11.4545 6C11.4545 9.01247 9.01247 11.4545 6 11.4545Z",fill:r})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_1555_2219"},l.createElement("rect",{width:"12",height:"12",fill:"white"}))))};const SA=function(e){var t=e.className,n=void 0===t?{}:t;return l.createElement("svg",{width:"19",className:n,height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M3.5 15.025H3.975V15.5C3.975 16.1697 4.24103 16.8119 4.71456 17.2854C5.18809 17.759 5.83033 18.025 6.5 18.025H15.5C16.1697 18.025 16.8119 17.759 17.2854 17.2854C17.759 16.8119 18.025 16.1697 18.025 15.5V6.5C18.025 5.83033 17.759 5.18809 17.2854 4.71456C16.8119 4.24103 16.1697 3.975 15.5 3.975H15.025V3.5C15.025 2.83033 14.759 2.18808 14.2854 1.71456C13.8119 1.24103 13.1697 0.975 12.5 0.975H3.5C2.83033 0.975 2.18808 1.24103 1.71456 1.71456C1.24103 2.18808 0.975 2.83033 0.975 3.5V12.5C0.975 13.1697 1.24103 13.8119 1.71456 14.2854C2.18808 14.759 2.83033 15.025 3.5 15.025ZM15.5 5.025C15.8912 5.025 16.2664 5.1804 16.543 5.45702C16.8196 5.73363 16.975 6.10881 16.975 6.5V15.5C16.975 15.8912 16.8196 16.2664 16.543 16.543C16.2664 16.8196 15.8912 16.975 15.5 16.975H6.5C6.10881 16.975 5.73363 16.8196 5.45702 16.543C5.1804 16.2664 5.025 15.8912 5.025 15.5V15.025H12.5C13.1697 15.025 13.8119 14.759 14.2854 14.2854C14.759 13.8119 15.025 13.1697 15.025 12.5V5.025H15.5ZM2.025 3.5C2.025 3.10881 2.1804 2.73363 2.45702 2.45702C2.73363 2.1804 3.10881 2.025 3.5 2.025H12.5C12.8912 2.025 13.2664 2.1804 13.543 2.45702C13.8196 2.73363 13.975 3.10881 13.975 3.5V12.5C13.975 12.8912 13.8196 13.2664 13.543 13.543C13.2664 13.8196 12.8912 13.975 12.5 13.975H3.5C3.10881 13.975 2.73363 13.8196 2.45702 13.543C2.1804 13.2664 2.025 12.8912 2.025 12.5V3.5Z",fill:"",stroke:"",strokeWidth:"0.05"}))};const HA=function(e){var t=e.stroke;return l.createElement(l.Fragment,null,l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Capa_1",x:"0px",y:"0px",viewBox:"0 0 512 512",style:{width:"18px",height:"18px"},xmlSpace:"preserve",width:"512",height:"512"},l.createElement("g",null,l.createElement("path",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},d:"M412,136h40c22.091,0,40,17.909,40,40v160c0,22.091-17.909,40-40,40h-40"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"100",y1:"216",x2:"180",y2:"216"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"140",y1:"296",x2:"140",y2:"216"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"332",y1:"456",x2:"332",y2:"56"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"292",y1:"56",x2:"372",y2:"56"}),l.createElement("line",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},x1:"292",y1:"456",x2:"372",y2:"456"}),l.createElement("path",{style:{fill:"none",stroke:"".concat(t),strokeWidth:40,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},d:"M332,376H60c-22.091,0-40-17.909-40-40V176c0-22.091,17.909-40,40-40h272"}))))};function RA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VA(){return VA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VA.apply(null,arguments)}var TA={backgroundColor:"transparent"},NA={name:"Fields",Tab:(0,xC.observer)((function(e){return l.createElement(RC.SectionTab,VA({name:"Fields"},e),l.createElement(HA,{stroke:"var(--sidepanelSVGColor)"}))})),Panel:(0,xC.observer)((function(e){var t,n=e.store,r=RA((0,l.useState)(!1),2),a=(r[0],r[1]),o=ct(),i=et((function(e){return e.customFields.customFields})),s=et((function(e){return e.customFields.defaultDynamicFields})),c=et((function(e){return e.templates.product})),u=null==c?void 0:c.productType;(0,l.useEffect)((function(){o(Wr())}),[o]);var f=function(e,t,r){if(e.preventDefault(),"Real Penned Letter"===u)return d(t),void o(Gp("".concat(t," Copied")));var a,i;if("drag"===r){var l=e.currentTarget.getBoundingClientRect();a=e.clientX-l.left,i=e.clientY-l.top}else a=n.width/2-200,i=300;a/=n.activePage.scale,i/=n.activePage.scale,n.activePage.addElement({type:"text",x:a,y:i,text:t,width:t.length>15?10*t.length:150,contentEditable:!1})};return l.createElement("div",{className:"dynamic-content"},l.createElement("div",{className:"dynamic-content__top"},l.createElement("div",null,l.createElement("span",{className:"title"},"Contact Fields"),l.createElement(MA,{fill:"var(--primaryColor)",className:"infoIcon"}),l.createElement(zA,{anchorSelect:".infoIcon",place:"bottom",title:"Merge fields allow you to personalize your mailer with contact information."}))),s.map((function(e,t){var n=e.key,r=e.value;return l.createElement("div",{style:{display:"flex",alignItems:"center"},key:t},l.createElement("span",{className:"contact-element",onClick:function(e){return f(e,n,"click")}},r),l.createElement(cs,{style:TA,onClick:function(){return d(n)}},l.createElement(SA,{className:"copy"})))})),l.createElement(zA,{anchorSelect:".copy",place:"bottom",title:"Copy"}),l.createElement("hr",{className:"divider"}),l.createElement("div",{className:"dynamic-content__top"},l.createElement("div",null,l.createElement("span",{className:"title"},"Custom Fields"),l.createElement(MA,{fill:"var(--primaryColor)",className:"custom"}),l.createElement(zA,{anchorSelect:".custom",place:"bottom",title:"You can add custom fields to your template."})),l.createElement(cs,{onClick:function(){a((function(e){return!e}))}})),null===(t=i.data)||void 0===t?void 0:t.map((function(e,t){var n=e.key,r=e.value;return l.createElement("div",{style:{display:"flex",alignItems:"center"},key:t},l.createElement("span",{className:"contact-element",onClick:function(e){return f(e,n,"click")}},r),l.createElement(cs,{style:TA,onClick:function(){return d(n)}},l.createElement(SA,{className:"copy"})))})))}))};const OA=NA;function PA(e){return function(e){if(Array.isArray(e))return kA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return kA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kA(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const DA=function(e){var t=RC.DEFAULT_SECTIONS.filter((function(e){return!["photos","size","templates"].includes(e.name)}));return l.createElement(Eh.SidePanelWrap,null,l.createElement(RC.SidePanel,{store:e.store,sections:[KC].concat(PA(t),[OA]),defaultSection:"text"}))};var BA=a(22995),IA={};IA.styleTagTransform=rs(),IA.setAttributes=$l(),IA.insert=Jl().bind(null,"head"),IA.domAPI=Xl(),IA.insertStyleElement=ts();Yl()(BA.A,IA);BA.A&&BA.A.locals&&BA.A.locals;function FA(e){return FA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FA(e)}function GA(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */GA=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),l=new x(r||[]);return a(i,"_invoke",{value:M(e,n,l)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",C="completed",A={};function m(){}function v(){}function g(){}var y={};c(y,i,(function(){return this}));var b=Object.getPrototypeOf,L=b&&b(b(V([])));L&&L!==n&&r.call(L,i)&&(y=L);var E=g.prototype=m.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function z(e,t){function n(a,o,i,l){var s=d(e[a],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==FA(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function M(t,n,r){var a=f;return function(o,i){if(a===h)throw Error("Generator is already running");if(a===C){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var l=r.delegate;if(l){var s=S(l,r);if(s){if(s===A)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=C,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=h;var c=d(t,n,r);if("normal"===c.type){if(a=r.done?C:p,c.arg===A)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=C,r.method="throw",r.arg=c.arg)}}}function S(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),A;var o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,A):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function H(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(H,this),this.reset(!0)}function V(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(FA(t)+" is not iterable")}return v.prototype=g,a(E,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},w(z.prototype),c(z.prototype,l,(function(){return this})),t.AsyncIterator=z,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new z(u(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=V,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return l.type="throw",l.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,A):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;R(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:V(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),A}},t}function jA(e,t,n,r,a,o,i){try{var l=e[o](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,a)}function UA(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){jA(o,r,a,i,l,"next",e)}function l(e){jA(o,r,a,i,l,"throw",e)}i(void 0)}))}}function qA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return WA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function WA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,wh.Ut)(Ca);const QA=function(e){var t=e.store,n=e.styles,r=e.returnRoute,a=qA((0,l.useState)(!1),2),o=a[0],i=a[1],s=qA((0,l.useState)(1),2),c=s[0],u=s[1],d=ce().id,f=ct(),p=se(),h=et((function(e){return e.templates.template})),C=et((function(e){return e.templates.product})),A=et((function(e){return e.templates.envelopeType})),m=null==C?void 0:C.productType,v=Rh()({width:"100vw",height:"90vh",position:"relative",backgroundColor:"var(--mainBackgroundColor) !important"},n||{});(0,l.useEffect)((function(){b()}),[h]),(0,l.useEffect)((function(){var e=function(){document.hidden&&u((function(e){return e+1}))};return document.addEventListener("visibilitychange",e),function(){document.removeEventListener("visibilitychange",e)}}),[]),(0,l.useEffect)((function(){C||p("/create-template")}),[]),(0,l.useEffect)((function(){if(C){(0,wh.O3)(Vh),d?f(ua(d)):0===t.pages.length&&g(),f(function(){var e=ca(la().mark((function e(t){var n,r,a;return la().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Dr("custom-fields");case 3:200===(null==(n=e.sent)?void 0:n.status)&&(a=null==n||null===(r=n.data)||void 0===r?void 0:r.data.reduce((function(e,t){return e[t.key.replace(/{{|}}/g,"")]=t,e}),{}),t({type:pr,payload:{data:a}})),e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",e.t0.response);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}());var e=t.on("change",(function(){o||i(!0)}));return function(){t.history.clear(),t.clear(),e()}}}),[]),(0,l.useEffect)((function(){!d&&C&&0===t.pages.length&&g()}),[C]),(0,l.useEffect)((function(){var e=function(e){var t="Are you sure you want to leave?";return e.returnValue=t,t};return o&&(window.removeEventListener("beforeunload",e),window.addEventListener("beforeunload",e)),function(){window.removeEventListener("beforeunload",e)}}),[o]);var g=function(){var e=UA(GA().mark((function e(){var n,r;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C&&(t.addPage(),r=null==C||null===(n=C.selectedSize)||void 0===n?void 0:n.split("x"),t.setUnit({unit:"in",dpi:ba}),t.setSize(+r[1]*ba,+r[0]*ba),Ea.includes(C.productType)&&(t.addPage(),t.selectPage(t.pages[0].id)),Ba(t,C,A),"Real Penned Letter"===m&&y(),t.history.clear()),i(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=UA(GA().mark((function e(){var n,r,a;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.addFont({fontFamily:"lexi Regular",url:Th}),xh(t),e.next=5,fetch(Th);case 5:return n=e.sent,e.next=8,n.blob();case 8:r=e.sent,(a=new FileReader).onloadend=function(){t.addFont({fontFamily:"lexi Regular",url:a.result})},a.readAsDataURL(r),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.error("Error loading the font file:",e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=UA(GA().mark((function e(){var n,r,a,o;return GA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=15;break}return(r=document.querySelector(".polotno-workspace-container"))&&r.classList.add("show-loader"),a=null==h||null===(n=h.product)||void 0===n?void 0:n.paperSize.split("x"),t.setUnit({unit:"in",dpi:96}),t.setSize(+a[1]*ba,+a[0]*ba),e.next=8,Oa(null==h?void 0:h.templateUrl);case 8:return o=e.sent,t.loadJSON(o),e.next=12,t.waitLoading();case 12:i(!1),f({type:cr,payload:!1}),r&&r.classList.add("hide-loader");case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return l.createElement("div",{className:"polotno-container"},c>0&&l.createElement("div",{className:"builder-wrapper"},l.createElement(HC,{store:t,isStoreUpdated:o,returnRoute:r}),l.createElement(Eh.PolotnoContainer,{style:v},"Real Penned Letter"!==m&&l.createElement(DA,{store:t}),l.createElement(Eh.WorkspaceWrap,null,"Real Penned Letter"!==m&&l.createElement(zh.Toolbar,{store:t,downloadButtonEnabled:!1}),"Real Penned Letter"!==m?l.createElement(Sh.Workspace,{store:t,pageControlsEnabled:!1}):l.createElement(Sh.Workspace,{store:t,pageControlsEnabled:!1,components:{Tooltip:function(){return null}}}),l.createElement(Mh.ZoomButtons,{store:t}))),l.createElement(Wp,null)))};var YA,ZA;function XA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function KA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return JA(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JA(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _A=function(e){return(0,oa.createStore)({key:e,showCredit:!1})};const $A=function(e){var t,n=e.secretKey,r=e.returnRoute,a=e.styles,o=KA((0,l.useState)(_A(n)),2),i=o[0],s=o[1],c=null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.pathname;(0,l.useEffect)((function(){if("/create-template"===c){var e=_A(n);s(e)}}),[c]);var u=a&&Object.keys(a).length?Ol(YA||(YA=XA(["\n :root {\n ","\n }\n body { background-color: var(--mainBackgroundColor);}"])),a?Object.entries(a.root).map((function(e){var t=KA(e,2),n=t[0],r=t[1];return"".concat(n,": ").concat(r,";")})).join(" "):""):Ol(ZA||(ZA=XA(["<></>"])));return l.createElement(l.Fragment,null,l.createElement(u,null),l.createElement(ze,null,l.createElement(Ee,{path:"/create-template",element:l.createElement(Lh,{returnRoute:r})}),l.createElement(Ee,{path:"/template-builder",element:l.createElement(QA,{store:i,returnRoute:r})})))};var em=a(10002),tm={};tm.styleTagTransform=rs(),tm.setAttributes=$l(),tm.insert=Jl().bind(null,"head"),tm.domAPI=Xl(),tm.insertStyleElement=ts();Yl()(em.A,tm);em.A&&em.A.locals&&em.A.locals;var nm=a(90330),rm={};rm.styleTagTransform=rs(),rm.setAttributes=$l(),rm.insert=Jl().bind(null,"head"),rm.domAPI=Xl(),rm.insertStyleElement=ts();Yl()(nm.A,rm);nm.A&&nm.A.locals&&nm.A.locals;var am=a(91729),om={};om.styleTagTransform=rs(),om.setAttributes=$l(),om.insert=Jl().bind(null,"head"),om.domAPI=Xl(),om.insertStyleElement=ts();Yl()(am.A,om);am.A&&am.A.locals&&am.A.locals;var im=a(68300),lm={};lm.styleTagTransform=rs(),lm.setAttributes=$l(),lm.insert=Jl().bind(null,"head"),lm.domAPI=Xl(),lm.insertStyleElement=ts();Yl()(im.A,lm);im.A&&im.A.locals&&im.A.locals;var sm=a(39719),cm={};cm.styleTagTransform=rs(),cm.setAttributes=$l(),cm.insert=Jl().bind(null,"head"),cm.domAPI=Xl(),cm.insertStyleElement=ts();Yl()(sm.A,cm);sm.A&&sm.A.locals&&sm.A.locals;const um=function(e){var t=e.container,n=e.apiKey,r=e.secretKey,a=e.mode,o=e.returnRoute,i=e.styles;if(!t)throw new Error("Root element not found");if(!n)throw new Error("apiKey not found");if(!r)throw new Error("secretKey not found");f(n),function(e){e}(a),c.createRoot(t).render(l.createElement(l.StrictMode,null,l.createElement(Ne,null,l.createElement(ot,{store:aa},l.createElement($A,{secretKey:r,styles:i,returnRoute:o})))))};var dm=o.A;export{dm as default};
|
|
548
548
|
//# sourceMappingURL=index.js.map
|