@creaditor/newsletter-starterkit 1.0.61 → 1.0.62
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5909],{65909(e,t,i){i.r(t),i.d(t,{NextButton:()=>g,PUBLISH_ERROR_EVENT:()=>f,PUBLISH_EVENT:()=>u});var
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5909],{65909(e,t,i){i.r(t),i.d(t,{NextButton:()=>g,PUBLISH_ERROR_EVENT:()=>f,PUBLISH_EVENT:()=>u});var o=i(59929),s=i(86319),r=i(93432),n=i(90090),a=i(86959),l=i(15604);const c=`${(0,a.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/seo-generate`;const d=o.qy`
|
|
2
2
|
<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16" aria-hidden="true">
|
|
3
3
|
<path
|
|
4
4
|
d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"
|
|
5
5
|
/>
|
|
6
6
|
</svg>
|
|
7
|
-
`;class h extends
|
|
7
|
+
`;class h extends o.WF{constructor(){super(),this.resolver=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.onCancel=()=>{this.loading||(this.settle(null),this.dismiss())},this.onKeywordKeydown=e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),this.commitDraftKeyword()):"Backspace"===e.key&&""===this.keywordDraft&&this.keywordList.length&&(this.keywordList=this.keywordList.slice(0,-1))},this.generateField=async e=>{if(this.loading||this.generatingField)return;const t=function(){const e=document.getElementById("main-page-wrapper");return(e?.innerText||"").trim()}();if(t){this.generatingField=e;try{const i="rtl"===this.direction?"he":"en",o=await this.requestSeo(e,t,i);if("keywords"===e){const e=(Array.isArray(o)?o:String(o).split(",")).map(e=>e.trim()).filter(Boolean),t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t}else"title"===e?this.title=String(o).slice(0,100):this.description=String(o).slice(0,255)}catch(e){console.error("[seo-generate] failed:",e),this.snackbar(this.t("seo_generate_failed","Couldn't generate. Please try again."))}finally{this.generatingField=""}}else this.snackbar(this.t("seo_generate_empty","Add some content to the page first."))},this.onPublish=()=>{this.loading||(this.commitDraftKeyword(),this.loading=!0,this.settle({seo:{title:this.title.trim(),description:this.description.trim(),keywords:[...this.keywordList]},busy:e=>{this.isConnected&&(this.loading=e)},done:this.dismiss}))},this.loading=!1,this.title="",this.description="",this.keywordList=[],this.keywordDraft="",this.keywordsFocused=!1,this.generatingField=""}static open(){const e=document.createElement("cdtr-publish-seo"),t=s.M.get("app","seo")||{};return e.title=t.title||"",e.description=t.description||"",e.keywordList=(Array.isArray(t.keywords)?t.keywords:String(t.keywords||"").split(",")).map(e=>String(e).trim()).filter(Boolean),document.body.appendChild(e),e.waitForChoice()}waitForChoice(){return new Promise(e=>{this.resolver=e})}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}settle(e){this.resolver&&(this.resolver(e),this.resolver=null)}commitDraftKeyword(){const e=this.keywordDraft.split(",").map(e=>e.trim()).filter(Boolean);if(!e.length)return;const t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t,this.keywordDraft=""}removeKeyword(e){this.keywordList=this.keywordList.filter((t,i)=>i!==e)}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}async requestSeo(e,t,i){const o=async o=>{const s=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=l.Ay;if("function"==typeof t.studioTokenProvider)try{const i=await t.studioTokenProvider({forceRefresh:e});if("string"==typeof i&&i.length>0)return i}catch{}return"string"==typeof t.studioToken&&t.studioToken.length>0?t.studioToken:null}(o),r={"Content-Type":"application/json",Accept:"application/json"};return s&&(r.Authorization=`Bearer ${s}`),fetch(c,{method:"POST",headers:r,body:JSON.stringify({content:t,field:e,language:i})})};let s=await o(!1);if(401===s.status&&(s=await o(!0)),!s.ok)throw new Error(`HTTP ${s.status}`);const r=await s.json();if(!r.ok||void 0===r.value)throw new Error("bad response");return r.value}magicButton(e){const t=this.generatingField===e;return o.qy`
|
|
8
8
|
<button
|
|
9
9
|
class="magic"
|
|
10
10
|
type="button"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
?disabled=${this.loading||!!this.generatingField}
|
|
14
14
|
@click=${()=>this.generateField(e)}
|
|
15
15
|
>
|
|
16
|
-
${t?
|
|
16
|
+
${t?o.qy`<span class="mini-spinner"></span>`:d}
|
|
17
17
|
</button>
|
|
18
|
-
`}render(){const e=this.direction;return
|
|
18
|
+
`}render(){const e=this.direction;return o.qy`
|
|
19
19
|
<div class="backdrop" @click=${this.onCancel}></div>
|
|
20
20
|
<div class="card" dir=${e}>
|
|
21
21
|
<h2 class="heading">${this.t("ready_to_publish","Ready to publish")}</h2>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
class="chips ${this.keywordsFocused?"focused":""}"
|
|
64
64
|
@click=${e=>{const t=e.currentTarget.querySelector("input");t?.focus()}}
|
|
65
65
|
>
|
|
66
|
-
${this.keywordList.map((e,t)=>
|
|
66
|
+
${this.keywordList.map((e,t)=>o.qy`
|
|
67
67
|
<span class="chip">
|
|
68
68
|
${e}
|
|
69
69
|
<button
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
|
|
91
91
|
<div class="actions">
|
|
92
92
|
<button class="publish" ?disabled=${this.loading} @click=${this.onPublish}>
|
|
93
|
-
${this.loading?
|
|
93
|
+
${this.loading?o.qy`<span class="spinner"></span>`:this.t("publish","Publish")}
|
|
94
94
|
</button>
|
|
95
95
|
<button class="cancel" ?disabled=${this.loading} @click=${this.onCancel}>
|
|
96
96
|
${this.t("cancel","Cancel")}
|
|
97
97
|
</button>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
|
-
`}}h.styles=
|
|
100
|
+
`}}h.styles=o.AH`
|
|
101
101
|
:host {
|
|
102
102
|
position: fixed;
|
|
103
103
|
inset: 0;
|
|
@@ -343,20 +343,20 @@
|
|
|
343
343
|
@keyframes spin {
|
|
344
344
|
to { transform: rotate(360deg); }
|
|
345
345
|
}
|
|
346
|
-
`,h.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",h);class p extends
|
|
346
|
+
`,h.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",h);class p extends o.WF{constructor(){super(),this.raf=0,this.dismissTimer=null,this.onKeyDown=e=>{"Escape"===e.key&&this.dismiss()},this.dismiss=()=>{this.isConnected&&this.remove()},this.copyLink=async()=>{if(this.url)try{await navigator.clipboard.writeText(this.url),this.copied=!0,setTimeout(()=>this.copied=!1,2e3)}catch{}},this.message="",this.sub="",this.url="",this.seoTitle="",this.seoDescription="",this.copied=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeyDown)}firstUpdated(){this.launchConfetti(),this.dismissTimer=setTimeout(()=>this.dismiss(),6500)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),this.dismissTimer&&clearTimeout(this.dismissTimer),document.removeEventListener("keydown",this.onKeyDown)}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}get host(){return this.url?this.url.replace(/^https?:\/\//,"").replace(/\/+$/,""):""}launchConfetti(){const e=this.renderRoot.querySelector("canvas");if(!e)return;const t=e.getContext("2d");if(!t)return;const i=window.devicePixelRatio||1,o=window.innerWidth,s=window.innerHeight;e.width=o*i,e.height=s*i,t.scale(i,i);const r=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],n=o/2,a=.42*s,l=Math.min(220,Math.round(o/6)),c=Array.from({length:l},(e,t)=>{const i=2*Math.PI*t/l+t%3*.4,o=4+t%9;return{x:n,y:a,vx:Math.cos(i)*o,vy:Math.sin(i)*o-3,size:5+t%5,color:r[t%r.length],rot:t,vrot:(t%2?1:-1)*(.1+t%5*.03),life:1}}),d=performance.now(),h=e=>{const i=e-d;t.clearRect(0,0,o,s);let r=!1;for(const e of c)e.vy+=.16,e.x+=e.vx,e.y+=e.vy,e.rot+=e.vrot,i>2600*.55&&(e.life=Math.max(0,e.life-.02)),e.life>0&&e.y<s+40&&(r=!0),t.save(),t.globalAlpha=e.life,t.translate(e.x,e.y),t.rotate(e.rot),t.fillStyle=e.color,t.fillRect(-e.size/2,-e.size/2,e.size,.6*e.size),t.restore();r&&i<3e3?this.raf=requestAnimationFrame(h):t.clearRect(0,0,o,s)};this.raf=requestAnimationFrame(h)}renderPreview(){const e=this.host;if(!e)return o.s6;const t=(this.seoTitle||"").trim()||(this.seoDescription?"":e),i=(this.seoDescription||"").trim(),s=(t||e).charAt(0);return o.qy`
|
|
347
347
|
<div class="preview">
|
|
348
348
|
<p class="preview-caption">${this.t("search_preview_label","How your page will look on Google")}</p>
|
|
349
349
|
<div class="result-head">
|
|
350
|
-
<span class="favicon">${
|
|
350
|
+
<span class="favicon">${s}</span>
|
|
351
351
|
<div class="result-url">
|
|
352
352
|
<div class="result-host">${e.split("/")[0]}</div>
|
|
353
353
|
<div class="result-crumb">${e}</div>
|
|
354
354
|
</div>
|
|
355
355
|
</div>
|
|
356
|
-
${t?
|
|
357
|
-
${i?
|
|
356
|
+
${t?o.qy`<p class="result-title">${t}</p>`:o.s6}
|
|
357
|
+
${i?o.qy`<p class="result-desc">${i}</p>`:o.s6}
|
|
358
358
|
</div>
|
|
359
|
-
`}render(){const e=this.direction,t=this.copied?
|
|
359
|
+
`}render(){const e=this.direction,t=this.copied?o.qy`<svg viewBox="0 0 24 24" fill="none"><path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" /></svg>`:o.qy`<svg viewBox="0 0 24 24" fill="none"><rect x="9" y="9" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>`;return o.qy`
|
|
360
360
|
<canvas @click=${this.dismiss}></canvas>
|
|
361
361
|
<div class="card" dir=${e}>
|
|
362
362
|
<button
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
|
|
379
379
|
${this.renderPreview()}
|
|
380
380
|
|
|
381
|
-
${this.url?
|
|
381
|
+
${this.url?o.qy`
|
|
382
382
|
<div class="actions">
|
|
383
383
|
<a class="view" href=${this.url} target="_blank" rel="noopener">
|
|
384
384
|
<svg viewBox="0 0 24 24" fill="none"><path d="M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
@@ -389,9 +389,9 @@
|
|
|
389
389
|
${this.copied?this.t("link_copied","Link copied"):this.t("copy_link","Copy link")}
|
|
390
390
|
</button>
|
|
391
391
|
</div>
|
|
392
|
-
`:
|
|
392
|
+
`:o.s6}
|
|
393
393
|
</div>
|
|
394
|
-
`}}p.styles=
|
|
394
|
+
`}}p.styles=o.AH`
|
|
395
395
|
:host {
|
|
396
396
|
position: fixed;
|
|
397
397
|
inset: 0;
|
|
@@ -624,21 +624,21 @@
|
|
|
624
624
|
width: 15px;
|
|
625
625
|
height: 15px;
|
|
626
626
|
}
|
|
627
|
-
`,p.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",p);const u="creaditor:publish",f="creaditor:publish-error";class g extends
|
|
627
|
+
`,p.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",p);const u="creaditor:publish",f="creaditor:publish-error";class g extends o.WF{constructor(){super(),this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),this.onNextStep||(this.onNextStep=s.M.get("config","onNextStep")),this.onPublish||(this.onPublish=s.M.get("config","onPublish")),this.channel||(this.channel=s.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async handleClick(){if(this.isLocked||this.isLoading)return;const e=!!s.M.get("config","access"),t="web"===this.channel,i=e&&t;let o=null;if(t&&(o=await h.open(),!o))return;const a=o?o.seo:null;this.isLoading=!0,this.isLocked=!0;const l=Date.now();this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{if(t&&o){let e=!1;try{i&&a&&(await(0,n.YE)({seo:a}),await(0,n.bK)({})),"function"==typeof this.onPublish?e=await this.runHostPublish(this.onPublish,a,i,o):"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:r.FE,toJSON:r.U2,seo:a??void 0})}finally{o.done()}return void(e||(this.emitPublished(i,a),this.celebratePublish(a)))}const e=s.M.get("config","editor","props","onSave");"function"==typeof e&&await e({transactions:[],toJson:r.U2,toJSON:r.U2,toHTML:r.FE}),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:r.FE,toJSON:r.U2}),this.emitPublished(i,a)}catch(e){console.error("Error in publish/onNextStep:",e),this.emitPublishError(i,a,e),this.snackbar(s.M.get("lang","publishError")||"Publish failed")}finally{const e=Date.now()-l;e<400&&await new Promise(t=>setTimeout(t,400-e)),this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}runHostPublish(e,t,i,o){return new Promise(a=>{let l=!1;const c=(e,r,n)=>{l||(l=!0,clearTimeout(d),o.done(),e?(this.celebratePublish(t),this.emitPublished(i,t)):(this.snackbar(n||s.M.get("lang","publishError")||"Publish failed"),this.emitPublishError(i,t,r)),a(!0))},d=setTimeout(()=>{l||(console.warn("config.onPublish never signalled completion — finishing the publish without it. Call success() or error() (or return a promise) so the modal can come down."),l=!0,o.done(),a(!1))},6e4),h={title:t.title,description:t.description,keywords:t.keywords},p={loading:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return o.busy(e)},success:()=>c(!0),confetti:()=>c(!0),error:e=>c(!1,new Error(e||"host publish failed"),e),commands:{patchSite:e=>(0,n.YE)(e??{}),publishSite:e=>(0,n.bK)(e??{}),toHTML:r.FE,toJSON:r.U2}};let u;try{u=e(h,p)}catch(e){return console.error("Error in config.onPublish:",e),void c(!1,e)}u&&"function"==typeof u.then&&Promise.resolve(u).then(()=>c(!0),e=>{console.error("Error in config.onPublish:",e),c(!1,e)})})}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}siteUrl(){const e=s.M.get("app","domains"),t=e?.[0]?.name;if(t)return/^https?:\/\//.test(t)?t:`https://${t}`}emitPublished(e,t){const i={channel:this.channel,selfPublish:e,seo:t??void 0,url:this.siteUrl(),toHTML:r.FE,toJSON:r.U2};window.dispatchEvent(new CustomEvent(u,{detail:i}))}emitPublishError(e,t,i){const o={channel:this.channel,selfPublish:e,seo:t??void 0,error:i};window.dispatchEvent(new CustomEvent(f,{detail:o}))}celebratePublish(e){const t=document.createElement("cdtr-publish-success");e&&(t.seoTitle=e.title,t.seoDescription=e.description);const i=this.siteUrl();i&&(t.url=i),document.body.appendChild(t)}render(){const e=!!s.M.get("config","access");if(!(this.onNextStep||"function"==typeof this.onPublish||"web"===this.channel&&e))return null;const t="web"===this.channel?"publish":"next";return o.qy`
|
|
628
628
|
<paper-button
|
|
629
629
|
@click=${this.handleClick}
|
|
630
630
|
class="next-button"
|
|
631
631
|
?disabled=${this.isLocked}
|
|
632
632
|
>
|
|
633
|
-
${this.isLoading?
|
|
633
|
+
${this.isLoading?o.qy`
|
|
634
634
|
<div class="loading-spinner"></div>
|
|
635
|
-
`:
|
|
635
|
+
`:o.qy`
|
|
636
636
|
<div class="button-content ${this.isLoading?"loading":""}">
|
|
637
637
|
<lang-text text=${t}></lang-text>
|
|
638
638
|
</div>
|
|
639
639
|
`}
|
|
640
640
|
</paper-button>
|
|
641
|
-
`}}g.styles=
|
|
641
|
+
`}}g.styles=o.AH`
|
|
642
642
|
:host {
|
|
643
643
|
display: block;
|
|
644
644
|
}
|
|
Binary file
|
package/dist/creaditor.bundle.js
CHANGED
|
@@ -1806,7 +1806,7 @@
|
|
|
1806
1806
|
</div>`:null}
|
|
1807
1807
|
</div>
|
|
1808
1808
|
</div>
|
|
1809
|
-
`;h()}var Ce=n(29811),Ee={};Ee.setAttributes=g(),Ee.insert=f().bind(null,"head"),Ee.domAPI=h(),Ee.insertStyleElement=y();d()(Ce.A,Ee);const Se=Ce.A&&Ce.A.locals?Ce.A.locals:void 0;var Be=n(73890);function Me(e){const{props:t,commands:r,justify:i,items:a,editor:s,store:l,schema:c}=e,{style:d,classList:p=[]}=t;e.automations||(e.automations={});const h=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",null,(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"}))),u=(0,o.A)("cdtr-form-builder",{className:Se.form},h);n.e(2550).then(n.t.bind(n,12550,23)).then(()=>{h.remove(),u.style.outlineOffset="10px",u.style.display="block",u.language=l.get("config","language"),u.autoComplete="off",u.spacing=2,u.theme={palette:{primary:{main:"#845EC2"}}},u.formStyle=e.style,u.onSelectField=(e,t)=>{const n=[...u.items];l.get("ctrlKey")?n[e].selected=!n[e].selected:(n.forEach(e=>e.selected=!1),n[e].selected=!0),u.items=n,s.dispatch("update")},u.onSortEnd=e=>{let{items:t}=e;s.store().updateComponent(x,"items",t)},u.items=e.items});const f=(0,o.A)("cdtr-move-handle-bar",null),m=(0,o.A)("cdtr-editor-bar",{opened:!1,direction:"left",offsetY:60,componentId:e.id},(0,o.A)("cdtr-tooltip",{content:"form:manage_fields"},(0,o.A)("paper-button",{class:Se.button,onClick:()=>y()},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"createField"}))),(0,o.A)("cdtr-tooltip",{content:"design_form"},(0,o.A)("paper-button",{onClick:()=>{const e=x.closest("card");e&&s.clean().selectComponent(e)},class:Se.button},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"designForm"})))),g=(0,o.A)("div",{"data-type":e.type,"data-id":e.id,"draggable-element":"element","droppable-element":"element",style:{width:"100%"},className:p.concat("form-component").join(" ")},u,f,m),b={set:(e,t,n)=>{switch(t){case"onSubmit":return u.onSubmit=e[t],!0;case"items:v":return u.items=[],e[t]=r.cloneDeep(n),u.items=e[t],!0;case"items":return r.debounce(()=>{u.items=[],e[t]=r.cloneDeep(n),u.items=e[t]},10),!0;case"automations":return e[t]=r.deepMerge(e[t],n),!0;case"display":return e[t]=r.deepMerge(e[t]||{},n),!0;case"style":return e[t]=r.deepMerge(e[t],n),u.formStyle=e[t],!0;default:return!0}}};m.opened=!1;const y=()=>{const t=e.schema??(l.get("config","editor","configure","plugins")||[]).find(e=>e&&"form"===e.name),n=t?.configure?.fields;if(!n)return void console.warn("[form] manage fields: no form plugin schema available (fields missing)");const r=(0,o.A)("cdtr-drawer",{backdropColor:"#000000a1",width:"400px",style:{direction:"var(--direction-locale)"}});r.opened=!0,r.headerText="available_fields",document.body.appendChild(r);const i={fields:n.map(e=>{const t=u.items.find(t=>t.id===e.id);return e.inserted=!!t,e}),onChange:(e,t,n)=>{const r=u.items.findIndex(t=>t.id===e.id);if(t&&-1===r){const t=u.items.findIndex(e=>e.selected)||u.items.length-1;ue({item:e,index:t,compose:x}),fe("insert",e)}else if(!t&&-1!==r){if("button"===u.items[r]?.type)return e.inserted=!0,void d(i.fields);const t=[...u.items];t.splice(r,1),s.updateComponent(x,"items",t),fe("remove",e)}},onCreate:async(e,t)=>{const r=t?"update":"create",o=await async function(e,t){E.Ay.dispatch(`form:field:${e}`,{field:t,action:e});const n=E.Ay.formHooks||{},r="create"===e?n.onFieldCreate:"update"===e?n.onFieldUpdate:"delete"===e?n.onFieldDelete:null;if("function"!=typeof r)return t;const o="delete"===e?t.id:t,i=await r(o);return"delete"===e?t:i&&"object"==typeof i?i:t}(r,e),a=i.fields.find(e=>e.id===o.id);a?Object.assign(a,o):(o.inserted=!0,i.fields.push(o),n.push(o));const l=u.items.findIndex(e=>e.id===o.id);if(-1===l){const e=u.items.findIndex(e=>e.selected)||u.items.length-1;ue({item:o,index:e,compose:x})}else{const e=[...u.items];e.splice(l,1),s.updateComponent(x,"items",e),ue({item:o,index:l,compose:x})}a&&(a.inserted=!0),d(i.fields)}},a=()=>d(i.fields),c=function(){return ke({target:r,field:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,onSubmit:i.onCreate,onCancel:a})},d=e=>{r.headerText="available_fields";(0,X.XX)((0,Be.A)({items:e,onChange:i.onChange,debounce:e=>{let{target:t}=e;const n=t.value,r=i.fields.filter(e=>-1!==e.name.indexOf(n));d(r)},onAdd:()=>c(),onEdit:e=>c(e)}),r)};d(i.fields),r.addEventListener("close",()=>{r.remove()},{once:!0})},A=function(e){let{debounce:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s.components.forEach(t=>{if("form"===t.type){const n=JSON.parse(JSON.stringify(t.props.items));let r=0;const o=()=>{r=n.length};for(;r<n.length;r++){const i=n[r];i.props.label_field||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props.style||(i.props.label_field.props.style={}),i.props.style||(i.props.style={}),"menu"!==i.type&&"dropdown"!==i.type||(i.props.triggerProps||(i.props.triggerProps={}),i.props.triggerProps.style||(i.props.triggerProps.style={})),e(i,{stop:o,items:n,compose:t})}s.store().updateComponent(t,"items",n)}})};let w=!1;const x=(0,M.n)({name:"form",id:e.id,template:g,atomElement:u,defaultProps:{style:{},classList:[],items:[]},schema:c,onSelect:t=>{m.opened=!0,m.componentId=x.closest("card")?.id||e.id},onDeselect:e=>{m.opened=!1},elementProps:e,createEditor:e=>{let{component:t,props:n,commands:r,helpers:o}=e;const i={BUTTONS:["button"],INPUTS:["input","textarea"],TOGGLES:["radio-group","checkbox","toggle"],MENUS:["dropdown","menu"]},a=t.props.items?.find(e=>e.selected);if(!a)return{};function d(){return c?.configure?.mailingLists.map(e=>({...e,value:e.label}))}return{select:e=>{let{changeTab:t,tab:n}=e;"style"!==n.text&&t("style")},tabs:e=>{const t=[{text:"style"},{text:"list-settings"},{text:"automations"},{text:"settings"}];return t.forEach(t=>t.selected=t.text===e),t},layout:e=>{let{tab:n,changeTab:r,tabs:p}=e;if("automations"!==n.text){const e=t?.props?.automations?.when?.submitted?.then?.sendMail;if(e?.to?.length){const t=e.to.filter(e=>"string"==typeof e&&""!==e.trim());t.length!==e.to.length&&s.store().execCommands({key:"automations",value:n=>o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:{...e,to:t}}}}}),options:{find:"form"}})}}const h=t?.props?.display||{},u=h.mode||"inline",f=e=>s.store().execCommands({key:"display",value:t=>o.deepMerge(t.props.display||{},e),options:{find:"form"}}),m=[{type:"heading",level:6,text:"form_behavior",active:"style"===n.text},{type:"dropdown",title:"display_mode",active:"style"===n.text,value:u,selected:u,items:[{key:"display_inline",value:"inline"},{key:"display_modal",value:"modal"}],onChange:e=>{f({mode:e.target.value}),r("style")}},{type:"slider",title:"open_delay_seconds",inputType:"number",min:0,max:60,active:"style"===n.text&&"modal"===u,value:h.delaySeconds??3,onInput:e=>{f({delaySeconds:parseFloat(e.target.value)})}},{type:"heading",level:6,text:"settings",active:"style"===n.text&&"button"===a.type},{type:"input",title:"text:button",active:"style"===n.text&&"button"===a.type,value:a.props.text,onInput:e=>{const t=e.target.value;A(e=>{e.selected&&"button"===e.type&&(e.props.text=t)},{debounce:!0})}},{type:"heading",level:6,text:"field_settings",active:"list-settings"===n.text&&"button"!==a.type},{type:"input",title:"label",active:"button"!==a.type&&"list-settings"===n.text,value:a?.props?.label_field?.props?.text,onInput:e=>{const t=e.target.value;A(e=>{e.selected&&"button"!==e.type&&(e.props.label_field.props.text=t)},{debounce:!0})}},{type:"input",title:"placeholder",active:i.INPUTS.includes(a.type)&&"list-settings"===n.text,value:a.props.placeholder,onInput:e=>{const t=e.target.value;A(e=>{i.INPUTS.includes(e.type)&&e.selected&&"button"!==e.type&&(e.props.placeholder=t)},{debounce:!0})}},{type:"checkbox",title:"checkbox_checked_as_default",checked:a.props.checked,active:["toggle","checkbox"].includes(a.type)&&"list-settings"===n.text,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&i.TOGGLES.includes(e.type)&&(e.props.checked=t)})}},{type:"checkbox",title:"checkbox_on_right_side",checked:!0===a.props.labelPlacement,active:"checkbox"===a.type&&"list-settings"===n.text,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&"checkbox"===e.type&&(e.props.labelPlacement=t?"start":"end")})}},{type:"stringListBuilder",title:"items_in_menu",active:(i.MENUS.includes(a.type)||"radio-group"===a.type)&&"list-settings"===n.text,items:a.props.items,changeItemValue:(e,t,n)=>{A(n=>{n!==a&&n.id!==a.id||(n.props.items[e].label=t)})}},{type:"heading",level:6,text:"typography",active:"style"===n.text},{type:"fontFamily",active:"style"===n.text,value:a?.props?.style?.fontFamily||a?.props?.label_field?.props?.style?.fontFamily,weight:!0,weightValue:a?.props?.style?.fontWeight||a?.props?.label_field?.props?.style?.fontWeight,onChange:e=>{const t=e.target.value;(0,pe.sw)({cssRule:t}),t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontFamily=t:i.TOGGLES.includes(a.type)&&a.id===e.id?(e.props.label_field.props.style.fontFamily=t,e.props.style.fontFamily=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.fontFamily=t:(e.props.label_field.props.style.fontFamily=t,e.props.style.fontFamily=t))},{debounce:!0})},onWeightChange:e=>{const t=e.detail.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontWeight=t:i.TOGGLES.includes(a.type)&&a.id===e.id?(e.props.label_field.props.style.fontWeight=t,e.props.style.fontWeight=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.fontWeight=t:(e.props.label_field.props.style.fontWeight=t,e.props.style.fontWeight=t))},{debounce:!0})}},{type:"slider",title:"fontSize",max:30,min:8,active:"style"===n.text,value:parseInt(a.props?.style?.fontSize)||parseInt(a?.props?.label_field?.props?.style?.fontSize)||16,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontSize=t:(i.TOGGLES.includes(a.type)&&a.id===e.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type))&&(e.props.label_field.props.style.fontSize=t)},{debounce:!0})}},{type:"typography",active:"style"===n.text,bold:700===a.props?.style?.fontWeight||700===a.props?.label_field?.props?.style?.fontWeight,italic:"italic"===a.props?.style?.fontStyle||"italic"===a.props?.label_field?.props?.style?.fontStyle,underline:"underline"===a.props?.style?.textDecoration||"underline"===a.props?.label_field?.props?.style?.textDecoration,onChange:e=>{function t(t){switch(e){case"bold":t.fontWeight=null===t.fontWeight?700:null;break;case"italic":t.fontStyle=null===t.fontStyle?"italic":null;break;case"underline":t.textDecoration="underline"===t.textDecoration?null:"underline"}}A(e=>{"checkbox"===a.type?e.selected&&"checkbox"===e.type&&t(e.props.label_field.props.style):e.selected&&"button"===a.type&&"button"===e.type?t(e.props.style):"button"!==a.type&&"button"!==e.type&&(!e.selected||"menu"!==e.type&&"dropdown"!==e.type?e.selected&&t(e.props.label_field.props.style):t(e.props.label_field.props.style))},{debounce:!0})}},{type:"heading",level:6,text:"colors",active:"style"===n.text},{type:"colorpicker",title:"color:label",active:"style"===n.text,value:a.props?.label_field?.props?.style?.color||a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.color=t:(i.TOGGLES.includes(a.type)&&a.id===e.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type))&&(e.props.label_field.props.style.color=t)},{debounce:!0})}},{type:"colorpicker",title:"component_color",active:()=>"style"===n.text&&i.TOGGLES.includes(a?.type),value:a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.TOGGLES.includes(a.type)&&a.id===e.id&&(e.props.style.color=t)},{debounce:!0})}},{type:"colorpicker",title:"button"===a.type?"background":"form:background",allowGradient:"web"===l.get("config","channel")&&i.BUTTONS.includes(a.type),active:"style"===n.text&&-1!==[...i.BUTTONS,...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.triggerProps?.style?.background||a.props?.style?.background,onChange:e=>{const t=e.target.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?(e.props.style.background=t,t.includes("gradient(")&&(e.props.style.backgroundColor=null)):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.background=t:e.props.style.background=t)})}},{type:"colorpicker",title:"form:placeholder_color",active:"style"===n.text&&-1!==[...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.INPUTS.includes(e.type)&&i.INPUTS.includes(a.type)?e.props.style.color=t:i.MENUS.includes(e.type)&&i.MENUS.includes(a.type)&&(e.props.triggerProps.style.color=t)},{debounce:!0})}},{type:"heading",level:6,text:"dimensions",active:"style"===n.text},{type:"slider",title:"height",max:70,min:20,active:"style"===n.text&&["input",...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a.props?.style?.minHeight)||parseInt(a?.props?.triggerProps?.style?.minHeight)||40,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?(delete e.props.style.height,e.props.style.minHeight=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.minHeight=t:delete e.props.style.height,e.props.style.minHeight=t)},{debounce:!0})}},{type:"slider",title:"radius",max:50,min:0,active:"style"===n.text&&[...i.INPUTS,...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a?.props?.style?.borderRadius)||parseInt(a?.props?.triggerProps?.style?.borderRadius)||0,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.borderRadius=t:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.borderRadius=t:e.props.style.borderRadius=t)},{debounce:!0})}},{type:"dropdown",title:"type",value:a.props.type,active:()=>"input"===a.type&&"list-settings"===n.text,selected:a.props.type,items:c.types.find(e=>"input"===e.name)?.types.map(e=>new Object({key:e,value:e})),onChange:e=>{const t=e.target.value;A(e=>{"input"===a.type&&e.selected&&"input"===e.type&&(e.props.type=t)},{debounce:!0})}},{type:"input",title:"default_value",active:()=>"input"===a.type&&"list-settings"===n.text,value:a.props.value,onInput:e=>{const t=e.target.value;A(e=>{!e.selected||"input"!==e.type&&"menu"!==e.type&&"dropdown"!==e.type&&"textarea"!==e.type||(e.props.value=t)},{debounce:!0})}},{type:"heading",level:6,text:"properties",active:"list-settings"===n.text&&"button"!==a.type},{type:"checkbox",title:"required",info:"required_form_field_info",checked:a.props.isRequired,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&(e.props.isRequired=t)})}},{type:"checkbox",title:"hidden_field",info:"hidden_form_field_info",checked:a.props.isHidden,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&(e.props.isHidden=t)})}},{type:"input",max:1024,title:"url_param",active:"list-settings"===n.text&&"button"!==a.type,value:a.props.paramName,onInput:e=>{let{target:t}=e,n=t.value;n=n.trim().replace(/\s/g,"_"),n=n.replace(/\//g,""),n=n.replace(/\\/g,""),n=n.replace(/[^a-zA-Z0-9_\-]/g,"");A((e,r)=>{let{stop:o,items:i}=r;i.find(e=>e.paramName===n)||e.selected&&"button"!==e.type&&(e.props.paramName=t.value=n,o())})}},{type:"heading",level:6,text:"after_submission",active:"automations"===n.text},{type:"dropdown",title:"after_submission",active:()=>(w=!!t?.props?.automations?.when?.submitted?.then?.redirect?.url,"automations"===n.text),selected:t?.props?.automations?.when?.submitted?.then?.redirect?.url?"redirect":"stay_at_page",value:w?"redirect":"stay_at_page",items:[{value:"stay_at_page",key:"stay_at_page"},{value:"redirect",key:"redirect",selected:!!t?.props?.automations?.when?.submitted?.then?.redirect?.url}],onChange:e=>{"redirect"===e.target.value?(w=!0,r("automations")):(w=!1,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}}),r("automations"))}},{type:"input",title:"where_to_redirect",max:1024,value:t?.props?.automations?.when?.submitted?.then?.redirect?.url||"",active:!0===w&&"automations"===n.text,autofocus:!1==!!t?.props?.automations?.when?.submitted?.then?.redirect?.url,onChange:e=>{let{target:t}=e;const n=t.value,r=new o.Url(n);if(""===r.href)return w=!1,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}});w=!0,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:r.href}}}}}),options:{find:"form"}})}},{type:"checkbox",title:"forward_params",checked:t?.props?.automations?.when?.submitted?.then?.redirect?.forward_params||!1,active:!0===w&&"automations"===n.text,onChange:e=>{let{target:t}=e;const n=t.checked;s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{forward_params:n}}}}}),options:{find:"form"}})}},{type:"heading",level:6,text:"select_mailing_lists",active:"automations"===n.text},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"add_user_from_mailinglist_after_subscribed",onCreate:()=>{c?.configure?.mailingListEvents?.create({name:"hello",resolve:()=>{},reject:()=>{}})},onChange:e=>{const n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists,r=n.findIndex(t=>t.key===e.key);-1!==r?n.splice(r,1):n.push({key:e.key}),s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:[{key:e.key}]}}}}}}),options:{find:"form"}})},list:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const t=e;return n.forEach(e=>{const n=t.find(t=>t.key===e.key);n&&(n.inserted=!0)}),t}return[...e]}(),items:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const t=[];return n.forEach(n=>{const r=e.find(e=>e.key===n.key);r&&(r.inserted=!0,t.push(r))}),t}return[]}()},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"remove_user_from_mailinglist_after_subscribed",onChange:e=>{const n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists,r=n.findIndex(t=>t.key===e.key);-1!==r?n.splice(r,1):n.push({key:e.key}),s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:[{key:e.key}]}}}}}}),options:{find:"form"}})},list:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const t=e;return n.forEach(e=>{const n=t.find(t=>t.key===e.key);n&&(n.inserted=!0)}),t}return e}(),items:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const t=[];return n.forEach(n=>{const r=e.find(e=>e.key===n.key);r&&(r.inserted=!0,t.push(r))}),t}return[]}()},{type:"heading",level:6,text:"automations",active:"automations"===n.text},{type:"input",max:1024,active:"automations"===n.text,value:t?.props?.automations?.when?.submitted?.then?.sendParams?.url,placeholder:"URL...",title:"send_the_data_to",onInput:e=>{let{target:t}=e;const n=t.value,r={method:"post",url:new o.Url(n).href,type:"http"};s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{sendParams:r}}}}),options:{find:"form"}})}},{type:"stringListBuilder",title:"send_mail_on_submitted",active:"automations"===n.text,placeholder:"example@email.com",inputType:"email",items:t?.props?.automations?.when?.submitted?.then?.sendMail?.to||[""],changeItemValue:(e,t,n)=>{s.store().execCommands({key:"automations",value:n=>{let r=n?.props?.automations?.when?.submitted?.then?.sendMail;if(r)return r.to[e]=t,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})},onRemove:(e,t)=>{s.store().execCommands({key:"automations",value:t=>{let n=t?.props?.automations?.when?.submitted?.then?.sendMail;if(n)return n.to.splice(e,1),o.deepMerge(t.props.automations,{when:{submitted:{then:{sendMail:n}}}})},options:{find:"form"}})},onAddItem:()=>{s.store().execCommands({key:"automations",value:e=>{let t=e?.props?.automations?.when?.submitted?.then?.sendMail;return t||(t={to:[],html:"",text:"",subject:"",from:""}),t.to.push(""),o.deepMerge(e.props.automations,{when:{submitted:{then:{sendMail:t}}}})},options:{find:"form"}})},onChange:(e,t,n)=>{s.store().execCommands({key:"automations",value:n=>{const r=n.props.automations.when.submitted.then.sendMail;return r.to[e]=t,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})}}];return m}}},commands:{select:e=>{m.opened=!0},deSelect:e=>{m.opened=!1},deSelectedField:()=>{u.items.forEach(e=>{e.selected=!1}),x.props.items=u.items}},globalCommands:{},remove:()=>{g.remove()},destroy:()=>{},validator:b});return x}var Te=n(21663),Le=n(98352),Oe=n.n(Le);const Ie=JSON.parse('["ase","art","bmp","blp","cd5","cit","cpt","cr2","cut","dds","dib","djvu","egt","exif","gif","gpl","grf","icns","ico","iff","jng","jpeg","jpg","jfif","jp2","jps","lbm","max","miff","mng","msp","nef","nitf","ota","pbm","pc1","pc2","pc3","pcf","pcx","pdn","pgm","PI1","PI2","PI3","pict","pct","pnm","pns","ppm","psb","psd","pdd","psp","px","pxm","pxr","qfx","raw","rle","sct","sgi","rgb","int","bw","tga","tiff","tif","vtf","xbm","xcf","xpm","3dv","amf","ai","awg","cgm","cdr","cmx","dxf","e2d","egt","eps","fs","gbr","odg","svg","stl","vrml","x3d","sxd","v2d","vnd","wmf","emf","art","xar","png","webp","jxr","hdp","wdp","cur","ecw","iff","lbm","liff","nrrd","pam","pcx","pgf","sgi","rgb","rgba","bw","int","inta","sid","ras","sun","tga","heic","heif"]');function Ne(e){const t=(/(?:\.([^.]+))?$/.exec(e.toLowerCase())??[])[1]||"",n=t.includes("&")?t.split("&")[0]:t;return-1!==Ie.findIndex(e=>e===n)}var Re=n(4982),$e=n.n(Re);const De={deepMerge:k(),mergeDiff:a.A,deepEqual:$e(),cloneDeep:Oe(),arrayToString:i.A},Pe=e=>{const{type:t,children:n,props:c}=e,d={mergeDiff:a.A,deepMerge:k(),isRtl:Te.A,arrayToString:i.A,cloneDeep:Oe(),isImage:Ne,debounce:(new s.A).run,snackbar:e=>B.A.dispatch("snackbar",{text:e})},p={...e,...c,commands:d,editor:E.Ay,store:l.M},h={block:()=>(0,o.A)(D,p,n),row:()=>(0,o.A)(oe,p,n),"menu-widget":()=>(0,o.A)(de,p,n),background:()=>(0,o.A)(Q,p),form:()=>{const e=l.M.get("config","editor"),t=e?.configure?.plugins;if(!t)return;const i=t.find(e=>"form"===e.name),a=(0,o.A)(Me,(0,r.A)({schema:i},p),n);return a&&"function"==typeof a.createEditor&&i&&(i.createEditor=a.createEditor),a},iframe:()=>(0,o.A)(Y,p),html:()=>(0,o.A)(F,p)};if(h[t])return"function"==typeof h[t]?h[t]():h[t];{const n=l.M.get("config","editor","configure","plugins")||[],r=l.M.get("config","channel"),o=n.find(e=>e.name===t);if(o&&o.name&&o.lazy&&"function"==typeof o.lazy){const i=o=>{const i=n.findIndex(e=>e.name===t);if(-1===i)return void console.error("scheme not found when resolving component",t);const a=o.create({compose:p,createElement:M.n,helpers:De,channel:r});a.type=t,a.createEditor&&(n[i].createEditor=a.createEditor),"function"==typeof o.menu&&(n[i].menu=o.menu);try{const h=l.M.get("components",e.id);if(!h)return console.error("element not found during lazy load","#8l#$f"),null;function u(){h.element.parentElement&&h.element.parentElement.replaceChild(a.element,h.element),h.element.remove()}"cdtr-block-loader"===h.element.localName&&(h.element.onLoad=()=>{u()},h.element.isConnected&&u())}catch(f){console.error("lazy load replace failed",f,t)}const s=l.M.get("components"),c=s[e.id],d=e=>Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e);c&&(d(c.children)&&!d(a.children)&&(a.children=c.children),d(c.elements)&&!d(a.elements)&&(a.elements=c.elements)),s[e.id]=a,l.M.set({components:s})};return o.lazy(i),{name:o.name,id:e.id,element:(()=>{const t=document.createElement("cdtr-block-loader");return t.setAttribute("data-component-type",e.type),t})()}}if(o&&o.create){const e=o.create({compose:p,createElement:M.n,helpers:De,channel:r});return e.type=t,e&&"object"==typeof e&&"function"==typeof e.createEditor&&(o.createEditor=e.createEditor),e}}};var ze=n(98829);const He=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=n=>{if(!n||n.is_removed)return;if(n.props||(n.props={}),"string"==typeof n)return n;n._id&&(n.id=n._id),e.id&&(n.parentId=e.id),n.children&&(n.__children=[...n.children].map(e=>{if(e)return e.id||e._id})),n.elements&&(n.__elements=[...n.elements].map(e=>{if(e)return e.id||e._id}));const{children:i,elements:a}=He(n,t);n.props.style&&"object"==typeof n.props.style&&Object.keys(n.props.style).forEach(e=>{null!==n.props.style[e]&&void 0!==n.props.style[e]||delete n.props.style[e]});const s=(0,o.A)(Pe,(0,r.A)({},n,{elements:a,"data-id":n.id,"data-type":n.type,silent:t.silent}),i);if(s&&!0!==t.silent)(e=>{(e=>{e.props&&(e.props.interactions||(e.props.interactions=[]),void 0===e.props.show_on_desktop&&(e.props.show_on_desktop=!0),void 0===e.props.show_on_tablet&&(e.props.show_on_tablet=!0),void 0===e.props.show_on_mobile&&(e.props.show_on_mobile=!0))})(e);const{props:t,element:n,id:r,extend:o,parentId:i,__children:a,__elements:s}=e,c=l.M.get("components");window.location.href.includes("localhost")&&(window.components=c);const d={id:r,...e,props:t,children:a||[],elements:s||[]};c[r]=d})({...n,...s});else if(!s)return console.error("unresolved compose",n,n.type),null;return s.element};return"object"==typeof e&&(e=JSON.parse(JSON.stringify(e))),e.children&&(e.children=e.children.map(n)),e.elements&&(e.elements=e.elements.map(n)),e};const je=e=>{!function(e){e.forEach(e=>{e.props||(e.props={}),e.props.style||(e.props.style={}),e.id||(e._id?e.id=e._id:console.error("component must have id")),e._id||(e._id=e.id)})}(e);let t,n=e.findIndex(e=>"root"===e.type);-1===n&&(n=e.findIndex(e=>"section"===e.type)),-1!==n&&([t]=e.splice(n,1),t.props.datasetId||(t.props.datasetId=crypto.randomUUID()));const r=t=>{if(t)return Array.isArray(t.children)&&t.children.length>0&&(t.children_ids=t.children,t.children=t.children.map(o=>{if(Array.isArray(o))return;if(!o)return;const i=e.find(e=>e._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING child "${o}" referenced by ${t.type} ${t._id} — it exists as a child-id but not as a component in the loaded doc, so it will not render.`);n(i);const a=r(i);return a&&a.children&&(i.children=a.children),a&&a.elements&&(i.elements=a.elements),i})),Array.isArray(t.elements)&&t.elements.length>0&&(t.elements=t.elements.map(o=>{const i=e.find(e=>e._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING element "${o}" referenced by ${t.type} ${t._id} — layer-2 element id has no matching component, so it will not render.`);n(i);const a=r(i);return a&&a.elements&&(i.elements=a.elements),a&&a.children&&Array.isArray(t.children)&&t.children.length>0&&(i.children=a.children),i})),t;function n(e){if(!e)return;"text"===e.type&&e.props?.text&&"string"==typeof e.props.text&&(e.props.text=((e,t)=>{if("text"===e&&"string"==typeof t)try{return JSON.parse(t)}catch(e){(0,ze.v)({error_code:"#11jhb",info:e,msg:"could not parse text in transformValues",s:"E"})}return t})("text",e.props.text)),"form"===e.type&&Array.isArray(e.props?.items)&&e.props.items.forEach(e=>{const t=e?.props?.style?.fontFamily;t&&(0,pe.sw)({cssRule:t})});const t=e.props?.style?.fontFamily;t&&(0,pe.sw)({cssRule:t})}};if(t){const e=r(t);e.children&&(t.children=e.children)}return t}},83860(e,t,n){"use strict";n.d(t,{D$:()=>s});var r=n(86319);const o={mobile:"sm"};function i(){if("web"!==r.M.get("config","channel"))return null;const e=r.M.get("deviceFilter")||"all";return o[e]||null}function a(e,t,n){const r=i();if(!r)return null;if("style"!==t&&"text"!==t)return null;const o=e?.props?.breakpoints||{},a=o[r]||{};let s;return s="style"===t?{...a,style:{...a.style||{},...n}}:{...a,text:n},{key:"breakpoints",value:{...o,[r]:s}}}function s(e,t,n){return a(e,t,n)||{key:t,value:n}}},15604(e,t,n){"use strict";n.d(t,{Ay:()=>M,EN:()=>B});var r=n(81840),o=n(4952),i=n(86319),a=n(12106),s=n(18057),l=n(29780),c=n(98829),d=n(93432);const p=class{constructor(e,t,n,r,o){this.component=e,this.color=t,this.userId=n,this.name=r,this.componentId=o,this.borderElement=null,this.isDestroyed=!1,this.createBorder(),this.updatePosition(),this.attachListeners()}createBorder(){this.borderElement=document.createElement("div"),this.borderElement.style.position="absolute",this.borderElement.style.pointerEvents="none",this.borderElement.style.border=`2px solid ${this.color}`,this.borderElement.style.zIndex="0",this.borderElement.style.transition="all 0.01s ease-out",document.body.appendChild(this.borderElement),this.labelElement=document.createElement("div"),this.labelElement.textContent=this.name,this.labelElement.style.position="absolute",this.labelElement.style.pointerEvents="none",this.labelElement.style.backgroundColor=this.color,this.labelElement.style.color="#fff",this.labelElement.style.padding="2px 6px",this.labelElement.style.fontSize="11px",this.labelElement.style.fontWeight="500",this.labelElement.style.borderRadius="3px",this.labelElement.style.zIndex="0",this.labelElement.style.whiteSpace="nowrap",this.labelElement.style.transition="all 0.01s ease-out",this.labelElement.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.labelElement),this.updatePosition()}updatePosition(){if(this.isDestroyed||!this.component.element)return;const e=this.component.element.getBoundingClientRect();if(this.borderElement.style.top=e.top+"px",this.borderElement.style.left=e.left+"px",this.borderElement.style.width=e.width+"px",this.borderElement.style.height=e.height+"px",this.labelElement){const t=e.top-20,n=t<0?e.top+2:t;this.labelElement.style.top=n+"px",this.labelElement.style.left=e.left+e.width/6+"px"}}attachListeners(){this.boundUpdatePosition=this.updatePosition.bind(this),window.addEventListener("scroll",this.boundUpdatePosition,!0),window.addEventListener("resize",this.boundUpdatePosition),this.mutationObserver=new MutationObserver(this.boundUpdatePosition),this.component.element&&this.mutationObserver.observe(this.component.element,{attributes:!0,attributeFilter:["style","class"]})}remove(){this.isDestroyed=!0,window.removeEventListener("scroll",this.boundUpdatePosition,!0),window.removeEventListener("resize",this.boundUpdatePosition),this.mutationObserver&&this.mutationObserver.disconnect(),this.borderElement&&this.borderElement.parentNode&&this.borderElement.parentNode.removeChild(this.borderElement),this.labelElement&&this.labelElement.parentNode&&this.labelElement.parentNode.removeChild(this.labelElement),this.borderElement=null,this.labelElement=null,this.component=null}},h=[];function u(){return h}function f(e){h.push(e)}function m(e){const t=h.findIndex(t=>t?.userId===e);-1!==t&&(h[t].borderSelected.remove(),h.splice(t,1))}function g(){h.forEach(e=>{e.borderSelected.updatePosition()})}var b=n(4217),y=n(69172);function A(e){const{type:t,componentId:n,parentId:r,newParentId:o}=e,a=i.M.get("components",n);if(!a)return!0;if("MOVE"===t)return a.parentId===o;const s=i.M.get("components",r);if(!s)return!0;const l=Array.isArray(s.children)&&s.children.includes(n)||Array.isArray(s.elements)&&s.elements.includes(n);return"ADD"===t?l:!l}function w(e){if(e.disconnectedAt){if(Date.now()-e.disconnectedAt>e.maxDisconnectTime)return console.error("%cDisconnected too long, reload required","color:red"),e.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Disconnected for too long. Please reload the page to ensure data sync."}}),void(0,l.U)("updateNeeded")}if(e.reconnectAttempts>=e.maxReconnectAttempts)return console.error("%cMax reconnection attempts reached","color:red"),e.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Unable to reconnect to server"}}),void(0,l.U)(500);e.reconnectAttempts++;const t=1===e.reconnectAttempts?0:Math.min(e.reconnectDelay*Math.pow(2,e.reconnectAttempts-2),3e4);0===t?console.log(`%cAttempting to reconnect immediately (${e.reconnectAttempts}/${e.maxReconnectAttempts})`,"color:orange"):console.log(`%cAttempting to reconnect (${e.reconnectAttempts}/${e.maxReconnectAttempts}) in ${t}ms`,"color:orange"),i.M.set({wsConnection:{status:"reconnecting",attempts:e.reconnectAttempts,nextAttemptIn:t}}),e.reconnectTimer=setTimeout(()=>{e.wsConnectionProps&&(console.log("%cReconnecting...","color:orange"),_(e,e.wsConnectionProps))},t)}function x(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.isReconnecting=!1}function v(e,t){try{console.log("WS MESSAGE RECEIVED:",t.data);const n=JSON.parse(t.data);u();if(n.transactions)return n.transactions.forEach(t=>{switch(t.type){case"SELECT_ELEMENT":{const r=e.getComponent(t.componentId);if(r){m(n.user.id);const e=function(e,t,n,r,o){return new p(e,t,n,r,o)}(r,n.user.color,n.user.id,n.user.name,t.componentId);f({userId:n.user.id,componentId:t.componentId,borderSelected:e})}break}case"USER_JOINED":{const e=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:[...e,t.user]});break}case"USER_LEFT":{const e=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:e.filter(e=>e.userId!==t.user.userId)}),m(t.user.userId);break}case"SESSION_INITIALIZED":{const n=e.wsConnectionProps?.userId,r=t.users.filter(e=>e.userId!==n);i.M.set({connectedUsers:r});break}case"PATCH":e.updateComponent(t.componentId,t.key,t.value,{silent:!0,sync:!1});break;case"MOVE":if(A(t))break;e.moveComponent({componentId:t.componentId,newParentId:t.newParentId,newIndex:t.newIndex,oldIndex:t.oldIndex,oldParentId:t.oldParentId,direction:t.direction,fromLayer:t.fromLayer,toLayer:t.toLayer},{sync:!1});break;case"CREATE":e.createComponent({componentId:t.componentId,parentId:t.parentId,index:t.index,body:t.body,layer:t.layer},{sync:!1,clone:!0});break;case"ADD":if(A(t))break;e.addComponent({componentId:t.componentId,parentId:t.parentId,index:t.index,layer:t.layer},{sync:!1});break;case"REMOVE":if(A(t))break;e.removeComponent({componentId:t.componentId,parentId:t.parentId,index:t.index},{sync:!1})}}),void g();if("transaction:complete"===n.type){const t=n.completed;if(!e.transactions[n.transactionId])return(0,c.v)({msg:"transaction not found to mark as completed",s:"E",info:{tasks:t},error_code:"#c4ca2"}),void console.error("transaction not found to mark as completed");let r=!0;Array.isArray(t)&&t.forEach(e=>{"completed"!==e.status&&(r=!1)}),r?(delete e.transactions[n.transactionId],e.lastSyncTimestamp=Date.now()):((0,c.v)({msg:"some of tasks not completed",s:"E",info:{tasks:t},error_code:"#c4222"}),(0,l.U)(500),console.error("some of tasks not completed",n))}else"notification:reset"===n.type&&(0,l.U)("updateNeeded")}catch(e){(0,c.v)({msg:e.message,s:"E",info:{data:e.stack},error_code:"#c4222"}),console.error(e)}}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{onOpen:n,access:r,userId:o,sessionId:a,avatar:s,name:c}=t;let d;r?d=`app:${r}`:(o||(0,l.U)(401),a||(0,l.U)(401),d=`freesolo?userId=${o}&sessionId=${a}&avatar=${s}&name=${c}`),e.wsConnectionProps=t,x(e),i.M.set({wsConnection:{status:e.isReconnecting?"reconnecting":"connecting",attempts:e.reconnectAttempts}});const p=e.wsService=new b.w3cwebsocket(`${y.XW.ws_url}/${d}`);p.onopen=()=>{console.log("%cConnected","color:green"),e.wasConnected=!0,e.reconnectAttempts=0,e.isReconnecting=!1,e.disconnectedAt=null,i.M.set({wsConnection:{status:"connected",attempts:0}}),"function"==typeof n&&n()},p.onmessage=t=>v(e,t),p.onclose=t=>{if(console.log("%cWebSocket connection closed","color:orange",t),i.M.set({wsConnection:{status:"disconnected",code:t.code,reason:t.reason}}),!e.wasConnected)return console.error("%cInitial connection failed, not attempting reconnection","color:red"),void(0,l.U)(500);e.disconnectedAt||(e.disconnectedAt=Date.now());[1e3,1008,4401].includes(t.code)?(0,l.U)(500):e.isReconnecting||(e.isReconnecting=!0,w(e))},p.onerror=e=>{console.error("%cWebSocket error:","color:red",e),i.M.set({wsConnection:{status:"error",error:e.message||"WebSocket error occurred"}})}}var k=n(52529),C=n(3832),E=n(81139),S=n(83860);"undefined"!=typeof window&&(window.location?.href?.includes("DEBUG=1"),1)&&(window.__trace__=[]);const B=new class{constructor(e){let{editors:t}=e;this.debounder=new s.A,this.configure={},this.app=new r.A,this.pendingTransactions=[],this.undoRedo=o.A,this.templates={},this.commands={goToError:l.U,logError:c.v},this.wsService={send:e=>console.warn("ws not connected yet, please wait..",e)},window.transactions=this.transactions={},this.withSnapshot=!1,this.editors=[],this.__elements={},this.changes=[],this.globalCommands={bodyWalk:l.S},this.isRealtimeConnected=!1,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.reconnectDelay=1e3,this.reconnectTimer=null,this.wsConnectionProps=null,this.isReconnecting=!1,this.wasConnected=!1,this.lastSyncTimestamp=Date.now(),this.disconnectedAt=null,this.maxDisconnectTime=3e5,this.connectOnline=e=>{"string"==typeof e&&0!==e.length?_(this,{access:e,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}}):(0,l.U)(401)},this.connectRealtime=e=>{if(e&&"object"==typeof e){const{sessionId:t,avatar:n,name:r}=e,o=(0,a.A)();t||(0,l.U)(401),_(this,{userId:o,sessionId:t,avatar:n,name:r,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}})}},t&&t.forEach(e=>this.addEditor(e)),this.type=null,this.components=[],this.undoRedo.on("ON_REDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_UNDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_SNAPSHOT",e=>{let{deletedSteps:t}=e;Array.isArray(t)&&t.forEach(e=>{e?.stack&&e.stack.forEach(e=>{"CREATE"!==e.type&&"REMOVE"!==e.type||(e.__type=e.type)})})}),this.commitEdits=e=>function(e,t){i.M.get("config","savedDebounce"),e.pendingTransactions.push(...t),e.debounder.run(()=>{e.updateAll([...e.pendingTransactions]),Array.isArray(window.__trace__)&&window.__trace__.push({transactions:[...e.pendingTransactions]}),e.pendingTransactions.forEach(e=>{delete e.newValue,delete e.oldValue});const t={transactions:[...e.pendingTransactions],transactionId:(0,a.A)(),created_at:Date.now()};if(e.transactions[t.transactionId]=[...e.pendingTransactions],e.isRealtimeConnected){const n=JSON.stringify(t);if(e.wsService.readyState===WebSocket.OPEN)try{e.wsService.send(n),console.trace("transactions sent",t.transactions.length),e.pendingTransactions=[],e.transactions[t.transactionId]=[]}catch(e){(0,c.v)({msg:"There is Error on sync data with the server",info:n,error_code:"#c4ca4",s:"E"}),console.warn("error on syncing, sent:",n),(0,l.U)()}else(0,c.v)({msg:"ws not connected",s:"E",info:{connection:e.wsService.readyState},error_code:"#c4ca9"}),console.warn("ws not connected"),(0,l.U)()}})}(this,e),this.updateAll=e=>function(e,t){t&&t.forEach(t=>{const n=e.getComponent(t.componentId);if(n){const e=(n.atomElement||n.element).getBoundingClientRect();n.props.rect=e,n.props.width=e.width,n.props.height=e.height}else console.error("component not found in updateAll",t)}),e.app.dispatch("update",{editor:e}),g();const n=i.M.get("config","editor","props","onSave");"function"==typeof n&&n({transactions:t,toJson:d.U2,toJSON:d.U2,toHTML:d.FE})}(this,e),this.attemptReconnect=()=>w(this),this.cancelReconnect=()=>x(this),this.connectToWSServer=e=>_(this,e),this.addComponent=(e,t)=>(0,k.X8)(this,e,t),this.removeComponent=(e,t)=>(0,k.o$)(this,e,t),this.moveComponent=(e,t)=>(0,k.pp)(this,e,t),this.createComponent=(e,t)=>(0,k.a0)(this,e,t),this.cloneComponent=e=>(0,k.ty)(this,e),this.updateComponent=(e,t,n,r)=>(0,k.ZP)(this,e,t,n,r),this.silentPatch=(e,t,n)=>(0,k.c_)(this,e,t,n),this.selectComponent=(e,t)=>(0,k.Cs)(this,e,t),this.clean=()=>(0,k.uH)(this),this.execCommand2=e=>function(e,t){let{transactions:n,update:r=e.components}=t;const o=[];Array.isArray(r)||(r=[r]),n.forEach(e=>{let{type:t,key:n,value:i}=e;r.forEach(e=>{const r=t?e.closest(t):e;if(r){const e=(0,S.D$)(r,n,i);o.push(new E.A({componentId:r.id,key:e.key,value:e.value}))}})}),e.withSnapshot&&o.length>0?((0,C.Ay)({steps:o,onEnd:()=>{e.withSnapshot=!1}}),e.commitEdits(o)):o.forEach(t=>{let{componentId:n,key:r,value:a}=t;const s=i.M.get("components",n);s&&(s.props[r]=a,e.commitEdits(o))})}(this,e),this.execCommands=(e,t)=>function(e,t,n){let{components:r=[...e.components],silent:o=!1}=n||{};Array.isArray(r)||(r=[r]),Array.isArray(t)||(t=[t]);const a=[];return t.forEach(t=>{let{componentId:n,key:o,value:i,options:s={}}=t;const{find:l}=s;if(n){let t=i;if("function"==typeof i){const r=e.getComponent(n);t=i(r)}const r=e.getComponent(n),s=r?(0,S.D$)(r,o,t):{key:o,value:t};a.push(new E.A({componentId:n,key:s.key,value:s.value}))}else r.forEach(t=>{if(l){let e=t.closest(l);if(e||(e=t.find(l)),!e)return void console.log("component not found on execCommands",l);t=e}let n=i;if("function"==typeof i&&(n=i(t),null===n))return e;const r=(0,S.D$)(t,o,n);a.push(new E.A({componentId:t.id,key:r.key,value:r.value}))})}),e.withSnapshot&&a.length>0?((0,C.Ay)({steps:a,onEnd:()=>{e.withSnapshot=!1}}),e.commitEdits(a)):a.forEach(t=>{let{componentId:n,key:r,value:o}=t;const s=i.M.get("components",n);s&&(s.props[r]=o,e.commitEdits(a))}),e}(this,e,t)}dispatch(e,t){return this.app.dispatch(e,t),this}on(e,t){this.app.subscribe(e,t)}off(e,t){switch(e){case"update":this.app.unSubscribe("update",t);break;case"select":this.app.unSubscribe("select",t)}}addEditor(e){let{id:t,type:n,name:r,editor:o}=e;this.editors.push({id:t,type:n,name:r,editor:o})}removeEditor(e){let{id:t,name:n,type:r}=e;t&&(this.editors=this.editors.filter(e=>e.id!==t)),n&&(this.editors=this.editors.filter(e=>e.name!==n)),r&&(this.editors=this.editors.filter(e=>e.type!==r))}getComponents(){return i.M.get("components")}getComponent(e){return e?i.M.get("components",e):null}getEditor(e){if(e){const t=this.editors.find(t=>t.name===e);return t?t.editor:null}return this.editors}getSelectedComponent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{find:t=null}=e;if(!t)return this.components;const n=[],r=e=>{e&&e.forEach(e=>{const o=this.getComponent(e);o&&(t?.equalWith(o.type)&&n.push(o),r(o.children))})};return this.components.forEach(e=>{t?.equalWith(e.type)&&n.push(e),e.children&&r(e.children)}),n}saveTemplate(e,t){this.templates[e]=t}getTemplate(e){return this.templates[`style:${e}`]}store(){return this.withSnapshot=!0,this}execCommand(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.execCommands({key:e,value:t,options:n}),this}createschema(e,t){this.__elements[e]=t}getschema(e){return this.__elements[e]}}({}),M=B},52529(e,t,n){"use strict";n.d(t,{X8:()=>b,uH:()=>A,ty:()=>x,a0:()=>k,pp:()=>_,o$:()=>v,iI:()=>g,Cs:()=>y,c_:()=>E,ZP:()=>C});var r=n(86319),o=n(12106),i=n(4075),a=n(3832),s=n(98829),l=n(67549);class c{constructor(e){let{componentId:t,parentId:n,index:r,layer:o}=e;this.componentId=t,this.parentId=n,this.index=r,this.type="ADD",this.layer=o}}var d=n(4807),p=n(89531),h=n(3474),u=n(81139),f=n(29780),m=n(83860);function g(e,t){return Array.isArray(e?.elements)&&e.elements.includes(t)?2:1}function b(e,t){let{componentId:n,parentId:o,index:i,layer:s}=t,{sync:l=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=r.M.get("components",n),p=r.M.get("components",o);if(!d||!p)return;const h=[new c({componentId:n,parentId:o,index:i,layer:s})];d.parentId=o,2===s?(Array.isArray(p.elements)||(p.elements=[]),p.elements.splice("number"==typeof i?i:p.elements.length,0,n),p.element.appendChild(d.element)):(p.children.splice(i,0,n),p.appendChild(d.element,i)),e.withSnapshot&&h.length>0&&(0,a.Ay)({steps:h,onEnd:()=>e.withSnapshot=!1}),l&&e.commitEdits(h)}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t?(-1!==e.components.findIndex(e=>e.id===t.id)||(t.isSelected=!0,e.type=n.type||t.type,"function"==typeof t.onSelect&&t.onSelect("selected"),e.wsService.send(JSON.stringify({transactions:[{type:"SELECT_ELEMENT",componentId:t.id}]})),e.components.push(t),e.app.dispatch("update",{editor:e,props:n}),e.app.dispatch("select",{editor:e,props:n,component:t,components:e.components})),e):e}function A(e){return e.components.forEach(e=>{e.isSelected=!1,"function"==typeof e.onDeselect&&e.onDeselect("selected")}),e.components=[],e}function w(e){const t={type:e.type,props:JSON.parse(JSON.stringify(e.props)),children:[]},n=(e,t)=>{Array.isArray(e)&&e.forEach(e=>{const n=(o=e)?"string"==typeof o?o:o.dataset?.id||o.id||null:null;var o;const i=n&&r.M.get("components",n);i&&t.push(w(i))})};return n(e.children,t.children),Array.isArray(e.elements)&&e.elements.length>0&&(t.elements=[],n(e.elements,t.elements)),t}function x(e,t){let{componentId:n,parentId:o,index:i}=t;const c=[],p=r.M.get("components",n),h=r.M.get("components",o);if(!p||!h)return console.error("component not found");const u=w(p),f=g(h,n);if(e.createComponent({body:u,parentId:o,index:i,layer:f})){if(c.push(new d.A({componentId:u.id,parentId:o,index:i,body:u,layer:f})),("card"===p.type||"col"===p.type)&&"function"==typeof p.closest){const e=p.closest("block");if(e){(0,l.s)(e).forEach(e=>{r.M.get("components",e.componentId)?c.push(e):(console.error("col not found for resize on clone"),(0,s.v)({s:"E",error_code:"#ggbbk$",info:{},msg:"col not found for resize on clone"}))})}}return(0,a.Ay)({steps:c,update:!0}),r.M.get("components",u.id)}}function v(e,t){let{componentId:n}=t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const{sync:t=!0}=o,i=r.M.get("components",n);if(!i)return(0,s.v)({msg:"component not found",error_code:"#e44lk",info:{},s:"E"}),void(0,f.U)();const l=i.parent();if(!l)return e;if(2!==g(l,i.id)){const r=l.children.findIndex(e=>e===i.id);if(r<0)return(0,s.v)({msg:`children index not found for parent ${i.id}: ${r}`,error_code:"#e24lmvD3",info:{data:{componentId:n,parentId:l.id,children:l.children,layer:1}},s:"E"}),(0,f.U)(),e;l.children.splice(r,1);const o=[new p.A({componentId:n,parentId:l.id,index:r,layer:1})];i.remove(),e.withSnapshot&&o.length>0&&(0,a.Ay)({steps:o,onEnd:()=>e.withSnapshot=!1}),t&&e.commitEdits(o)}else{const t=l.elements.findIndex(e=>e===i.id);if(t<0)return(0,s.v)({msg:`parent index not found: ${t}`,error_code:"#eggf4",info:{data:{componentId:n,parentId:l.id,elements:l.elements,layer:2}},s:"E"}),(0,f.U)(),e;l.elements.splice(t,1);const r=[new p.A({componentId:n,parentId:l.id,index:t,layer:2})];i.remove(),e.withSnapshot&&r.length>0&&(0,a.Ay)({steps:r,onEnd:()=>e.withSnapshot=!1}),e.commitEdits(r)}return e}catch(e){(0,s.v)({error_code:"#eggf!!4",msg:e.message,info:{data:e.stack},s:"E"}),(0,f.U)(),console.error(e)}}function _(e,t){let{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p,direction:u}=t,{sync:m=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(-1===c||-1===l)return(0,s.v)({error_code:"#eggf$^4",msg:"invalid index on moveComponent",info:{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p},s:"E"}),(0,f.U)(),null;const g=[new h.A({componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,direction:u,fromLayer:d,toLayer:p})],b=r.M.get("components",i),y=r.M.get("components",o),A=r.M.get("components",n);if(!A||!y||!b)return console.error("component not found on move",`\n componentId: ${n},\n newParentId: ${o},\n oldParentId: ${i},\n newIndex: ${l},\n oldIndex: ${c},\n fromLayer: ${d},\n toLayer: ${p}`),e;try{if(2===d&&2===p)Array.isArray(y.elements)||(y.elements=[]),b.elements.splice(c,1),y.elements.splice(l,0,A.id),y.element.appendChild(A.element);else{let e;b.children.splice(c,1),y.children.splice(l,0,A.id),b.id===y.id&&"block"===y.type&&(e={direction:l>c?"bottom":"top"}),y.appendChild(A.element,l,e)}}catch(e){console.error("appendChild method required for move",y)}return e.withSnapshot&&g.length>0&&(0,a.Ay)({steps:g,onEnd:()=>e.withSnapshot=!1}),A.parentId=o,m&&e.commitEdits(g),e}function k(e,t){let{body:n,parentId:l,index:c,layer:p}=t,{sync:h=!0,clone:u=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const m=r.M.get("components",l);if(!m)return(0,f.U)(),void(0,s.v)({msg:"component not found on create",error_code:"#c49vk",info:{data:{body:n,parentId:l,index:c,layer:p}},s:"E"});n.layer=p||1;const g=e=>{e.id=e._id=u?e.id:`cdtr-${(0,o.A)()}`,[e.children,e.elements].forEach(t=>{Array.isArray(t)&&t.forEach(t=>{t&&"object"==typeof t&&(t.parentId=e.id,g(t))})})};g(n),n.children||(n.children=[]),2===p?(Array.isArray(m.elements)||(m.elements=[]),m.elements.splice(c,0,n.id)):m.children.splice(c,0,n.id);const{children:b}=(0,i.X)({children:[n],id:l});if(requestAnimationFrame(()=>{b[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),2===p)m.element.appendChild(b[0]);else{if("function"!=typeof m.appendChild)return console.error("appendChild method required for create",m),void(0,s.v)({msg:"parent cannot host children on create",error_code:"#c49vk2",info:{data:{parentId:l,type:m.type}},s:"E"});m.appendChild(b[0],c)}const y=[new d.A({componentId:n.id,parentId:l,body:n,index:c,layer:p})];return h&&e.commitEdits(y),e.withSnapshot&&y.length>0&&(0,a.Ay)({steps:y,onEnd:()=>e.withSnapshot=!1}),r.M.get("components",n.id)}function C(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{sync:l=!0}=i;if("string"==typeof t&&(t=r.M.get("components",t)),!t)return console.error("component not found on update"),(0,s.v)({error_code:"#e@lld",msg:"component not found on update",info:{},s:"E"}),null;const c=(0,m.D$)(t,n,o),d=[new u.A({componentId:t.id,key:c.key,value:c.value&&"object"==typeof c.value?JSON.parse(JSON.stringify(c.value)):c.value})];return e.withSnapshot&&d.length>0?((0,a.Ay)({steps:d,onEnd:()=>{e.withSnapshot=!1}}),l&&e.commitEdits(d)):(t.props[c.key]=c.value,l?e.commitEdits(d):e.updateAll()),e}function E(e,t,n,r){const o=[new u.A({componentId:t.id,key:n,value:r})];e.commitEdits(o)}},29780(e,t,n){"use strict";n.d(t,{S:()=>o,U:()=>i});var r=n(86319);const o=(e,t)=>{e&&(t(e),e.children&&e.children.forEach(e=>{o(e,t)}))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;r.M.get("error","status")||n(50629)(`./${e}`).then(()=>{r.M.set({error:{status:e}}),window.__show_errors=!0;const t=document.createElement(`cdtr-${e}`);document.body.appendChild(t)})}},61084(e,t,n){"use strict";n.d(t,{MC:()=>f,Zj:()=>u});var r=n(59929),o=n(30052),i=n(76151);const a=[{value:"cover",label:"cover"},{value:"contain",label:"contain"},{value:"auto",label:"auto"}],s=[{value:"no-repeat",label:"no_repeat"},{value:"repeat",label:"repeat"},{value:"repeat-x",label:"repeat_x"},{value:"repeat-y",label:"repeat_y"}],l=[{value:"local",label:"normal_scroll"},{value:"fixed",label:"parallax"}],c={fit:!1,focus:!1,repeat:!1,attachment:!1,opacity:!1,filter:!1},d=["left top","center top","right top","left center","center center","right center","left bottom","center bottom","right bottom"],p={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center"},h=/\.(png|jpe?g|gif|svg|webp|avif|bmp|ico|tiff?)$/i,u=e=>{const t=String(e||"").trim();return!!t&&(!!/^data:image\//i.test(t)||t.split(",").every(e=>{const t=e.trim();if(!t)return!1;let n=t;try{n=new URL(t,"https://placeholder.invalid").pathname}catch(e){}return h.test(n)}))},f=(e,t)=>{const n=JSON.parse(JSON.stringify(e||{}));return n.properties=n.properties||{},n.properties.style={...n.properties.style||{},...t},n};class m extends r.WF{constructor(){super(),this.background=null,this.channel="web",this.opacity=1,this.canRemove=!1,this.src=""}get _style(){return this.background?.properties?.style||{}}get _isImage(){return"images"===this.background?.type}_allows(e){return"web"===this.channel||!0===c[e]}_hasImageOptions(){return["fit","focus","repeat","attachment","opacity","filter"].some(e=>this._allows(e))}_patch(e){"function"==typeof this.onPatchStyle&&this.onPatchStyle(e)}_setFilter(e){const t=(e=>{let{blur:t,brightness:n}=e;const r=[];return t>0&&r.push(`blur(${t}px)`),100!==n&&r.push(`brightness(${n/100})`),r.join(" ")})(e);this._patch({filter:t,transform:e.blur>0?"scale(1.08)":""})}_renderSegmented(e,t,n,o){return r.qy`
|
|
1809
|
+
`;h()}var Ce=n(29811),Ee={};Ee.setAttributes=g(),Ee.insert=f().bind(null,"head"),Ee.domAPI=h(),Ee.insertStyleElement=y();d()(Ce.A,Ee);const Se=Ce.A&&Ce.A.locals?Ce.A.locals:void 0;var Be=n(73890);function Me(e){const{props:t,commands:r,justify:i,items:a,editor:s,store:l,schema:c}=e,{style:d,classList:p=[]}=t;e.automations||(e.automations={});const h=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",null,(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"}))),u=(0,o.A)("cdtr-form-builder",{className:Se.form},h);n.e(2550).then(n.t.bind(n,12550,23)).then(()=>{h.remove(),u.style.outlineOffset="10px",u.style.display="block",u.language=l.get("config","language"),u.autoComplete="off",u.spacing=2,u.theme={palette:{primary:{main:"#845EC2"}}},u.formStyle=e.style,u.onSelectField=(e,t)=>{const n=[...u.items];l.get("ctrlKey")?n[e].selected=!n[e].selected:(n.forEach(e=>e.selected=!1),n[e].selected=!0),u.items=n,s.dispatch("update")},u.onSortEnd=e=>{let{items:t}=e;s.store().updateComponent(x,"items",t)},u.items=e.items});const f=(0,o.A)("cdtr-move-handle-bar",null),m=(0,o.A)("cdtr-editor-bar",{opened:!1,direction:"left",offsetY:60,componentId:e.id},(0,o.A)("cdtr-tooltip",{content:"form:manage_fields"},(0,o.A)("paper-button",{class:Se.button,onClick:()=>y()},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"createField"}))),(0,o.A)("cdtr-tooltip",{content:"design_form"},(0,o.A)("paper-button",{onClick:()=>{const e=x.closest("card");e&&s.clean().selectComponent(e)},class:Se.button},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"designForm"})))),g=(0,o.A)("div",{"data-type":e.type,"data-id":e.id,"draggable-element":"element","droppable-element":"element",style:{width:"100%"},className:p.concat("form-component").join(" ")},u,f,m),b={set:(e,t,n)=>{switch(t){case"onSubmit":return u.onSubmit=e[t],!0;case"items:v":return u.items=[],e[t]=r.cloneDeep(n),u.items=e[t],!0;case"items":return r.debounce(()=>{u.items=[],e[t]=r.cloneDeep(n),u.items=e[t]},10),!0;case"automations":return e[t]=r.deepMerge(e[t],n),!0;case"display":return e[t]=r.deepMerge(e[t]||{},n),!0;case"style":return e[t]=r.deepMerge(e[t],n),u.formStyle=e[t],!0;default:return!0}}};m.opened=!1;const y=()=>{const t=e.schema??(l.get("config","editor","configure","plugins")||[]).find(e=>e&&"form"===e.name),n=t?.configure?.fields;if(!n)return void console.warn("[form] manage fields: no form plugin schema available (fields missing)");const r=(0,o.A)("cdtr-drawer",{backdropColor:"#000000a1",width:"400px",style:{direction:"var(--direction-locale)"}});r.opened=!0,r.headerText="available_fields",document.body.appendChild(r);const i={fields:n.map(e=>{const t=u.items.find(t=>t.id===e.id);return e.inserted=!!t,e}),onChange:(e,t,n)=>{const r=u.items.findIndex(t=>t.id===e.id);if(t&&-1===r){const t=u.items.findIndex(e=>e.selected)||u.items.length-1;ue({item:e,index:t,compose:x}),fe("insert",e)}else if(!t&&-1!==r){if("button"===u.items[r]?.type)return e.inserted=!0,void d(i.fields);const t=[...u.items];t.splice(r,1),s.updateComponent(x,"items",t),fe("remove",e)}},onCreate:async(e,t)=>{const r=t?"update":"create",o=await async function(e,t){E.Ay.dispatch(`form:field:${e}`,{field:t,action:e});const n=E.Ay.formHooks||{},r="create"===e?n.onFieldCreate:"update"===e?n.onFieldUpdate:"delete"===e?n.onFieldDelete:null;if("function"!=typeof r)return t;const o="delete"===e?t.id:t,i=await r(o);return"delete"===e?t:i&&"object"==typeof i?i:t}(r,e),a=i.fields.find(e=>e.id===o.id);a?Object.assign(a,o):(o.inserted=!0,i.fields.push(o),n.push(o));const l=u.items.findIndex(e=>e.id===o.id);if(-1===l){const e=u.items.findIndex(e=>e.selected)||u.items.length-1;ue({item:o,index:e,compose:x})}else{const e=[...u.items];e.splice(l,1),s.updateComponent(x,"items",e),ue({item:o,index:l,compose:x})}a&&(a.inserted=!0),d(i.fields)}},a=()=>d(i.fields),c=function(){return ke({target:r,field:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,onSubmit:i.onCreate,onCancel:a})},d=e=>{r.headerText="available_fields";(0,X.XX)((0,Be.A)({items:e,onChange:i.onChange,debounce:e=>{let{target:t}=e;const n=t.value,r=i.fields.filter(e=>-1!==e.name.indexOf(n));d(r)},onAdd:()=>c(),onEdit:e=>c(e)}),r)};d(i.fields),r.addEventListener("close",()=>{r.remove()},{once:!0})},A=function(e){let{debounce:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s.components.forEach(t=>{if("form"===t.type){const n=JSON.parse(JSON.stringify(t.props.items));let r=0;const o=()=>{r=n.length};for(;r<n.length;r++){const i=n[r];i.props.label_field||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props.style||(i.props.label_field.props.style={}),i.props.style||(i.props.style={}),"menu"!==i.type&&"dropdown"!==i.type||(i.props.triggerProps||(i.props.triggerProps={}),i.props.triggerProps.style||(i.props.triggerProps.style={})),e(i,{stop:o,items:n,compose:t})}s.store().updateComponent(t,"items",n)}})};let w=!1;const x=(0,M.n)({name:"form",id:e.id,template:g,atomElement:u,defaultProps:{style:{},classList:[],items:[]},schema:c,onSelect:t=>{m.opened=!0,m.componentId=x.closest("card")?.id||e.id},onDeselect:e=>{m.opened=!1},elementProps:e,createEditor:e=>{let{component:t,props:n,commands:r,helpers:o}=e;const i={BUTTONS:["button"],INPUTS:["input","textarea"],TOGGLES:["radio-group","checkbox","toggle"],MENUS:["dropdown","menu"]},a=t.props.items?.find(e=>e.selected);if(!a)return{};function d(){return c?.configure?.mailingLists.map(e=>({...e,value:e.label}))}return{select:e=>{let{changeTab:t,tab:n}=e;"style"!==n.text&&t("style")},tabs:e=>{const t=[{text:"style"},{text:"list-settings"},{text:"automations"},{text:"settings"}];return t.forEach(t=>t.selected=t.text===e),t},layout:e=>{let{tab:n,changeTab:r,tabs:p}=e;if("automations"!==n.text){const e=t?.props?.automations?.when?.submitted?.then?.sendMail;if(e?.to?.length){const t=e.to.filter(e=>"string"==typeof e&&""!==e.trim());t.length!==e.to.length&&s.store().execCommands({key:"automations",value:n=>o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:{...e,to:t}}}}}),options:{find:"form"}})}}const h=t?.props?.display||{},u=h.mode||"inline",f=e=>s.store().execCommands({key:"display",value:t=>o.deepMerge(t.props.display||{},e),options:{find:"form"}}),m=[{type:"heading",level:6,text:"form_behavior",active:"style"===n.text},{type:"dropdown",title:"display_mode",active:"style"===n.text,value:u,selected:u,items:[{key:"display_inline",value:"inline"},{key:"display_modal",value:"modal"}],onChange:e=>{f({mode:e.target.value}),r("style")}},{type:"slider",title:"open_delay_seconds",inputType:"number",min:0,max:60,active:"style"===n.text&&"modal"===u,value:h.delaySeconds??3,onInput:e=>{f({delaySeconds:parseFloat(e.target.value)})}},{type:"heading",level:6,text:"settings",active:"style"===n.text&&"button"===a.type},{type:"input",title:"text:button",active:"style"===n.text&&"button"===a.type,value:a.props.text,onInput:e=>{const t=e.target.value;A(e=>{e.selected&&"button"===e.type&&(e.props.text=t)},{debounce:!0})}},{type:"heading",level:6,text:"field_settings",active:"list-settings"===n.text&&"button"!==a.type},{type:"input",title:"label",active:"button"!==a.type&&"list-settings"===n.text,value:a?.props?.label_field?.props?.text,onInput:e=>{const t=e.target.value;A(e=>{e.selected&&"button"!==e.type&&(e.props.label_field.props.text=t)},{debounce:!0})}},{type:"input",title:"placeholder",active:i.INPUTS.includes(a.type)&&"list-settings"===n.text,value:a.props.placeholder,onInput:e=>{const t=e.target.value;A(e=>{i.INPUTS.includes(e.type)&&e.selected&&"button"!==e.type&&(e.props.placeholder=t)},{debounce:!0})}},{type:"checkbox",title:"checkbox_checked_as_default",checked:a.props.checked,active:["toggle","checkbox"].includes(a.type)&&"list-settings"===n.text,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&i.TOGGLES.includes(e.type)&&(e.props.checked=t)})}},{type:"checkbox",title:"checkbox_on_right_side",checked:!0===a.props.labelPlacement,active:"checkbox"===a.type&&"list-settings"===n.text,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&"checkbox"===e.type&&(e.props.labelPlacement=t?"start":"end")})}},{type:"stringListBuilder",title:"items_in_menu",active:(i.MENUS.includes(a.type)||"radio-group"===a.type)&&"list-settings"===n.text,items:a.props.items,changeItemValue:(e,t,n)=>{A(n=>{n!==a&&n.id!==a.id||(n.props.items[e].label=t)})}},{type:"heading",level:6,text:"typography",active:"style"===n.text},{type:"fontFamily",active:"style"===n.text,value:a?.props?.style?.fontFamily||a?.props?.label_field?.props?.style?.fontFamily,weight:!0,weightValue:a?.props?.style?.fontWeight||a?.props?.label_field?.props?.style?.fontWeight,onChange:e=>{const t=e.target.value;(0,pe.sw)({cssRule:t}),t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontFamily=t:i.TOGGLES.includes(a.type)&&a.id===e.id?(e.props.label_field.props.style.fontFamily=t,e.props.style.fontFamily=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.fontFamily=t:(e.props.label_field.props.style.fontFamily=t,e.props.style.fontFamily=t))},{debounce:!0})},onWeightChange:e=>{const t=e.detail.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontWeight=t:i.TOGGLES.includes(a.type)&&a.id===e.id?(e.props.label_field.props.style.fontWeight=t,e.props.style.fontWeight=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.fontWeight=t:(e.props.label_field.props.style.fontWeight=t,e.props.style.fontWeight=t))},{debounce:!0})}},{type:"slider",title:"fontSize",max:30,min:8,active:"style"===n.text,value:parseInt(a.props?.style?.fontSize)||parseInt(a?.props?.label_field?.props?.style?.fontSize)||16,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.fontSize=t:(i.TOGGLES.includes(a.type)&&a.id===e.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type))&&(e.props.label_field.props.style.fontSize=t)},{debounce:!0})}},{type:"typography",active:"style"===n.text,bold:700===a.props?.style?.fontWeight||700===a.props?.label_field?.props?.style?.fontWeight,italic:"italic"===a.props?.style?.fontStyle||"italic"===a.props?.label_field?.props?.style?.fontStyle,underline:"underline"===a.props?.style?.textDecoration||"underline"===a.props?.label_field?.props?.style?.textDecoration,onChange:e=>{function t(t){switch(e){case"bold":t.fontWeight=null===t.fontWeight?700:null;break;case"italic":t.fontStyle=null===t.fontStyle?"italic":null;break;case"underline":t.textDecoration="underline"===t.textDecoration?null:"underline"}}A(e=>{"checkbox"===a.type?e.selected&&"checkbox"===e.type&&t(e.props.label_field.props.style):e.selected&&"button"===a.type&&"button"===e.type?t(e.props.style):"button"!==a.type&&"button"!==e.type&&(!e.selected||"menu"!==e.type&&"dropdown"!==e.type?e.selected&&t(e.props.label_field.props.style):t(e.props.label_field.props.style))},{debounce:!0})}},{type:"heading",level:6,text:"colors",active:"style"===n.text},{type:"colorpicker",title:"color:label",active:"style"===n.text,value:a.props?.label_field?.props?.style?.color||a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.color=t:(i.TOGGLES.includes(a.type)&&a.id===e.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type))&&(e.props.label_field.props.style.color=t)},{debounce:!0})}},{type:"colorpicker",title:"component_color",active:()=>"style"===n.text&&i.TOGGLES.includes(a?.type),value:a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.TOGGLES.includes(a.type)&&a.id===e.id&&(e.props.style.color=t)},{debounce:!0})}},{type:"colorpicker",title:"button"===a.type?"background":"form:background",allowGradient:"web"===l.get("config","channel")&&i.BUTTONS.includes(a.type),active:"style"===n.text&&-1!==[...i.BUTTONS,...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.triggerProps?.style?.background||a.props?.style?.background,onChange:e=>{const t=e.target.value;t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?(e.props.style.background=t,t.includes("gradient(")&&(e.props.style.backgroundColor=null)):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.background=t:e.props.style.background=t)})}},{type:"colorpicker",title:"form:placeholder_color",active:"style"===n.text&&-1!==[...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.style?.color,onChange:e=>{const t=e.target.value;t&&A(e=>{i.INPUTS.includes(e.type)&&i.INPUTS.includes(a.type)?e.props.style.color=t:i.MENUS.includes(e.type)&&i.MENUS.includes(a.type)&&(e.props.triggerProps.style.color=t)},{debounce:!0})}},{type:"heading",level:6,text:"dimensions",active:"style"===n.text},{type:"slider",title:"height",max:70,min:20,active:"style"===n.text&&["input",...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a.props?.style?.minHeight)||parseInt(a?.props?.triggerProps?.style?.minHeight)||40,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?(delete e.props.style.height,e.props.style.minHeight=t):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.minHeight=t:delete e.props.style.height,e.props.style.minHeight=t)},{debounce:!0})}},{type:"slider",title:"radius",max:50,min:0,active:"style"===n.text&&[...i.INPUTS,...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a?.props?.style?.borderRadius)||parseInt(a?.props?.triggerProps?.style?.borderRadius)||0,onInput:e=>{const t=e.target.value+"px";t&&A(e=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(e.type)?e.props.style.borderRadius=t:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(e.type)&&(i.MENUS.includes(e.type)?e.props.triggerProps.style.borderRadius=t:e.props.style.borderRadius=t)},{debounce:!0})}},{type:"dropdown",title:"type",value:a.props.type,active:()=>"input"===a.type&&"list-settings"===n.text,selected:a.props.type,items:c.types.find(e=>"input"===e.name)?.types.map(e=>new Object({key:e,value:e})),onChange:e=>{const t=e.target.value;A(e=>{"input"===a.type&&e.selected&&"input"===e.type&&(e.props.type=t)},{debounce:!0})}},{type:"input",title:"default_value",active:()=>"input"===a.type&&"list-settings"===n.text,value:a.props.value,onInput:e=>{const t=e.target.value;A(e=>{!e.selected||"input"!==e.type&&"menu"!==e.type&&"dropdown"!==e.type&&"textarea"!==e.type||(e.props.value=t)},{debounce:!0})}},{type:"heading",level:6,text:"properties",active:"list-settings"===n.text&&"button"!==a.type},{type:"checkbox",title:"required",info:"required_form_field_info",checked:a.props.isRequired,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&(e.props.isRequired=t)})}},{type:"checkbox",title:"hidden_field",info:"hidden_form_field_info",checked:a.props.isHidden,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:e=>{const t=e.target.checked;A(e=>{e.selected&&(e.props.isHidden=t)})}},{type:"input",max:1024,title:"url_param",active:"list-settings"===n.text&&"button"!==a.type,value:a.props.paramName,onInput:e=>{let{target:t}=e,n=t.value;n=n.trim().replace(/\s/g,"_"),n=n.replace(/\//g,""),n=n.replace(/\\/g,""),n=n.replace(/[^a-zA-Z0-9_\-]/g,"");A((e,r)=>{let{stop:o,items:i}=r;i.find(e=>e.paramName===n)||e.selected&&"button"!==e.type&&(e.props.paramName=t.value=n,o())})}},{type:"heading",level:6,text:"after_submission",active:"automations"===n.text},{type:"dropdown",title:"after_submission",active:()=>(w=!!t?.props?.automations?.when?.submitted?.then?.redirect?.url,"automations"===n.text),selected:t?.props?.automations?.when?.submitted?.then?.redirect?.url?"redirect":"stay_at_page",value:w?"redirect":"stay_at_page",items:[{value:"stay_at_page",key:"stay_at_page"},{value:"redirect",key:"redirect",selected:!!t?.props?.automations?.when?.submitted?.then?.redirect?.url}],onChange:e=>{"redirect"===e.target.value?(w=!0,r("automations")):(w=!1,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}}),r("automations"))}},{type:"input",title:"where_to_redirect",max:1024,value:t?.props?.automations?.when?.submitted?.then?.redirect?.url||"",active:!0===w&&"automations"===n.text,autofocus:!1==!!t?.props?.automations?.when?.submitted?.then?.redirect?.url,onChange:e=>{let{target:t}=e;const n=t.value,r=new o.Url(n);if(""===r.href)return w=!1,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}});w=!0,s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{url:r.href}}}}}),options:{find:"form"}})}},{type:"checkbox",title:"forward_params",checked:t?.props?.automations?.when?.submitted?.then?.redirect?.forward_params||!1,active:!0===w&&"automations"===n.text,onChange:e=>{let{target:t}=e;const n=t.checked;s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{redirect:{forward_params:n}}}}}),options:{find:"form"}})}},{type:"heading",level:6,text:"select_mailing_lists",active:"automations"===n.text},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"add_user_from_mailinglist_after_subscribed",onCreate:()=>{c?.configure?.mailingListEvents?.create({name:"hello",resolve:()=>{},reject:()=>{}})},onChange:e=>{const n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists,r=n.findIndex(t=>t.key===e.key);-1!==r?n.splice(r,1):n.push({key:e.key}),s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:[{key:e.key}]}}}}}}),options:{find:"form"}})},list:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const t=e;return n.forEach(e=>{const n=t.find(t=>t.key===e.key);n&&(n.inserted=!0)}),t}return[...e]}(),items:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const t=[];return n.forEach(n=>{const r=e.find(e=>e.key===n.key);r&&(r.inserted=!0,t.push(r))}),t}return[]}()},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"remove_user_from_mailinglist_after_subscribed",onChange:e=>{const n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists,r=n.findIndex(t=>t.key===e.key);-1!==r?n.splice(r,1):n.push({key:e.key}),s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:[{key:e.key}]}}}}}}),options:{find:"form"}})},list:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const t=e;return n.forEach(e=>{const n=t.find(t=>t.key===e.key);n&&(n.inserted=!0)}),t}return e}(),items:function(){const e=d(),n=t.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const t=[];return n.forEach(n=>{const r=e.find(e=>e.key===n.key);r&&(r.inserted=!0,t.push(r))}),t}return[]}()},{type:"heading",level:6,text:"automations",active:"automations"===n.text},{type:"input",max:1024,active:"automations"===n.text,value:t?.props?.automations?.when?.submitted?.then?.sendParams?.url,placeholder:"URL...",title:"send_the_data_to",onInput:e=>{let{target:t}=e;const n=t.value,r={method:"post",url:new o.Url(n).href,type:"http"};s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{sendParams:r}}}}),options:{find:"form"}})}},{type:"stringListBuilder",title:"send_mail_on_submitted",active:"automations"===n.text,placeholder:"example@email.com",inputType:"email",items:t?.props?.automations?.when?.submitted?.then?.sendMail?.to||[""],changeItemValue:(e,t,n)=>{s.store().execCommands({key:"automations",value:n=>{let r=n?.props?.automations?.when?.submitted?.then?.sendMail;if(r)return r.to[e]=t,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})},onRemove:(e,t)=>{s.store().execCommands({key:"automations",value:t=>{let n=t?.props?.automations?.when?.submitted?.then?.sendMail;if(n)return n.to.splice(e,1),o.deepMerge(t.props.automations,{when:{submitted:{then:{sendMail:n}}}})},options:{find:"form"}})},onAddItem:()=>{s.store().execCommands({key:"automations",value:e=>{let t=e?.props?.automations?.when?.submitted?.then?.sendMail;return t||(t={to:[],html:"",text:"",subject:"",from:""}),t.to.push(""),o.deepMerge(e.props.automations,{when:{submitted:{then:{sendMail:t}}}})},options:{find:"form"}})},onChange:(e,t,n)=>{s.store().execCommands({key:"automations",value:n=>{const r=n.props.automations.when.submitted.then.sendMail;return r.to[e]=t,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})}}];return m}}},commands:{select:e=>{m.opened=!0},deSelect:e=>{m.opened=!1},deSelectedField:()=>{u.items.forEach(e=>{e.selected=!1}),x.props.items=u.items}},globalCommands:{},remove:()=>{g.remove()},destroy:()=>{},validator:b});return x}var Te=n(21663),Le=n(98352),Oe=n.n(Le);const Ie=JSON.parse('["ase","art","bmp","blp","cd5","cit","cpt","cr2","cut","dds","dib","djvu","egt","exif","gif","gpl","grf","icns","ico","iff","jng","jpeg","jpg","jfif","jp2","jps","lbm","max","miff","mng","msp","nef","nitf","ota","pbm","pc1","pc2","pc3","pcf","pcx","pdn","pgm","PI1","PI2","PI3","pict","pct","pnm","pns","ppm","psb","psd","pdd","psp","px","pxm","pxr","qfx","raw","rle","sct","sgi","rgb","int","bw","tga","tiff","tif","vtf","xbm","xcf","xpm","3dv","amf","ai","awg","cgm","cdr","cmx","dxf","e2d","egt","eps","fs","gbr","odg","svg","stl","vrml","x3d","sxd","v2d","vnd","wmf","emf","art","xar","png","webp","jxr","hdp","wdp","cur","ecw","iff","lbm","liff","nrrd","pam","pcx","pgf","sgi","rgb","rgba","bw","int","inta","sid","ras","sun","tga","heic","heif"]');function Ne(e){const t=(/(?:\.([^.]+))?$/.exec(e.toLowerCase())??[])[1]||"",n=t.includes("&")?t.split("&")[0]:t;return-1!==Ie.findIndex(e=>e===n)}var Re=n(4982),$e=n.n(Re);const De={deepMerge:k(),mergeDiff:a.A,deepEqual:$e(),cloneDeep:Oe(),arrayToString:i.A},Pe=e=>{const{type:t,children:n,props:c}=e,d={mergeDiff:a.A,deepMerge:k(),isRtl:Te.A,arrayToString:i.A,cloneDeep:Oe(),isImage:Ne,debounce:(new s.A).run,snackbar:e=>B.A.dispatch("snackbar",{text:e})},p={...e,...c,commands:d,editor:E.Ay,store:l.M},h={block:()=>(0,o.A)(D,p,n),row:()=>(0,o.A)(oe,p,n),"menu-widget":()=>(0,o.A)(de,p,n),background:()=>(0,o.A)(Q,p),form:()=>{const e=l.M.get("config","editor"),t=e?.configure?.plugins;if(!t)return;const i=t.find(e=>"form"===e.name),a=(0,o.A)(Me,(0,r.A)({schema:i},p),n);return a&&"function"==typeof a.createEditor&&i&&(i.createEditor=a.createEditor),a},iframe:()=>(0,o.A)(Y,p),html:()=>(0,o.A)(F,p)};if(h[t])return"function"==typeof h[t]?h[t]():h[t];{const n=l.M.get("config","editor","configure","plugins")||[],r=l.M.get("config","channel"),o=n.find(e=>e.name===t);if(o&&o.name&&o.lazy&&"function"==typeof o.lazy){const i=o=>{const i=n.findIndex(e=>e.name===t);if(-1===i)return void console.error("scheme not found when resolving component",t);const a=o.create({compose:p,createElement:M.n,helpers:De,channel:r});a.type=t,a.createEditor&&(n[i].createEditor=a.createEditor),"function"==typeof o.menu&&(n[i].menu=o.menu);try{const h=l.M.get("components",e.id);if(!h)return console.error("element not found during lazy load","#8l#$f"),null;function u(){h.element.parentElement&&h.element.parentElement.replaceChild(a.element,h.element),h.element.remove()}"cdtr-block-loader"===h.element.localName&&(h.element.onLoad=()=>{u()},h.element.isConnected&&u())}catch(f){console.error("lazy load replace failed",f,t)}const s=l.M.get("components"),c=s[e.id],d=e=>Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e);c&&(d(c.children)&&!d(a.children)&&(a.children=c.children),d(c.elements)&&!d(a.elements)&&(a.elements=c.elements)),s[e.id]=a,l.M.set({components:s})};return o.lazy(i),{name:o.name,id:e.id,element:(()=>{const t=document.createElement("cdtr-block-loader");return t.setAttribute("data-component-type",e.type),t})()}}if(o&&o.create){const e=o.create({compose:p,createElement:M.n,helpers:De,channel:r});return e.type=t,e&&"object"==typeof e&&"function"==typeof e.createEditor&&(o.createEditor=e.createEditor),e}}};var ze=n(98829);const He=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=n=>{if(!n||n.is_removed)return;if(n.props||(n.props={}),"string"==typeof n)return n;n._id&&(n.id=n._id),e.id&&(n.parentId=e.id),n.children&&(n.__children=[...n.children].map(e=>{if(e)return e.id||e._id})),n.elements&&(n.__elements=[...n.elements].map(e=>{if(e)return e.id||e._id}));const{children:i,elements:a}=He(n,t);n.props.style&&"object"==typeof n.props.style&&Object.keys(n.props.style).forEach(e=>{null!==n.props.style[e]&&void 0!==n.props.style[e]||delete n.props.style[e]});const s=(0,o.A)(Pe,(0,r.A)({},n,{elements:a,"data-id":n.id,"data-type":n.type,silent:t.silent}),i);if(s&&!0!==t.silent)(e=>{(e=>{e.props&&(e.props.interactions||(e.props.interactions=[]),void 0===e.props.show_on_desktop&&(e.props.show_on_desktop=!0),void 0===e.props.show_on_tablet&&(e.props.show_on_tablet=!0),void 0===e.props.show_on_mobile&&(e.props.show_on_mobile=!0))})(e);const{props:t,element:n,id:r,extend:o,parentId:i,__children:a,__elements:s}=e,c=l.M.get("components");window.location.href.includes("localhost")&&(window.components=c);const d={id:r,...e,props:t,children:a||[],elements:s||[]};c[r]=d})({...n,...s});else if(!s)return console.error("unresolved compose",n,n.type),null;return s.element};return"object"==typeof e&&(e=JSON.parse(JSON.stringify(e))),e.children&&(e.children=e.children.map(n)),e.elements&&(e.elements=e.elements.map(n)),e};const je=e=>{const t=(e=>{try{return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}catch(t){return console.error("[buildComponentTree] could not copy the component list, so it will be modified in place — the caller's document is being mutated and may not survive a second load. Most likely a DOM node or a function stored in a component's props.",t),e}})(e);!function(e){e.forEach(e=>{e.props||(e.props={}),e.props.style||(e.props.style={}),e.id||(e._id?e.id=e._id:console.error("component must have id")),e._id||(e._id=e.id)})}(t);let n,r=t.findIndex(e=>"root"===e.type);-1===r&&(r=t.findIndex(e=>"section"===e.type)),-1!==r&&([n]=t.splice(r,1),n.props.datasetId||(n.props.datasetId=crypto.randomUUID()));const o=e=>{if(e)return Array.isArray(e.children)&&e.children.length>0&&(e.children_ids=e.children,e.children=e.children.map(r=>{if(Array.isArray(r))return;if(!r)return;const i=t.find(e=>e._id===r);if(!i)return void console.error(`[buildComponentTree] MISSING child "${r}" referenced by ${e.type} ${e._id} — it exists as a child-id but not as a component in the loaded doc, so it will not render.`);n(i);const a=o(i);return a&&a.children&&(i.children=a.children),a&&a.elements&&(i.elements=a.elements),i})),Array.isArray(e.elements)&&e.elements.length>0&&(e.elements=e.elements.map(r=>{const i=t.find(e=>e._id===r);if(!i)return void console.error(`[buildComponentTree] MISSING element "${r}" referenced by ${e.type} ${e._id} — layer-2 element id has no matching component, so it will not render.`);n(i);const a=o(i);return a&&a.elements&&(i.elements=a.elements),a&&a.children&&Array.isArray(e.children)&&e.children.length>0&&(i.children=a.children),i})),e;function n(e){if(!e)return;"text"===e.type&&e.props?.text&&"string"==typeof e.props.text&&(e.props.text=((e,t)=>{if("text"===e&&"string"==typeof t)try{return JSON.parse(t)}catch(e){(0,ze.v)({error_code:"#11jhb",info:e,msg:"could not parse text in transformValues",s:"E"})}return t})("text",e.props.text)),"form"===e.type&&Array.isArray(e.props?.items)&&e.props.items.forEach(e=>{const t=e?.props?.style?.fontFamily;t&&(0,pe.sw)({cssRule:t})});const t=e.props?.style?.fontFamily;t&&(0,pe.sw)({cssRule:t})}};if(n){const e=o(n);e.children&&(n.children=e.children)}return n}},83860(e,t,n){"use strict";n.d(t,{D$:()=>s});var r=n(86319);const o={mobile:"sm"};function i(){if("web"!==r.M.get("config","channel"))return null;const e=r.M.get("deviceFilter")||"all";return o[e]||null}function a(e,t,n){const r=i();if(!r)return null;if("style"!==t&&"text"!==t)return null;const o=e?.props?.breakpoints||{},a=o[r]||{};let s;return s="style"===t?{...a,style:{...a.style||{},...n}}:{...a,text:n},{key:"breakpoints",value:{...o,[r]:s}}}function s(e,t,n){return a(e,t,n)||{key:t,value:n}}},15604(e,t,n){"use strict";n.d(t,{Ay:()=>M,EN:()=>B});var r=n(81840),o=n(4952),i=n(86319),a=n(12106),s=n(18057),l=n(29780),c=n(98829),d=n(93432);const p=class{constructor(e,t,n,r,o){this.component=e,this.color=t,this.userId=n,this.name=r,this.componentId=o,this.borderElement=null,this.isDestroyed=!1,this.createBorder(),this.updatePosition(),this.attachListeners()}createBorder(){this.borderElement=document.createElement("div"),this.borderElement.style.position="absolute",this.borderElement.style.pointerEvents="none",this.borderElement.style.border=`2px solid ${this.color}`,this.borderElement.style.zIndex="0",this.borderElement.style.transition="all 0.01s ease-out",document.body.appendChild(this.borderElement),this.labelElement=document.createElement("div"),this.labelElement.textContent=this.name,this.labelElement.style.position="absolute",this.labelElement.style.pointerEvents="none",this.labelElement.style.backgroundColor=this.color,this.labelElement.style.color="#fff",this.labelElement.style.padding="2px 6px",this.labelElement.style.fontSize="11px",this.labelElement.style.fontWeight="500",this.labelElement.style.borderRadius="3px",this.labelElement.style.zIndex="0",this.labelElement.style.whiteSpace="nowrap",this.labelElement.style.transition="all 0.01s ease-out",this.labelElement.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.labelElement),this.updatePosition()}updatePosition(){if(this.isDestroyed||!this.component.element)return;const e=this.component.element.getBoundingClientRect();if(this.borderElement.style.top=e.top+"px",this.borderElement.style.left=e.left+"px",this.borderElement.style.width=e.width+"px",this.borderElement.style.height=e.height+"px",this.labelElement){const t=e.top-20,n=t<0?e.top+2:t;this.labelElement.style.top=n+"px",this.labelElement.style.left=e.left+e.width/6+"px"}}attachListeners(){this.boundUpdatePosition=this.updatePosition.bind(this),window.addEventListener("scroll",this.boundUpdatePosition,!0),window.addEventListener("resize",this.boundUpdatePosition),this.mutationObserver=new MutationObserver(this.boundUpdatePosition),this.component.element&&this.mutationObserver.observe(this.component.element,{attributes:!0,attributeFilter:["style","class"]})}remove(){this.isDestroyed=!0,window.removeEventListener("scroll",this.boundUpdatePosition,!0),window.removeEventListener("resize",this.boundUpdatePosition),this.mutationObserver&&this.mutationObserver.disconnect(),this.borderElement&&this.borderElement.parentNode&&this.borderElement.parentNode.removeChild(this.borderElement),this.labelElement&&this.labelElement.parentNode&&this.labelElement.parentNode.removeChild(this.labelElement),this.borderElement=null,this.labelElement=null,this.component=null}},h=[];function u(){return h}function f(e){h.push(e)}function m(e){const t=h.findIndex(t=>t?.userId===e);-1!==t&&(h[t].borderSelected.remove(),h.splice(t,1))}function g(){h.forEach(e=>{e.borderSelected.updatePosition()})}var b=n(4217),y=n(69172);function A(e){const{type:t,componentId:n,parentId:r,newParentId:o}=e,a=i.M.get("components",n);if(!a)return!0;if("MOVE"===t)return a.parentId===o;const s=i.M.get("components",r);if(!s)return!0;const l=Array.isArray(s.children)&&s.children.includes(n)||Array.isArray(s.elements)&&s.elements.includes(n);return"ADD"===t?l:!l}function w(e){if(e.disconnectedAt){if(Date.now()-e.disconnectedAt>e.maxDisconnectTime)return console.error("%cDisconnected too long, reload required","color:red"),e.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Disconnected for too long. Please reload the page to ensure data sync."}}),void(0,l.U)("updateNeeded")}if(e.reconnectAttempts>=e.maxReconnectAttempts)return console.error("%cMax reconnection attempts reached","color:red"),e.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Unable to reconnect to server"}}),void(0,l.U)(500);e.reconnectAttempts++;const t=1===e.reconnectAttempts?0:Math.min(e.reconnectDelay*Math.pow(2,e.reconnectAttempts-2),3e4);0===t?console.log(`%cAttempting to reconnect immediately (${e.reconnectAttempts}/${e.maxReconnectAttempts})`,"color:orange"):console.log(`%cAttempting to reconnect (${e.reconnectAttempts}/${e.maxReconnectAttempts}) in ${t}ms`,"color:orange"),i.M.set({wsConnection:{status:"reconnecting",attempts:e.reconnectAttempts,nextAttemptIn:t}}),e.reconnectTimer=setTimeout(()=>{e.wsConnectionProps&&(console.log("%cReconnecting...","color:orange"),_(e,e.wsConnectionProps))},t)}function x(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.isReconnecting=!1}function v(e,t){try{console.log("WS MESSAGE RECEIVED:",t.data);const n=JSON.parse(t.data);u();if(n.transactions)return n.transactions.forEach(t=>{switch(t.type){case"SELECT_ELEMENT":{const r=e.getComponent(t.componentId);if(r){m(n.user.id);const e=function(e,t,n,r,o){return new p(e,t,n,r,o)}(r,n.user.color,n.user.id,n.user.name,t.componentId);f({userId:n.user.id,componentId:t.componentId,borderSelected:e})}break}case"USER_JOINED":{const e=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:[...e,t.user]});break}case"USER_LEFT":{const e=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:e.filter(e=>e.userId!==t.user.userId)}),m(t.user.userId);break}case"SESSION_INITIALIZED":{const n=e.wsConnectionProps?.userId,r=t.users.filter(e=>e.userId!==n);i.M.set({connectedUsers:r});break}case"PATCH":e.updateComponent(t.componentId,t.key,t.value,{silent:!0,sync:!1});break;case"MOVE":if(A(t))break;e.moveComponent({componentId:t.componentId,newParentId:t.newParentId,newIndex:t.newIndex,oldIndex:t.oldIndex,oldParentId:t.oldParentId,direction:t.direction,fromLayer:t.fromLayer,toLayer:t.toLayer},{sync:!1});break;case"CREATE":e.createComponent({componentId:t.componentId,parentId:t.parentId,index:t.index,body:t.body,layer:t.layer},{sync:!1,clone:!0});break;case"ADD":if(A(t))break;e.addComponent({componentId:t.componentId,parentId:t.parentId,index:t.index,layer:t.layer},{sync:!1});break;case"REMOVE":if(A(t))break;e.removeComponent({componentId:t.componentId,parentId:t.parentId,index:t.index},{sync:!1})}}),void g();if("transaction:complete"===n.type){const t=n.completed;if(!e.transactions[n.transactionId])return(0,c.v)({msg:"transaction not found to mark as completed",s:"E",info:{tasks:t},error_code:"#c4ca2"}),void console.error("transaction not found to mark as completed");let r=!0;Array.isArray(t)&&t.forEach(e=>{"completed"!==e.status&&(r=!1)}),r?(delete e.transactions[n.transactionId],e.lastSyncTimestamp=Date.now()):((0,c.v)({msg:"some of tasks not completed",s:"E",info:{tasks:t},error_code:"#c4222"}),(0,l.U)(500),console.error("some of tasks not completed",n))}else"notification:reset"===n.type&&(0,l.U)("updateNeeded")}catch(e){(0,c.v)({msg:e.message,s:"E",info:{data:e.stack},error_code:"#c4222"}),console.error(e)}}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{onOpen:n,access:r,userId:o,sessionId:a,avatar:s,name:c}=t;let d;r?d=`app:${r}`:(o||(0,l.U)(401),a||(0,l.U)(401),d=`freesolo?userId=${o}&sessionId=${a}&avatar=${s}&name=${c}`),e.wsConnectionProps=t,x(e),i.M.set({wsConnection:{status:e.isReconnecting?"reconnecting":"connecting",attempts:e.reconnectAttempts}});const p=e.wsService=new b.w3cwebsocket(`${y.XW.ws_url}/${d}`);p.onopen=()=>{console.log("%cConnected","color:green"),e.wasConnected=!0,e.reconnectAttempts=0,e.isReconnecting=!1,e.disconnectedAt=null,i.M.set({wsConnection:{status:"connected",attempts:0}}),"function"==typeof n&&n()},p.onmessage=t=>v(e,t),p.onclose=t=>{if(console.log("%cWebSocket connection closed","color:orange",t),i.M.set({wsConnection:{status:"disconnected",code:t.code,reason:t.reason}}),!e.wasConnected)return console.error("%cInitial connection failed, not attempting reconnection","color:red"),void(0,l.U)(500);e.disconnectedAt||(e.disconnectedAt=Date.now());[1e3,1008,4401].includes(t.code)?(0,l.U)(500):e.isReconnecting||(e.isReconnecting=!0,w(e))},p.onerror=e=>{console.error("%cWebSocket error:","color:red",e),i.M.set({wsConnection:{status:"error",error:e.message||"WebSocket error occurred"}})}}var k=n(52529),C=n(3832),E=n(81139),S=n(83860);"undefined"!=typeof window&&(window.location?.href?.includes("DEBUG=1"),1)&&(window.__trace__=[]);const B=new class{constructor(e){let{editors:t}=e;this.debounder=new s.A,this.configure={},this.app=new r.A,this.pendingTransactions=[],this.undoRedo=o.A,this.templates={},this.commands={goToError:l.U,logError:c.v},this.wsService={send:e=>console.warn("ws not connected yet, please wait..",e)},window.transactions=this.transactions={},this.withSnapshot=!1,this.editors=[],this.__elements={},this.changes=[],this.globalCommands={bodyWalk:l.S},this.isRealtimeConnected=!1,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.reconnectDelay=1e3,this.reconnectTimer=null,this.wsConnectionProps=null,this.isReconnecting=!1,this.wasConnected=!1,this.lastSyncTimestamp=Date.now(),this.disconnectedAt=null,this.maxDisconnectTime=3e5,this.connectOnline=e=>{"string"==typeof e&&0!==e.length?_(this,{access:e,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}}):(0,l.U)(401)},this.connectRealtime=e=>{if(e&&"object"==typeof e){const{sessionId:t,avatar:n,name:r}=e,o=(0,a.A)();t||(0,l.U)(401),_(this,{userId:o,sessionId:t,avatar:n,name:r,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}})}},t&&t.forEach(e=>this.addEditor(e)),this.type=null,this.components=[],this.undoRedo.on("ON_REDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_UNDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_SNAPSHOT",e=>{let{deletedSteps:t}=e;Array.isArray(t)&&t.forEach(e=>{e?.stack&&e.stack.forEach(e=>{"CREATE"!==e.type&&"REMOVE"!==e.type||(e.__type=e.type)})})}),this.commitEdits=e=>function(e,t){i.M.get("config","savedDebounce"),e.pendingTransactions.push(...t),e.debounder.run(()=>{e.updateAll([...e.pendingTransactions]),Array.isArray(window.__trace__)&&window.__trace__.push({transactions:[...e.pendingTransactions]}),e.pendingTransactions.forEach(e=>{delete e.newValue,delete e.oldValue});const t={transactions:[...e.pendingTransactions],transactionId:(0,a.A)(),created_at:Date.now()};if(e.transactions[t.transactionId]=[...e.pendingTransactions],e.isRealtimeConnected){const n=JSON.stringify(t);if(e.wsService.readyState===WebSocket.OPEN)try{e.wsService.send(n),console.trace("transactions sent",t.transactions.length),e.pendingTransactions=[],e.transactions[t.transactionId]=[]}catch(e){(0,c.v)({msg:"There is Error on sync data with the server",info:n,error_code:"#c4ca4",s:"E"}),console.warn("error on syncing, sent:",n),(0,l.U)()}else(0,c.v)({msg:"ws not connected",s:"E",info:{connection:e.wsService.readyState},error_code:"#c4ca9"}),console.warn("ws not connected"),(0,l.U)()}})}(this,e),this.updateAll=e=>function(e,t){t&&t.forEach(t=>{const n=e.getComponent(t.componentId);if(n){const e=(n.atomElement||n.element).getBoundingClientRect();n.props.rect=e,n.props.width=e.width,n.props.height=e.height}else console.error("component not found in updateAll",t)}),e.app.dispatch("update",{editor:e}),g();const n=i.M.get("config","editor","props","onSave");"function"==typeof n&&n({transactions:t,toJson:d.U2,toJSON:d.U2,toHTML:d.FE})}(this,e),this.attemptReconnect=()=>w(this),this.cancelReconnect=()=>x(this),this.connectToWSServer=e=>_(this,e),this.addComponent=(e,t)=>(0,k.X8)(this,e,t),this.removeComponent=(e,t)=>(0,k.o$)(this,e,t),this.moveComponent=(e,t)=>(0,k.pp)(this,e,t),this.createComponent=(e,t)=>(0,k.a0)(this,e,t),this.cloneComponent=e=>(0,k.ty)(this,e),this.updateComponent=(e,t,n,r)=>(0,k.ZP)(this,e,t,n,r),this.silentPatch=(e,t,n)=>(0,k.c_)(this,e,t,n),this.selectComponent=(e,t)=>(0,k.Cs)(this,e,t),this.clean=()=>(0,k.uH)(this),this.execCommand2=e=>function(e,t){let{transactions:n,update:r=e.components}=t;const o=[];Array.isArray(r)||(r=[r]),n.forEach(e=>{let{type:t,key:n,value:i}=e;r.forEach(e=>{const r=t?e.closest(t):e;if(r){const e=(0,S.D$)(r,n,i);o.push(new E.A({componentId:r.id,key:e.key,value:e.value}))}})}),e.withSnapshot&&o.length>0?((0,C.Ay)({steps:o,onEnd:()=>{e.withSnapshot=!1}}),e.commitEdits(o)):o.forEach(t=>{let{componentId:n,key:r,value:a}=t;const s=i.M.get("components",n);s&&(s.props[r]=a,e.commitEdits(o))})}(this,e),this.execCommands=(e,t)=>function(e,t,n){let{components:r=[...e.components],silent:o=!1}=n||{};Array.isArray(r)||(r=[r]),Array.isArray(t)||(t=[t]);const a=[];return t.forEach(t=>{let{componentId:n,key:o,value:i,options:s={}}=t;const{find:l}=s;if(n){let t=i;if("function"==typeof i){const r=e.getComponent(n);t=i(r)}const r=e.getComponent(n),s=r?(0,S.D$)(r,o,t):{key:o,value:t};a.push(new E.A({componentId:n,key:s.key,value:s.value}))}else r.forEach(t=>{if(l){let e=t.closest(l);if(e||(e=t.find(l)),!e)return void console.log("component not found on execCommands",l);t=e}let n=i;if("function"==typeof i&&(n=i(t),null===n))return e;const r=(0,S.D$)(t,o,n);a.push(new E.A({componentId:t.id,key:r.key,value:r.value}))})}),e.withSnapshot&&a.length>0?((0,C.Ay)({steps:a,onEnd:()=>{e.withSnapshot=!1}}),e.commitEdits(a)):a.forEach(t=>{let{componentId:n,key:r,value:o}=t;const s=i.M.get("components",n);s&&(s.props[r]=o,e.commitEdits(a))}),e}(this,e,t)}dispatch(e,t){return this.app.dispatch(e,t),this}on(e,t){this.app.subscribe(e,t)}off(e,t){switch(e){case"update":this.app.unSubscribe("update",t);break;case"select":this.app.unSubscribe("select",t)}}addEditor(e){let{id:t,type:n,name:r,editor:o}=e;this.editors.push({id:t,type:n,name:r,editor:o})}removeEditor(e){let{id:t,name:n,type:r}=e;t&&(this.editors=this.editors.filter(e=>e.id!==t)),n&&(this.editors=this.editors.filter(e=>e.name!==n)),r&&(this.editors=this.editors.filter(e=>e.type!==r))}getComponents(){return i.M.get("components")}getComponent(e){return e?i.M.get("components",e):null}getEditor(e){if(e){const t=this.editors.find(t=>t.name===e);return t?t.editor:null}return this.editors}getSelectedComponent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{find:t=null}=e;if(!t)return this.components;const n=[],r=e=>{e&&e.forEach(e=>{const o=this.getComponent(e);o&&(t?.equalWith(o.type)&&n.push(o),r(o.children))})};return this.components.forEach(e=>{t?.equalWith(e.type)&&n.push(e),e.children&&r(e.children)}),n}saveTemplate(e,t){this.templates[e]=t}getTemplate(e){return this.templates[`style:${e}`]}store(){return this.withSnapshot=!0,this}execCommand(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.execCommands({key:e,value:t,options:n}),this}createschema(e,t){this.__elements[e]=t}getschema(e){return this.__elements[e]}}({}),M=B},52529(e,t,n){"use strict";n.d(t,{X8:()=>b,uH:()=>A,ty:()=>x,a0:()=>k,pp:()=>_,o$:()=>v,iI:()=>g,Cs:()=>y,c_:()=>E,ZP:()=>C});var r=n(86319),o=n(12106),i=n(4075),a=n(3832),s=n(98829),l=n(67549);class c{constructor(e){let{componentId:t,parentId:n,index:r,layer:o}=e;this.componentId=t,this.parentId=n,this.index=r,this.type="ADD",this.layer=o}}var d=n(4807),p=n(89531),h=n(3474),u=n(81139),f=n(29780),m=n(83860);function g(e,t){return Array.isArray(e?.elements)&&e.elements.includes(t)?2:1}function b(e,t){let{componentId:n,parentId:o,index:i,layer:s}=t,{sync:l=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=r.M.get("components",n),p=r.M.get("components",o);if(!d||!p)return;const h=[new c({componentId:n,parentId:o,index:i,layer:s})];d.parentId=o,2===s?(Array.isArray(p.elements)||(p.elements=[]),p.elements.splice("number"==typeof i?i:p.elements.length,0,n),p.element.appendChild(d.element)):(p.children.splice(i,0,n),p.appendChild(d.element,i)),e.withSnapshot&&h.length>0&&(0,a.Ay)({steps:h,onEnd:()=>e.withSnapshot=!1}),l&&e.commitEdits(h)}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t?(-1!==e.components.findIndex(e=>e.id===t.id)||(t.isSelected=!0,e.type=n.type||t.type,"function"==typeof t.onSelect&&t.onSelect("selected"),e.wsService.send(JSON.stringify({transactions:[{type:"SELECT_ELEMENT",componentId:t.id}]})),e.components.push(t),e.app.dispatch("update",{editor:e,props:n}),e.app.dispatch("select",{editor:e,props:n,component:t,components:e.components})),e):e}function A(e){return e.components.forEach(e=>{e.isSelected=!1,"function"==typeof e.onDeselect&&e.onDeselect("selected")}),e.components=[],e}function w(e){const t={type:e.type,props:JSON.parse(JSON.stringify(e.props)),children:[]},n=(e,t)=>{Array.isArray(e)&&e.forEach(e=>{const n=(o=e)?"string"==typeof o?o:o.dataset?.id||o.id||null:null;var o;const i=n&&r.M.get("components",n);i&&t.push(w(i))})};return n(e.children,t.children),Array.isArray(e.elements)&&e.elements.length>0&&(t.elements=[],n(e.elements,t.elements)),t}function x(e,t){let{componentId:n,parentId:o,index:i}=t;const c=[],p=r.M.get("components",n),h=r.M.get("components",o);if(!p||!h)return console.error("component not found");const u=w(p),f=g(h,n);if(e.createComponent({body:u,parentId:o,index:i,layer:f})){if(c.push(new d.A({componentId:u.id,parentId:o,index:i,body:u,layer:f})),("card"===p.type||"col"===p.type)&&"function"==typeof p.closest){const e=p.closest("block");if(e){(0,l.s)(e).forEach(e=>{r.M.get("components",e.componentId)?c.push(e):(console.error("col not found for resize on clone"),(0,s.v)({s:"E",error_code:"#ggbbk$",info:{},msg:"col not found for resize on clone"}))})}}return(0,a.Ay)({steps:c,update:!0}),r.M.get("components",u.id)}}function v(e,t){let{componentId:n}=t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const{sync:t=!0}=o,i=r.M.get("components",n);if(!i)return(0,s.v)({msg:"component not found",error_code:"#e44lk",info:{},s:"E"}),void(0,f.U)();const l=i.parent();if(!l)return e;if(2!==g(l,i.id)){const r=l.children.findIndex(e=>e===i.id);if(r<0)return(0,s.v)({msg:`children index not found for parent ${i.id}: ${r}`,error_code:"#e24lmvD3",info:{data:{componentId:n,parentId:l.id,children:l.children,layer:1}},s:"E"}),(0,f.U)(),e;l.children.splice(r,1);const o=[new p.A({componentId:n,parentId:l.id,index:r,layer:1})];i.remove(),e.withSnapshot&&o.length>0&&(0,a.Ay)({steps:o,onEnd:()=>e.withSnapshot=!1}),t&&e.commitEdits(o)}else{const t=l.elements.findIndex(e=>e===i.id);if(t<0)return(0,s.v)({msg:`parent index not found: ${t}`,error_code:"#eggf4",info:{data:{componentId:n,parentId:l.id,elements:l.elements,layer:2}},s:"E"}),(0,f.U)(),e;l.elements.splice(t,1);const r=[new p.A({componentId:n,parentId:l.id,index:t,layer:2})];i.remove(),e.withSnapshot&&r.length>0&&(0,a.Ay)({steps:r,onEnd:()=>e.withSnapshot=!1}),e.commitEdits(r)}return e}catch(e){(0,s.v)({error_code:"#eggf!!4",msg:e.message,info:{data:e.stack},s:"E"}),(0,f.U)(),console.error(e)}}function _(e,t){let{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p,direction:u}=t,{sync:m=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(-1===c||-1===l)return(0,s.v)({error_code:"#eggf$^4",msg:"invalid index on moveComponent",info:{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p},s:"E"}),(0,f.U)(),null;const g=[new h.A({componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,direction:u,fromLayer:d,toLayer:p})],b=r.M.get("components",i),y=r.M.get("components",o),A=r.M.get("components",n);if(!A||!y||!b)return console.error("component not found on move",`\n componentId: ${n},\n newParentId: ${o},\n oldParentId: ${i},\n newIndex: ${l},\n oldIndex: ${c},\n fromLayer: ${d},\n toLayer: ${p}`),e;try{if(2===d&&2===p)Array.isArray(y.elements)||(y.elements=[]),b.elements.splice(c,1),y.elements.splice(l,0,A.id),y.element.appendChild(A.element);else{let e;b.children.splice(c,1),y.children.splice(l,0,A.id),b.id===y.id&&"block"===y.type&&(e={direction:l>c?"bottom":"top"}),y.appendChild(A.element,l,e)}}catch(e){console.error("appendChild method required for move",y)}return e.withSnapshot&&g.length>0&&(0,a.Ay)({steps:g,onEnd:()=>e.withSnapshot=!1}),A.parentId=o,m&&e.commitEdits(g),e}function k(e,t){let{body:n,parentId:l,index:c,layer:p}=t,{sync:h=!0,clone:u=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const m=r.M.get("components",l);if(!m)return(0,f.U)(),void(0,s.v)({msg:"component not found on create",error_code:"#c49vk",info:{data:{body:n,parentId:l,index:c,layer:p}},s:"E"});n.layer=p||1;const g=e=>{e.id=e._id=u?e.id:`cdtr-${(0,o.A)()}`,[e.children,e.elements].forEach(t=>{Array.isArray(t)&&t.forEach(t=>{t&&"object"==typeof t&&(t.parentId=e.id,g(t))})})};g(n),n.children||(n.children=[]),2===p?(Array.isArray(m.elements)||(m.elements=[]),m.elements.splice(c,0,n.id)):m.children.splice(c,0,n.id);const{children:b}=(0,i.X)({children:[n],id:l});if(requestAnimationFrame(()=>{b[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),2===p)m.element.appendChild(b[0]);else{if("function"!=typeof m.appendChild)return console.error("appendChild method required for create",m),void(0,s.v)({msg:"parent cannot host children on create",error_code:"#c49vk2",info:{data:{parentId:l,type:m.type}},s:"E"});m.appendChild(b[0],c)}const y=[new d.A({componentId:n.id,parentId:l,body:n,index:c,layer:p})];return h&&e.commitEdits(y),e.withSnapshot&&y.length>0&&(0,a.Ay)({steps:y,onEnd:()=>e.withSnapshot=!1}),r.M.get("components",n.id)}function C(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{sync:l=!0}=i;if("string"==typeof t&&(t=r.M.get("components",t)),!t)return console.error("component not found on update"),(0,s.v)({error_code:"#e@lld",msg:"component not found on update",info:{},s:"E"}),null;const c=(0,m.D$)(t,n,o),d=[new u.A({componentId:t.id,key:c.key,value:c.value&&"object"==typeof c.value?JSON.parse(JSON.stringify(c.value)):c.value})];return e.withSnapshot&&d.length>0?((0,a.Ay)({steps:d,onEnd:()=>{e.withSnapshot=!1}}),l&&e.commitEdits(d)):(t.props[c.key]=c.value,l?e.commitEdits(d):e.updateAll()),e}function E(e,t,n,r){const o=[new u.A({componentId:t.id,key:n,value:r})];e.commitEdits(o)}},29780(e,t,n){"use strict";n.d(t,{S:()=>o,U:()=>i});var r=n(86319);const o=(e,t)=>{e&&(t(e),e.children&&e.children.forEach(e=>{o(e,t)}))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;r.M.get("error","status")||n(50629)(`./${e}`).then(()=>{r.M.set({error:{status:e}}),window.__show_errors=!0;const t=document.createElement(`cdtr-${e}`);document.body.appendChild(t)})}},61084(e,t,n){"use strict";n.d(t,{MC:()=>f,Zj:()=>u});var r=n(59929),o=n(30052),i=n(76151);const a=[{value:"cover",label:"cover"},{value:"contain",label:"contain"},{value:"auto",label:"auto"}],s=[{value:"no-repeat",label:"no_repeat"},{value:"repeat",label:"repeat"},{value:"repeat-x",label:"repeat_x"},{value:"repeat-y",label:"repeat_y"}],l=[{value:"local",label:"normal_scroll"},{value:"fixed",label:"parallax"}],c={fit:!1,focus:!1,repeat:!1,attachment:!1,opacity:!1,filter:!1},d=["left top","center top","right top","left center","center center","right center","left bottom","center bottom","right bottom"],p={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center"},h=/\.(png|jpe?g|gif|svg|webp|avif|bmp|ico|tiff?)$/i,u=e=>{const t=String(e||"").trim();return!!t&&(!!/^data:image\//i.test(t)||t.split(",").every(e=>{const t=e.trim();if(!t)return!1;let n=t;try{n=new URL(t,"https://placeholder.invalid").pathname}catch(e){}return h.test(n)}))},f=(e,t)=>{const n=JSON.parse(JSON.stringify(e||{}));return n.properties=n.properties||{},n.properties.style={...n.properties.style||{},...t},n};class m extends r.WF{constructor(){super(),this.background=null,this.channel="web",this.opacity=1,this.canRemove=!1,this.src=""}get _style(){return this.background?.properties?.style||{}}get _isImage(){return"images"===this.background?.type}_allows(e){return"web"===this.channel||!0===c[e]}_hasImageOptions(){return["fit","focus","repeat","attachment","opacity","filter"].some(e=>this._allows(e))}_patch(e){"function"==typeof this.onPatchStyle&&this.onPatchStyle(e)}_setFilter(e){const t=(e=>{let{blur:t,brightness:n}=e;const r=[];return t>0&&r.push(`blur(${t}px)`),100!==n&&r.push(`brightness(${n/100})`),r.join(" ")})(e);this._patch({filter:t,transform:e.blur>0?"scale(1.08)":""})}_renderSegmented(e,t,n,o){return r.qy`
|
|
1810
1810
|
<div class="group">
|
|
1811
1811
|
<span class="label"><lang-text text="${e}"></lang-text></span>
|
|
1812
1812
|
<div class="segmented">
|
|
Binary file
|
package/dist/service-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,d={};const r=(r,c)=>(r=new URL(r+".js",c).href,d[r]||new Promise(d=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=d,document.head.appendChild(e)}else e=r,importScripts(r),d()}).then(()=>{let e=d[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e}));self.define=(c,b)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(d[i])return;let a={};const n=e=>r(e,i),o={module:{uri:i},exports:a,require:n};d[i]=Promise.all(c.map(e=>o[e]||n(e))).then(e=>(b(...e),a))}}define(["./workbox-f3063069"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"112.creaditor.bundle.js",revision:"cecb35ee28609df9dfede4e6a01ab32b"},{url:"1142.creaditor.bundle.js",revision:"d39cafc88e6aea1556c82cb620e1a2ff"},{url:"1271.creaditor.bundle.js",revision:"cb64a53a41e39bd79f80e2c3cd0e16d9"},{url:"1317.creaditor.bundle.js",revision:"8f6674ecb348b5f3e5fca58cd4771c20"},{url:"1317.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"1334.creaditor.bundle.js",revision:"3d94fa72808bafc3c2e3a12c03004daf"},{url:"1396.creaditor.bundle.js",revision:"b28c7f0fbfc65927d08924655f5a0264"},{url:"1403.creaditor.bundle.js",revision:"b965b1cc3e11e4c46736fbc855524349"},{url:"1456.creaditor.bundle.js",revision:"3811b6097041da788cbf61ea03601784"},{url:"1529.creaditor.bundle.js",revision:"7961204004317491e920dbad90d56277"},{url:"168.creaditor.bundle.js",revision:"8b292ba3e21f73726da0a30307da11ed"},{url:"168.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"170.creaditor.bundle.js",revision:"ee3f12bc30f67cc8951daf483c248a15"},{url:"175.creaditor.bundle.js",revision:"a887a17fd0554975b3c18dbadc204f4c"},{url:"1972.creaditor.bundle.js",revision:"6a5534c86003dbf4ab66c8dbbcde71b2"},{url:"2001.creaditor.bundle.js",revision:"90dc6d5a0eb2684dda8082606bd259bd"},{url:"2001.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"211.creaditor.bundle.js",revision:"28e0be495a3c39a902b5983ddb9f4cbb"},{url:"2112.creaditor.bundle.js",revision:"f3d613a97be1c80e79325d7ccfc636b5"},{url:"2234.creaditor.bundle.js",revision:"cd27ac5f566b304d4f1eece81ddc83bd"},{url:"2298.creaditor.bundle.js",revision:"acf2a7dd09e917ea4c4bac7853cca6bc"},{url:"235.creaditor.bundle.js",revision:"63204b1ff18d337dc64bb47970a9ae06"},{url:"235.creaditor.bundle.js.LICENSE.txt",revision:"5a0e25bacaf347bc90cf875c3e0944e7"},{url:"2350.creaditor.bundle.js",revision:"ad4b40d4c824ea45be38cdb38ec2811b"},{url:"2377.creaditor.bundle.js",revision:"e81b1dd02afb539702685ebbd241656f"},{url:"2384.creaditor.bundle.js",revision:"df77aad53bb57322953dc61708c7de8d"},{url:"2397.creaditor.bundle.js",revision:"de8115961695c5d83c5de95e2c1fa68a"},{url:"2409.creaditor.bundle.js",revision:"8014a9970419e80d12c5bb615a6637bb"},{url:"2547.creaditor.bundle.js",revision:"33e5789379606491dcd127470fe7375a"},{url:"2550.creaditor.bundle.js",revision:"3aa264f6eaef0bb9fee6bd767fb4c787"},{url:"2550.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"2590.creaditor.bundle.js",revision:"b10991e68aa92f461d2b43cb976c3f6c"},{url:"2706.creaditor.bundle.js",revision:"a095008b0a296f92f2a6bbc9833de233"},{url:"2706.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"271.creaditor.bundle.js",revision:"cbe05e76796bcbdb423a068052189278"},{url:"2717.creaditor.bundle.js",revision:"a56e0f09b3e93d1253c843d93258a88c"},{url:"2717.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"2765.creaditor.bundle.js",revision:"2fd755d2081dba8605ed2a70ced32bc0"},{url:"2773.creaditor.bundle.js",revision:"b66aacd479b264d24a3c839ce092631c"},{url:"2833.creaditor.bundle.js",revision:"ad5632253d9435d7fa06a40151ebabcf"},{url:"2956.creaditor.bundle.js",revision:"a3f3bd46f723e9ad76a9d07f1bd73759"},{url:"2963.creaditor.bundle.js",revision:"a9d74c704253bb5d900740cd7b77c91d"},{url:"3105.creaditor.bundle.js",revision:"fcb21b9ac1bd11953529a83c8afad526"},{url:"3233.creaditor.bundle.js",revision:"d00041d99bfc950eacc5a7d2bec2a61b"},{url:"3503.creaditor.bundle.js",revision:"bf52229318432d17219966fd65f34d02"},{url:"3521.creaditor.bundle.js",revision:"ee35781e7b85e0ccd665b2ea09a658f3"},{url:"353.creaditor.bundle.js",revision:"89b04a79885687acdc202fa12d9f9ea2"},{url:"3545.creaditor.bundle.js",revision:"9118195e3eacd5124658abbe4ae8853e"},{url:"3553.creaditor.bundle.js",revision:"23972b3cdf3710236936e452841cb809"},{url:"3606.creaditor.bundle.js",revision:"ce9c2afb795a55c1146ff701e3547766"},{url:"380.creaditor.bundle.js",revision:"4240d212d2b6a5fc8dd9813090465e6f"},{url:"3827.creaditor.bundle.js",revision:"4af63258ddbfc5c46e5a5280e0653f5b"},{url:"3847.creaditor.bundle.js",revision:"a4e828af930443dc18c0d3564fda7701"},{url:"3875.creaditor.bundle.js",revision:"f40afe8e0a5e2a398e76b26830f967b8"},{url:"3971.creaditor.bundle.js",revision:"f73ae68bb1bf498268c61ae19cc4c8f2"},{url:"4061.creaditor.bundle.js",revision:"10fe419753b19250c5adb0695bd4ef7b"},{url:"4061.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"407.creaditor.bundle.js",revision:"3dd332a7512da4854694091607a03d24"},{url:"4074.creaditor.bundle.js",revision:"2639150e66dc341573cb6b3687bbc54b"},{url:"4100.creaditor.bundle.js",revision:"35fe1f1ac5cda4b570654afda2d2018b"},{url:"4109.creaditor.bundle.js",revision:"73fc250ad1b4a805b32ee61e87c2af53"},{url:"4109.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"4114.creaditor.bundle.js",revision:"8b3a3dfa4d9aea25e8124c4a085aa951"},{url:"4161.creaditor.bundle.js",revision:"4993026497ada2ac97d716cb2f4c0a64"},{url:"4186.creaditor.bundle.js",revision:"85d24c06f787aea1bcc096aaa4d00092"},{url:"4186.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"4288.creaditor.bundle.js",revision:"5d721b24f58a69f2e35dc8e62171f0e2"},{url:"4413.creaditor.bundle.js",revision:"b054be84ed2994e2b938641e9d3fab19"},{url:"4475.creaditor.bundle.js",revision:"3ecfd6de644933d2e31e2146a7b2ad9f"},{url:"453.creaditor.bundle.js",revision:"f250f77957b9b5412c3849e98cb22fe9"},{url:"4615.creaditor.bundle.js",revision:"0203064be05b359b62fe87b0a6495ad3"},{url:"4639.creaditor.bundle.js",revision:"0528c60b84f726b8aa5a2071195d2194"},{url:"467.creaditor.bundle.js",revision:"989e6b4d31dfbcfc6890330cd0894aa5"},{url:"4762.creaditor.bundle.js",revision:"82e589852084bb8277653bdf659ae567"},{url:"4770.creaditor.bundle.js",revision:"b060bafc940465b48c98d16f5dbe47b4"},{url:"4819.creaditor.bundle.js",revision:"70c235283f0650f7505cb07b2dedd19a"},{url:"4947.creaditor.bundle.js",revision:"077e60d7a64d257c8eed1ee081869184"},{url:"4987.creaditor.bundle.js",revision:"406826ae5f86e0a1541cef5471bf0609"},{url:"4987.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"4988.creaditor.bundle.js",revision:"3609437bf3e31dd856209c6988b0628f"},{url:"5133.creaditor.bundle.js",revision:"0dbb4e24ccdd657592b8370551debaa5"},{url:"5156.creaditor.bundle.js",revision:"01fc24bdaf55f14f36c2d8a5bd9950d7"},{url:"5284.creaditor.bundle.js",revision:"5d5f0b484b6a732671f63db0cb0d2fcc"},{url:"5284.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"5379.creaditor.bundle.js",revision:"5c482b14889b9355b41b884905c8b3cc"},{url:"5391.creaditor.bundle.js",revision:"f01d8de1d661b87a991d7c1f3579bc6d"},{url:"5411.creaditor.bundle.js",revision:"eae48b84ccfddff3ff4a616cbf1443c9"},{url:"5501.creaditor.bundle.js",revision:"4d0e717d93b6fadc54ff28f95a0d0517"},{url:"5530.creaditor.bundle.js",revision:"aea2b33b71d2aad5c5ccc7db288e2141"},{url:"5666.creaditor.bundle.js",revision:"fcc31fe060abf5475603bdd21052c7b2"},{url:"567.creaditor.bundle.js",revision:"f7907ceb7cdcec2b38a3a6faa45baed3"},{url:"5713.creaditor.bundle.js",revision:"ccc2bba0ee89f84aa5a8078b8b004677"},{url:"5713.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"574.creaditor.bundle.js",revision:"048702a59ceddd07abec85beb96c99e8"},{url:"574.creaditor.bundle.js.LICENSE.txt",revision:"7e87622d8f6027cbd50a87a2a0160d32"},{url:"578.creaditor.bundle.js",revision:"eea5a718ca8ccd7b81746c89529da3ab"},{url:"5791.creaditor.bundle.js",revision:"afcc2f40cd9dd357f205014f7aaba4f8"},{url:"5839.creaditor.bundle.js",revision:"02193ff7580fc12e262dbebc29e89401"},{url:"5849.creaditor.bundle.js",revision:"d530a38500cdeff163b19e8aaedc590d"},{url:"5850.creaditor.bundle.js",revision:"3b6d2c073ba4418cacc65ca7006ab3e7"},{url:"589.creaditor.bundle.js",revision:"d47c8f62eab8ebd5e2f5d201c7c25765"},{url:"59.creaditor.bundle.js",revision:"bebc52161360d22d5867b5bc83c61353"},{url:"59.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"5909.creaditor.bundle.js",revision:"5a14f1d42acf15f6f99b11a88c83ef3a"},{url:"5926.creaditor.bundle.js",revision:"c08dfb2f6974766a8e50d7b86f10d09e"},{url:"6036.creaditor.bundle.js",revision:"d8cc62bcfd4c4bf1b6e12b82daa9dd12"},{url:"6216.creaditor.bundle.js",revision:"f7d61056194ed8d16d95da665714c11c"},{url:"6216.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"638.creaditor.bundle.js",revision:"0805c65662d7b96ee150b7865da7cca6"},{url:"6442.creaditor.bundle.js",revision:"0c16b97e4c3b5a16fc895ea96b25cacf"},{url:"6496.creaditor.bundle.js",revision:"338b9529acf47bdc601be968cdeaad9e"},{url:"653.creaditor.bundle.js",revision:"52b9de427f192150b4b3c3b9725aad72"},{url:"6751.creaditor.bundle.js",revision:"365c1f0cd5c99801f035606282a231c7"},{url:"6814.creaditor.bundle.js",revision:"a7f323c08e346ec2b1c68cf81ff47333"},{url:"7051.creaditor.bundle.js",revision:"d65dbbbd2541ea4cb4b42d89da193b3b"},{url:"7051.creaditor.bundle.js.LICENSE.txt",revision:"07b9ce85d65b059fc522aa29a4819489"},{url:"7055.creaditor.bundle.js",revision:"f31fc847732490920b65b45e7d7875b8"},{url:"7055.creaditor.bundle.js.LICENSE.txt",revision:"1299004e20f2ce6cb16d4370129c3cec"},{url:"715.creaditor.bundle.js",revision:"fa1475c83830889b0000781f4b8ae27f"},{url:"715.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"7155.creaditor.bundle.js",revision:"5d2854bb436f39fcb0a60c7e8cb5b42c"},{url:"7209.creaditor.bundle.js",revision:"d2ae86ade358a5e2dd0d81bccf01fc34"},{url:"7238.creaditor.bundle.js",revision:"06ab3510e2ccb95663f42f30b935cbeb"},{url:"7255.creaditor.bundle.js",revision:"4bd8abfce57c30fc2354b9a0833c8e3a"},{url:"738.creaditor.bundle.js",revision:"69f421253b26ef5d11d6c08abbc1d886"},{url:"7380.creaditor.bundle.js",revision:"fddb1138256dfd180b1edcf12d95f832"},{url:"7463.creaditor.bundle.js",revision:"dbbb9bb5df85208a7892eeeb73a547ee"},{url:"7463.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"7466.creaditor.bundle.js",revision:"71a436e7a7948c51c98758e223ec6ca5"},{url:"7483.creaditor.bundle.js",revision:"29a69809b0ee565447312c0a8dffbe7e"},{url:"752.creaditor.bundle.js",revision:"7e38754a782c4b33b80310aad0957d5b"},{url:"7523.creaditor.bundle.js",revision:"9c97d67cf0ded1acc2df043abd0c5b41"},{url:"7564.creaditor.bundle.js",revision:"8d335e8846f544d305c1df15bce3e32e"},{url:"763.creaditor.bundle.js",revision:"a0504a7feb7a87cfff9f7dde7415ea2d"},{url:"7654.creaditor.bundle.js",revision:"5cac40177715bf4c40b4b0aa0436d71a"},{url:"767.creaditor.bundle.js",revision:"a793f4e09d2155124a22a35579a3f046"},{url:"7789.creaditor.bundle.js",revision:"6634d5299fde0509aeae0aebbe607366"},{url:"7789.creaditor.bundle.js.LICENSE.txt",revision:"4c52c7161b2e22ac40ee29b327ab651b"},{url:"7838.creaditor.bundle.js",revision:"35a256e66c57b40d7245bff92cc1c4f8"},{url:"7918.creaditor.bundle.js",revision:"c8c365ab3942a7980aaf4fb2d63455af"},{url:"7937.creaditor.bundle.js",revision:"c68a91978a2c5ae0624fe54e9bd7e4a3"},{url:"7997.creaditor.bundle.js",revision:"a3b7ec234aa6407ae509b1f1df616793"},{url:"8042.creaditor.bundle.js",revision:"a24e3dabf0262b9c8a71fa68d1d9c023"},{url:"8064.creaditor.bundle.js",revision:"48839022909f72bb9163ecf18f8c1677"},{url:"8141.creaditor.bundle.js",revision:"b6221648d5f82dc59a50d4ce1074b936"},{url:"8173.creaditor.bundle.js",revision:"ea7cc21cb8903648ecd2c4b07debfbec"},{url:"8173.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"823.creaditor.bundle.js",revision:"8afa8f7274a9bf1ead2f62c6c07712bd"},{url:"8250.creaditor.bundle.js",revision:"e29a6bedf8a2b93c561353211f8993ef"},{url:"8251.creaditor.bundle.js",revision:"76d697c599d8455348dc0b137600d5b1"},{url:"8299.creaditor.bundle.js",revision:"2da33b74c936fb5214c90143f94f82be"},{url:"8315.creaditor.bundle.js",revision:"87577f0aafca067de3c1cbc776e28f4b"},{url:"8443.creaditor.bundle.js",revision:"800ba70473831238aee9cd5310516e1e"},{url:"8516.creaditor.bundle.js",revision:"ef7a9c47677772b41857e5bb1e1adb99"},{url:"8533.creaditor.bundle.js",revision:"3b3fb333cb7c06cabc493abcc80cefdf"},{url:"8547.creaditor.bundle.js",revision:"4a3ddcc1a420f924eafad922398e113e"},{url:"8570.creaditor.bundle.js",revision:"2003dfcb0e758be45e0bdb85456d0dbb"},{url:"8646.creaditor.bundle.js",revision:"c415822f4a39c3845363d78fa7e1a1ea"},{url:"8654.creaditor.bundle.js",revision:"3618798ef21e495e600ecbafc4fdd2ec"},{url:"8854.creaditor.bundle.js",revision:"a462f451c2ef5c1242108a613a419433"},{url:"8916.creaditor.bundle.js",revision:"8d4ec7b7a7d17c38bb9e7b8bc3d5663b"},{url:"8921.creaditor.bundle.js",revision:"905f21a5c96ace0384c6e3b2ec8a5959"},{url:"898.creaditor.bundle.js",revision:"a024646e3ca480fcfce29ed8cbd0b55b"},{url:"898.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8983.creaditor.bundle.js",revision:"374fb7bb4bb76d97a4a4d4249db0ae5b"},{url:"9041.creaditor.bundle.js",revision:"c9bc970d0ce04d3d0995e5a40b7c74fb"},{url:"9158.creaditor.bundle.js",revision:"71f0e38cb7b0ea1ec0ebc2c1ad03983b"},{url:"9158.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"9250.creaditor.bundle.js",revision:"40b6399127ffdf51b74a8761f7d73c56"},{url:"9386.creaditor.bundle.js",revision:"cbd8b350e5cfcf88cad16c4574369c9d"},{url:"9431.creaditor.bundle.js",revision:"69e69ea14b6f6c22d2c2af901627f6bf"},{url:"9453.creaditor.bundle.js",revision:"ebda05d2c346ee6cb7a5885ad311e8fc"},{url:"9570.creaditor.bundle.js",revision:"40da6756ba5727d76ae8087aad6c86ee"},{url:"9694.creaditor.bundle.js",revision:"15bff01cd425f84f1a26208336a83238"},{url:"975.creaditor.bundle.js",revision:"b60acccab2d53d47f49522a884c6c289"},{url:"976.creaditor.bundle.js",revision:"bf2738d19d647728b3c2c5ee01f75796"},{url:"9986.creaditor.bundle.js",revision:"adb41b5fe860ad2b59c43457d61f9641"},{url:"9990.creaditor.bundle.js",revision:"27083e0439ea303348c0d17ae7aea2de"},{url:"9994.creaditor.bundle.js",revision:"26e6c210fe02e1f9b0287290011655e3"},{url:"creaditor.bundle.js",revision:"d52b30d61bb56278b3e40c2edb9b8689"},{url:"creaditor.bundle.js.LICENSE.txt",revision:"1abe495823f6e1bf9de370aeec70c6ed"},{url:"dca9330af07325d31ab04d60838684cd.png",revision:null},{url:"index.html",revision:"633997b83db73351ce2c09a40bc5dd2f"}],{})});
|
|
1
|
+
if(!self.define){let e,d={};const r=(r,c)=>(r=new URL(r+".js",c).href,d[r]||new Promise(d=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=d,document.head.appendChild(e)}else e=r,importScripts(r),d()}).then(()=>{let e=d[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e}));self.define=(c,b)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(d[i])return;let a={};const n=e=>r(e,i),o={module:{uri:i},exports:a,require:n};d[i]=Promise.all(c.map(e=>o[e]||n(e))).then(e=>(b(...e),a))}}define(["./workbox-f3063069"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"112.creaditor.bundle.js",revision:"cecb35ee28609df9dfede4e6a01ab32b"},{url:"1142.creaditor.bundle.js",revision:"d39cafc88e6aea1556c82cb620e1a2ff"},{url:"1271.creaditor.bundle.js",revision:"cb64a53a41e39bd79f80e2c3cd0e16d9"},{url:"1317.creaditor.bundle.js",revision:"8f6674ecb348b5f3e5fca58cd4771c20"},{url:"1317.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"1334.creaditor.bundle.js",revision:"3d94fa72808bafc3c2e3a12c03004daf"},{url:"1396.creaditor.bundle.js",revision:"b28c7f0fbfc65927d08924655f5a0264"},{url:"1403.creaditor.bundle.js",revision:"b965b1cc3e11e4c46736fbc855524349"},{url:"1456.creaditor.bundle.js",revision:"3811b6097041da788cbf61ea03601784"},{url:"1529.creaditor.bundle.js",revision:"7961204004317491e920dbad90d56277"},{url:"168.creaditor.bundle.js",revision:"8b292ba3e21f73726da0a30307da11ed"},{url:"168.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"170.creaditor.bundle.js",revision:"ee3f12bc30f67cc8951daf483c248a15"},{url:"175.creaditor.bundle.js",revision:"a887a17fd0554975b3c18dbadc204f4c"},{url:"1972.creaditor.bundle.js",revision:"6a5534c86003dbf4ab66c8dbbcde71b2"},{url:"2001.creaditor.bundle.js",revision:"90dc6d5a0eb2684dda8082606bd259bd"},{url:"2001.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"211.creaditor.bundle.js",revision:"28e0be495a3c39a902b5983ddb9f4cbb"},{url:"2112.creaditor.bundle.js",revision:"f3d613a97be1c80e79325d7ccfc636b5"},{url:"2234.creaditor.bundle.js",revision:"cd27ac5f566b304d4f1eece81ddc83bd"},{url:"2298.creaditor.bundle.js",revision:"acf2a7dd09e917ea4c4bac7853cca6bc"},{url:"235.creaditor.bundle.js",revision:"63204b1ff18d337dc64bb47970a9ae06"},{url:"235.creaditor.bundle.js.LICENSE.txt",revision:"5a0e25bacaf347bc90cf875c3e0944e7"},{url:"2350.creaditor.bundle.js",revision:"ad4b40d4c824ea45be38cdb38ec2811b"},{url:"2377.creaditor.bundle.js",revision:"e81b1dd02afb539702685ebbd241656f"},{url:"2384.creaditor.bundle.js",revision:"df77aad53bb57322953dc61708c7de8d"},{url:"2397.creaditor.bundle.js",revision:"de8115961695c5d83c5de95e2c1fa68a"},{url:"2409.creaditor.bundle.js",revision:"8014a9970419e80d12c5bb615a6637bb"},{url:"2547.creaditor.bundle.js",revision:"33e5789379606491dcd127470fe7375a"},{url:"2550.creaditor.bundle.js",revision:"3aa264f6eaef0bb9fee6bd767fb4c787"},{url:"2550.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"2590.creaditor.bundle.js",revision:"b10991e68aa92f461d2b43cb976c3f6c"},{url:"2706.creaditor.bundle.js",revision:"a095008b0a296f92f2a6bbc9833de233"},{url:"2706.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"271.creaditor.bundle.js",revision:"cbe05e76796bcbdb423a068052189278"},{url:"2717.creaditor.bundle.js",revision:"a56e0f09b3e93d1253c843d93258a88c"},{url:"2717.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"2765.creaditor.bundle.js",revision:"2fd755d2081dba8605ed2a70ced32bc0"},{url:"2773.creaditor.bundle.js",revision:"b66aacd479b264d24a3c839ce092631c"},{url:"2833.creaditor.bundle.js",revision:"ad5632253d9435d7fa06a40151ebabcf"},{url:"2956.creaditor.bundle.js",revision:"a3f3bd46f723e9ad76a9d07f1bd73759"},{url:"2963.creaditor.bundle.js",revision:"a9d74c704253bb5d900740cd7b77c91d"},{url:"3105.creaditor.bundle.js",revision:"fcb21b9ac1bd11953529a83c8afad526"},{url:"3233.creaditor.bundle.js",revision:"d00041d99bfc950eacc5a7d2bec2a61b"},{url:"3503.creaditor.bundle.js",revision:"bf52229318432d17219966fd65f34d02"},{url:"3521.creaditor.bundle.js",revision:"ee35781e7b85e0ccd665b2ea09a658f3"},{url:"353.creaditor.bundle.js",revision:"89b04a79885687acdc202fa12d9f9ea2"},{url:"3545.creaditor.bundle.js",revision:"9118195e3eacd5124658abbe4ae8853e"},{url:"3553.creaditor.bundle.js",revision:"23972b3cdf3710236936e452841cb809"},{url:"3606.creaditor.bundle.js",revision:"ce9c2afb795a55c1146ff701e3547766"},{url:"380.creaditor.bundle.js",revision:"4240d212d2b6a5fc8dd9813090465e6f"},{url:"3827.creaditor.bundle.js",revision:"4af63258ddbfc5c46e5a5280e0653f5b"},{url:"3847.creaditor.bundle.js",revision:"a4e828af930443dc18c0d3564fda7701"},{url:"3875.creaditor.bundle.js",revision:"f40afe8e0a5e2a398e76b26830f967b8"},{url:"3971.creaditor.bundle.js",revision:"f73ae68bb1bf498268c61ae19cc4c8f2"},{url:"4061.creaditor.bundle.js",revision:"10fe419753b19250c5adb0695bd4ef7b"},{url:"4061.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"407.creaditor.bundle.js",revision:"3dd332a7512da4854694091607a03d24"},{url:"4074.creaditor.bundle.js",revision:"2639150e66dc341573cb6b3687bbc54b"},{url:"4100.creaditor.bundle.js",revision:"35fe1f1ac5cda4b570654afda2d2018b"},{url:"4109.creaditor.bundle.js",revision:"73fc250ad1b4a805b32ee61e87c2af53"},{url:"4109.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"4114.creaditor.bundle.js",revision:"8b3a3dfa4d9aea25e8124c4a085aa951"},{url:"4161.creaditor.bundle.js",revision:"4993026497ada2ac97d716cb2f4c0a64"},{url:"4186.creaditor.bundle.js",revision:"85d24c06f787aea1bcc096aaa4d00092"},{url:"4186.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"4288.creaditor.bundle.js",revision:"5d721b24f58a69f2e35dc8e62171f0e2"},{url:"4413.creaditor.bundle.js",revision:"b054be84ed2994e2b938641e9d3fab19"},{url:"4475.creaditor.bundle.js",revision:"3ecfd6de644933d2e31e2146a7b2ad9f"},{url:"453.creaditor.bundle.js",revision:"f250f77957b9b5412c3849e98cb22fe9"},{url:"4615.creaditor.bundle.js",revision:"0203064be05b359b62fe87b0a6495ad3"},{url:"4639.creaditor.bundle.js",revision:"0528c60b84f726b8aa5a2071195d2194"},{url:"467.creaditor.bundle.js",revision:"989e6b4d31dfbcfc6890330cd0894aa5"},{url:"4762.creaditor.bundle.js",revision:"82e589852084bb8277653bdf659ae567"},{url:"4770.creaditor.bundle.js",revision:"b060bafc940465b48c98d16f5dbe47b4"},{url:"4819.creaditor.bundle.js",revision:"70c235283f0650f7505cb07b2dedd19a"},{url:"4947.creaditor.bundle.js",revision:"077e60d7a64d257c8eed1ee081869184"},{url:"4987.creaditor.bundle.js",revision:"406826ae5f86e0a1541cef5471bf0609"},{url:"4987.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"4988.creaditor.bundle.js",revision:"3609437bf3e31dd856209c6988b0628f"},{url:"5133.creaditor.bundle.js",revision:"0dbb4e24ccdd657592b8370551debaa5"},{url:"5156.creaditor.bundle.js",revision:"01fc24bdaf55f14f36c2d8a5bd9950d7"},{url:"5284.creaditor.bundle.js",revision:"5d5f0b484b6a732671f63db0cb0d2fcc"},{url:"5284.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"5379.creaditor.bundle.js",revision:"5c482b14889b9355b41b884905c8b3cc"},{url:"5391.creaditor.bundle.js",revision:"f01d8de1d661b87a991d7c1f3579bc6d"},{url:"5411.creaditor.bundle.js",revision:"eae48b84ccfddff3ff4a616cbf1443c9"},{url:"5501.creaditor.bundle.js",revision:"4d0e717d93b6fadc54ff28f95a0d0517"},{url:"5530.creaditor.bundle.js",revision:"aea2b33b71d2aad5c5ccc7db288e2141"},{url:"5666.creaditor.bundle.js",revision:"fcc31fe060abf5475603bdd21052c7b2"},{url:"567.creaditor.bundle.js",revision:"f7907ceb7cdcec2b38a3a6faa45baed3"},{url:"5713.creaditor.bundle.js",revision:"ccc2bba0ee89f84aa5a8078b8b004677"},{url:"5713.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"574.creaditor.bundle.js",revision:"048702a59ceddd07abec85beb96c99e8"},{url:"574.creaditor.bundle.js.LICENSE.txt",revision:"7e87622d8f6027cbd50a87a2a0160d32"},{url:"578.creaditor.bundle.js",revision:"eea5a718ca8ccd7b81746c89529da3ab"},{url:"5791.creaditor.bundle.js",revision:"afcc2f40cd9dd357f205014f7aaba4f8"},{url:"5839.creaditor.bundle.js",revision:"02193ff7580fc12e262dbebc29e89401"},{url:"5849.creaditor.bundle.js",revision:"d530a38500cdeff163b19e8aaedc590d"},{url:"5850.creaditor.bundle.js",revision:"3b6d2c073ba4418cacc65ca7006ab3e7"},{url:"589.creaditor.bundle.js",revision:"d47c8f62eab8ebd5e2f5d201c7c25765"},{url:"59.creaditor.bundle.js",revision:"bebc52161360d22d5867b5bc83c61353"},{url:"59.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"5909.creaditor.bundle.js",revision:"ca16e1055995f58babfce09d3cdebd34"},{url:"5926.creaditor.bundle.js",revision:"c08dfb2f6974766a8e50d7b86f10d09e"},{url:"6036.creaditor.bundle.js",revision:"d8cc62bcfd4c4bf1b6e12b82daa9dd12"},{url:"6216.creaditor.bundle.js",revision:"f7d61056194ed8d16d95da665714c11c"},{url:"6216.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"638.creaditor.bundle.js",revision:"0805c65662d7b96ee150b7865da7cca6"},{url:"6442.creaditor.bundle.js",revision:"0c16b97e4c3b5a16fc895ea96b25cacf"},{url:"6496.creaditor.bundle.js",revision:"338b9529acf47bdc601be968cdeaad9e"},{url:"653.creaditor.bundle.js",revision:"52b9de427f192150b4b3c3b9725aad72"},{url:"6751.creaditor.bundle.js",revision:"365c1f0cd5c99801f035606282a231c7"},{url:"6814.creaditor.bundle.js",revision:"a7f323c08e346ec2b1c68cf81ff47333"},{url:"7051.creaditor.bundle.js",revision:"d65dbbbd2541ea4cb4b42d89da193b3b"},{url:"7051.creaditor.bundle.js.LICENSE.txt",revision:"07b9ce85d65b059fc522aa29a4819489"},{url:"7055.creaditor.bundle.js",revision:"f31fc847732490920b65b45e7d7875b8"},{url:"7055.creaditor.bundle.js.LICENSE.txt",revision:"1299004e20f2ce6cb16d4370129c3cec"},{url:"715.creaditor.bundle.js",revision:"fa1475c83830889b0000781f4b8ae27f"},{url:"715.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"7155.creaditor.bundle.js",revision:"5d2854bb436f39fcb0a60c7e8cb5b42c"},{url:"7209.creaditor.bundle.js",revision:"d2ae86ade358a5e2dd0d81bccf01fc34"},{url:"7238.creaditor.bundle.js",revision:"06ab3510e2ccb95663f42f30b935cbeb"},{url:"7255.creaditor.bundle.js",revision:"4bd8abfce57c30fc2354b9a0833c8e3a"},{url:"738.creaditor.bundle.js",revision:"69f421253b26ef5d11d6c08abbc1d886"},{url:"7380.creaditor.bundle.js",revision:"fddb1138256dfd180b1edcf12d95f832"},{url:"7463.creaditor.bundle.js",revision:"dbbb9bb5df85208a7892eeeb73a547ee"},{url:"7463.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"7466.creaditor.bundle.js",revision:"71a436e7a7948c51c98758e223ec6ca5"},{url:"7483.creaditor.bundle.js",revision:"29a69809b0ee565447312c0a8dffbe7e"},{url:"752.creaditor.bundle.js",revision:"7e38754a782c4b33b80310aad0957d5b"},{url:"7523.creaditor.bundle.js",revision:"9c97d67cf0ded1acc2df043abd0c5b41"},{url:"7564.creaditor.bundle.js",revision:"8d335e8846f544d305c1df15bce3e32e"},{url:"763.creaditor.bundle.js",revision:"a0504a7feb7a87cfff9f7dde7415ea2d"},{url:"7654.creaditor.bundle.js",revision:"5cac40177715bf4c40b4b0aa0436d71a"},{url:"767.creaditor.bundle.js",revision:"a793f4e09d2155124a22a35579a3f046"},{url:"7789.creaditor.bundle.js",revision:"6634d5299fde0509aeae0aebbe607366"},{url:"7789.creaditor.bundle.js.LICENSE.txt",revision:"4c52c7161b2e22ac40ee29b327ab651b"},{url:"7838.creaditor.bundle.js",revision:"35a256e66c57b40d7245bff92cc1c4f8"},{url:"7918.creaditor.bundle.js",revision:"c8c365ab3942a7980aaf4fb2d63455af"},{url:"7937.creaditor.bundle.js",revision:"c68a91978a2c5ae0624fe54e9bd7e4a3"},{url:"7997.creaditor.bundle.js",revision:"a3b7ec234aa6407ae509b1f1df616793"},{url:"8042.creaditor.bundle.js",revision:"a24e3dabf0262b9c8a71fa68d1d9c023"},{url:"8064.creaditor.bundle.js",revision:"48839022909f72bb9163ecf18f8c1677"},{url:"8141.creaditor.bundle.js",revision:"b6221648d5f82dc59a50d4ce1074b936"},{url:"8173.creaditor.bundle.js",revision:"ea7cc21cb8903648ecd2c4b07debfbec"},{url:"8173.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"823.creaditor.bundle.js",revision:"8afa8f7274a9bf1ead2f62c6c07712bd"},{url:"8250.creaditor.bundle.js",revision:"e29a6bedf8a2b93c561353211f8993ef"},{url:"8251.creaditor.bundle.js",revision:"76d697c599d8455348dc0b137600d5b1"},{url:"8299.creaditor.bundle.js",revision:"2da33b74c936fb5214c90143f94f82be"},{url:"8315.creaditor.bundle.js",revision:"87577f0aafca067de3c1cbc776e28f4b"},{url:"8443.creaditor.bundle.js",revision:"800ba70473831238aee9cd5310516e1e"},{url:"8516.creaditor.bundle.js",revision:"ef7a9c47677772b41857e5bb1e1adb99"},{url:"8533.creaditor.bundle.js",revision:"3b3fb333cb7c06cabc493abcc80cefdf"},{url:"8547.creaditor.bundle.js",revision:"4a3ddcc1a420f924eafad922398e113e"},{url:"8570.creaditor.bundle.js",revision:"2003dfcb0e758be45e0bdb85456d0dbb"},{url:"8646.creaditor.bundle.js",revision:"c415822f4a39c3845363d78fa7e1a1ea"},{url:"8654.creaditor.bundle.js",revision:"3618798ef21e495e600ecbafc4fdd2ec"},{url:"8854.creaditor.bundle.js",revision:"a462f451c2ef5c1242108a613a419433"},{url:"8916.creaditor.bundle.js",revision:"8d4ec7b7a7d17c38bb9e7b8bc3d5663b"},{url:"8921.creaditor.bundle.js",revision:"905f21a5c96ace0384c6e3b2ec8a5959"},{url:"898.creaditor.bundle.js",revision:"a024646e3ca480fcfce29ed8cbd0b55b"},{url:"898.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8983.creaditor.bundle.js",revision:"374fb7bb4bb76d97a4a4d4249db0ae5b"},{url:"9041.creaditor.bundle.js",revision:"c9bc970d0ce04d3d0995e5a40b7c74fb"},{url:"9158.creaditor.bundle.js",revision:"71f0e38cb7b0ea1ec0ebc2c1ad03983b"},{url:"9158.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"9250.creaditor.bundle.js",revision:"40b6399127ffdf51b74a8761f7d73c56"},{url:"9386.creaditor.bundle.js",revision:"cbd8b350e5cfcf88cad16c4574369c9d"},{url:"9431.creaditor.bundle.js",revision:"69e69ea14b6f6c22d2c2af901627f6bf"},{url:"9453.creaditor.bundle.js",revision:"ebda05d2c346ee6cb7a5885ad311e8fc"},{url:"9570.creaditor.bundle.js",revision:"40da6756ba5727d76ae8087aad6c86ee"},{url:"9694.creaditor.bundle.js",revision:"15bff01cd425f84f1a26208336a83238"},{url:"975.creaditor.bundle.js",revision:"b60acccab2d53d47f49522a884c6c289"},{url:"976.creaditor.bundle.js",revision:"bf2738d19d647728b3c2c5ee01f75796"},{url:"9986.creaditor.bundle.js",revision:"adb41b5fe860ad2b59c43457d61f9641"},{url:"9990.creaditor.bundle.js",revision:"27083e0439ea303348c0d17ae7aea2de"},{url:"9994.creaditor.bundle.js",revision:"26e6c210fe02e1f9b0287290011655e3"},{url:"creaditor.bundle.js",revision:"5995166654aa345b95c34bf10b114bc7"},{url:"creaditor.bundle.js.LICENSE.txt",revision:"1abe495823f6e1bf9de370aeec70c6ed"},{url:"dca9330af07325d31ab04d60838684cd.png",revision:null},{url:"index.html",revision:"633997b83db73351ce2c09a40bc5dd2f"}],{})});
|
|
Binary file
|
package/package.json
CHANGED