formeo 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo/assets/css/demo.min.css +2 -2
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +2 -2
- package/dist/demo/assets/img/formeo-sprite.svg +1 -1
- package/dist/demo/assets/js/demo.min.js +2 -2
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/form.min.js +1 -1
- package/dist/demo/assets/js/formeo.cjs.js +3 -4
- package/dist/demo/assets/js/formeo.es.js +3 -4
- package/dist/demo/assets/js/formeo.min.cjs.js +2 -2
- package/dist/demo/assets/js/formeo.min.es.js +2 -2
- package/dist/demo/assets/js/formeo.min.js +3 -4
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +3 -4
- package/dist/demo/assets/js/html.min.js +1 -1
- package/dist/demo/assets/js/layout.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js.gz +0 -0
- package/dist/demo/assets/js/theme-github_light_default.min.js +1 -1
- package/dist/demo/index.html +1 -1
- package/dist/formeo-sprite.svg +1 -1
- package/dist/formeo.cjs.js +3 -4
- package/dist/formeo.css +9 -42
- package/dist/formeo.es.js +3 -4
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +2 -2
- package/dist/formeo.min.es.js +2 -2
- package/dist/formeo.min.js +3 -4
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +3 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 5.
|
|
4
|
+
Version: 5.3.0
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ var Ls=Object.create,pi=Object.defineProperty,Rs=Object.getOwnPropertyDescriptor
|
|
|
9
9
|
|
|
10
10
|
`,`
|
|
11
11
|
`))}static fromFile(i){const t=i.split(`
|
|
12
|
-
`),n={};for(let m,g=0;g<t.length;g++)m=/^(.+?) *?= *?([^\n]+)/.exec(t[g]),m&&(n[m[1]]=m[2].trim());return n}static getInstance(i){return qt||(qt=new ii(i)),qt}static resetInstance(){qt=null}async loadLang(i,t=!0){if(this.loaded.includes(i)&&t)return this.langs[i];const n=`${this.config.location}${i}${this.config.extension}`;try{const m=await(async function(f){try{const c=await fetch(f);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return await c[f.endsWith(".lang")?"text":"json"]()}catch(c){throw c}})(n),g=ii.processFile(m);return this.applyLanguage(i,g),this.langs[i]}catch{return this.applyLanguage(i)}}applyLanguage(i,t={}){const n=this.config.override[i]||{},m=this.langs[i]||{};return this.langs[i]={...m,...t,...n},this.loaded.push(i),this.langs[i]}get getLangs(){return this.config.langs}async setCurrent(i="en-US"){return this.loaded.includes(i)||await this.loadLang(i),this.locale=i,this.current=this.langs[i],this.current}},{apply:(e,i,t)=>e.getInstance(...t),construct:(e,i)=>new e(...i),get:(e,i)=>e[i]}),Z=eo.getInstance();(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Fs=Object.defineProperty,zs=(e,i,t)=>i in e?Fs(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,Fe=(e,i,t)=>zs(e,typeof i!="symbol"?i+"":i,t),Mt={tooltip:"_3x4ZIcu-",visible:"JIt36hCJ"},Ps={triggerName:"tooltip"},to=class gt{constructor(i=Ps){Fe(this,"triggerName"),Fe(this,"tooltip"),Fe(this,"activeTriggerType",null),Fe(this,"spacing",12),Fe(this,"handleClick",t=>{const n=this.triggerName,m=t.target.closest(`[${n}][${n}-type="click"]`);if(m)if(this.isVisible())this.hide();else{const g=m.getAttribute(`${n}`);this.show(m,g),this.activeTriggerType="click"}else this.hide()}),Fe(this,"handleMouseOver",t=>{const n=this.triggerName,m=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&m?.getAttribute(`${n}-type`)!=="click"){const g=m?.getAttribute(`${n}`);g&&(this.show(m,g),this.activeTriggerType="hover")}}),Fe(this,"handleMouseOut",t=>{const n=this.triggerName,m=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&m?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Fe(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Fe(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),gt.instance&>.instance.destroy(),this.triggerName=`data-${i.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${Mt.tooltip}`,document.body.appendChild(this.tooltip),this.setupEventListeners(),gt.instance=this}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),globalThis.addEventListener("resize",this.handleResize),globalThis.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(Mt.visible)}calculatePosition(i){const t=i.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),m=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return m.find(g=>this.fitsInViewport(g,n))||m[0]}fitsInViewport(i,t){return i.x>=0&&i.y>=0&&i.x+t.width<=globalThis.innerWidth&&i.y+t.height<=globalThis.innerHeight?[[i.x,i.y],[i.x+t.width,i.y],[i.x,i.y+t.height],[i.x+t.width,i.y+t.height],[i.x+t.width/2,i.y+t.height/2]].flatMap(([n,m])=>Array.from(document.elementsFromPoint(n,m))).filter(n=>{if(this.tooltip.contains(n)||n===this.tooltip||n.classList.contains(Mt.tooltip)||getComputedStyle(n).pointerEvents==="none")return!1}).length===0:!1}show(i,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Mt.visible);const n=this.calculatePosition(i);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(Mt.visible),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),globalThis.removeEventListener("resize",this.handleResize),globalThis.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove(),gt.instance===this&&(gt.instance=null)}};Fe(to,"instance",null);var io=to;globalThis!==void 0&&(globalThis.SmartTooltip=io);var Hs=j(((e,i)=>{function t(){this.__data__=[],this.size=0}i.exports=t})),Vt=j(((e,i)=>{function t(n,m){return n===m||n!==n&&m!==m}i.exports=t})),Ai=j(((e,i)=>{var t=Vt();function n(m,g){for(var f=m.length;f--;)if(t(m[f][0],g))return f;return-1}i.exports=n})),Bs=j(((e,i)=>{var t=Ai(),n=Array.prototype.splice;function m(g){var f=this.__data__,c=t(f,g);return c<0?!1:(c==f.length-1?f.pop():n.call(f,c,1),--this.size,!0)}i.exports=m})),Ws=j(((e,i)=>{var t=Ai();function n(m){var g=this.__data__,f=t(g,m);return f<0?void 0:g[f][1]}i.exports=n})),js=j(((e,i)=>{var t=Ai();function n(m){return t(this.__data__,m)>-1}i.exports=n})),Vs=j(((e,i)=>{var t=Ai();function n(m,g){var f=this.__data__,c=t(f,m);return c<0?(++this.size,f.push([m,g])):f[c][1]=g,this}i.exports=n})),ki=j(((e,i)=>{var t=Hs(),n=Bs(),m=Ws(),g=js(),f=Vs();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),Us=j(((e,i)=>{var t=ki();function n(){this.__data__=new t,this.size=0}i.exports=n})),Gs=j(((e,i)=>{function t(n){var m=this.__data__,g=m.delete(n);return this.size=m.size,g}i.exports=t})),Ks=j(((e,i)=>{function t(n){return this.__data__.get(n)}i.exports=t})),qs=j(((e,i)=>{function t(n){return this.__data__.has(n)}i.exports=t})),no=j(((e,i)=>{var t=typeof global=="object"&&global&&global.Object===Object&&global;i.exports=t})),We=j(((e,i)=>{var t=no(),n=typeof self=="object"&&self&&self.Object===Object&&self,m=t||n||Function("return this")();i.exports=m})),Ti=j(((e,i)=>{var t=We().Symbol;i.exports=t})),Ys=j(((e,i)=>{var t=Ti(),n=Object.prototype,m=n.hasOwnProperty,g=n.toString,f=t?t.toStringTag:void 0;function c(o){var h=m.call(o,f),d=o[f];try{o[f]=void 0;var u=!0}catch{}var l=g.call(o);return u&&(h?o[f]=d:delete o[f]),l}i.exports=c})),Zs=j(((e,i)=>{var t=Object.prototype.toString;function n(m){return t.call(m)}i.exports=n})),At=j(((e,i)=>{var t=Ti(),n=Ys(),m=Zs(),g="[object Null]",f="[object Undefined]",c=t?t.toStringTag:void 0;function o(h){return h==null?h===void 0?f:g:c&&c in Object(h)?n(h):m(h)}i.exports=o})),et=j(((e,i)=>{function t(n){var m=typeof n;return n!=null&&(m=="object"||m=="function")}i.exports=t})),kn=j(((e,i)=>{var t=At(),n=et(),m="[object AsyncFunction]",g="[object Function]",f="[object GeneratorFunction]",c="[object Proxy]";function o(h){if(!n(h))return!1;var d=t(h);return d==g||d==f||d==m||d==c}i.exports=o})),Qs=j(((e,i)=>{var t=We()["__core-js_shared__"];i.exports=t})),Xs=j(((e,i)=>{var t=Qs(),n=(function(){var g=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""})();function m(g){return!!n&&n in g}i.exports=m})),ro=j(((e,i)=>{var t=Function.prototype.toString;function n(m){if(m!=null){try{return t.call(m)}catch{}try{return m+""}catch{}}return""}i.exports=n})),Js=j(((e,i)=>{var t=kn(),n=Xs(),m=et(),g=ro(),f=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,o=Function.prototype,h=Object.prototype,d=o.toString,u=h.hasOwnProperty,l=RegExp("^"+d.call(u).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function s(r){return!m(r)||n(r)?!1:(t(r)?l:c).test(g(r))}i.exports=s})),ea=j(((e,i)=>{function t(n,m){return n?.[m]}i.exports=t})),ut=j(((e,i)=>{var t=Js(),n=ea();function m(g,f){var c=n(g,f);return t(c)?c:void 0}i.exports=m})),Tn=j(((e,i)=>{var t=ut()(We(),"Map");i.exports=t})),Mi=j(((e,i)=>{var t=ut()(Object,"create");i.exports=t})),ta=j(((e,i)=>{var t=Mi();function n(){this.__data__=t?t(null):{},this.size=0}i.exports=n})),ia=j(((e,i)=>{function t(n){var m=this.has(n)&&delete this.__data__[n];return this.size-=m?1:0,m}i.exports=t})),na=j(((e,i)=>{var t=Mi(),n="__lodash_hash_undefined__",m=Object.prototype.hasOwnProperty;function g(f){var c=this.__data__;if(t){var o=c[f];return o===n?void 0:o}return m.call(c,f)?c[f]:void 0}i.exports=g})),ra=j(((e,i)=>{var t=Mi(),n=Object.prototype.hasOwnProperty;function m(g){var f=this.__data__;return t?f[g]!==void 0:n.call(f,g)}i.exports=m})),oa=j(((e,i)=>{var t=Mi(),n="__lodash_hash_undefined__";function m(g,f){var c=this.__data__;return this.size+=this.has(g)?0:1,c[g]=t&&f===void 0?n:f,this}i.exports=m})),sa=j(((e,i)=>{var t=ta(),n=ia(),m=na(),g=ra(),f=oa();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),aa=j(((e,i)=>{var t=sa(),n=ki(),m=Tn();function g(){this.size=0,this.__data__={hash:new t,map:new(m||n),string:new t}}i.exports=g})),la=j(((e,i)=>{function t(n){var m=typeof n;return m=="string"||m=="number"||m=="symbol"||m=="boolean"?n!=="__proto__":n===null}i.exports=t})),$i=j(((e,i)=>{var t=la();function n(m,g){var f=m.__data__;return t(g)?f[typeof g=="string"?"string":"hash"]:f.map}i.exports=n})),ca=j(((e,i)=>{var t=$i();function n(m){var g=t(this,m).delete(m);return this.size-=g?1:0,g}i.exports=n})),ua=j(((e,i)=>{var t=$i();function n(m){return t(this,m).get(m)}i.exports=n})),da=j(((e,i)=>{var t=$i();function n(m){return t(this,m).has(m)}i.exports=n})),ha=j(((e,i)=>{var t=$i();function n(m,g){var f=t(this,m),c=f.size;return f.set(m,g),this.size+=f.size==c?0:1,this}i.exports=n})),Mn=j(((e,i)=>{var t=aa(),n=ca(),m=ua(),g=da(),f=ha();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),pa=j(((e,i)=>{var t=ki(),n=Tn(),m=Mn(),g=200;function f(c,o){var h=this.__data__;if(h instanceof t){var d=h.__data__;if(!n||d.length<g-1)return d.push([c,o]),this.size=++h.size,this;h=this.__data__=new m(d)}return h.set(c,o),this.size=h.size,this}i.exports=f})),oo=j(((e,i)=>{var t=ki(),n=Us(),m=Gs(),g=Ks(),f=qs(),c=pa();function o(h){var d=this.__data__=new t(h);this.size=d.size}o.prototype.clear=n,o.prototype.delete=m,o.prototype.get=g,o.prototype.has=f,o.prototype.set=c,i.exports=o})),so=j(((e,i)=>{var t=ut(),n=(function(){try{var m=t(Object,"defineProperty");return m({},"",{}),m}catch{}})();i.exports=n})),$n=j(((e,i)=>{var t=so();function n(m,g,f){g=="__proto__"&&t?t(m,g,{configurable:!0,enumerable:!0,value:f,writable:!0}):m[g]=f}i.exports=n})),ao=j(((e,i)=>{var t=$n(),n=Vt();function m(g,f,c){(c!==void 0&&!n(g[f],c)||c===void 0&&!(f in g))&&t(g,f,c)}i.exports=m})),fa=j(((e,i)=>{function t(n){return function(m,g,f){for(var c=-1,o=Object(m),h=f(m),d=h.length;d--;){var u=h[n?d:++c];if(g(o[u],u,o)===!1)break}return m}}i.exports=t})),ga=j(((e,i)=>{var t=fa()();i.exports=t})),ma=j(((e,i)=>{var t=We(),n=typeof e=="object"&&e&&!e.nodeType&&e,m=n&&typeof i=="object"&&i&&!i.nodeType&&i,g=m&&m.exports===n?t.Buffer:void 0,f=g?g.allocUnsafe:void 0;function c(o,h){if(h)return o.slice();var d=o.length,u=f?f(d):new o.constructor(d);return o.copy(u),u}i.exports=c})),lo=j(((e,i)=>{var t=We().Uint8Array;i.exports=t})),va=j(((e,i)=>{var t=lo();function n(m){var g=new m.constructor(m.byteLength);return new t(g).set(new t(m)),g}i.exports=n})),ya=j(((e,i)=>{var t=va();function n(m,g){var f=g?t(m.buffer):m.buffer;return new m.constructor(f,m.byteOffset,m.length)}i.exports=n})),ba=j(((e,i)=>{function t(n,m){var g=-1,f=n.length;for(m||(m=Array(f));++g<f;)m[g]=n[g];return m}i.exports=t})),wa=j(((e,i)=>{var t=et(),n=Object.create,m=(function(){function g(){}return function(f){if(!t(f))return{};if(n)return n(f);g.prototype=f;var c=new g;return g.prototype=void 0,c}})();i.exports=m})),co=j(((e,i)=>{function t(n,m){return function(g){return n(m(g))}}i.exports=t})),uo=j(((e,i)=>{var t=co()(Object.getPrototypeOf,Object);i.exports=t})),Ln=j(((e,i)=>{var t=Object.prototype;function n(m){var g=m&&m.constructor;return m===(typeof g=="function"&&g.prototype||t)}i.exports=n})),Ca=j(((e,i)=>{var t=wa(),n=uo(),m=Ln();function g(f){return typeof f.constructor=="function"&&!m(f)?t(n(f)):{}}i.exports=g})),dt=j(((e,i)=>{function t(n){return n!=null&&typeof n=="object"}i.exports=t})),Sa=j(((e,i)=>{var t=At(),n=dt(),m="[object Arguments]";function g(f){return n(f)&&t(f)==m}i.exports=g})),ho=j(((e,i)=>{var t=Sa(),n=dt(),m=Object.prototype,g=m.hasOwnProperty,f=m.propertyIsEnumerable,c=t((function(){return arguments})())?t:function(o){return n(o)&&g.call(o,"callee")&&!f.call(o,"callee")};i.exports=c})),ht=j(((e,i)=>{var t=Array.isArray;i.exports=t})),po=j(((e,i)=>{var t=9007199254740991;function n(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=t}i.exports=n})),Li=j(((e,i)=>{var t=kn(),n=po();function m(g){return g!=null&&n(g.length)&&!t(g)}i.exports=m})),xa=j(((e,i)=>{var t=Li(),n=dt();function m(g){return n(g)&&t(g)}i.exports=m})),Ea=j(((e,i)=>{function t(){return!1}i.exports=t})),Rn=j(((e,i)=>{var t=We(),n=Ea(),m=typeof e=="object"&&e&&!e.nodeType&&e,g=m&&typeof i=="object"&&i&&!i.nodeType&&i,f=g&&g.exports===m?t.Buffer:void 0,c=(f?f.isBuffer:void 0)||n;i.exports=c})),Aa=j(((e,i)=>{var t=At(),n=uo(),m=dt(),g="[object Object]",f=Function.prototype,c=Object.prototype,o=f.toString,h=c.hasOwnProperty,d=o.call(Object);function u(l){if(!m(l)||t(l)!=g)return!1;var s=n(l);if(s===null)return!0;var r=h.call(s,"constructor")&&s.constructor;return typeof r=="function"&&r instanceof r&&o.call(r)==d}i.exports=u})),ka=j(((e,i)=>{var t=At(),n=po(),m=dt(),g="[object Arguments]",f="[object Array]",c="[object Boolean]",o="[object Date]",h="[object Error]",d="[object Function]",u="[object Map]",l="[object Number]",s="[object Object]",r="[object RegExp]",a="[object Set]",p="[object String]",v="[object WeakMap]",y="[object ArrayBuffer]",k="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",M="[object Int16Array]",L="[object Int32Array]",R="[object Uint8Array]",$="[object Uint8ClampedArray]",D="[object Uint16Array]",T="[object Uint32Array]",E={};E[x]=E[w]=E[S]=E[M]=E[L]=E[R]=E[$]=E[D]=E[T]=!0,E[g]=E[f]=E[y]=E[c]=E[k]=E[o]=E[h]=E[d]=E[u]=E[l]=E[s]=E[r]=E[a]=E[p]=E[v]=!1;function C(b){return m(b)&&n(b.length)&&!!E[t(b)]}i.exports=C})),Ta=j(((e,i)=>{function t(n){return function(m){return n(m)}}i.exports=t})),Ma=j(((e,i)=>{var t=no(),n=typeof e=="object"&&e&&!e.nodeType&&e,m=n&&typeof i=="object"&&i&&!i.nodeType&&i,g=m&&m.exports===n&&t.process,f=(function(){try{var c=m&&m.require&&m.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();i.exports=f})),_n=j(((e,i)=>{var t=ka(),n=Ta(),m=Ma(),g=m&&m.isTypedArray,f=g?n(g):t;i.exports=f})),fo=j(((e,i)=>{function t(n,m){if(!(m==="constructor"&&typeof n[m]=="function")&&m!="__proto__")return n[m]}i.exports=t})),go=j(((e,i)=>{var t=$n(),n=Vt(),m=Object.prototype.hasOwnProperty;function g(f,c,o){var h=f[c];(!(m.call(f,c)&&n(h,o))||o===void 0&&!(c in f))&&t(f,c,o)}i.exports=g})),$a=j(((e,i)=>{var t=go(),n=$n();function m(g,f,c,o){var h=!c;c||(c={});for(var d=-1,u=f.length;++d<u;){var l=f[d],s=o?o(c[l],g[l],l,c,g):void 0;s===void 0&&(s=g[l]),h?n(c,l,s):t(c,l,s)}return c}i.exports=m})),La=j(((e,i)=>{function t(n,m){for(var g=-1,f=Array(n);++g<n;)f[g]=m(g);return f}i.exports=t})),On=j(((e,i)=>{var t=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function m(g,f){var c=typeof g;return f=f??t,!!f&&(c=="number"||c!="symbol"&&n.test(g))&&g>-1&&g%1==0&&g<f}i.exports=m})),mo=j(((e,i)=>{var t=La(),n=ho(),m=ht(),g=Rn(),f=On(),c=_n(),o=Object.prototype.hasOwnProperty;function h(d,u){var l=m(d),s=!l&&n(d),r=!l&&!s&&g(d),a=!l&&!s&&!r&&c(d),p=l||s||r||a,v=p?t(d.length,String):[],y=v.length;for(var k in d)(u||o.call(d,k))&&!(p&&(k=="length"||r&&(k=="offset"||k=="parent")||a&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||f(k,y)))&&v.push(k);return v}i.exports=h})),Ra=j(((e,i)=>{function t(n){var m=[];if(n!=null)for(var g in Object(n))m.push(g);return m}i.exports=t})),_a=j(((e,i)=>{var t=et(),n=Ln(),m=Ra(),g=Object.prototype.hasOwnProperty;function f(c){if(!t(c))return m(c);var o=n(c),h=[];for(var d in c)d=="constructor"&&(o||!g.call(c,d))||h.push(d);return h}i.exports=f})),vo=j(((e,i)=>{var t=mo(),n=_a(),m=Li();function g(f){return m(f)?t(f,!0):n(f)}i.exports=g})),Oa=j(((e,i)=>{var t=$a(),n=vo();function m(g){return t(g,n(g))}i.exports=m})),Ia=j(((e,i)=>{var t=ao(),n=ma(),m=ya(),g=ba(),f=Ca(),c=ho(),o=ht(),h=xa(),d=Rn(),u=kn(),l=et(),s=Aa(),r=_n(),a=fo(),p=Oa();function v(y,k,x,w,S,M,L){var R=a(y,x),$=a(k,x),D=L.get($);if(D){t(y,x,D);return}var T=M?M(R,$,x+"",y,k,L):void 0,E=T===void 0;if(E){var C=o($),b=!C&&d($),A=!C&&!b&&r($);T=$,C||b||A?o(R)?T=R:h(R)?T=g(R):b?(E=!1,T=n($,!0)):A?(E=!1,T=m($,!0)):T=[]:s($)||c($)?(T=R,c(R)?T=p(R):(!l(R)||u(R))&&(T=f($))):E=!1}E&&(L.set($,T),S(T,$,w,M,L),L.delete($)),t(y,x,T)}i.exports=v})),Da=j(((e,i)=>{var t=oo(),n=ao(),m=ga(),g=Ia(),f=et(),c=vo(),o=fo();function h(d,u,l,s,r){d!==u&&m(u,function(a,p){if(r||(r=new t),f(a))g(d,u,p,l,h,s,r);else{var v=s?s(o(d,p),a,p+"",d,u,r):void 0;v===void 0&&(v=a),n(d,p,v)}},c)}i.exports=h})),yo=j(((e,i)=>{function t(n){return n}i.exports=t})),Na=j(((e,i)=>{function t(n,m,g){switch(g.length){case 0:return n.call(m);case 1:return n.call(m,g[0]);case 2:return n.call(m,g[0],g[1]);case 3:return n.call(m,g[0],g[1],g[2])}return n.apply(m,g)}i.exports=t})),Fa=j(((e,i)=>{var t=Na(),n=Math.max;function m(g,f,c){return f=n(f===void 0?g.length-1:f,0),function(){for(var o=arguments,h=-1,d=n(o.length-f,0),u=Array(d);++h<d;)u[h]=o[f+h];h=-1;for(var l=Array(f+1);++h<f;)l[h]=o[h];return l[f]=c(u),t(g,this,l)}}i.exports=m})),za=j(((e,i)=>{function t(n){return function(){return n}}i.exports=t})),Pa=j(((e,i)=>{var t=za(),n=so(),m=yo(),g=n?function(f,c){return n(f,"toString",{configurable:!0,enumerable:!1,value:t(c),writable:!0})}:m;i.exports=g})),Ha=j(((e,i)=>{var t=800,n=16,m=Date.now;function g(f){var c=0,o=0;return function(){var h=m(),d=n-(h-o);if(o=h,d>0){if(++c>=t)return arguments[0]}else c=0;return f.apply(void 0,arguments)}}i.exports=g})),Ba=j(((e,i)=>{var t=Pa(),n=Ha()(t);i.exports=n})),Wa=j(((e,i)=>{var t=yo(),n=Fa(),m=Ba();function g(f,c){return m(n(f,c,t),f+"")}i.exports=g})),ja=j(((e,i)=>{var t=Vt(),n=Li(),m=On(),g=et();function f(c,o,h){if(!g(h))return!1;var d=typeof o;return(d=="number"?n(h)&&m(o,h.length):d=="string"&&o in h)?t(h[o],c):!1}i.exports=f})),Va=j(((e,i)=>{var t=Wa(),n=ja();function m(g){return t(function(f,c){var o=-1,h=c.length,d=h>1?c[h-1]:void 0,u=h>2?c[2]:void 0;for(d=g.length>3&&typeof d=="function"?(h--,d):void 0,u&&n(c[0],c[1],u)&&(d=h<3?void 0:d,h=1),f=Object(f);++o<h;){var l=c[o];l&&g(f,l,o,d)}return f})}i.exports=m})),Ua=j(((e,i)=>{var t=Da(),n=Va()(function(m,g,f,c){t(m,g,f,c)});i.exports=n})),Ga=Et(Ua(),1),Ka="formeo",qa="5.2.2",Ya="module",Za="dist/formeo.cjs.js",Qa="dist/formeo.es.js",Xa="dist/formeo.umd.js",Ja={".":{import:"./dist/formeo.es.js",require:"./dist/formeo.cjs.js",default:"./dist/formeo.umd.js"},"./dist/formeo.min.css":{import:"./dist/formeo.min.css",require:"./dist/formeo.min.css",default:"./dist/formeo.min.css"}},el=["dist/*","demo/**/*"],tl="https://formeo.io",il={url:"https://github.com/Draggable/formeo",type:"git"},nl="Draggable https://draggable.io",rl=[{name:"Kevin Chappell",email:"kevin@chappell.dev",url:"https://kevin-chappell.com"}],ol={url:"https://github.com/draggable/formeo/issues"},sl="A zero dependency JavaScript module for drag and drop form creation.",al=["drag and drop","form builder","form maker","forms"];var ll=["**/*","node_modules","test"],cl={files:{test:["test/**/*.spec.js"],"formeo-editor":{js:"src/js/editor.js"},"formeo-renderer":{js:"src/js/renderer.js"},site:["demo/assets/sass/site.scss"]}},ul={dev:"vite --mode development",preview:"vite preview","prebuild:lib":`node -e "require('node:fs').rmSync('dist', { recursive: true, force: true })"`,"build:lib":"npm-run-all -p build:lib:unminified build:lib:minified","build:lib:unminified":"vite build --config vite.config.lib.mjs --mode production","build:lib:minified":"vite build --config vite.config.lib.mjs --mode production-minified",build:"npm-run-all -p build:icons build:demo",prebuild:"npm run build:lib",postbuild:"npm run generate:jsonSchema","build:demo":"vite build --mode demo","postbuild:demo":"node --no-warnings tools/copy-assets.mjs","build:demo:watch":"vite build --mode demo --watch","build:icons":"node ./tools/generate-sprite",lint:"biome check ./src && node tools/check-color-literals.mjs && node tools/check-doc-links.mjs","lint:fix":"biome check --write ./src",format:"biome format --write .",test:"node --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:watch":"node --watch --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:updateSnapshots":"node --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --test-update-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:ci":"npm test --coverage",start:"npm-run-all build:icons dev","semantic-release":"semantic-release --ci --debug","copy:lang":"node ./tools/copy-directory.mjs ./node_modules/formeo-i18n/dist/lang ./src/demo/assets/lang","travis-deploy-once":"travis-deploy-once --pro","playwright:test":"playwright test","playwright:test:ui":"playwright test --ui","playwright:test:report":"playwright show-report","playwright:test:ci":"playwright test --reporter=dot",prepush:"npm test",prepare:"lefthook install",postmerge:"lefthook install","generate:jsonSchema":"node --experimental-strip-types --no-warnings ./tools/generate-json-schema.ts"},dl={"@biomejs/biome":"^2.3.3","@commitlint/cli":"^21.0.1","@commitlint/config-conventional":"^21.0.1","@playwright/test":"^1.49.1","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.8","@semantic-release/npm":"^13.1.3","@types/node":"^25.8.0","ace-builds":"^1.36.5",esbuild:"^0.28.0",jsdom:"^29.1.1",lefthook:"^2.1.6","npm-run-all":"^4.1.5","sass-embedded":"^1.80.1","semantic-release":"^25.0.2","svg-sprite":"^2.0.4",vite:"^8.0.13","vite-plugin-banner":"^0.8.0","vite-plugin-compression":"^0.5.1","vite-plugin-html":"^3.2.2",zod:"^4.4.3"},hl={"@draggable/formeo-languages":"^3.4.1","@draggable/i18n":"^1.0.7","@draggable/tooltip":"^1.2.2",lodash:"^4.17.21",sortablejs:"^1.15.3"},pl={branches:["main"],verifyConditions:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"],prepare:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],publish:["@semantic-release/npm","@semantic-release/github"],success:["@semantic-release/github"],fail:["@semantic-release/github"]},fl={extends:["@commitlint/config-conventional"],rules:{"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]]}},bo={name:Ka,version:qa,type:Ya,main:Za,module:Qa,unpkg:Xa,exports:Ja,files:el,homepage:tl,repository:il,author:nl,contributors:rl,bugs:ol,description:sl,keywords:al,license:"MIT",ignore:ll,config:cl,scripts:ul,devDependencies:dl,dependencies:hl,release:pl,commitlint:fl},gl='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acprefix__rect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="acprefix__layer1"><g id="acprefix__text4203"><g id="acprefix__g4212" transform="translate(0.10112835,0.1001358)"><path id="acprefix__path4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acprefix__path4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agprefix__rect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="aiprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="aiprefix__rect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqprefix__g4220"><rect id="aqprefix__rect4191" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqprefix__g4220-6"><rect id="aqprefix__rect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><path d="M2 7h2v2H2zM7 7h2v2H7zM12 7h2v2h-2zM2 12h2v2H2zM7 12h2v2H7zM12 12h2v2h-2z" transform="rotate(90 9.25 9.25)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><path d="M9.5-6.5h2v2h-2zm-5 0h2v2h-2zm5-5h2v2h-2zm-5 0h2v2h-2z" transform="rotate(90)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Zm10-5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-stage" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5h2v2H2zM7 4.5h2v2H7zM12 4.5h2v2h-2zM2 9.5h2v2H2zM7 9.5h2v2H7zM12 9.5h2v2h-2zM2-.5h2v2H2zM7-.5h2v2H7zM12-.5h2v2h-2z" transform="translate(0 2.5)"/></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="arprefix__icomoon-ignore"/><path d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h1v-1H0Zm15-7h1V4h-1zm-1 7h1v-1h-1zm-2 0h1v-1h-1zm-2 0h1v-1h-1Zm-2 0h1v-1H8Zm-2 0h1v-1H6Zm-2 0h1v-1H4Zm-2 0h1v-1H2Zm13-1h1v-1h-1ZM0 10h1V9H0Zm15-1h1V8h-1ZM0 8h1V7H0Zm15-1h1V6h-1ZM0 6h1V5H0Zm13-1h1V4h-1zm-2 0h1V4h-1ZM9 5h1V4H9ZM7 5h1V4H7ZM5 5h1V4H5ZM3 5h1V4H3ZM1 5h1V4H1Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 32 32" id="f-i-info-circle" xmlns="http://www.w3.org/2000/svg"><path d="m17.962 24.725 1.806.096v2.531h-7.534v-2.406l1.045-.094c.568-.063.916-.254.916-1.014v-8.801c0-.699-.188-.92-.791-.92l-1.106-.062v-2.626h5.666zM15.747 4.648c1.394 0 2.405 1.047 2.405 2.374 0 1.331-1.014 2.313-2.438 2.313-1.454 0-2.404-.982-2.404-2.313 0-1.327.95-2.374 2.437-2.374M16 32C7.178 32 0 24.822 0 16S7.178 0 16 0c8.82 0 16 7.178 16 16s-7.18 16-16 16m0-29C8.832 3 3 8.832 3 16s5.832 13 13 13 13-5.832 13-13S23.168 3 16 3"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="avprefix__icomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L18 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><metadata id="axprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="3440" inkscape:window-height="1416" id="axprefix__namedview6" showgrid="false" inkscape:zoom="1.84375" inkscape:cx="421.4312" inkscape:cy="218.56484" inkscape:window-x="0" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"/><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z" id="axprefix__path4" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:connector-curvature="0" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:nodetypes="ccccccccccc"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-plus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12H18M12 6V18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><path d="M193.694-139.2h87.322v510.916h-87.322zM-18.103 159.92V72.597h510.915v87.322z" transform="rotate(45 77.994 208.636)"/></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="bfprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="bfprefix__g7209"><path id="bfprefix__rect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bgprefix__XMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bhprefix__icomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="biprefix__XMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bjprefix__XMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="boprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',In=bo.name,Dn=bo.version,Ri=In,ml="formeo-sprite",vl=`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/${ml}.svg`,yl=`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/formeo.min.css`,bl="https://draggable.github.io/formeo/assets/css/formeo.min.css",wo="f-panel",ot="control-group",kt=`${Ri}-stage`,Ue=`${Ri}-row`,Ge=`${Ri}-column`,Tt=`${Ri}-field`,hn="custom-column-widths",Co="column-preset",Pi="resizing-columns",wl=new Map([[kt,Ue],[Ue,Ge],[Ge,Tt]]),Nn=["stage","row","column","field"],Fn=Nn.map(e=>`${e}s`),yp=new Map(Fn.map((e,i)=>[e,Nn[i]])),Cl=new RegExp(`^${Fn.join("|")}.`),So=[...Nn],xo=[...Fn],Sl=new Map(xo.map((e,i)=>[e,So[i]])),bp=new RegExp(`^${xo.join("|")}.`),Hi=So.reduce((e,i)=>(e[i]=i,e),{}),xl=[{name:"controls",className:ot},{name:"stage",className:kt},{name:"row",className:Ue},{name:"column",className:Ge},{name:"field",className:Tt}],zn={controls:ot,stage:kt,row:Ue,column:Ge,field:Tt},El=Object.entries(zn).reduce((e,[i,t])=>(e[t]=i,e),{}),Al=Object.values(zn),kl=new RegExp(`${Al.join("|")}`,"g"),{childTypeMapVals:Eo,childTypeIndexMapVals:Tl}=xl.reduce((e,{name:i},t,n)=>{const{name:m}=n[t+1]||{};return m&&(e.childTypeMapVals.push([i,m]),e.childTypeIndexMapVals.push([`${i}s`,`${m}s`])),e},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Ml=Eo.slice().map(e=>e.slice().reverse()).reverse(),pr=new Map(Eo),$l=new Map(Tl),Ll=new Map(Ml.slice()),Rl=[[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]],_l=new Map(Rl.reduce((e,i,t)=>(e.push([t,i]),e),[])),Pn=`${In}-formData`,fr=`${In}-locale`;var st=Math.round(333/2),Hn=Math.round(333*2),wp=Math.round(333/5),Ao="formeoSaved",Bn="formeoUpdated",Ol="formeoChanged",ko="formeoUpdatedStage",To="formeoUpdatedRow",Mo="formeoUpdatedColumn",$o="formeoUpdatedField",Il="formeoCleared",Lo="formeoOnRender",Dl="formeoConditionUpdated",Wn="formeoAddedRow",jn="formeoAddedColumn",Vn="formeoAddedField",Un="formeoRemovedRow",Gn="formeoRemovedColumn",Kn="formeoRemovedField",Ro={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Nl={and:"&&",or:"||"},_o={equals:"="},Fl=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],gr=["isChecked","isNotChecked"],mr=["isVisible","isNotVisible"],ni=["value"],zl={comparison:Ro,assignment:_o,logical:Nl};var Pl="then",qn=()=>({if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[Pl]:[{target:"",targetProperty:"",assignment:"",value:""}]}),Hl=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,pn=/\bcol-\w+-\d+/g,Oo="f-i-",wt=()=>({id:Me(),stages:{[Me()]:{}},rows:{},columns:{},fields:{}}),fi=["selected","checked"],Bl=fi.toReversed(),Wl=new Map([["config",new Set(["label","helpText","hideLabel","labelAfter","disableHtmlLabel","tooltip"])]]),jl=()=>crypto.randomUUID().slice(0,8),Vl=()=>jl().slice(0,8),vr=(e="",i)=>{if(!i)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof i=="string"?[i]:i;n=n.map(g=>g==="*"?"":g.replace(t,"\\$&"));let m=!0;return n.length&&(m=!new RegExp(n.join("|"),"i").exec(e)),m},Ul=(e,i)=>{const t=e.indexOf(i);t!==-1&&e.splice(t,1)},be=e=>{const i=e.className?.match(kl);return i&&El[i[0]]},at=e=>Array.from(new Set(e)),Me=e=>e?.attrs?.id||e?.id||Vl(),De=(e,i)=>{const t=(n,m)=>{if(Array.isArray(n))return m!=null?at(n.concat(m)):m;if(Array.isArray(m))return n!=null?at(m.concat(n)):m};return(0,Ga.default)({},e,i,t)},He=e=>{let i;const t=e instanceof Promise;if(e===null||typeof e!="object"||t)return e;if(e instanceof Date)return i=new Date,i.setTime(e.getTime()),i;if(Array.isArray(e)){i=[];for(let n=0,m=e.length;n<m;n++)i[n]=He(e[n]);return i}if(e instanceof Object){i={};for(const n in e)Object.hasOwn(e,n)&&(i[n]=He(e[n]));return i}throw new Error("Unable to copy Object, type not supported.")},Bi=(e,i)=>e/i*100,fn=e=>`${e.toString()}%`,Yn=Object.create(null,{get:{value:e=>{const i=window.sessionStorage?.getItem(e);try{return JSON.parse(i)}catch{return i}}},set:{value:(e,i)=>{try{return window.sessionStorage?.setItem(e,JSON.stringify(i))}catch(t){console.error(t)}}}}),Te=e=>/^(stage|row|column|field)s./.test(e),Gl=e=>Cl.test(e);function Io(e,i=Hn,{trailing:t=!1}={}){let n=0,m=null,g=null;return function(...f){const c=i-(Date.now()-n);if(c<=0){clearTimeout(m),m=null,n=Date.now(),e.apply(this,f);return}t&&(g=f,m||(m=setTimeout(()=>{m=null,n=Date.now(),e.apply(this,g)},c)))}}function gi(e,i=st){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>e.apply(this,n),i)}}function gn(e){return e}function mn(){}function _i(e=Object.create(null)){if(typeof e=="string")try{return JSON.parse(e)}catch(i){return console.error("Invalid JSON string provided:",i),Object.create(null)}return e}var rt=e=>e?He(_i(e)):wt();function Do(e,i,t,n={}){if(!i||!e[t][i])return n;const m=`${t}.${i}`;n[m]=e[t][i];const g=$l.get(t);if(g){const f=e[t][i].data?.children||[];for(const c of f)Do(e,c,g,n)}return n}var Kl="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(e=>String.raw`\s${e}\s`),ql=new RegExp(String.raw`(?!${Kl.join("|")})\w\S*`,"g"),Yl=/\s+/g;function je(e){return typeof e!="string"||e.trim().match(Yl)?e:e.replace(ql,i=>i.charAt(0).toUpperCase()+i.substring(1).replace(/[A-Z]/g,t=>` ${t}`))}var No=(e,i="-")=>e.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,i),lt=e=>{if(Array.isArray(e))return e;const i=/[.[\]]/g,t=[];let n=0,m=i.exec(e);for(;m!==null;)t.push(e.slice(n,m.index)),n=m.index+m[0].length,m=i.exec(e);return n<e.length&&t.push(e.slice(n)),t.filter(Boolean)},yr=(e,i="-")=>lt(e).join(i),Zl=e=>{const i=document.createElement("div");return i.innerHTML=e,i.textContent||i.innerText||""},Ql=(e,i,t="…")=>{if(e.length<=i)return e;const n=e.slice(0,i),m=n.lastIndexOf(" ");let g=`${m>0?n.slice(0,m):n}`;return t&&(g+=t),g},Xl=/^attrs\.|^meta\.|^options\.|^config\./g;function mi(e){return e.replaceAll(Xl,"")}var Yt="no-transition",Jl={debug:!1,bubbles:!0,formeoLoaded:e=>{},onAdd:()=>{},onRemove:()=>{},onChange:e=>Q.opts?.debug&&console.log(e),onUpdate:e=>Q.opts?.debug&&console.log(e),onUpdateStage:e=>Q.opts?.debug&&console.log(e),onUpdateRow:e=>Q.opts?.debug&&console.log(e),onUpdateColumn:e=>Q.opts?.debug&&console.log(e),onUpdateField:e=>Q.opts?.debug&&console.log(e),onAddRow:e=>Q.opts?.debug&&console.log(e),onAddColumn:e=>Q.opts?.debug&&console.log(e),onAddField:e=>Q.opts?.debug&&console.log(e),onRemoveRow:e=>Q.opts?.debug&&console.log(e),onRemoveColumn:e=>Q.opts?.debug&&console.log(e),onRemoveField:e=>Q.opts?.debug&&console.log(e),onRender:e=>Q.opts?.debug&&console.log(e),onSave:e=>{},confirmClearAll:e=>{globalThis.confirm(e.confirmationMessage)&&e.clearAllAction(e)}},_e=({src:e,...i},t=Bn)=>{const n=new globalThis.CustomEvent(t,{detail:i,bubbles:Q.opts?.debug||Q.opts?.bubbles});if(n.data=(e||document).dispatchEvent(n),t==="formeoUpdated"){const m=new globalThis.CustomEvent(Ol,{detail:i,bubbles:Q.opts?.debug||Q.opts?.bubbles});(e||document).dispatchEvent(m)}return n},Q={init:function(e){return this.opts={...Jl,...e},this},formeoSaved:e=>_e(e,Ao),formeoUpdated:(e,i)=>_e(e,i||"formeoUpdated"),formeoCleared:e=>_e(e,Il),formeoOnRender:e=>_e(e,Lo),formeoConditionUpdated:e=>_e(e,Dl),formeoAddedRow:e=>_e(e,Wn),formeoAddedColumn:e=>_e(e,jn),formeoAddedField:e=>_e(e,Vn),formeoRemovedRow:e=>_e(e,Un),formeoRemovedColumn:e=>_e(e,Gn),formeoRemovedField:e=>_e(e,Kn)},ec=Io(()=>{const e={timeStamp:globalThis.performance.now(),type:Bn,detail:oe.formData};Q.opts.onUpdate(e),Q.opts.onChange!==Q.opts.onUpdate&&Q.opts.onChange(e)},st,{trailing:!0});document.addEventListener(Bn,ec);document.addEventListener(ko,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateStage(m)});document.addEventListener(To,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateRow(m)});document.addEventListener(Mo,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateColumn(m)});document.addEventListener($o,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateField(m)});document.addEventListener(Wn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddRow(m)});document.addEventListener(jn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddColumn(m)});document.addEventListener(Vn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddField(m)});document.addEventListener(Un,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveRow(m)});document.addEventListener(Gn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveColumn(m)});document.addEventListener(Kn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveField(m)});document.addEventListener(Lo,e=>{const{timeStamp:i,type:t,detail:n}=e;Q.opts.onRender({timeStamp:i,type:t,detail:n})});document.addEventListener("confirmClearAll",e=>{e={timeStamp:e.timeStamp,type:e.type,confirmationMessage:e.detail.confirmationMessage,clearAllAction:e.detail.clearAllAction,btnCoords:e.detail.btnCoords},Q.opts.confirmClearAll(e)});document.addEventListener(Ao,({timeStamp:e,type:i,detail:{formData:t}})=>{const n={timeStamp:e,type:i,formData:t};Q.opts.onSave(n)});document.addEventListener("formeoLoaded",e=>{Q.opts.formeoLoaded(e.detail.formeo)});var Wi;function tc(){Wi=Wi||window.requestAnimationFrame(()=>{Wi=!1;for(const e of Object.values(Ht.data))e.dom.classList.add(Yt),Bt.dom.classList.add(Yt),Bt.panels.nav.refresh(),e.refreshFieldPanels(),Io(()=>{e.dom.classList.remove(Yt),Bt.dom.classList.remove(Yt)},333)})}window.addEventListener("resize",tc);var Zn=j(((e,i)=>{var t=At(),n=dt(),m="[object Symbol]";function g(f){return typeof f=="symbol"||n(f)&&t(f)==m}i.exports=g})),ic=j(((e,i)=>{var t=ht(),n=Zn(),m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function f(c,o){if(t(c))return!1;var h=typeof c;return h=="number"||h=="symbol"||h=="boolean"||c==null||n(c)?!0:g.test(c)||!m.test(c)||o!=null&&c in Object(o)}i.exports=f})),nc=j(((e,i)=>{var t=Mn(),n="Expected a function";function m(g,f){if(typeof g!="function"||f!=null&&typeof f!="function")throw new TypeError(n);var c=function(){var o=arguments,h=f?f.apply(this,o):o[0],d=c.cache;if(d.has(h))return d.get(h);var u=g.apply(this,o);return c.cache=d.set(h,u)||d,u};return c.cache=new(m.Cache||t),c}m.Cache=t,i.exports=m})),rc=j(((e,i)=>{var t=nc(),n=500;function m(g){var f=t(g,function(o){return c.size===n&&c.clear(),o}),c=f.cache;return f}i.exports=m})),oc=j(((e,i)=>{var t=rc(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m=/\\(\\)?/g,g=t(function(f){var c=[];return f.charCodeAt(0)===46&&c.push(""),f.replace(n,function(o,h,d,u){c.push(d?u.replace(m,"$1"):h||o)}),c});i.exports=g})),sc=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length,c=Array(f);++g<f;)c[g]=m(n[g],g,n);return c}i.exports=t})),ac=j(((e,i)=>{var t=Ti(),n=sc(),m=ht(),g=Zn(),f=1/0,c=t?t.prototype:void 0,o=c?c.toString:void 0;function h(d){if(typeof d=="string")return d;if(m(d))return n(d,h)+"";if(g(d))return o?o.call(d):"";var u=d+"";return u=="0"&&1/d==-f?"-0":u}i.exports=h})),Oi=j(((e,i)=>{var t=ac();function n(m){return m==null?"":t(m)}i.exports=n})),Fo=j(((e,i)=>{var t=ht(),n=ic(),m=oc(),g=Oi();function f(c,o){return t(c)?c:n(c,o)?[c]:m(g(c))}i.exports=f})),zo=j(((e,i)=>{var t=Zn(),n=1/0;function m(g){if(typeof g=="string"||t(g))return g;var f=g+"";return f=="0"&&1/g==-n?"-0":f}i.exports=m})),lc=j(((e,i)=>{var t=Fo(),n=zo();function m(g,f){f=t(f,g);for(var c=0,o=f.length;g!=null&&c<o;)g=g[n(f[c++])];return c&&c==o?g:void 0}i.exports=m})),cc=j(((e,i)=>{var t=lc();function n(m,g,f){var c=m==null?void 0:t(m,g);return c===void 0?f:c}i.exports=n})),uc=j(((e,i)=>{var t=go(),n=Fo(),m=On(),g=et(),f=zo();function c(o,h,d,u){if(!g(o))return o;h=n(h,o);for(var l=-1,s=h.length,r=s-1,a=o;a!=null&&++l<s;){var p=f(h[l]),v=d;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(l!=r){var y=a[p];v=u?u(y,p,a):void 0,v===void 0&&(v=g(y)?y:m(h[l+1])?[]:{})}t(a,p,v),a=a[p]}return o}i.exports=c})),dc=j(((e,i)=>{var t=uc();function n(m,g,f){return m==null?m:t(m,g,f)}i.exports=n})),hc=Et(cc(),1),pc=Et(dc(),1),we=hc.default,Ii=pc.default;function fc(e,i={}){const t={...e};for(const n in i)Object.hasOwn(i,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(i[n]):t[n]=[t[n],i[n]]:t[n]=i[n]);return t}function ri(...e){return e.flat().reduce((i,t)=>(i[t]=t,i),{})}var gc=j(((e,i)=>{var t="__lodash_hash_undefined__";function n(m){return this.__data__.set(m,t),this}i.exports=n})),mc=j(((e,i)=>{function t(n){return this.__data__.has(n)}i.exports=t})),vc=j(((e,i)=>{var t=Mn(),n=gc(),m=mc();function g(f){var c=-1,o=f==null?0:f.length;for(this.__data__=new t;++c<o;)this.add(f[c])}g.prototype.add=g.prototype.push=n,g.prototype.has=m,i.exports=g})),yc=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length;++g<f;)if(m(n[g],g,n))return!0;return!1}i.exports=t})),bc=j(((e,i)=>{function t(n,m){return n.has(m)}i.exports=t})),Po=j(((e,i)=>{var t=vc(),n=yc(),m=bc(),g=1,f=2;function c(o,h,d,u,l,s){var r=d&g,a=o.length,p=h.length;if(a!=p&&!(r&&p>a))return!1;var v=s.get(o),y=s.get(h);if(v&&y)return v==h&&y==o;var k=-1,x=!0,w=d&f?new t:void 0;for(s.set(o,h),s.set(h,o);++k<a;){var S=o[k],M=h[k];if(u)var L=r?u(M,S,k,h,o,s):u(S,M,k,o,h,s);if(L!==void 0){if(L)continue;x=!1;break}if(w){if(!n(h,function(R,$){if(!m(w,$)&&(S===R||l(S,R,d,u,s)))return w.push($)})){x=!1;break}}else if(!(S===M||l(S,M,d,u,s))){x=!1;break}}return s.delete(o),s.delete(h),x}i.exports=c})),wc=j(((e,i)=>{function t(n){var m=-1,g=Array(n.size);return n.forEach(function(f,c){g[++m]=[c,f]}),g}i.exports=t})),Cc=j(((e,i)=>{function t(n){var m=-1,g=Array(n.size);return n.forEach(function(f){g[++m]=f}),g}i.exports=t})),Sc=j(((e,i)=>{var t=Ti(),n=lo(),m=Vt(),g=Po(),f=wc(),c=Cc(),o=1,h=2,d="[object Boolean]",u="[object Date]",l="[object Error]",s="[object Map]",r="[object Number]",a="[object RegExp]",p="[object Set]",v="[object String]",y="[object Symbol]",k="[object ArrayBuffer]",x="[object DataView]",w=t?t.prototype:void 0,S=w?w.valueOf:void 0;function M(L,R,$,D,T,E,C){switch($){case x:if(L.byteLength!=R.byteLength||L.byteOffset!=R.byteOffset)return!1;L=L.buffer,R=R.buffer;case k:return!(L.byteLength!=R.byteLength||!E(new n(L),new n(R)));case d:case u:case r:return m(+L,+R);case l:return L.name==R.name&&L.message==R.message;case a:case v:return L==R+"";case s:var b=f;case p:var A=D&o;if(b||(b=c),L.size!=R.size&&!A)return!1;var _=C.get(L);if(_)return _==R;D|=h,C.set(L,R);var O=g(b(L),b(R),D,T,E,C);return C.delete(L),O;case y:if(S)return S.call(L)==S.call(R)}return!1}i.exports=M})),xc=j(((e,i)=>{function t(n,m){for(var g=-1,f=m.length,c=n.length;++g<f;)n[c+g]=m[g];return n}i.exports=t})),Ec=j(((e,i)=>{var t=xc(),n=ht();function m(g,f,c){var o=f(g);return n(g)?o:t(o,c(g))}i.exports=m})),Ac=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length,c=0,o=[];++g<f;){var h=n[g];m(h,g,n)&&(o[c++]=h)}return o}i.exports=t})),kc=j(((e,i)=>{function t(){return[]}i.exports=t})),Tc=j(((e,i)=>{var t=Ac(),n=kc(),m=Object.prototype.propertyIsEnumerable,g=Object.getOwnPropertySymbols,f=g?function(c){return c==null?[]:(c=Object(c),t(g(c),function(o){return m.call(c,o)}))}:n;i.exports=f})),Mc=j(((e,i)=>{var t=co()(Object.keys,Object);i.exports=t})),$c=j(((e,i)=>{var t=Ln(),n=Mc(),m=Object.prototype.hasOwnProperty;function g(f){if(!t(f))return n(f);var c=[];for(var o in Object(f))m.call(f,o)&&o!="constructor"&&c.push(o);return c}i.exports=g})),Lc=j(((e,i)=>{var t=mo(),n=$c(),m=Li();function g(f){return m(f)?t(f):n(f)}i.exports=g})),Rc=j(((e,i)=>{var t=Ec(),n=Tc(),m=Lc();function g(f){return t(f,m,n)}i.exports=g})),_c=j(((e,i)=>{var t=Rc(),n=1,m=Object.prototype.hasOwnProperty;function g(f,c,o,h,d,u){var l=o&n,s=t(f),r=s.length;if(r!=t(c).length&&!l)return!1;for(var a=r;a--;){var p=s[a];if(!(l?p in c:m.call(c,p)))return!1}var v=u.get(f),y=u.get(c);if(v&&y)return v==c&&y==f;var k=!0;u.set(f,c),u.set(c,f);for(var x=l;++a<r;){p=s[a];var w=f[p],S=c[p];if(h)var M=l?h(S,w,p,c,f,u):h(w,S,p,f,c,u);if(!(M===void 0?w===S||d(w,S,o,h,u):M)){k=!1;break}x||(x=p=="constructor")}if(k&&!x){var L=f.constructor,R=c.constructor;L!=R&&"constructor"in f&&"constructor"in c&&!(typeof L=="function"&&L instanceof L&&typeof R=="function"&&R instanceof R)&&(k=!1)}return u.delete(f),u.delete(c),k}i.exports=g})),Oc=j(((e,i)=>{var t=ut()(We(),"DataView");i.exports=t})),Ic=j(((e,i)=>{var t=ut()(We(),"Promise");i.exports=t})),Dc=j(((e,i)=>{var t=ut()(We(),"Set");i.exports=t})),Nc=j(((e,i)=>{var t=ut()(We(),"WeakMap");i.exports=t})),Fc=j(((e,i)=>{var t=Oc(),n=Tn(),m=Ic(),g=Dc(),f=Nc(),c=At(),o=ro(),h="[object Map]",d="[object Object]",u="[object Promise]",l="[object Set]",s="[object WeakMap]",r="[object DataView]",a=o(t),p=o(n),v=o(m),y=o(g),k=o(f),x=c;(t&&x(new t(new ArrayBuffer(1)))!=r||n&&x(new n)!=h||m&&x(m.resolve())!=u||g&&x(new g)!=l||f&&x(new f)!=s)&&(x=function(w){var S=c(w),M=S==d?w.constructor:void 0,L=M?o(M):"";if(L)switch(L){case a:return r;case p:return h;case v:return u;case y:return l;case k:return s}return S}),i.exports=x})),zc=j(((e,i)=>{var t=oo(),n=Po(),m=Sc(),g=_c(),f=Fc(),c=ht(),o=Rn(),h=_n(),d=1,u="[object Arguments]",l="[object Array]",s="[object Object]",r=Object.prototype.hasOwnProperty;function a(p,v,y,k,x,w){var S=c(p),M=c(v),L=S?l:f(p),R=M?l:f(v);L=L==u?s:L,R=R==u?s:R;var $=L==s,D=R==s,T=L==R;if(T&&o(p)){if(!o(v))return!1;S=!0,$=!1}if(T&&!$)return w||(w=new t),S||h(p)?n(p,v,y,k,x,w):m(p,v,L,y,k,x,w);if(!(y&d)){var E=$&&r.call(p,"__wrapped__"),C=D&&r.call(v,"__wrapped__");if(E||C){var b=E?p.value():p,A=C?v.value():v;return w||(w=new t),x(b,A,y,k,w)}}return T?(w||(w=new t),g(p,v,y,k,x,w)):!1}i.exports=a})),Pc=j(((e,i)=>{var t=zc(),n=dt();function m(g,f,c,o,h){return g===f?!0:g==null||f==null||!n(g)&&!n(f)?g!==g&&f!==f:t(g,f,c,o,m,h)}i.exports=m})),Hc=j(((e,i)=>{var t=Pc();function n(m,g){return t(m,g)}i.exports=n})),vn=Et(Hc(),1),Bc=(e,i)=>e===void 0?"added":i===void 0?"removed":(0,vn.default)(e,i)?"unchanged":"changed",Qn=class{constructor(e,i=Object.create(null)){this.name=e,this.data=i,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,i)=>JSON.stringify(e,null,i);get=e=>we(this.data,e);set(e,i){const t=we(this.data,e),n=Ii(this.data,e,i),m=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(m)),f={newVal:i,oldVal:t,path:e};for(const c of g)for(const o of this.setCallbacks[c])o(f);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:i,data:n,changeType:Bc(t,i),src:this.dom};if(t&&(c.previousValue=t),Q.formeoUpdated(c),this.name){const o={stage:ko,row:To,column:Mo,field:$o}[this.name];o&&Q.formeoUpdated(c,o)}}return n}addSetCallback(e,i){this.setCallbacks[e]?this.setCallbacks[e].push(i):this.setCallbacks[e]=[i]}removeSetCallback(e,i){this.setCallbacks[e]=this.setCallbacks[e].filter(t=>t!==i)}add=(e,i=Object.create(null))=>{const{id:t}=i,n=e||t||Me();return this.set(n,i)};remove=e=>{const i=lt(e),t=i.pop(),n=this.get(i);return Array.isArray(n)?n.splice(Number(t),1):n&&delete n[t],n};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[i,t])=>(e[i]=t?.data?t.getData():t,e),{});setCallbacks={};configVal=Object.create(null)},Di=class extends Qn{load=e=>{const i=_i(e);this.empty();for(const[t,n]of Object.entries(i))this.add(t,n);return this.data};get=e=>e?we(this.data,e):this.add();add=(e,i=Object.create(null))=>{const t=e||Me(),n=this.Component({...i,id:t});this.data[t]=n,this.active=n;const m={row:Wn,column:jn,field:Vn}[this.name];return m&&Q.formeoUpdated({entity:n,componentId:t,componentType:this.name,data:n.data},m),n};remove=e=>{if(Array.isArray(e))for(const i of e)this.get(i).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const i=Object.values(this.data).map(t=>t.empty(e));return Promise.all(i)};set config(e){this.configVal=De(this.configVal,He(e))}get config(){return this.configVal}conditionMap=new Map};function Wc(e,i,t){return(i=Gc(i))in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Ke.apply(null,arguments)}function br(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),t.push.apply(t,n)}return t}function Be(e){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?br(Object(t),!0).forEach(function(n){Wc(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):br(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function jc(e,i){if(e==null)return{};var t,n,m=Vc(e,i);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(e);for(n=0;n<g.length;n++)t=g[n],i.indexOf(t)===-1&&{}.propertyIsEnumerable.call(e,t)&&(m[t]=e[t])}return m}function Vc(e,i){if(e==null)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(i.indexOf(n)!==-1)continue;t[n]=e[n]}return t}function Uc(e,i){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,i||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(e)}function Gc(e){var i=Uc(e,"string");return typeof i=="symbol"?i:i+""}function yn(e){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},yn(e)}var Kc="1.15.7";function Ve(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Ye=Ve(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ut=Ve(/Edge/i),wr=Ve(/firefox/i),Dt=Ve(/safari/i)&&!Ve(/chrome/i)&&!Ve(/android/i),Xn=Ve(/iP(ad|od|hone)/i),Ho=Ve(/chrome/i)&&Ve(/android/i),Bo={capture:!1,passive:!1};function re(e,i,t){e.addEventListener(i,t,!Ye&&Bo)}function ne(e,i,t){e.removeEventListener(i,t,!Ye&&Bo)}function vi(e,i){if(i){if(i[0]===">"&&(i=i.substring(1)),e)try{if(e.matches)return e.matches(i);if(e.msMatchesSelector)return e.msMatchesSelector(i);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(i)}catch{return!1}return!1}}function Wo(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function Ie(e,i,t,n){if(e){t=t||document;do{if(i!=null&&(i[0]===">"?e.parentNode===t&&vi(e,i):vi(e,i))||n&&e===t)return e;if(e===t)break}while(e=Wo(e))}return null}var Cr=/\s+/g;function xe(e,i,t){e&&i&&(e.classList?e.classList[t?"add":"remove"](i):e.className=((" "+e.className+" ").replace(Cr," ").replace(" "+i+" "," ")+(t?" "+i:"")).replace(Cr," "))}function ee(e,i,t){var n=e&&e.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),i===void 0?t:t[i];!(i in n)&&i.indexOf("webkit")===-1&&(i="-webkit-"+i),n[i]=t+(typeof t=="string"?"":"px")}}function Ct(e,i){var t="";if(typeof e=="string")t=e;else do{var n=ee(e,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!i&&(e=e.parentNode));var m=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return m&&new m(t)}function jo(e,i,t){if(e){var n=e.getElementsByTagName(i),m=0,g=n.length;if(t)for(;m<g;m++)t(n[m],m);return n}return[]}function Pe(){var e=document.scrollingElement;return e||document.documentElement}function de(e,i,t,n,m){if(!(!e.getBoundingClientRect&&e!==window)){var g,f,c,o,h,d,u;if(e!==window&&e.parentNode&&e!==Pe()?(g=e.getBoundingClientRect(),f=g.top,c=g.left,o=g.bottom,h=g.right,d=g.height,u=g.width):(f=0,c=0,o=window.innerHeight,h=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(i||t)&&e!==window&&(m=m||e.parentNode,!Ye))do if(m&&m.getBoundingClientRect&&(ee(m,"transform")!=="none"||t&&ee(m,"position")!=="static")){var l=m.getBoundingClientRect();f-=l.top+parseInt(ee(m,"border-top-width")),c-=l.left+parseInt(ee(m,"border-left-width")),o=f+g.height,h=c+g.width;break}while(m=m.parentNode);if(n&&e!==window){var s=Ct(m||e),r=s&&s.a,a=s&&s.d;s&&(f/=a,c/=r,u/=r,d/=a,o=f+d,h=c+u)}return{top:f,left:c,bottom:o,right:h,width:u,height:d}}}function Sr(e,i,t){for(var n=Xe(e,!0),m=de(e)[i];n;){var g=de(n)[t],f=void 0;if(t==="top"||t==="left"?f=m>=g:f=m<=g,!f)return n;if(n===Pe())break;n=Xe(n,!1)}return!1}function St(e,i,t,n){for(var m=0,g=0,f=e.children;g<f.length;){if(f[g].style.display!=="none"&&f[g]!==J.ghost&&(n||f[g]!==J.dragged)&&Ie(f[g],t.draggable,e,!1)){if(m===i)return f[g];m++}g++}return null}function Jn(e,i){for(var t=e.lastElementChild;t&&(t===J.ghost||ee(t,"display")==="none"||i&&!vi(t,i));)t=t.previousElementSibling;return t||null}function ke(e,i){var t=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==J.clone&&(!i||vi(e,i))&&t++;return t}function xr(e){var i=0,t=0,n=Pe();if(e)do{var m=Ct(e),g=m.a,f=m.d;i+=e.scrollLeft*g,t+=e.scrollTop*f}while(e!==n&&(e=e.parentNode));return[i,t]}function qc(e,i){for(var t in e)if(e.hasOwnProperty(t)){for(var n in i)if(i.hasOwnProperty(n)&&i[n]===e[t][n])return Number(t)}return-1}function Xe(e,i){if(!e||!e.getBoundingClientRect)return Pe();var t=e,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var m=ee(t);if(t.clientWidth<t.scrollWidth&&(m.overflowX=="auto"||m.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(m.overflowY=="auto"||m.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Pe();if(n||i)return t;n=!0}}while(t=t.parentNode);return Pe()}function Yc(e,i){if(e&&i)for(var t in i)i.hasOwnProperty(t)&&(e[t]=i[t]);return e}function ji(e,i){return Math.round(e.top)===Math.round(i.top)&&Math.round(e.left)===Math.round(i.left)&&Math.round(e.height)===Math.round(i.height)&&Math.round(e.width)===Math.round(i.width)}var Nt;function Vo(e,i){return function(){if(!Nt){var t=arguments,n=this;t.length===1?e.call(n,t[0]):e.apply(n,t),Nt=setTimeout(function(){Nt=void 0},i)}}}function Zc(){clearTimeout(Nt),Nt=void 0}function Uo(e,i,t){e.scrollLeft+=i,e.scrollTop+=t}function Go(e){var i=window.Polymer,t=window.jQuery||window.Zepto;return i&&i.dom?i.dom(e).cloneNode(!0):t?t(e).clone(!0)[0]:e.cloneNode(!0)}function Ko(e,i,t){var n={};return Array.from(e.children).forEach(function(m){var g,f,c,o;if(!(!Ie(m,i.draggable,e,!1)||m.animated||m===t)){var h=de(m);n.left=Math.min((g=n.left)!==null&&g!==void 0?g:1/0,h.left),n.top=Math.min((f=n.top)!==null&&f!==void 0?f:1/0,h.top),n.right=Math.max((c=n.right)!==null&&c!==void 0?c:-1/0,h.right),n.bottom=Math.max((o=n.bottom)!==null&&o!==void 0?o:-1/0,h.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Ce="Sortable"+new Date().getTime();function Qc(){var e=[],i;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(n){if(!(ee(n,"display")==="none"||n===J.ghost)){e.push({target:n,rect:de(n)});var m=Be({},e[e.length-1].rect);if(n.thisAnimationDuration){var g=Ct(n,!0);g&&(m.top-=g.f,m.left-=g.e)}n.fromRect=m}})},addAnimationState:function(n){e.push(n)},removeAnimationState:function(n){e.splice(qc(e,{target:n}),1)},animateAll:function(n){var m=this;if(!this.options.animation){clearTimeout(i),typeof n=="function"&&n();return}var g=!1,f=0;e.forEach(function(c){var o=0,h=c.target,d=h.fromRect,u=de(h),l=h.prevFromRect,s=h.prevToRect,r=c.rect,a=Ct(h,!0);a&&(u.top-=a.f,u.left-=a.e),h.toRect=u,h.thisAnimationDuration&&ji(l,u)&&!ji(d,u)&&(r.top-u.top)/(r.left-u.left)===(d.top-u.top)/(d.left-u.left)&&(o=Jc(r,l,s,m.options)),ji(u,d)||(h.prevFromRect=d,h.prevToRect=u,o||(o=m.options.animation),m.animate(h,r,u,o)),o&&(g=!0,f=Math.max(f,o),clearTimeout(h.animationResetTimer),h.animationResetTimer=setTimeout(function(){h.animationTime=0,h.prevFromRect=null,h.fromRect=null,h.prevToRect=null,h.thisAnimationDuration=null},o),h.thisAnimationDuration=o)}),clearTimeout(i),g?i=setTimeout(function(){typeof n=="function"&&n()},f):typeof n=="function"&&n(),e=[]},animate:function(n,m,g,f){if(f){ee(n,"transition",""),ee(n,"transform","");var c=Ct(this.el),o=c&&c.a,h=c&&c.d,d=(m.left-g.left)/(o||1),u=(m.top-g.top)/(h||1);n.animatingX=!!d,n.animatingY=!!u,ee(n,"transform","translate3d("+d+"px,"+u+"px,0)"),this.forRepaintDummy=Xc(n),ee(n,"transition","transform "+f+"ms"+(this.options.easing?" "+this.options.easing:"")),ee(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ee(n,"transition",""),ee(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},f)}}}}function Xc(e){return e.offsetWidth}function Jc(e,i,t,n){return Math.sqrt(Math.pow(i.top-e.top,2)+Math.pow(i.left-e.left,2))/Math.sqrt(Math.pow(i.top-t.top,2)+Math.pow(i.left-t.left,2))*n.animation}var pt=[],Vi={initializeByDefault:!0},Gt={mount:function(i){for(var t in Vi)Vi.hasOwnProperty(t)&&!(t in i)&&(i[t]=Vi[t]);pt.forEach(function(n){if(n.pluginName===i.pluginName)throw"Sortable: Cannot mount plugin ".concat(i.pluginName," more than once")}),pt.push(i)},pluginEvent:function(i,t,n){var m=this;this.eventCanceled=!1,n.cancel=function(){m.eventCanceled=!0};var g=i+"Global";pt.forEach(function(f){t[f.pluginName]&&(t[f.pluginName][g]&&t[f.pluginName][g](Be({sortable:t},n)),t.options[f.pluginName]&&t[f.pluginName][i]&&t[f.pluginName][i](Be({sortable:t},n)))})},initializePlugins:function(i,t,n,m){pt.forEach(function(c){var o=c.pluginName;if(!(!i.options[o]&&!c.initializeByDefault)){var h=new c(i,t,i.options);h.sortable=i,h.options=i.options,i[o]=h,Ke(n,h.defaults)}});for(var g in i.options)if(i.options.hasOwnProperty(g)){var f=this.modifyOption(i,g,i.options[g]);typeof f<"u"&&(i.options[g]=f)}},getEventProperties:function(i,t){var n={};return pt.forEach(function(m){typeof m.eventProperties=="function"&&Ke(n,m.eventProperties.call(t[m.pluginName],i))}),n},modifyOption:function(i,t,n){var m;return pt.forEach(function(g){i[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[t]=="function"&&(m=g.optionListeners[t].call(i[g.pluginName],n))}),m}};function eu(e){var i=e.sortable,t=e.rootEl,n=e.name,m=e.targetEl,g=e.cloneEl,f=e.toEl,c=e.fromEl,o=e.oldIndex,h=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,l=e.originalEvent,s=e.putSortable,r=e.extraEventProperties;if(i=i||t&&t[Ce],!!i){var a,p=i.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!Ye&&!Ut?a=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(a=document.createEvent("Event"),a.initEvent(n,!0,!0)),a.to=f||t,a.from=c||t,a.item=m||t,a.clone=g,a.oldIndex=o,a.newIndex=h,a.oldDraggableIndex=d,a.newDraggableIndex=u,a.originalEvent=l,a.pullMode=s?s.lastPutMode:void 0;var y=Be(Be({},r),Gt.getEventProperties(n,i));for(var k in y)a[k]=y[k];t&&t.dispatchEvent(a),p[v]&&p[v].call(i,a)}}var tu=["evt"],ye=function(i,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m=n.evt,g=jc(n,tu);Gt.pluginEvent.bind(J)(i,t,Be({dragEl:K,parentEl:ce,ghostEl:ie,rootEl:se,nextEl:nt,lastDownEl:oi,cloneEl:ae,cloneHidden:Qe,dragStarted:_t,putSortable:pe,activeSortable:J.active,originalEvent:m,oldIndex:yt,oldDraggableIndex:Ft,newIndex:Ee,newDraggableIndex:Ze,hideGhostForTarget:Qo,unhideGhostForTarget:Xo,cloneNowHidden:function(){Qe=!0},cloneNowShown:function(){Qe=!1},dispatchSortableEvent:function(c){me({sortable:t,name:c,originalEvent:m})}},g))};function me(e){eu(Be({putSortable:pe,cloneEl:ae,targetEl:K,rootEl:se,oldIndex:yt,oldDraggableIndex:Ft,newIndex:Ee,newDraggableIndex:Ze},e))}var K,ce,ie,se,nt,oi,ae,Qe,yt,Ee,Ft,Ze,Zt,pe,mt=!1,yi=!1,bi=[],tt,Oe,Ui,Gi,Er,Ar,_t,ft,zt,Pt=!1,Qt=!1,si,fe,Ki=[],bn=!1,wi=[],Ni=typeof document<"u",Xt=Xn,kr=Ut||Ye?"cssFloat":"float",iu=Ni&&!Ho&&!Xn&&"draggable"in document.createElement("div"),qo=(function(){if(Ni){if(Ye)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Yo=function(i,t){var n=ee(i),m=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),g=St(i,0,t),f=St(i,1,t),c=g&&ee(g),o=f&&ee(f),h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+de(g).width,d=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+de(f).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&c.float&&c.float!=="none"){var u=c.float==="left"?"left":"right";return f&&(o.clear==="both"||o.clear===u)?"vertical":"horizontal"}return g&&(c.display==="block"||c.display==="flex"||c.display==="table"||c.display==="grid"||h>=m&&n[kr]==="none"||f&&n[kr]==="none"&&h+d>m)?"vertical":"horizontal"},nu=function(i,t,n){var m=n?i.left:i.top,g=n?i.right:i.bottom,f=n?i.width:i.height,c=n?t.left:t.top,o=n?t.right:t.bottom,h=n?t.width:t.height;return m===c||g===o||m+f/2===c+h/2},ru=function(i,t){var n;return bi.some(function(m){var g=m[Ce].options.emptyInsertThreshold;if(!(!g||Jn(m))){var f=de(m),c=i>=f.left-g&&i<=f.right+g,o=t>=f.top-g&&t<=f.bottom+g;if(c&&o)return n=m}}),n},Zo=function(i){function t(g,f){return function(c,o,h,d){var u=c.options.group.name&&o.options.group.name&&c.options.group.name===o.options.group.name;if(g==null&&(f||u))return!0;if(g==null||g===!1)return!1;if(f&&g==="clone")return g;if(typeof g=="function")return t(g(c,o,h,d),f)(c,o,h,d);var l=(f?c:o).options.group.name;return g===!0||typeof g=="string"&&g===l||g.join&&g.indexOf(l)>-1}}var n={},m=i.group;(!m||yn(m)!="object")&&(m={name:m}),n.name=m.name,n.checkPull=t(m.pull,!0),n.checkPut=t(m.put),n.revertClone=m.revertClone,i.group=n},Qo=function(){!qo&&ie&&ee(ie,"display","none")},Xo=function(){!qo&&ie&&ee(ie,"display","")};Ni&&!Ho&&document.addEventListener("click",function(e){if(yi)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),yi=!1,!1},!0);var it=function(i){if(K){i=i.touches?i.touches[0]:i;var t=ru(i.clientX,i.clientY);if(t){var n={};for(var m in i)i.hasOwnProperty(m)&&(n[m]=i[m]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Ce]._onDragOver(n)}}},ou=function(i){K&&K.parentNode[Ce]._isOutsideThisEl(i.target)};function J(e,i){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=i=Ke({},i),e[Ce]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Yo(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,c){f.setData("Text",c.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:J.supportPointer!==!1&&"PointerEvent"in window&&(!Dt||Xn),emptyInsertThreshold:5};Gt.initializePlugins(this,e,t);for(var n in t)!(n in i)&&(i[n]=t[n]);Zo(i);for(var m in this)m.charAt(0)==="_"&&typeof this[m]=="function"&&(this[m]=this[m].bind(this));this.nativeDraggable=i.forceFallback?!1:iu,this.nativeDraggable&&(this.options.touchStartThreshold=1),i.supportPointer?re(e,"pointerdown",this._onTapStart):(re(e,"mousedown",this._onTapStart),re(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(re(e,"dragover",this),re(e,"dragenter",this)),bi.push(this.el),i.store&&i.store.get&&this.sort(i.store.get(this)||[]),Ke(this,Qc())}J.prototype={constructor:J,_isOutsideThisEl:function(i){!this.el.contains(i)&&i!==this.el&&(ft=null)},_getDirection:function(i,t){return typeof this.options.direction=="function"?this.options.direction.call(this,i,t,K):this.options.direction},_onTapStart:function(i){if(i.cancelable){var t=this,n=this.el,m=this.options,g=m.preventOnFilter,f=i.type,c=i.touches&&i.touches[0]||i.pointerType&&i.pointerType==="touch"&&i,o=(c||i).target,h=i.target.shadowRoot&&(i.path&&i.path[0]||i.composedPath&&i.composedPath()[0])||o,d=m.filter;if(pu(n),!K&&!(/mousedown|pointerdown/.test(f)&&i.button!==0||m.disabled)&&!h.isContentEditable&&!(!this.nativeDraggable&&Dt&&o&&o.tagName.toUpperCase()==="SELECT")&&(o=Ie(o,m.draggable,n,!1),!(o&&o.animated)&&oi!==o)){if(yt=ke(o),Ft=ke(o,m.draggable),typeof d=="function"){if(d.call(this,i,o,this)){me({sortable:t,rootEl:h,name:"filter",targetEl:o,toEl:n,fromEl:n}),ye("filter",t,{evt:i}),g&&i.preventDefault();return}}else if(d&&(d=d.split(",").some(function(u){if(u=Ie(h,u.trim(),n,!1),u)return me({sortable:t,rootEl:u,name:"filter",targetEl:o,fromEl:n,toEl:n}),ye("filter",t,{evt:i}),!0}),d)){g&&i.preventDefault();return}m.handle&&!Ie(h,m.handle,n,!1)||this._prepareDragStart(i,c,o)}}},_prepareDragStart:function(i,t,n){var m=this,g=m.el,f=m.options,c=g.ownerDocument,o;if(n&&!K&&n.parentNode===g){var h=de(n);if(se=g,K=n,ce=K.parentNode,nt=K.nextSibling,oi=n,Zt=f.group,J.dragged=K,tt={target:K,clientX:(t||i).clientX,clientY:(t||i).clientY},Er=tt.clientX-h.left,Ar=tt.clientY-h.top,this._lastX=(t||i).clientX,this._lastY=(t||i).clientY,K.style["will-change"]="all",o=function(){if(ye("delayEnded",m,{evt:i}),J.eventCanceled){m._onDrop();return}m._disableDelayedDragEvents(),!wr&&m.nativeDraggable&&(K.draggable=!0),m._triggerDragStart(i,t),me({sortable:m,name:"choose",originalEvent:i}),xe(K,f.chosenClass,!0)},f.ignore.split(",").forEach(function(d){jo(K,d.trim(),qi)}),re(c,"dragover",it),re(c,"mousemove",it),re(c,"touchmove",it),f.supportPointer?(re(c,"pointerup",m._onDrop),!this.nativeDraggable&&re(c,"pointercancel",m._onDrop)):(re(c,"mouseup",m._onDrop),re(c,"touchend",m._onDrop),re(c,"touchcancel",m._onDrop)),wr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),ye("delayStart",this,{evt:i}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ut||Ye))){if(J.eventCanceled){this._onDrop();return}f.supportPointer?(re(c,"pointerup",m._disableDelayedDrag),re(c,"pointercancel",m._disableDelayedDrag)):(re(c,"mouseup",m._disableDelayedDrag),re(c,"touchend",m._disableDelayedDrag),re(c,"touchcancel",m._disableDelayedDrag)),re(c,"mousemove",m._delayedDragTouchMoveHandler),re(c,"touchmove",m._delayedDragTouchMoveHandler),f.supportPointer&&re(c,"pointermove",m._delayedDragTouchMoveHandler),m._dragStartTimer=setTimeout(o,f.delay)}else o()}},_delayedDragTouchMoveHandler:function(i){var t=i.touches?i.touches[0]:i;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){K&&qi(K),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var i=this.el.ownerDocument;ne(i,"mouseup",this._disableDelayedDrag),ne(i,"touchend",this._disableDelayedDrag),ne(i,"touchcancel",this._disableDelayedDrag),ne(i,"pointerup",this._disableDelayedDrag),ne(i,"pointercancel",this._disableDelayedDrag),ne(i,"mousemove",this._delayedDragTouchMoveHandler),ne(i,"touchmove",this._delayedDragTouchMoveHandler),ne(i,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(i,t){t=t||i.pointerType=="touch"&&i,!this.nativeDraggable||t?this.options.supportPointer?re(document,"pointermove",this._onTouchMove):t?re(document,"touchmove",this._onTouchMove):re(document,"mousemove",this._onTouchMove):(re(K,"dragend",this),re(se,"dragstart",this._onDragStart));try{document.selection?ai(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(i,t){if(mt=!1,se&&K){ye("dragStarted",this,{evt:t}),this.nativeDraggable&&re(document,"dragover",ou);var n=this.options;!i&&xe(K,n.dragClass,!1),xe(K,n.ghostClass,!0),J.active=this,i&&this._appendGhost(),me({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Oe){this._lastX=Oe.clientX,this._lastY=Oe.clientY,Qo();for(var i=document.elementFromPoint(Oe.clientX,Oe.clientY),t=i;i&&i.shadowRoot&&(i=i.shadowRoot.elementFromPoint(Oe.clientX,Oe.clientY),i!==t);)t=i;if(K.parentNode[Ce]._isOutsideThisEl(i),t)do{if(t[Ce]){var n=void 0;if(n=t[Ce]._onDragOver({clientX:Oe.clientX,clientY:Oe.clientY,target:i,rootEl:t}),n&&!this.options.dragoverBubble)break}i=t}while(t=Wo(t));Xo()}},_onTouchMove:function(i){if(tt){var t=this.options,n=t.fallbackTolerance,m=t.fallbackOffset,g=i.touches?i.touches[0]:i,f=ie&&Ct(ie,!0),c=ie&&f&&f.a,o=ie&&f&&f.d,h=Xt&&fe&&xr(fe),d=(g.clientX-tt.clientX+m.x)/(c||1)+(h?h[0]-Ki[0]:0)/(c||1),u=(g.clientY-tt.clientY+m.y)/(o||1)+(h?h[1]-Ki[1]:0)/(o||1);if(!J.active&&!mt){if(n&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<n)return;this._onDragStart(i,!0)}if(ie){f?(f.e+=d-(Ui||0),f.f+=u-(Gi||0)):f={a:1,b:0,c:0,d:1,e:d,f:u};var l="matrix(".concat(f.a,",").concat(f.b,",").concat(f.c,",").concat(f.d,",").concat(f.e,",").concat(f.f,")");ee(ie,"webkitTransform",l),ee(ie,"mozTransform",l),ee(ie,"msTransform",l),ee(ie,"transform",l),Ui=d,Gi=u,Oe=g}i.cancelable&&i.preventDefault()}},_appendGhost:function(){if(!ie){var i=this.options.fallbackOnBody?document.body:se,t=de(K,!0,Xt,!0,i),n=this.options;if(Xt){for(fe=i;ee(fe,"position")==="static"&&ee(fe,"transform")==="none"&&fe!==document;)fe=fe.parentNode;fe!==document.body&&fe!==document.documentElement?(fe===document&&(fe=Pe()),t.top+=fe.scrollTop,t.left+=fe.scrollLeft):fe=Pe(),Ki=xr(fe)}ie=K.cloneNode(!0),xe(ie,n.ghostClass,!1),xe(ie,n.fallbackClass,!0),xe(ie,n.dragClass,!0),ee(ie,"transition",""),ee(ie,"transform",""),ee(ie,"box-sizing","border-box"),ee(ie,"margin",0),ee(ie,"top",t.top),ee(ie,"left",t.left),ee(ie,"width",t.width),ee(ie,"height",t.height),ee(ie,"opacity","0.8"),ee(ie,"position",Xt?"absolute":"fixed"),ee(ie,"zIndex","100000"),ee(ie,"pointerEvents","none"),J.ghost=ie,i.appendChild(ie),ee(ie,"transform-origin",Er/parseInt(ie.style.width)*100+"% "+Ar/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(i,t){var n=this,m=i.dataTransfer,g=n.options;if(ye("dragStart",this,{evt:i}),J.eventCanceled){this._onDrop();return}ye("setupClone",this),J.eventCanceled||(ae=Go(K),ae.removeAttribute("id"),ae.draggable=!1,ae.style["will-change"]="",this._hideClone(),xe(ae,this.options.chosenClass,!1),J.clone=ae),n.cloneId=ai(function(){ye("clone",n),!J.eventCanceled&&(n.options.removeCloneOnHide||se.insertBefore(ae,K),n._hideClone(),me({sortable:n,name:"clone"}))}),!t&&xe(K,g.dragClass,!0),t?(yi=!0,n._loopId=setInterval(n._emulateDragOver,50)):(ne(document,"mouseup",n._onDrop),ne(document,"touchend",n._onDrop),ne(document,"touchcancel",n._onDrop),m&&(m.effectAllowed="move",g.setData&&g.setData.call(n,m,K)),re(document,"drop",n),ee(K,"transform","translateZ(0)")),mt=!0,n._dragStartId=ai(n._dragStarted.bind(n,t,i)),re(document,"selectstart",n),_t=!0,window.getSelection().removeAllRanges(),Dt&&ee(document.body,"user-select","none")},_onDragOver:function(i){var t=this.el,n=i.target,m,g,f,c=this.options,o=c.group,h=J.active,d=Zt===o,u=c.sort,l=pe||h,s,r=this,a=!1;if(bn)return;function p(O,I){ye(O,r,Be({evt:i,isOwner:d,axis:s?"vertical":"horizontal",revert:f,dragRect:m,targetRect:g,canSort:u,fromSortable:l,target:n,completed:y,onMove:function(F,z){return Jt(se,t,K,m,F,de(F),i,z)},changed:k},I))}function v(){p("dragOverAnimationCapture"),r.captureAnimationState(),r!==l&&l.captureAnimationState()}function y(O){return p("dragOverCompleted",{insertion:O}),O&&(d?h._hideClone():h._showClone(r),r!==l&&(xe(K,pe?pe.options.ghostClass:h.options.ghostClass,!1),xe(K,c.ghostClass,!0)),pe!==r&&r!==J.active?pe=r:r===J.active&&pe&&(pe=null),l===r&&(r._ignoreWhileAnimating=n),r.animateAll(function(){p("dragOverAnimationComplete"),r._ignoreWhileAnimating=null}),r!==l&&(l.animateAll(),l._ignoreWhileAnimating=null)),(n===K&&!K.animated||n===t&&!n.animated)&&(ft=null),!c.dragoverBubble&&!i.rootEl&&n!==document&&(K.parentNode[Ce]._isOutsideThisEl(i.target),!O&&it(i)),!c.dragoverBubble&&i.stopPropagation&&i.stopPropagation(),a=!0}function k(){Ee=ke(K),Ze=ke(K,c.draggable),me({sortable:r,name:"change",toEl:t,newIndex:Ee,newDraggableIndex:Ze,originalEvent:i})}if(i.preventDefault!==void 0&&i.cancelable&&i.preventDefault(),n=Ie(n,c.draggable,t,!0),p("dragOver"),J.eventCanceled)return a;if(K.contains(i.target)||n.animated&&n.animatingX&&n.animatingY||r._ignoreWhileAnimating===n)return y(!1);if(yi=!1,h&&!c.disabled&&(d?u||(f=ce!==se):pe===this||(this.lastPutMode=Zt.checkPull(this,h,K,i))&&o.checkPut(this,h,K,i))){if(s=this._getDirection(i,n)==="vertical",m=de(K),p("dragOverValid"),J.eventCanceled)return a;if(f)return ce=se,v(),this._hideClone(),p("revert"),J.eventCanceled||(nt?se.insertBefore(K,nt):se.appendChild(K)),y(!0);var x=Jn(t,c.draggable);if(!x||cu(i,s,this)&&!x.animated){if(x===K)return y(!1);if(x&&t===i.target&&(n=x),n&&(g=de(n)),Jt(se,t,K,m,n,g,i,!!n)!==!1)return v(),x&&x.nextSibling?t.insertBefore(K,x.nextSibling):t.appendChild(K),ce=t,k(),y(!0)}else if(x&&lu(i,s,this)){var w=St(t,0,c,!0);if(w===K)return y(!1);if(n=w,g=de(n),Jt(se,t,K,m,n,g,i,!1)!==!1)return v(),t.insertBefore(K,w),ce=t,k(),y(!0)}else if(n.parentNode===t){g=de(n);var S=0,M,L=K.parentNode!==t,R=!nu(K.animated&&K.toRect||m,n.animated&&n.toRect||g,s),$=s?"top":"left",D=Sr(n,"top","top")||Sr(K,"top","top"),T=D?D.scrollTop:void 0;ft!==n&&(M=g[$],Pt=!1,Qt=!R&&c.invertSwap||L),S=uu(i,n,g,s,R?1:c.swapThreshold,c.invertedSwapThreshold==null?c.swapThreshold:c.invertedSwapThreshold,Qt,ft===n);var E;if(S!==0){var C=ke(K);do C-=S,E=ce.children[C];while(E&&(ee(E,"display")==="none"||E===ie))}if(S===0||E===n)return y(!1);ft=n,zt=S;var b=n.nextElementSibling,A=!1;A=S===1;var _=Jt(se,t,K,m,n,g,i,A);if(_!==!1)return(_===1||_===-1)&&(A=_===1),bn=!0,setTimeout(au,30),v(),A&&!b?t.appendChild(K):n.parentNode.insertBefore(K,A?b:n),D&&Uo(D,0,T-D.scrollTop),ce=K.parentNode,M!==void 0&&!Qt&&(si=Math.abs(M-de(n)[$])),k(),y(!0)}if(t.contains(K))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ne(document,"mousemove",this._onTouchMove),ne(document,"touchmove",this._onTouchMove),ne(document,"pointermove",this._onTouchMove),ne(document,"dragover",it),ne(document,"mousemove",it),ne(document,"touchmove",it)},_offUpEvents:function(){var i=this.el.ownerDocument;ne(i,"mouseup",this._onDrop),ne(i,"touchend",this._onDrop),ne(i,"pointerup",this._onDrop),ne(i,"pointercancel",this._onDrop),ne(i,"touchcancel",this._onDrop),ne(document,"selectstart",this)},_onDrop:function(i){var t=this.el,n=this.options;if(Ee=ke(K),Ze=ke(K,n.draggable),ye("drop",this,{evt:i}),ce=K&&K.parentNode,Ee=ke(K),Ze=ke(K,n.draggable),J.eventCanceled){this._nulling();return}mt=!1,Qt=!1,Pt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wn(this.cloneId),wn(this._dragStartId),this.nativeDraggable&&(ne(document,"drop",this),ne(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dt&&ee(document.body,"user-select",""),ee(K,"transform",""),i&&(_t&&(i.cancelable&&i.preventDefault(),!n.dropBubble&&i.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(se===ce||pe&&pe.lastPutMode!=="clone")&&ae&&ae.parentNode&&ae.parentNode.removeChild(ae),K&&(this.nativeDraggable&&ne(K,"dragend",this),qi(K),K.style["will-change"]="",_t&&!mt&&xe(K,pe?pe.options.ghostClass:this.options.ghostClass,!1),xe(K,this.options.chosenClass,!1),me({sortable:this,name:"unchoose",toEl:ce,newIndex:null,newDraggableIndex:null,originalEvent:i}),se!==ce?(Ee>=0&&(me({rootEl:ce,name:"add",toEl:ce,fromEl:se,originalEvent:i}),me({sortable:this,name:"remove",toEl:ce,originalEvent:i}),me({rootEl:ce,name:"sort",toEl:ce,fromEl:se,originalEvent:i}),me({sortable:this,name:"sort",toEl:ce,originalEvent:i})),pe&&pe.save()):Ee!==yt&&Ee>=0&&(me({sortable:this,name:"update",toEl:ce,originalEvent:i}),me({sortable:this,name:"sort",toEl:ce,originalEvent:i})),J.active&&((Ee==null||Ee===-1)&&(Ee=yt,Ze=Ft),me({sortable:this,name:"end",toEl:ce,originalEvent:i}),this.save()))),this._nulling()},_nulling:function(){ye("nulling",this),se=K=ce=ie=nt=ae=oi=Qe=tt=Oe=_t=Ee=Ze=yt=Ft=ft=zt=pe=Zt=J.dragged=J.ghost=J.clone=J.active=null;var i=this.el;wi.forEach(function(t){i.contains(t)&&(t.checked=!0)}),wi.length=Ui=Gi=0},handleEvent:function(i){switch(i.type){case"drop":case"dragend":this._onDrop(i);break;case"dragenter":case"dragover":K&&(this._onDragOver(i),su(i));break;case"selectstart":i.preventDefault();break}},toArray:function(){for(var i=[],t,n=this.el.children,m=0,g=n.length,f=this.options;m<g;m++)t=n[m],Ie(t,f.draggable,this.el,!1)&&i.push(t.getAttribute(f.dataIdAttr)||hu(t));return i},sort:function(i,t){var n={},m=this.el;this.toArray().forEach(function(g,f){var c=m.children[f];Ie(c,this.options.draggable,m,!1)&&(n[g]=c)},this),t&&this.captureAnimationState(),i.forEach(function(g){n[g]&&(m.removeChild(n[g]),m.appendChild(n[g]))}),t&&this.animateAll()},save:function(){var i=this.options.store;i&&i.set&&i.set(this)},closest:function(i,t){return Ie(i,t||this.options.draggable,this.el,!1)},option:function(i,t){var n=this.options;if(t===void 0)return n[i];var m=Gt.modifyOption(this,i,t);typeof m<"u"?n[i]=m:n[i]=t,i==="group"&&Zo(n)},destroy:function(){ye("destroy",this);var i=this.el;i[Ce]=null,ne(i,"mousedown",this._onTapStart),ne(i,"touchstart",this._onTapStart),ne(i,"pointerdown",this._onTapStart),this.nativeDraggable&&(ne(i,"dragover",this),ne(i,"dragenter",this)),Array.prototype.forEach.call(i.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bi.splice(bi.indexOf(this.el),1),this.el=i=null},_hideClone:function(){if(!Qe){if(ye("hideClone",this),J.eventCanceled)return;ee(ae,"display","none"),this.options.removeCloneOnHide&&ae.parentNode&&ae.parentNode.removeChild(ae),Qe=!0}},_showClone:function(i){if(i.lastPutMode!=="clone"){this._hideClone();return}if(Qe){if(ye("showClone",this),J.eventCanceled)return;K.parentNode==se&&!this.options.group.revertClone?se.insertBefore(ae,K):nt?se.insertBefore(ae,nt):se.appendChild(ae),this.options.group.revertClone&&this.animate(K,ae),ee(ae,"display",""),Qe=!1}}};function su(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Jt(e,i,t,n,m,g,f,c){var o,h=e[Ce],d=h.options.onMove,u;return window.CustomEvent&&!Ye&&!Ut?o=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(o=document.createEvent("Event"),o.initEvent("move",!0,!0)),o.to=i,o.from=e,o.dragged=t,o.draggedRect=n,o.related=m||i,o.relatedRect=g||de(i),o.willInsertAfter=c,o.originalEvent=f,e.dispatchEvent(o),d&&(u=d.call(h,o,f)),u}function qi(e){e.draggable=!1}function au(){bn=!1}function lu(e,i,t){var n=de(St(t.el,0,t.options,!0)),m=Ko(t.el,t.options,ie),g=10;return i?e.clientX<m.left-g||e.clientY<n.top&&e.clientX<n.right:e.clientY<m.top-g||e.clientY<n.bottom&&e.clientX<n.left}function cu(e,i,t){var n=de(Jn(t.el,t.options.draggable)),m=Ko(t.el,t.options,ie),g=10;return i?e.clientX>m.right+g||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>m.bottom+g||e.clientX>n.right&&e.clientY>n.top}function uu(e,i,t,n,m,g,f,c){var o=n?e.clientY:e.clientX,h=n?t.height:t.width,d=n?t.top:t.left,u=n?t.bottom:t.right,l=!1;if(!f){if(c&&si<h*m){if(!Pt&&(zt===1?o>d+h*g/2:o<u-h*g/2)&&(Pt=!0),Pt)l=!0;else if(zt===1?o<d+si:o>u-si)return-zt}else if(o>d+h*(1-m)/2&&o<u-h*(1-m)/2)return du(i)}return l=l||f,l&&(o<d+h*g/2||o>u-h*g/2)?o>d+h/2?1:-1:0}function du(e){return ke(K)<ke(e)?1:-1}function hu(e){for(var i=e.tagName+e.className+e.src+e.href+e.textContent,t=i.length,n=0;t--;)n+=i.charCodeAt(t);return n.toString(36)}function pu(e){wi.length=0;for(var i=e.getElementsByTagName("input"),t=i.length;t--;){var n=i[t];n.checked&&wi.push(n)}}function ai(e){return setTimeout(e,0)}function wn(e){return clearTimeout(e)}Ni&&re(document,"touchmove",function(e){(J.active||mt)&&e.cancelable&&e.preventDefault()});J.utils={on:re,off:ne,css:ee,find:jo,is:function(i,t){return!!Ie(i,t,i,!1)},extend:Yc,throttle:Vo,closest:Ie,toggleClass:xe,clone:Go,index:ke,nextTick:ai,cancelNextTick:wn,detectDirection:Yo,getChild:St,expando:Ce};J.get=function(e){return e[Ce]};J.mount=function(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];i[0].constructor===Array&&(i=i[0]),i.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(J.utils=Be(Be({},J.utils),n.utils)),Gt.mount(n)})};J.create=function(e,i){return new J(e,i)};J.version=Kc;var ue=[],Ot,Cn,Sn=!1,Yi,Zi,Ci,It;function fu(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}return e.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?re(document,"dragover",this._handleAutoScroll):this.options.supportPointer?re(document,"pointermove",this._handleFallbackAutoScroll):n.touches?re(document,"touchmove",this._handleFallbackAutoScroll):re(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?ne(document,"dragover",this._handleAutoScroll):(ne(document,"pointermove",this._handleFallbackAutoScroll),ne(document,"touchmove",this._handleFallbackAutoScroll),ne(document,"mousemove",this._handleFallbackAutoScroll)),Tr(),li(),Zc()},nulling:function(){Ci=Cn=Ot=Sn=It=Yi=Zi=null,ue.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var m=this,g=(t.touches?t.touches[0]:t).clientX,f=(t.touches?t.touches[0]:t).clientY,c=document.elementFromPoint(g,f);if(Ci=t,n||this.options.forceAutoScrollFallback||Ut||Ye||Dt){Qi(t,this.options,c,n);var o=Xe(c,!0);Sn&&(!It||g!==Yi||f!==Zi)&&(It&&Tr(),It=setInterval(function(){var h=Xe(document.elementFromPoint(g,f),!0);h!==o&&(o=h,li()),Qi(t,m.options,h,n)},10),Yi=g,Zi=f)}else{if(!this.options.bubbleScroll||Xe(c,!0)===Pe()){li();return}Qi(t,this.options,Xe(c,!1),!1)}}},Ke(e,{pluginName:"scroll",initializeByDefault:!0})}function li(){ue.forEach(function(e){clearInterval(e.pid)}),ue=[]}function Tr(){clearInterval(It)}var Qi=Vo(function(e,i,t,n){if(i.scroll){var m=(e.touches?e.touches[0]:e).clientX,g=(e.touches?e.touches[0]:e).clientY,f=i.scrollSensitivity,c=i.scrollSpeed,o=Pe(),h=!1,d;Cn!==t&&(Cn=t,li(),Ot=i.scroll,d=i.scrollFn,Ot===!0&&(Ot=Xe(t,!0)));var u=0,l=Ot;do{var s=l,r=de(s),a=r.top,p=r.bottom,v=r.left,y=r.right,k=r.width,x=r.height,w=void 0,S=void 0,M=s.scrollWidth,L=s.scrollHeight,R=ee(s),$=s.scrollLeft,D=s.scrollTop;s===o?(w=k<M&&(R.overflowX==="auto"||R.overflowX==="scroll"||R.overflowX==="visible"),S=x<L&&(R.overflowY==="auto"||R.overflowY==="scroll"||R.overflowY==="visible")):(w=k<M&&(R.overflowX==="auto"||R.overflowX==="scroll"),S=x<L&&(R.overflowY==="auto"||R.overflowY==="scroll"));var T=w&&(Math.abs(y-m)<=f&&$+k<M)-(Math.abs(v-m)<=f&&!!$),E=S&&(Math.abs(p-g)<=f&&D+x<L)-(Math.abs(a-g)<=f&&!!D);if(!ue[u])for(var C=0;C<=u;C++)ue[C]||(ue[C]={});(ue[u].vx!=T||ue[u].vy!=E||ue[u].el!==s)&&(ue[u].el=s,ue[u].vx=T,ue[u].vy=E,clearInterval(ue[u].pid),(T!=0||E!=0)&&(h=!0,ue[u].pid=setInterval(function(){n&&this.layer===0&&J.active._onTouchMove(Ci);var b=ue[this.layer].vy?ue[this.layer].vy*c:0,A=ue[this.layer].vx?ue[this.layer].vx*c:0;typeof d=="function"&&d.call(J.dragged.parentNode[Ce],A,b,e,Ci,ue[this.layer].el)!=="continue"||Uo(ue[this.layer].el,A,b)}.bind({layer:u}),24))),u++}while(i.bubbleScroll&&l!==o&&(l=Xe(l,!1)));Sn=h}},30),Jo=function(i){var t=i.originalEvent,n=i.putSortable,m=i.dragEl,g=i.activeSortable,f=i.dispatchSortableEvent,c=i.hideGhostForTarget,o=i.unhideGhostForTarget;if(t){var h=n||g;c();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(d.clientX,d.clientY);o(),h&&!h.el.contains(u)&&(f("spill"),this.onSpill({dragEl:m,putSortable:n}))}};function er(){}er.prototype={startIndex:null,dragStart:function(i){var t=i.oldDraggableIndex;this.startIndex=t},onSpill:function(i){var t=i.dragEl,n=i.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var m=St(this.sortable.el,this.startIndex,this.options);m?this.sortable.el.insertBefore(t,m):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Jo};Ke(er,{pluginName:"revertOnSpill"});function tr(){}tr.prototype={onSpill:function(i){var t=i.dragEl,n=i.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Jo};Ke(tr,{pluginName:"removeOnSpill"});J.mount(new fu);J.mount(tr,er);var es=e=>Number.isInteger(Number(e)),Je=e=>{let i=0,t=e;for(;t?.previousElementSibling;)t=t.previousElementSibling,i++;return i},Si=(e,i,t)=>{const n=t.split("||");return at(at(i).map(m=>e.find(g=>{const f=n.find(c=>!!we(g,c));return f&&we(g,f)===m})).filter(Boolean).concat(e))},Fi=(e,i,t)=>{for(let n=0;n<e.length;n++)i.call(t,e[n],n)},ir=(e,i)=>{const t=[];return Fi(e,(n,m)=>t.push(i(n,m))),t},Xi={},ts=e=>{const i={className:"class"};if(Xi[e])return Xi[e];const t=(i[e]||e).replace(/^\d+/,"").replace(/[^a-zA-Z0-9_:-]/g,"");return Xi[e]=t,t},is=e=>e.replace(/\b\w/g,i=>i.toUpperCase()),gu=e=>window.JSON.parse(window.JSON.stringify(e)),mu=(e,i)=>i.filter(t=>!~e.indexOf(t)),Ae={capitalize:is,safeAttrName:ts,forEach:Fi,copyObj:gu,map:ir,subtract:mu,indexOfNode:Je,isInt:es,get:we,orderObjectsBy:Si},ge={getStyle:(e,i=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(e,null):e.currentStyle&&(t=e.currentStyle),i?t[i]:t},fadeOut:(e,i=250)=>{const t=1/(i/60);e.style.opacity=1,(function n(){const m=Number(e.style.opacity)-t;m>0?(e.style.opacity=m,window.requestAnimationFrame(n)):e.remove()})()},slideDown:(e,i=250,t=!1)=>{e.style.display="block";const n=ge.getStyle(e),m=Number.parseInt(n.height,10),g=m/(i/60);e.style.height="0px",(function f(){const c=Number.parseFloat(e.style.height),o=c+g;c<m?(e.style.height=`${o}px`,window.requestAnimationFrame(f)):(e.style.height="auto",t&&t(e))})()},slideUp:(e,i=250,t=!1)=>{const n=ge.getStyle(e),m=Number.parseInt(n.height,10),g=n.overflow;e.style.overflow="hidden",e.style.height=`${m}px`;const f=n.minHeight;e.style.minHeight="auto";const c=parseFloat(m/(i/60)).toFixed(2);(function o(){const h=Number.parseInt(e.style.height,10)-c;h>0?(e.style.height=`${h}px`,window.requestAnimationFrame(o)):(e.style.overflow=g,e.style.display="none",e.style.minHeight=f,delete e.style.height,t&&t(e))})()},slideToggle:(e,i=250,t=ge.getStyle(e,"display")==="none")=>{t?ge.slideDown(e,i):ge.slideUp(e,i)}},bt="f-autocomplete",vu=`${bt}-display-field`,nr=`${bt}-list`,$t="highlight-component",xi=`${nr}-item`,yu=(e,i)=>{const t=e.reduce((n,m)=>n+(m===i),0);return t>1?`(${t})`:""},ns=["config.label","config.controlId"],bu=["config.legend","name"],wu=[...ns,...bu],Ji=e=>ns.reduce((i,t)=>i||e.get(t),null),Mr=e=>wu.reduce((i,t)=>i||e.get(t),null)||je(e.name),Cu=new Map([["condition.source",Ji],["if.condition.source",Ji],["if.condition.target",Ji],["then.condition.target",Mr],["condition.target",Mr]]),rs=({id:e,...i},t)=>{const{name:n,label:m}=i;return n?Cu.get(t)(i):m},Su=({selectedId:e,...i})=>(i.value===e&&(i.selected=!0),i),en=e=>(e.classList.contains(xi)||(e=e.parentElement),e),os=({value:e,textLabel:i,htmlLabel:t,componentType:n,depth:m=0},g)=>{const f={tag:"li",children:t,dataset:{value:e,label:i},className:[xi,`${xi}-depth-${m}`,`component-type-${n}`],action:{mousedown:({target:c})=>{c=en(c),g.setValue(c),g.selectOption(c),g.hideList()},mouseover:({target:c})=>{c=en(c),g.removeHighlight(),g.highlightComponent(c)},mouseleave:({target:c})=>{c=en(c),g.removeHighlight()}}};return V.create(f)},xu=(e,i)=>{const t=e.data.options.map((n,m)=>{const g=`${e.address}.options[${m}]`,f=n.label,c=n.label;return os({value:g,textLabel:f,htmlLabel:c,componentType:"option",depth:1},i)});return V.create({tag:"ul",attrs:{className:[nr,"options-list"]},children:t})},Eu=e=>{const i=e.value,t=[],n=oe.flatList();return Object.entries(n).reduce((m,[g,f])=>{const c=rs(f,e.key);if(c){const o=f.name,h={tag:"span",content:` ${je(o)}`,className:"component-type"},d=`${o}.${c}`;t.push(d);const u=yu(t,d),l={tag:"span",content:u,className:"component-label-count"},s=[`${c} `,l,h],r=[c,u].join(" ").trim();if(f.isCheckable){const p=xu(f,e);s.push(p)}const a=Su({value:g,textLabel:r,htmlLabel:s,componentType:o,selectedId:i});m.push(os(a,e))}return m},[])},Au=class{lastCache=Date.now();optionsCache=null;constructor({key:e,value:i,className:t,onChange:n=mn}){this.key=e,this.className=[t||this.key.replace(/\./g,"-")].flat(),this.value=i,this.onChange=n||mn,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,i){if(i in e)return e[i];if(i in e.dom){const t=e.dom[i];return typeof t=="function"?t.bind(e.dom):t}},set(e,i,t){return i in e?e[i]=t:e.dom[i]=t,!0}})}get isAddress(){return Te(this.value)}get valueComponent(){return Te(this.value)&&oe.getAddress(this.value)}build(){const e=t=>{const n=this.list,m=this.getActiveOption();let g=new Map([[38,()=>{const f=this.getPreviousOption(m);f&&this.selectOption(f)}],[40,()=>{const f=this.getNextOption(m);f&&this.selectOption(f)}],[13,()=>{m&&(this.selectOption(m),this.setValue(m),n.style.display==="none"?this.showList(m):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return g||(g=()=>!1),g()},i={focus:({target:t})=>{this.updateOptions(),t.parentElement.classList.add(`${bt}-focused`);const n=V.toggleElementsByStr(this.list.querySelectorAll(`.${xi}-depth-0`),t.value);t.addEventListener("keydown",e);const m=this.list.querySelector(".active-option")||n[0];this.showList(m)},blur:({target:t})=>{t.parentElement.classList.remove(`${bt}-focused`),t.removeEventListener("keydown",e),this.hideList()},input:t=>{const{value:n}=t.target,m=V.toggleElementsByStr(this.list.querySelectorAll("li"),n);if(n.length===0&&this.clearValue(),m.length===0)this.hideList();else{const g=this.getActiveOption()||m[0];this.showList(g)}this.setValue({dataset:{label:n,value:n}})}};return this.displayField=V.create({tag:"input",autocomplete:"off",action:i,attrs:{type:"text",className:vu,value:this.label||this.value,placeholder:Z.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:bt,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:nr}}),this.clearButton=V.create({tag:"span",content:V.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=V.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[bt,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Te(this.value))return this.value;const e=this.value&&oe.getAddress(this.value);return e&&rs(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const i=Date.now();(i-this.lastCache>Hn*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=i),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=Eu(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:i}=this.displayField,t=this.displayField.closest(".formeo-stage").getBoundingClientRect(),n=this.displayField.getBoundingClientRect(),m={position:"absolute",top:`${n.y+e-t.y}px`,left:`${n.x+window.scrollX-t.x+2}px`,width:`${i}px`};Object.assign(this.list.style,m)}showList(e,i=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),ge.slideDown(i,st)}hideList(e=this.list){ge.slideUp(e,st),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const i=e.querySelector(".active-option");return i?.style.display!=="none"?i:null}getPreviousOption(e){let i=e;do i=i?i.previousSibling:null;while(i!=null&&i.style.display==="none");return i}getNextOption(e){let i=e;do i=i?i.nextSibling:null;while(i!=null&&i.style.display==="none");return i}selectOption(e,i=this.list){const t=i.querySelectorAll("li");for(const n of t){const{dataset:{value:m}}=n;n.classList.remove("active-option"),Te(m)&&oe.getAddress(m)?.dom?.classList.remove($t)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName($t);for(const i of e)i.classList.remove($t)}highlightComponent(e){const{dataset:{value:i}}=e;if(Te(i)){const{componentAddress:t,isOptionAddress:n,optionIndex:m}=lt(i).reduce((f,c)=>c==="options"?(f.isOptionAddress=!0,f):f.isOptionAddress?(f.optionIndex=+c,f):(f.componentAddress.push(c),f),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=oe.getAddress(t);g?.dom&&(g.dom.classList.add($t),n&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[m]?.classList.add($t))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:i,value:t}=e.dataset;this.displayField.value=i,this.hiddenField.value=t,this.value=t,this.clearButton.classList.toggle("hidden",!t.length),this.onChange?.({target:this.hiddenField})}},ss=e=>Z.get(`${e}.placeholder`)||je(mi(e)),rr=e=>e.replaceAll(".","-"),$r=new Map([["config.helpText",(...e)=>Lr(...e)],["config.tooltip",(...e)=>Lr(...e)]]);function tn({key:e,value:i,type:t="text",checked:n}){const m={tag:"input",attrs:{type:t,value:i,placeholder:ss(e)},className:[rr(e)],config:{}};return n&&(m.attrs.checked=!0),m}function Lr({key:e,value:i}){return{tag:"textarea",attrs:{placeholder:ss(e)},className:[rr(e)],config:{},textContent:i}}function ze(e){const i=Z.get(e);if(i)return i;const t=mi(e);return Z.get(t)||je(t)}var xt={autocomplete:(...e)=>new Au(...e).createProxy(),string:({key:e,value:i})=>$r.has(e)?$r.get(e)({key:e,value:i}):tn({key:e,value:i}),boolean:({key:e,value:i})=>tn({key:e,value:i,type:e==="selected"?"radio":"checkbox",checked:!!i}),number:({key:e,value:i})=>tn({key:e,value:i,type:"number"}),array:({key:e,value:i})=>({tag:"select",attrs:{placeholder:ze(`placeholder.${e}`)},className:[rr(e)],options:i}),object:e=>Object.entries(e).map(([i,t])=>xt[V.childType(t)]({key:i,value:t}))},ku={boolean:(e,i)=>({click:({target:t})=>{if(t.type==="radio"){const n=i.data.options.map(m=>({...m,selected:!1}));i.set("options",n)}i.set(e,t.checked),i.updatePreview()}}),string:(e,i)=>({input:({target:{value:t}})=>{i.set(e,t),i.debouncedUpdatePreview()}}),number:(e,i)=>({input:({target:{value:t}})=>{i.set(e,Number(t)),i.debouncedUpdatePreview()}}),array:(e,i)=>({change:({target:{value:t}})=>{i.set(e,t),i.debouncedUpdatePreview()}}),object:()=>({})},as="hidden-property",Tu="hidden-option",nn=/\.options\[\d+\]$/,Mu={"if-sourceProperty":ri(ni,gr,mr),"if-targetProperty":ri(ni),"then-targetProperty":ri(ni,gr,mr),...Object.entries(zl).reduce((e,[i,t])=>(e[`if-${i}`]=t,e[`then-${i}`]=t,e),{})},ls={assignment:Lt,comparison:Lt,logical:Lt,source:({key:e,value:i,onChange:t,conditionType:n})=>xt.autocomplete({key:`${n}.condition.${e}`,value:i,onChange:t,className:`condition-${e}`}),sourceProperty:Lt,targetProperty:Lt,target:e=>ls.source(e),value:({key:e,value:i,onChange:t},n)=>{const m=xt.string({key:`condition.${e}`,value:i});return m.action={input:t},m}};function $u({key:e,value:i,conditionType:t}){return Object.entries(Mu[`${t}-${e}`]||{}).map(([n,m])=>Lu({fieldName:e,fieldValue:i,key:n,optionValue:m}))}function Lu({fieldName:e,fieldValue:i,key:t,optionValue:n}){return{label:Z.get(`${e}.${t}`)||je(t).toLowerCase(),value:n,selected:n===i}}function Lt({key:e,value:i,onChange:t,conditionType:n}){const m=$u({key:e,value:i,conditionType:n}),g=xt.array({key:`condition.${e}`,value:m});return g.action={change:t},g}var Ru=e=>!e?.classList.contains(as),_u={sourceProperty:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i.value;return _r(!!i.value.match(nn),t),!n},comparison:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i.value,m=!!i.value.match(nn);return!n||m||t.value!=="value"},assignment:e=>{const i=e.get("target"),t=e.get("targetProperty");return!i.value||t.value.startsWith("is")},targetProperty:e=>{const i=e.get("target"),t=e.get("targetProperty");return _r(!!i.value.match(nn),t),!Gl(i.value)},target:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i?.value;return t&&!n?!0:t&&t?.value!=="value"},value:e=>{const i=e.get("target"),t=e.get("targetProperty");return t===void 0?!1:i&&!i.value||!Ru(e.get("comparison"))||t.value===cs?!0:t.value.startsWith("is")}},Rr=e=>{for(const[i,t]of e){const n=!!_u[i]?.(e)||!1;t.classList.toggle(as,n)}},cs="isChecked",rn=e=>e.value.endsWith("Checked"),_r=(e,i)=>{if(e&&rn(i))return null;const t=Array.from(i.querySelectorAll("option")),n=[];for(const m of t){const g=rn(m),f=e?!g:g;f&&n.push(m.value),m.classList.toggle(Tu,f)}n.includes(i.value)&&(i.value=e?cs:t.find(m=>!rn(m))?.value||i.value)};function Ou(e,i=Fl){return i.reduce((t,n)=>(e[n]!==void 0&&t.push([n,e[n]]),t),[])}var Iu=class{constructor({conditionValues:e,conditionType:i,conditionCount:t,index:n},m){this.values=new Map(Ou(e)),this.conditionType=i,this.parent=m,this.baseAddress=`${m.address}.${i}`,this.fields=new Map,this.conditionCount=t,this.index=n,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=oe.getAddress(this.baseAddress);e.splice(this.index,1),oe.setAddress(this.baseAddress,e),ge.slideUp(this.dom,st,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:Z.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[t,n]of this.values){const m=o=>this.onChangeCondition({key:t,target:o.target}),g={key:t,value:n,conditionType:this.conditionType,onChange:m},f=ls[t](g,this.values),c=f.dom||V.create(f);this.fields.set(t,f.dom?f:c),e.push(c)}const i={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return V.create(i)}generateConditionTypeActionButtons(){const e=[],i="manage-condition-type",t=g=>`${g}-condition-type`,n=V.btnTemplate({title:Z.get(`remove${this.conditionType}Condition`),className:[i,t("remove")],content:V.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(n);const m=V.btnTemplate({title:Z.get(`add${this.conditionType}Condition`),className:[i,t("add")],content:V.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),f={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(f)}}});return e.push(m),e}get value(){return Array.from(this.fields).reduce((e,[i,t])=>(e[i]=t.value,e),{})}processUiState(){Rr(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=gi(e=>{Q.formeoUpdated(e),oe.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:i})=>{const t={changedProperty:e,dataPath:this.address,value:this.value,src:i};Rr(this.fields),this.updateDataDebounced(t)}},Du=new Map([["attrs",({itemKey:e})=>e],["options",({itemKey:e,key:i})=>`${e}.${i}`]]),us=(e,i)=>{if(i.controlId==="select"){const t=i.editPanels.get("options"),[n,m]=e?fi:Bl,g=t.data.map(({[n]:f,...c})=>({[m]:f,...c}));t.setData(g)}},Nu=new Map([["attrs-multiple",e=>({change:({target:i})=>{e.field.controlId==="select"&&us(i.checked,e.field)}})]]),Rt=class{constructor({key:e,index:i,field:t,panel:n,data:m}){this.field=t,this.itemKey=e,this.itemIndex=i,this.panel=n,this.panelName=n.name,this.isDisabled=t.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&t.config.panels[this.panelName].hideDisabled,this.isLocked=t.isLockedProp(e,this.panelName),this.address=`${t.indexName}.${t.id}.${e}`,this.itemSlug=yr(e),this.conditionTypeWrap=new Map,m!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,m);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=V.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?Si(Object.entries(e),fi,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let i=this.conditionTypeWrap.get(e);return i||(i=V.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,i),i)}itemInputs(){const e=V.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([i,t])=>this.panelName==="conditions"?this.generateConditionFields(i,t):this.itemInput(i,t))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,i)=>{const t=this.findOrCreateConditionTypeWrap(e);let n=i;if(!n){const[g]=qn()[e],f=t.children.length;e==="if"&&(g.logical="||"),n={conditionValues:g,conditionCount:f,index:f}}const m=new Iu({conditionType:e,...n},this);return t.appendChild(m.dom),m};removeConditionType=(e,i)=>{const t=this.conditionTypeWrap.get(e).children[i];t.destroy(),t.dom.remove()};generateConditionFields=(e,i)=>(this.conditions=new Map,i.forEach((t,n)=>{const m=this.addConditionType(e,{index:n,conditionCount:i.length,conditionValues:t});this.conditions.set(n,m)}),this.findOrCreateConditionTypeWrap(e));removeItem=()=>{this.field.remove(this.itemKey),this.dom.remove(),this.panel.updateProps(),this.field.debouncedUpdatePreview?.()};get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{ge.slideUp(this.dom,333,this.removeItem)},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:V.icon("remove")},i=this.panelName==="options"&&{tag:"button",attrs:{type:"button",className:"prop-order prop-control",style:"display: inline-block; right: auto",title:Z.get("reorderOption")||"Drag to reorder","aria-label":Z.get("reorderOption")||"Drag to reorder"},content:V.icon("move-vertical")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e,i].filter(Boolean)}}getConfigAttrOptions(e){const i=e.split(".").pop(),t=this.field.config?.attrs?.[i];return Array.isArray(t)?t:null}itemInput(e,i){if(this.isDisabled)return null;let t=V.childType(i)||"string",n=i;if(this.panelName==="attrs"){const s=this.getConfigAttrOptions(e);s&&(n=s.map(r=>({...r,selected:r.value===i})),t="array")}const m=Du.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,g=m.split(".").filter(Number.isNaN).join(".")||e,f=xt[t]({key:e,value:n}),c=`${this.field.shortId}-${yr(m).replaceAll(/-\d+-(selected)/g,"-$1")}`,o={label:this.panelName!=="options"&&ze(g),labelAfter:!1,inputWrap:["f-input-wrap",this.isLocked&&"locked-prop",this.isDisabled&&"disabled-prop"].filter(Boolean).join(" ")},h={name:f.attrs.type==="checkbox"?`${c}[]`:c};h.disabled=this.isDisabled,h.readonly=this.isLocked;const d=Nu.get(this.itemSlug)?.(this),u=fc(ku[t](m,this.field),d||{}),l=De(xt[t]({key:e,value:n}),{action:u,attrs:h,config:o});return fi.includes(e)?{className:"f-addon",children:l}:l}},Fu={multiple:(e,i)=>{us(!!e,i)}},zu=[{label:ze("config.label"),value:"label"},{label:ze("config.hideLabel"),value:"hideLabel"},{label:ze("config.helpText"),value:"helpText"},{label:ze("config.labelAfter"),value:"labelAfter"},{label:ze("config.disableHtmlLabel"),value:"disableHtmlLabel"},{label:ze("config.tooltip"),value:"tooltip"}],Pu={label:"New Field",hideLabel:!1,helpText:"",labelAfter:!1,disableHtmlLabel:!1,tooltip:""},Hu=class{constructor(e,i,t){this.type=V.childType(e),this.name=i,this.component=t,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:Z.get(`panel.label.${this.name}`)},attrs:{className:`${wo} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,m)=>{const g=this.type==="array",f=n[0],c=g?`[${m}]`:`.${n[0]}`,o=g?n:{[n[0]]:n[1]},h=`${this.name}${c}`,d=this.component.isDisabledProp(h,this.name),u=Wl.get(this.name)?.has(f)??!0;return d||!u?null:new Rt({key:h,data:o,field:this.component,index:m,panel:this})}).filter(Boolean);const i={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},content:this.editPanelItems},t=V.create(i);return this.name==="options"&&(this.sortable?.destroy(),this.sortable=J.create(t,{animation:150,handle:".prop-order",draggable:".prop-wrap",forceFallback:!0,onEnd:({oldIndex:n,newIndex:m})=>window.requestAnimationFrame(()=>this.moveOption(n,m))})),t}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}moveOption=(e,i)=>{const t=this.component.get("options");if(!Array.isArray(t)||!Number.isInteger(e)||!Number.isInteger(i)||e===i||e<0||e>=t.length||i<0||i>=t.length)return;const n=[...t],[m]=n.splice(e,1);n.splice(i,0,m),this.component.set("options",n),this.updateProps(),this.component.debouncedUpdatePreview?.()};createEditButtons(){const e=this.name,i={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition,config:this.addConfiguration},t=[];if(e==="conditions"){Z.current&&!Z.current.clearAll&&Z.put("clearAll","Clear All");const g={...V.btnTemplate({content:[V.icon("bin"),Z.get("clearAll")],title:Z.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};t.push(g)}const n=Z.get(`panelEditButtons.${e}`)||`+ Add ${je(e)}`,m={...V.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:g=>{const f={btnCoords:V.coords(g.target),addAction:i[e]};e==="attrs"&&(f.isDisabled=this.component.isDisabledProp,f.isLocked=this.component.isLockedProp,f.message={attr:Z.get(`action.add.${e}.attr`),value:Z.get(`action.add.${e}.value`)});const c=je(e),o=new globalThis.CustomEvent(`onAdd${c}`,{detail:f});ve.add[e](f),document.dispatchEvent(o)}}};return t.push(m),{className:"panel-action-buttons",content:t}}addAttribute=(e,i)=>{let t=i;const n=ts(e),m=`attrs.${n}`;Z.current[m]||Z.put(m,is(e)),typeof t=="string"&&["true","false"].includes(t)&&(t=JSON.parse(t)),this.component.set(`attrs.${e}`,t),Fu[n]?.(t,this.component);const g=`${this.component.name}-attrs-${n}`,f=Array.from(this.props.children).find(o=>o.classList.contains(g)),c=new Rt({key:m,data:{[n]:t},field:this.component,panel:this});f?f.replaceWith(c.dom):this.props.appendChild(c.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,i=this.component.get("options"),t=e==="select"?"option":e,n=Z.get("newOptionLabel",{type:t})||"New Option",m=`${this.name}[${this.data.length}]`,g=i[i.length-1],f={...i.length?g:{},label:n};e!=="button"&&(f.value=No(n));const c=new Rt({key:m,data:f,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(c),this.props.appendChild(c.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const i=`conditions[${this.component.get("conditions").length}]`,t=new Rt({key:i,data:e.template,field:this.component,panel:this});this.props.appendChild(t.dom),this.component.set(i,e.template),this.component.resizePanelWrap()};addConfiguration=()=>{const e=this.component.get("config");new Ss({className:"config-item-dialog",content:[{tag:"select",config:{label:Z.get("selectConfigKey")||"Select Configuration Key"},attrs:{name:"selectConfigKey",required:!0,className:"config-key-select"},options:zu.filter(i=>!(i.value in e))}],onConfirm:i=>{const t=i.get("selectConfigKey").trim(),n=`config.${t}`;if(t){const m=new Rt({key:n,data:Pu[t],field:this.component,panel:this});this.editPanelItems.push(m),this.props.appendChild(m.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()}}}).open()};clearAllItems=()=>{const e=this.type==="array"?[]:{},i={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};ve.remove[this.name](i);const t=je(this.name),n=new globalThis.CustomEvent(`onRemove${t}`,{detail:i});document.dispatchEvent(n)};setData(e){this.component.set(this.name,e),this.updateProps()}},Or=Object.freeze({type:"field",displayType:"slider"}),ei=e=>({transform:`translateX(${e?`${e}px`:0})`}),ds=class{constructor(e){this.opts=De(Or,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const i=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const t=new window.ResizeObserver(([{contentRect:{width:m}}])=>{this.currentWidth!==m&&(this.toggleTabbedLayout(),this.currentWidth=m,this.nav.setTranslateX(this.activePanelIndex,!1))}),n=window.setTimeout(()=>{t.observe(i),window.clearTimeout(n)},Hn)}getPanelDisplay(){const e=this.panelsWrap,i=Number.parseInt(V.getStyle(e,"width"),10)>390?"tabbed":"slider",t=this.opts.displayType==="auto";return this.panelDisplay=t?i:this.opts.displayType||Or.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=V.create({className:"panels",content:this.opts.panels.map(({config:i,...t})=>t)});return this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}createPanelNavLabels(){const e=this.opts.panels.map(n=>({tag:"h5",action:{click:m=>{const g=Je(m.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:n.config.label})),i={className:"panel-labels",content:{content:e}},[t]=e;return t.className="active-tab",V.create(i)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:Z.get("controlGroups.nextGroup"),type:"button"},action:{click:t=>this.nav.nextGroup(t)},content:V.icon("triangle-right")},i={tag:"button",attrs:{className:"prev-group",title:Z.get("controlGroups.prevGroup"),type:"button"},action:{click:t=>this.nav.prevGroup(t)},content:V.icon("triangle-left")};return V.create({tag:"nav",attrs:{className:"panel-nav"},content:[i,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},i=this.currentPanel.parentElement,t=this.labels.firstChild,n=t.children,m=this.currentPanel.parentElement.childNodes;this.activePanelIndex=Je(this.currentPanel);let g={nav:0,panel:0},f={...g};e.groupChange=h=>(this.activePanelIndex=h,this.currentPanel=m[h],V.removeClasses(m,"active-panel"),V.removeClasses(n,"active-tab"),this.currentPanel.classList.add("active-panel"),n[h].classList.add("active-tab"),this.currentPanel);const c=h=>({nav:-t.offsetWidth*h,panel:-i.offsetWidth*h}),o=({offset:h,reset:d,duration:u=st,animate:l=!this.isTabbed})=>{const s=[ei(f.panel),ei(h.panel)],r=[ei(f.nav),ei(this.isTabbed?0:h.nav)];if(d){const[y]=s,[k]=r;s.push(y),r.push(k)}const a={easing:"ease-in-out",duration:l?u:0,fill:"forwards"},p=i.animate(s,a);t.animate(r,a);const v=()=>{p.removeEventListener("finish",v),d||(f=h)};p.addEventListener("finish",v)};return e.setTranslateX=(h=this.activePanelIndex,d=!0)=>{g=c(h),o({offset:g,animate:d})},e.refresh=(h=this.activePanelIndex)=>{this.activePanelIndex!==h&&e.groupChange(h),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const h=this.activePanelIndex+1;if(h!==m.length){const d=m[h];g={nav:-t.offsetWidth*h,panel:-d.offsetLeft},o({offset:g}),e.groupChange(h)}else g={nav:f.nav-8,panel:f.panel-8},o({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const h=this.activePanelIndex-1,d=m[h];g={nav:-t.offsetWidth*h,panel:-d.offsetLeft},o({offset:g}),e.groupChange(h)}else g={nav:8,panel:8},o({offset:g,reset:!0})},e}},Bu="modulepreload",Wu=function(e){return"/formeo/"+e},Ir={},vt=function(i,t,n){let m=Promise.resolve();if(t&&t.length>0){let h=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};const f=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),o=c?.nonce||c?.getAttribute("nonce");m=h(t.map(d=>{if(d=Wu(d,n),d in Ir)return;Ir[d]=!0;const u=d.endsWith(".css"),l=u?'[rel="stylesheet"]':"";if(n)for(let r=f.length-1;r>=0;r--){const a=f[r];if(a.href===d&&(!u||a.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${l}`))return;const s=document.createElement("link");if(s.rel=u?"stylesheet":Bu,u||(s.as="script"),s.crossOrigin="",s.href=d,o&&s.setAttribute("nonce",o),document.head.appendChild(s),u)return new Promise((r,a)=>{s.addEventListener("load",r),s.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${d}`)))})}))}function g(f){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=f,window.dispatchEvent(c),!c.defaultPrevented)throw f}return m.then(f=>{for(const c of f||[])c.status==="rejected"&&g(c.reason);return i().catch(g)})},on=null,sn=ri(ni),zi=class extends Qn{constructor(e,i={}){const t={...i,id:i.id||Me()};super(e,t),this.id=t.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config={...t.config,...oe[`${this.name}s`].config},this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach(([e,i])=>{this.addEventListener(e,i)})}addEventListener(e,i){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(i)}removeEventListener(e,i){if(!this.eventListeners?.has(e))return;const t=this.eventListeners.get(e),n=t.indexOf(i);n>-1&&t.splice(n,1)}dispatchComponentEvent(e,i={}){const t={component:this,target:this,type:e,timestamp:Date.now(),...i};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(n=>{try{typeof n=="function"&&n(t)}catch(m){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,m)}}),t}set(e,i){const t=this.get(e),n=super.set(e,i);return t!==i&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:t,newValue:i}),n}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const c=lt(e),o=c.pop(),h=this.get(c),d=h?.[o];return Array.isArray(h)?es(o)?(h.splice(Number(o),1),this.dispatchRemovedPath(e,d)):this.set(c,h.filter(u=>u!==o)):(delete h[o],this.dispatchRemovedPath(e,d)),h}if(this.name==="stage")return null;const i=this.parent,t=this.children,n=`${i.name}s.${i.id}.children`,m=[...oe.getAddress(n)||[]];this.dispatchComponentEvent("onRemove",{path:e,parent:i,children:[...t]}),Fi(t,c=>c.remove()),this.dom.remove(),Ul(oe.getAddress(n),this.id),i.children.length||i.emptyClass(),i.name==="row"&&i.autoColumnWidths();const g={row:Un,column:Gn,field:Kn}[this.name];g&&Q.formeoUpdated({componentId:this.id,componentType:this.name,parent:i},g);const f=oe[`${this.name}s`].delete(this.id);return Q.formeoUpdated({entity:this,componentId:this.id,componentType:this.name,dataPath:`${i.name}s.${i.id}`,changePath:n,value:[...oe.getAddress(n)||[]],previousValue:m,changeType:"removed"}),f};dispatchRemovedPath=(e,i)=>{const t=Array.isArray(e)?e.join("."):e;Q.formeoUpdated({entity:this,dataPath:this.address,changePath:`${this.address}.${t}`,value:void 0,previousValue:i,changeType:"removed",data:this.data})};empty(){const e=this.children.map(i=>(i.remove(),i));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{oe.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:i})=>{this.dom.classList.remove(...e),oe.stages.active.dom.classList.remove(`active-hover-${this.name}`),i.removeAttribute("style")}},children:[{...V.btnTemplate({content:V.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>V.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[V.icon(`handle-${this.name}`),je(this.name)].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const i=this.dom,t="editing",n=`${t}-${this.name}`,m=this.dom.querySelector(`.${this.name}-edit`);ge.slideToggle(m,333,e),this.name==="field"&&(ge.slideToggle(this.preview,333,!e),i.parentElement.classList.toggle(`column-${n}`,e)),i.classList.toggle(t,e),i.classList.toggle(n,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(m=`handle-${this.name}`)=>({...V.btnTemplate({content:V.icon(m)}),className:["component-handle"]}),move:(m="move")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-move"],meta:{id:"move"}}),edit:(m="edit")=>({...V.btnTemplate({content:V.icon(m)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(m="remove")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{ge.slideUp(this.dom,333,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(m="copy")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:i,disabled:t}=this.config.actionButtons,n=i.filter(m=>!t.includes(m)).map(m=>e[m]?.()||m);return this.actionButtons=n,this.actionButtons}get index(){return Je(this.dom)}removeClasses=e=>{const i={string:()=>this.dom.classList.remove(e),array:()=>e.map(t=>this.dom.classList.remove(t))};return i.object=i.string,i[V.childType(e)](this.dom)};get parentType(){return Ll.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const i=this.dom.closest(`.${zn[e]}`);return i&&V.asComponent(i)}get children(){if(!this.dom)return[];const e=this.domChildren,i=pr.get(this.name);return ir(e,t=>oe.getAddress(`${i}s.${t.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(i=>this.addChild({id:i}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},i=this.domChildren.length){let t=e;typeof e!="object"&&(t={id:t});const n=this.dom.querySelector(".children"),{id:m=Me()}=t,g=pr.get(this.name);if(!g)return null;const f=`${g}s`,c=oe.getAddress(`${f}.${m}`)||oe[f].add(m,t);i>=n.children.length?n.appendChild(c.dom):n.children[i].before(c.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:c,child:c,index:i}),c.dispatchComponentEvent("onAdd",{parent:this,target:c,index:i,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:c});const o=c.get("children");return o?.length&&c.loadChildren(o),this.removeClasses("empty"),this.saveChildOrder(),c}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:i})=>i);return this.set("children",e),e};onAdd({from:e,to:i,item:t,newIndex:n}){e.classList.contains("control-group")||(e=e.parentElement);const m=be(e),g=be(i.parentElement),f=()=>{this.saveChildOrder(),this.removeClasses("empty")},c=new Map([[-2,()=>{const h=this.addChild({},n).addChild();return h.addChild.bind(h)}],[-1,()=>{const h=this.addChild({},n);return h.addChild.bind(h)}],[0,()=>this.addChild.bind(this)],[1,h=>{const d=Je(this.dom);return()=>this.parent.addChild(h,d+1)}],[2,h=>()=>this.parent.parent.addChild(h)]]),o={controls:async()=>{if(!on){const{default:p}=await vt(async()=>{const{default:v}=await Promise.resolve().then(()=>dd);return{default:v}},void 0);on=p}const{controlData:{meta:{id:h},...d}}=on.get(t.id);Ii(d,"config.controlId",h);const u=h.startsWith("layout-"),l=u?h.replace(/^layout-/,""):"field",s=u?{}:d,r=we({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${l}`),a=c.get(r)();return V.remove(t),a(s,n)},row:()=>(c.get({stage:-1,row:0,column:1}[g])||gn)()?.({id:t.id},n),column:()=>(c.get({stage:-2,row:-1}[g])||gn)()?.(t.id)}[m]?.(t,n);return this.dispatchComponentEvent("onAdd",{from:e,to:i,item:t,newIndex:n,fromType:m,toType:g,addedComponent:o,addedVia:"dragDrop"}),f(),o}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(Ge)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:i}})=>{e?.classList.remove(`hovering-${be(e)}`),i?.classList.remove(`hovering-${be(i)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&V.onRender(this.dom,e.onRender)}set config(e){const i=we(e,"all"),t=we(this.data,"config.controlId"),n=[i,t&&we(e,t),we(e,this.id)].reduce((m,g)=>g?De(m,g):m,this.configVal);this.configVal=n}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(i=>{const t=this.processConditions(i.if),n=this.processResults(i.then);return t.map(m=>this.evaluateConditions(m)&&this.execResults(n))}):null};getComponent(e){const[i,t]=e.split("."),n=oe[i];return t===this.id?this:n?.get(t)}value=(e,i)=>{const t=e.split("."),n=this.getComponent(e),m=n&&t.slice(2,t.length).join(".");return[!n,!m,!sn[m]].some(Boolean)?e:i?n.set(sn[m],i):n.get(sn[m])};getResult=e=>({"=":(i,t,n)=>i.set(t,n)})[e];processResults=e=>e.map(({operator:i,target:t,value:n})=>{const m=this.getComponent(t);return{target:m,propertyPath:m&&t.split(".").slice(2,t.length).join("."),action:this.getResult(i),value:this.value(n)}});execResults=e=>{const i=e.map(t=>this.execResult(t));return Promise.all(i)};execResult=({target:e,action:i,value:t,_propertyPath:n})=>new Promise((m,g)=>{try{return m(i(e,t))}catch(f){return g(f)}});cloneData=()=>{const e={...He(this.data),id:Me()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const i=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(i),this.dispatchComponentEvent("onClone",{original:this,clone:i,parent:e}),i};cloneChildren(e){for(const i of this.children)i?.clone(e)}createChildWrap=e=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Hi.row}get isColumn(){return this.name===Hi.column}get isField(){return this.name===Hi.field}isDisabledProp=(e,i="attrs")=>{if(we(this.config,e))return!1;if((this.config?.disabled||[]).includes(e))return!0;const t=mi(e);return(this.config?.panels[i]?.disabled||[]).includes(t)};isLockedProp=(e,i="attrs")=>{if((this.config?.locked||[]).includes(e))return!0;const t=mi(e);return!!(this.config?.panels[i]?.locked||[]).includes(t)};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},i=this.editPanels.size;return i&&(e.className.push(`panel-count-${i}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(i===0){const t=this.dom.querySelector(".edit-toggle"),n=this.dom.querySelector(`.${this.name}-actions`),m=n.getElementsByTagName("button");n.style.maxWidth=`${m.length*m[0].clientWidth}px`,V.remove(t)}else this.resizePanelWrap()}},V.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=new Set(["object","array"]),i=at([...this.config.panels.order,...Object.keys(this.data)]),t=new Set(["children","meta","action","events",...this.config.panels.disabled]),n=i.filter(g=>!t.has(g));for(const g of n){const f=this.get(g),c=V.childType(f);if(e.has(c)){const o=new Hu(f,g,this);this.editPanels.set(o.name,o)}}const m={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new ds(m),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}},ju=class{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const i=e.querySelector(".children");if(!i)return 0;const t=i.children.length,n=V.getStyle(i,"gap")||"0px",m=parseFloat(n,10)||0;return this.totalGapWidth=m*(t-1),i.offsetWidth-this.totalGapWidth}validateResizeTarget(e,i){return e&&i&&e.offsetWidth&&i.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const i=e.target.parentElement,t=i.nextSibling||i.previousSibling,n=i.closest(`.${Ue}`);if(!this.validateResizeTarget(i,t)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,n.classList.add(Pi),this.columnPreset=n.querySelector(`.${Co}`),this.originalColumnClass=i.className,this.originalSiblingClass=t.className,i.className=i.className.replace(pn,""),t.className=t.className.replace(pn,""),this.colStartWidth=i.offsetWidth,this.sibStartWidth=t.offsetWidth,this.rowWidth=this.getRowWidth(n),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=i,this.sibling=t,this.row=n;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(m){console.error("Failed to initialize resize listeners:",m),this.cleanup()}}calculateNewWidths(e){const i=this.colStartWidth+e-this.startX,t=this.sibStartWidth-e+this.startX,n=parseFloat(Bi(i,this.rowWidth)),m=parseFloat(Bi(t,this.rowWidth));return n<10||m<10?null:{colWidth:fn(n.toFixed(1)),siblingColWidth:fn(m.toFixed(1))}}onMove(e){e.preventDefault();const{column:i,sibling:t}=this,n=e.type==="touchmove"?e.touches[0].clientX:e.clientX,m=this.calculateNewWidths(n);if(!m)return;const{colWidth:g,siblingColWidth:f}=m;i.dataset.colWidth=g,t.dataset.colWidth=f,i.style.width=g,t.style.width=f,this.resized=!0}onStop(){const{column:e,sibling:i}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),oe.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),oe.setAddress(`columns.${i.id}.config.width`,i.dataset.colWidth),this.row.classList.remove(Pi),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Pi),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let i=e.querySelector(`.${hn}`);const t=this.row.querySelector(".children").children,n=ir(t,f=>Bi(f.clientWidth,this.rowWidth).toFixed(1)),m=n.join(","),g=n.join(" | ");return i||(i=V.create({tag:"option",attrs:{className:hn,value:m,selected:!0},content:g}),e.append(i)),i.value=m,i.textContent=g,m}},Vu=()=>Object.freeze({config:{width:"100%"},children:[],className:[Ge]}),Dr={resizeHandle:e=>({className:"resize-x-handle",action:{pointerdown:e.onStart.bind(e)},content:[V.icon("triangle-down"),V.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})},Uu=class extends zi{constructor(e){super("column",{...Vu(),...e});const i=this.createChildWrap();this.dom=V.create({tag:"li",className:[Ge,"empty"],dataset:{hoverTag:Z.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Dr.editWindow(),Dr.resizeHandle(new ju),i]}),this.processConfig(),Q.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),J.create(i,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${Tt}`,handle:".item-move"})}processConfig(){const e=Ae.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))},Gu={actionButtons:{buttons:["clone","move","remove"],disabled:[]}},Ku=class extends Di{constructor(e){super("columns",e),this.config={all:Gu}}Component(e){return new Uu(e)}},hs=new Ku,qu=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Ue]}),Yu=class extends zi{constructor(e){super("row",{...qu(),...e});const i=this.createChildWrap();this.dom=V.create({tag:"li",className:[Ue,"empty"],dataset:{hoverTag:Z.get("row"),editingHoverTag:Z.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,i]}),J.create(i,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${Ge}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:Z.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:c}})=>{this.set("config.fieldset",!!c)}},config:{label:Z.get("row.settings.fieldsetWrap")}},i={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:Z.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:c}})=>this.set("config.inputGroup",c)},config:{label:Z.get("row.makeInputGroup"),description:Z.get("row.makeInputGroupDesc")}},t={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:c}})=>this.set("config.legend",c)},className:""}},n=V.formGroup([e,t]),m={tag:"label",content:Z.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=V.create(this.columnPresetControlConfig);const g={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=[i,"hr",n,"hr",V.formGroup([m,g],"row")];return V.create({className:`${this.name}-edit group-config`,action:{onRender:c=>{const o=f.map(h=>V.create(h));c.append(...o)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const i=Number.parseFloat((100/e.length).toFixed(1))/1;for(const t of e){t.removeClasses(pn);const n=t.dom,m=fn(i);t.set("config.width",m),n.style.width=m,n.dataset.colWidth=m;const g=setTimeout(()=>{clearTimeout(g),t.refreshFieldPanels()},st);document.dispatchEvent(Q.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:i,...t})=>V.create({tag:"option",content:i,attrs:t}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((i,t)=>{i.setWidth(`${e[t]}%`),i.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,i=_l.get(e.length-1)||[],t=e.map(n=>{const m=n.get("config.width")||"";return Number(m.replace("%","")).toFixed(1)}).join(",");if(i.length){const n=i.slice();return n.find(m=>m.value===t)||n.push({value:t,label:t.replace(/,/g," | "),className:hn}),n.map(m=>{const g={...m};return g.selected=m.value===t,g})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:Z.get("defineColumnLayout"),className:Co},action:{change:({target:e})=>{const{value:i}=e;this.setColumnWidths(i)}},options:this.getColumnPresetOptions}}},Zu={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}},Qu=class extends Di{constructor(e){super("rows",e),this.config={all:Zu}}Component(e){return new Yu(e)}},or=new Qu,Xu=()=>({conditions:[qn()],children:[]}),Ju=class extends zi{constructor(e){super("stage",{...Xu(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=gi(this.updateEditPanels),Z.get("Untitled Form"),Z.get("Untitled Form"),Z.get("Form Title"),Z.get("Form novalidate"),Z.get("Tags");const i=this.createChildWrap();this.dom=V.create({attrs:{className:[kt,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,i]}),J.create(i,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{Wt.active=this},onSort:this.onSort.bind(this),draggable:`.${Ue}`,handle:".item-move"})}empty(e=!0){return new Promise(i=>{e?(this.dom.classList.add("removing-all-fields"),ge.slideUp(this.dom,333,()=>{i(super.empty(e)),this.dom.classList.remove("removing-all-fields"),ge.slideDown(this.dom,333)})):i(super.empty())})}onAdd(...e){const i=super.onAdd(...e);i?.name==="column"&&i.parent.autoColumnWidths()}},ed=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}),td=class extends Di{constructor(e){super("stages",e),this.config={all:ed()}}Component(e){return new Ju(e)}},Wt=new td,$e={js:new Set,css:new Set,formeoSprite:null},id=1e4,Nr=(e,i,t=mn,n=id)=>new Promise(m=>{const g=typeof AbortSignal<"u"&&AbortSignal.timeout?AbortSignal.timeout(n):void 0;return fetch(e,g?{signal:g}:void 0).then(f=>{if(!f.ok)return m(t(f));m(i?i(f):f)}).catch(f=>m(t(f)))}),ps=(e,i)=>{e.removeEventListener("load",ps),i(e.src)},fs=(e,i)=>{e.removeEventListener("load",fs),i(e.src)},nd=e=>new Promise((i,t)=>{if($e.js.has(e))return i(e);$e.js.add(e);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:e},action:{load:()=>fs(n,i),error:()=>t(new Error(`${e} failed to load.`))}});document.head.appendChild(n)}),xn=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>new Promise((n,m)=>{if($e.css.has(t))return n(t);$e.css.add(t);const g=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>ps(g,n),error:()=>m(new Error(`${t} failed to load.`))}});document.head.appendChild(g)}));return Promise.all(i)},rd=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>nd(t));return Promise.all(i)},od=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>xn(t));return Promise.all(i)},Fr=e=>($e.formeoSprite=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,$e.formeoSprite),sd=async(e=null)=>{if($e.formeoSprite)return $e.formeoSprite;if(!e)return Fr(gl);const i=async t=>Fr(await t.text());return Nr(e,i,()=>Nr(vl,i))},ad={js:rd,css:od},gs=e=>{const i=Object.entries(e).map(([t,n])=>ad[t](n));return Promise.all(i)},ld=async e=>{if(e&&!$e.css.has(e)&&(await xn(e),!$e.css.has(e)&&!$e.css.has("https://draggable.github.io/formeo/assets/css/formeo.min.css")))return await xn(bl)},cd=class{controlCache=new Set;constructor({events:e={},dependencies:i={},controlAction:t,...n}){this.events=e,this.controlData=n,this.controlAction=t,this.dependencies=i,this.id=n.id||Me()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:i}=this.controlData,t=this.i18n(i.label)||i.label,n={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:V.icon(e.icon)},{tag:"span",className:"control-label",content:t}],action:{focus:({target:m})=>{const g=m.closest(`.${ot}`);return g&&ct.panels.nav.refresh(Je(g))},click:({target:m})=>{const g=m.closest(".field-control")?.id;g&&ct.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:n,meta:e,action:this.controlAction})}promise(){return gs(this.dependencies)}i18n(e,i){const t=Z.locale,n=this.definition?.i18n?.[t]||{};return(n[e]?.()??n[e])||Z.get(e,i)}},ud=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}}),dd=An({Controls:()=>ms,default:()=>ct}),ms=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const i=e.closest(`.${ot}`);return i&&this.panels.nav.refresh(Je(i))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,i=!1){return await this.applyOptions(e),this.buildDOM(i),this}registerControls(e){return this.controls=[],e.map(i=>{const t=typeof i=="function"?new i:new cd(i);return this.add(t),this.controls.push(t.dom),t.promise()})}groupLabel=e=>Z.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),i=this.controls.slice(),t=[];const n=[];return e=Si(e,this.groupOrder,"id"),e=e.filter(m=>vr(m.id,this.options.disable.groups)),t=e.map(m=>{const g={tag:"ul",attrs:{className:[ot,wo],id:`${m.id}-${ot}`},config:{label:this.groupLabel(m.label)}};if(this.options.elementOrder[m.id]){const f=this.options.elementOrder[m.id];m.elementOrder=at(f.concat(m.elementOrder))}return i=Si(i,m.elementOrder,"meta.id"),g.content=i.filter(f=>{const{controlData:c}=this.get(f.id),o=c.meta.id||"",h=[vr(o,this.options.disable.elements),c.meta.group===m.id,!n.includes(o)];let d=!0;return d=h.every(u=>u===!0),d&&n.push(o),d}),g}),t}add(e=Object.create(null)){const i=He(e);return this.data.set(i.id,i),i.controlData.meta.id&&this.data.set(i.controlData.meta.id,i.controlData),i}get(e){return He(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...V.btnTemplate({content:[V.icon("bin"),Z.get("clear")],title:Z.get("clearAll")}),className:["clear-form"],action:{click:t=>{or.size?(Q.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:Z.get("confirmClearAll"),clearAllAction:()=>{Wt.clearAll().then(()=>{const n={src:t.target};Q.formeoCleared(n)})},btnCoords:V.coords(t.target)}}),document.dispatchEvent(Q.confirmClearAll)):window.alert(Z.get("cannotClearFields"))}}},i={...V.btnTemplate({content:[V.icon("floppy-disk"),Z.get("save")],title:Z.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:n}=await vt(async()=>{const{default:f}=await Promise.resolve().then(()=>vd);return{default:f}},void 0),{formData:m}=n,g={action:()=>{},coords:V.coords(t),message:"",button:t};return ve.click.btn(g),ve.save.form(m)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:i}).reduce((t,[n,m])=>(this.options.disable.formActions.includes(n)||t.push(m),t),[])}}buildDOM(e){const i=this.groupElements(),t=this.formActions(),{displayType:n}=this.options.panels;this.panels=new ds({panels:i,type:"controls",displayType:n});const m=["control-groups","formeo-panels-wrap",`panel-count-${i.length}`],g=V.create({className:m,content:[this.panels.panelNav,this.panels.panelsWrap]}),f=["formeo-controls"];e&&f.push("formeo-sticky");const c=V.create({className:f,content:[g,t]}),o=c.getElementsByClassName("control-group");this.dom=c,this.groups=o;const[h]=o;this.currentGroup=h,this.actions={filter:d=>{const u=d!=="",l=this.controls;let s=g.querySelector(".filtered-term");if(V.toggleElementsByStr(l,d),u){const r=Z.get("controls.filteringTerm",d);c.classList.add("filtered"),s?s.textContent=r:(s=V.create({tag:"h5",className:"filtered-term",content:r}),g.insertBefore(s,g.firstChild))}else s&&(c.classList.remove("filtered"),s.remove())},addElement:this.addElement,addGroup:d=>console.log(d)};for(let d=o.length-1;d>=0;d--){const u=`formeo-controls-${o[d]}`;this.options.sortable||globalThis.localStorage.removeItem(u),J.create(o[d],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:l,item:s})=>{if(l.id=s.id,this.options.ghostPreview){const{controlData:r}=this.get(s.id);vt(async()=>{const{default:a}=await Promise.resolve().then(()=>hd);return{default:a}},void 0).then(({default:a})=>{l.innerHTML="",l.appendChild(new a(r).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const l=globalThis.localStorage.getItem(u);return l?l.split("|"):[]},set:l=>{const s=l.toArray();globalThis.localStorage.setItem(u,s.join("|"))}}})}return c}layoutTypes={row:()=>Wt.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:i,id:t},...n}=we(this.get(e),"controlData");return Ii(n,"config.controlId",t),i==="layout"?this.layoutTypes[t.replace("layout-","")]():this.layoutTypes.field(n)};applyOptions=async(e={})=>{const{container:i,elements:t,groupOrder:n,...m}=De(ud,e);this.container=V.resolveContainer(i),this.groupOrder=at(n.concat(["common","html","layout"])),this.options=m;const[g,f,c]=await Promise.all([vt(()=>import("./layout.min.js"),[]),vt(()=>import("./form.min.js"),[]),vt(()=>import("./html.min.js"),[])]),o=[g.default,f.default,c.default].flat();return Promise.all(this.registerControls([...o,...t]))}},ct=new ms,hd=An({default:()=>vs}),pd=new Set(["checkbox","radio"]),fd=new Set(["radio","checkbox","select-one","select-multiple"]),vs=class extends zi{constructor(e=Object.create(null)){super("field",e),this.debouncedUpdateEditPanels=gi(this.updateEditPanels),this.debouncedUpdatePreview=gi(this.updatePreview),this.label=V.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const i=this.getActionButtons(),t=this.actionButtons.some(m=>m.meta?.id==="edit");this.updateEditPanels();const n=V.create({tag:"li",attrs:{className:Tt},id:this.id,children:[this.label,this.getComponentTag(),i,t&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:Z.get("field")}});this.dom=n,this.isEditing=!1}get labelConfig(){if(this.get("config.hideLabel"))return null;const{label:e,editorLabel:i,disableHtmlLabel:t,helpText:n,tooltip:m}=this.get("config"),{required:g}=this.get("attrs")||{},f=i||e,c={tag:"label",attrs:{}};return t?(c.tag="input",c.attrs.value=f):(c.attrs.contenteditable=!0,c.children=f),{className:"prev-label",children:[{...c,action:{input:({target:{innerHTML:o,value:h}})=>{const d=t?h:o;super.set("config.label",d);const u=this.dom.querySelector(".config-label");u&&(u.value=d)}}},g&&V.requiredMark(),m&&V.tooltip(m),n&&V.helpText(n)]}}setData=(e,i)=>super.set(e,i);set(e,i){return this.setData(e,i)}updateLabel(){const e=V.create(this.labelConfig);(this.label||!e)&&this.label.remove(),e&&(this.data.config?.labelAfter?this.dom.append(e):this.dom.prepend(e)),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:i}=e,{type:t}=i;if(fd.has(t)){const n=this.preview.querySelectorAll(":checked"),m=this.get("options"),g=m?.[0]?.selected===void 0?"checked":"selected",f=m.reduce((c,o)=>(c[o.value]=o,c[o.value][g]=!1,c),{});for(const c of n)f[c.value][g]=c.value===f[c.value].value;return super.set("options",Object.values(f)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const i=e.parentElement.classList;if(i.contains("f-checkbox")||i.contains("f-radio")){const t=e.parentElement,n=Je(t);return this.setData(`options[${n}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...i}=He(this.data);i.id=`prev-${this.id}`,i.action=Object.entries(e).reduce((n,[m,g])=>(n[m]=g.bind(this),n),{}),this.data?.config.editableContent&&(i.attrs={...i.attrs,contenteditable:!0});const t={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:V.create(i,!0),action:this.defaultPreviewActions};return V.create(t,!0)}get isCheckable(){return pd.has(this.get("config.controlId"))}},gd=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}),md=class extends Di{constructor(e){super("fields",e),this.config={all:gd()}}Component(e){return new vs(e)}get=e=>{let i=e&&we(this.data,e);if(!i){const t=ct.get(e);t&&(i=this.add(null,t.controlData))}return i};getData=()=>Object.entries(this.data).reduce((e,[i,t])=>{const{conditions:n,...m}=t?.getData()||t;if(n?.length){let g=!0;if(n.length===1){const[f]=n;g=!!f.if[0].source}g&&(m.conditions=n)}return e[i]=m,e},{});load=(e=Object.create(null))=>{const i=_i(e);this.empty();for(const[t,n]of Object.entries(i)){const{meta:m,...g}=n;m?.id&&Ii(g,"config.controlId",m?.id),this.add(t,g)}return this.data}},ys=new md,vd=An({Columns:()=>Ht,Components:()=>bs,Controls:()=>Bt,Fields:()=>di,Rows:()=>ui,Stages:()=>ci,default:()=>oe}),ci=Wt,ui=or,Ht=hs,di=ys,Bt=ct,yd=(e,i=!1)=>{if(e!=null){const t=_i(e);if(t&&typeof t=="object"){const n=He(t);return{id:n.id||wt().id,stages:n.stages||wt().stages,rows:n.rows||{},columns:n.columns||{},fields:n.fields||{}}}console.warn("Formeo: Invalid formData provided, using default")}if(i){const t=Yn.get(Pn);if(t)return t}return wt()},bs=class extends Qn{constructor(){super("components"),this.disableEvents=!0,this.stages=ci,this.rows=ui,this.columns=Ht,this.fields=di,this.controls=Bt}load=(e,i)=>{this.empty();const t=yd(e,i.sessionStorage);this.opts=i,this.set("id",t.id),this.add("stages",ci.load(t.stages)),this.add("rows",ui.load(t.rows)),this.add("columns",Ht.load(t.columns)),this.add("fields",di.load(t.fields));for(const n of Object.values(this.get("stages")))n.loadChildren();return this.data};flatList(){const e={};for(const i of Object.keys(this.data.stages))Do(this.data,i,"stages",e);return e}getChildData=({type:e,id:i})=>{const t=this.get(e,i);if(t)return t.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Wt.getData(),rows:or.getData(),columns:hs.getData(),fields:ys.getData()}}set config(e){const{stages:i,rows:t,columns:n,fields:m}=e;ci.config=i,ui.config=t,Ht.config=n,di.config=m}getIndex(e){return this[e]||this[Sl.get(e)]}setAddress(e,i){if(!Te(e))return;const[t,n,...m]=Array.isArray(e)?e:lt(e),g=this.getIndex(t).get(n);return g?.set(m,i),g}getAddress(e){if(!Te(e))return;const[i,t,...n]=Array.isArray(e)?e:lt(e),m=this.getIndex(i).get(t);if(!(n.length&&!m))return n.length?m.get(n):m}},oe=new bs,bd={glyphicons:e=>`<span class="glyphicon glyphicon-${e}" aria-hidden="true"></span>`,"font-awesome":e=>{const[i,t]=e.split(" ");return`<i class="${i} fa-${t}"></i>`},fontello:e=>`<i class="${Oo}${e}">${e}</i>`},wd=new Set(["input","textarea","select"]),Ei="formeo-required-group",ws=["disabled","form"],Cd=new Set(["type","id","name","className","value","required",...ws]),Sd=(e={})=>Object.fromEntries(Object.entries(e).filter(([i])=>!Cd.has(i))),xd=e=>e.replace(/^on([A-Z])/,(i,t)=>t.toLowerCase()),Ed=new Set(["focus","blur"]),Ad=e=>{const i=xd(e);return(t,n)=>t.addEventListener(i,n,Ed.has(i))},Cs=(e={})=>{let i=e?.attrs?.name||e?.name;if(i)return i;const t=Me(e);let n=e.config?.label||e.attrs?.label||e?.label;return n&&(typeof n=="object"&&(n=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=Zl(n)),i=`${t}-${No(Ql(n,24,null))}`),i||t},kd=class{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=De(this.options,e)}processElemArg(e){let i=e,t;if(typeof i=="string")return t=i,i={tag:t},i;if(i.attrs){const{tag:n,...m}=i.attrs;n&&(typeof n=="string"?t=n:t=(n.find(g=>g.selected===!0)||n[0]).value),i.attrs=m}return i.tag=t||i.tag||"div",i}render=e=>(e.id=`f-${e.id||Me()}`,this.create(e));create=(e,i=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const t=this,n=["children","content"],{className:m,options:g,dataset:f,...c}=this.processElemArg(e);n.push("tag");let o;const{tag:h}=c;let d;const u={attrs:{},className:[Ae.get(c,"config.inputWrap")],children:[],config:{}};let l=document.createElement(h);const s={string:a=>{l.innerHTML+=a},object:a=>a&&l.appendChild(t.create(a,i)),node:a=>l.appendChild(a),component:a=>l.appendChild(a.dom),array:a=>{for(const p of a)o=t.childType(p),s[o](p)},function:a=>{a=a(),o=t.childType(a),s[o](a)},undefined:()=>null,boolean:()=>null};if(m&&(c.attrs=De(c.attrs,{className:m})),g){const a=this.processOptions(g,c,i);if(this.holdsContent(l)&&h!=="button")s.array.call(this,a),c.content=void 0;else{Ae.forEach(a,v=>{u.children.push(t.create(v,i))});const p=c.attrs||{};return p.className&&(u.className=p.className),u.id=c.id,u.attrs=Sd(p),u.config={...c.config,required:!!p.required},!i&&p.type==="checkbox"&&p.required&&(u.attrs[`data-${Ei}`]="true",u.action={change:({currentTarget:v})=>this.syncCheckboxGroupRequired(v)}),this.create(u,i)}n.push("options")}if(c.attrs&&(t.processAttrs(c,l,i),n.push("attrs")),c.config){if(c.config.label&&(c.config.label&&h!=="button"||["radio","checkbox"].includes(Ae.get(c,"attrs.type")))&&!i){const a=t.label(c);if(!c.config.hideLabel){const p=[a,l];t.labelAfter(c)&&p.reverse(),u.children.push(p)}}n.push("config")}if(c.content||c.children){const a=c.content||c.children;o=t.childType(a),s[o]||console.error(`childType: ${o} is not supported`),s[o].call(this,a)}if(f){for(const a in f)Object.hasOwn(f,a)&&(l.dataset[a]=typeof f[a]=="function"?f[a]():f[a]);n.push("dataset")}c.action&&(this.actionHandler(l,c.action),n.push("action"));const r=Ae.subtract(n,Object.keys(c));for(d=r.length-1;d>=0;d--)l[r[d]]=c[r[d]];return u.children.length&&(l=this.create(u)),l};onRender=(e,i,t=333)=>{const n=Date.now(),m=()=>{!e.parentElement&&Date.now()-n<t?window.requestAnimationFrame(m):e.parentElement&&i(e)};m()};actionHandler(e,i){const t={onRender:V.onRender,render:V.onRender};return Object.entries(i).map(([n,m])=>(Array.isArray(m)?m:[m]).map(g=>(t[n]||Ad(n))(e,g)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=$e.formeoSprite.querySelectorAll("svg symbol"),i=t=>{const n=t.getAttribute("viewBox")||"0 0 24 24",m=Array.from(t.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",t.id],viewBox:n,xmlns:"http://www.w3.org/2000/svg"},children:m}};return this.iconSymbols=Array.from(e).reduce((t,n)=>{const m=n.id.replace(Oo,"");return t[m]=i(n),t},{}),this.cachedIcons={},this.iconSymbols}icon(e,i){if(!e)return;const t=`${e}?${new URLSearchParams(i).toString()}`;if(this.cachedIcons?.[t])return this.cachedIcons[t];const n=this.icons[e];if(n){if(i){const m=De(n,i);return this.cachedIcons[t]=V.create(m).outerHTML,this.cachedIcons[t]}return this.cachedIcons[t]=V.create(n).outerHTML,this.cachedIcons[t]}return bd[V.options.iconFont]?.(e)||e}processAttrs(e,i,t){const{attrs:n={}}=e;if(!t&&!n.name&&n.name!==null&&this.isInput(e.tag)){const m=Cs(e);m&&i.setAttribute("name",m)}for(const m of Object.keys(n)){const g=Ae.safeAttrName(m),f=this.processAttrValue(n[m]);if(f!==!1)try{i.setAttribute(g,f)}catch(c){console.warn(`Could not set attribute ${g} with value ${f}`,c)}}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let i=e||"";if(Array.isArray(i))if(typeof i[0]=="object"){const t=i.filter(n=>n.selected===!0);i=t.length?t[0].value:i[0].value}else i=i.join(" ");return i}toggleElementsByStr=(e,i)=>{const t=[],n=(m,g)=>{g?(m.style.display="block",t.push(m)):m.style.display="none"};return V.elementsContainText(e,i,n),t};elementsContainText=(e,i,t)=>{const n=[];return Fi(e,m=>{const g=m.textContent.toLowerCase().indexOf(i.toLowerCase())!==-1;t?.(m,g),g&&n.push(m)}),n};generateOption=({type:e="option",label:i,value:t,i:n=0,selected:m})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:t||`${e}-${n}`,[e==="option"?"selected":"checked"]:m||!n},config:{label:i||Z.get("labelCount",{label:Z.get("option"),count:n})}});processOptions(e,i,t){const{action:n,attrs:m={}}=i,g=m.type||i.tag,f=m.id||i.id,c=!t&&m.name||f,o=Object.fromEntries(ws.filter(d=>d in m).map(d=>[d,m[d]]));m.required&&(o.required=g!=="checkbox"||!e.some(({selected:d,checked:u})=>d||u));const h=(d,u)=>{const{label:l,value:s,...r}=d,a=()=>{const p={tag:"input",attrs:{name:c,type:g,value:s||"",id:`${f}-${u}`,...o,...r},action:n},v={tag:"label",attrs:{for:`${f}-${u}`},children:l},y={children:[p,v],className:[`f-${g}`]};return m.className&&(i.config.inputWrap=m.className),i.config.inline&&y.className.push(`f-${g}-inline`),d.selected&&(p.attrs.checked=!0),t&&(v.attrs.contenteditable=!0),y};return{select:()=>{const p=d.attrs||d,{label:v,checked:y,selected:k,attrs:x}={attrs:p,...d,...p};return{tag:"option",attrs:{...x,selected:!!(y||k)},children:v}},button:p=>{const{type:v,label:y,className:k,id:x}=p;return{...i,attrs:{type:v},className:k,id:x||Me(),options:void 0,children:y,action:i.action}},checkbox:a,radio:a}[g]?.(d)};return e.map(h)}holdsContent(e){return e.outerHTML.includes("/")}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let i=e;return typeof i!="string"&&(i=i.tagName),wd.has(i)}parsedHtml(e){const i=document.createElement("textarea");return i.innerHTML=e,i.textContent}labelAfter(e){const i=Ae.get(e,"attrs.type"),t=Ae.get(e,"config.labelAfter");return t===void 0?i==="checkbox"||i==="radio":t}syncCheckboxGroupRequired(e){const i=Array.from(e.querySelectorAll('input[type="checkbox"]')),t=!!e.closest("[hidden]"),n=!i.some(m=>m.checked);for(const m of i)m.required=!t&&n}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});tooltip=e=>({tag:"span",className:"f-tooltip",dataset:{tooltip:e},content:V.icon("info-circle")});helpText=e=>({tag:"small",className:"f-help-text",children:e});label(e,i){const t=Ae.get(e,"attrs.required")||Ae.get(e,"config.required");let{config:{label:n="",helpText:m="",tooltip:g=null}}=e;const{id:f,attrs:c}=e;typeof n=="function"&&(n=n());const o={tag:"label",attrs:{for:f||c?.id},className:[],children:[n,t&&this.requiredMark(),g&&this.tooltip(g),m&&this.helpText(m)],action:{}};return i&&(o.attrs.for=void 0,o.attrs.contenteditable=!0,o.fMap=i),o}childType(e){return e===void 0?e:[["array",i=>Array.isArray(i)],["node",i=>i instanceof window.Node||i instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(i=>i[1](e))[0]}getStyle(e,i=!1){let t;return window.getComputedStyle?t=window.getComputedStyle(e,null):e.currentStyle&&(t=e.currentStyle),i?t[i]:t}getElement(e){return{node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)}[this.childType(e)]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const i=e.parentElement,t=be(e),n=i.getElementsByClassName(`formeo-${t}`);if(this.remove(e),!n.length)return this.isStage(i)?this.emptyClass(i):this.removeEmpty(i)};remove(e){const i=be(e);return i?oe.remove(`${i}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,i){const t={string:n=>n.classList.remove(i),array:n=>{for(const m of i)n.classList.remove(m)}};t.object=t.string,Ae.forEach(e,t[this.childType(i)])}addClasses(e,i){Ae.forEach(e,{string:t=>t.classList.add(i),array:t=>{for(const n of i)t.classList.add(n)}}[this.childType(i)])}formGroup(e,i=""){return{className:["f-field-group",i],children:e}}coords(e){const i=e.getBoundingClientRect(),t=document.body.getBoundingClientRect();return{pageX:i.left+i.width/2,pageY:i.top-t.top-i.height/2}}clearStage(e){e.classList.add("removing-all-fields");const i=()=>{V.empty(e),e.classList.remove("removing-all-fields"),V.emptyClass(e),ge.slideDown(e,300)};ge.slideUp(e,600,i)}toggleSortable(e,i){let t=i;const n=be(e);if(!n)return;const m=be(e.parentElement),g=V[n].get(e.id).sortable;t||(t=!g.option("disabled")),g.option("disabled",t),m&&["rows","columns","stages"].includes(m)&&this.toggleSortable(e.parentElement,t)}emptyClass(e){const i=e.getElementsByClassName(wl.get(e.classList.item(0)));e.classList.toggle("empty",!i.length)}btnTemplate=({title:e="",...i})=>({tag:"button",attrs:{type:"button",title:e},...i});isControls=e=>be(e)===ot;isStage=e=>be(e)===kt;isRow=e=>be(e)===Ue;isColumn=e=>be(e)===Ge;isField=e=>be(e)===Tt;asComponent=e=>oe[`${be(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}resolveContainer(e){return typeof e=="string"?document.querySelector(e):e?.jquery?e[0]||null:e}},V=new kd,Td=Object.freeze({title:"",content:null,confirmText:()=>ze("save"),cancelText:()=>ze("cancel"),onConfirm:()=>{},onCancel:()=>{},className:"",closeOnEscape:!0,position:"top",triggerElement:null,triggerCoords:null}),Ss=class hi{constructor(i){this.opts=De(Td,i),this.dialog=null}createDialog(){const{title:i,content:t,confirmText:n,cancelText:m,className:g,closeOnEscape:f,position:c}=this.opts,o=`dialog-position-${c}`,h=[];return i&&h.push({tag:"h3",className:"dialog-title",textContent:i}),t&&h.push({tag:"div",className:"dialog-body",children:Array.isArray(t)?t:[t]}),h.push({tag:"div",className:"dialog-actions",children:[{tag:"button",type:"button",className:"btn btn-sm btn-secondary",textContent:typeof m=="function"?m():m,action:{click:()=>this.handleCancel()}},{tag:"button",type:"submit",className:"btn btn-sm btn-primary",textContent:typeof n=="function"?n():n}]}),V.create({tag:"dialog",className:["formeo-dialog","formeo",o,g],children:[{tag:"form",className:"dialog-form",method:"dialog",children:h,action:{submit:d=>this.handleSubmit(d)}}],action:{cancel:d=>{f?this.handleCancel():d.preventDefault()}}})}handleSubmit(i){i.preventDefault();const t=new FormData(i.target);this.opts.onConfirm(t,this),this.close()}handleCancel(){this.opts.onCancel(this),this.close()}setPosition(){const{position:i,triggerElement:t,triggerCoords:n}=this.opts;if(i!=="trigger"||!this.dialog)return;let m=n;if(!m&&t){const g=t.getBoundingClientRect();m={x:g.left+g.width/2,y:g.bottom+8}}if(m){const g=this.dialog.getBoundingClientRect(),f=window.innerWidth,c=window.innerHeight;let o=m.x-g.width/2,h=m.y;const d=16;o=Math.max(d,Math.min(o,f-g.width-d)),h=Math.max(d,Math.min(h,c-g.height-d)),this.dialog.style.left=`${o}px`,this.dialog.style.top=`${h}px`,this.dialog.style.transform="none"}}open(){if(this.dialog||(this.dialog=this.createDialog()),document.body.appendChild(this.dialog),this.dialog.showModal(),this.opts.position==="trigger"){const i=setTimeout(()=>{this.setPosition(),clearTimeout(i)},0)}return this}close(){this.dialog&&(this.dialog.close(),this.dialog.remove(),this.dialog=null)}static alert(i,t=()=>{}){return new hi({content:{tag:"p",className:"dialog-message",textContent:i},confirmText:()=>Z.get("ok")||"OK",cancelText:"",onConfirm:()=>t()})}static confirm(i,t=()=>{},n=()=>{}){return new hi({content:{tag:"p",className:"dialog-message",textContent:i},confirmText:()=>Z.get("confirm")||"Confirm",onConfirm:()=>t(),onCancel:()=>n()})}static prompt(i,t=()=>{},n=""){return new hi({content:[{tag:"label",className:"dialog-prompt-label",children:[{tag:"p",className:"dialog-message",textContent:i},{tag:"input",type:"text",name:"prompt-value",className:"dialog-prompt-input",value:n}]}],onConfirm:m=>{t(m.get("prompt-value"))}})}},Md=/^[A-Za-z_:][-A-Za-z0-9_:]*$/,zr=(e,i)=>{const t=e.trim();return t?!Md.test(t)||i.isDisabled(`attrs.${t}`)?Z.get("attributeNotPermitted",{attribute:t})||`Attribute "${t}" is not permitted`:"":e?Z.get("attributeNameRequired")||"Enter an attribute name":""},$d=e=>new Ss({className:"add-attribute-dialog",content:[{tag:"input",attrs:{type:"text",name:"attrName",className:"attr-name-input",required:!0,autocomplete:"off"},config:{label:e.message.attr},action:{input:({target:i})=>i.setCustomValidity(zr(i.value,e))}},{tag:"input",attrs:{type:"text",name:"attrValue",className:"attr-value-input",autocomplete:"off"},config:{label:e.message.value}}],onConfirm:i=>{const t=String(i.get("attrName")??"").trim();t&&!zr(t,e)&&e.addAction(t,String(i.get("attrValue")??""))}}).open(),Pr={add:{attr:e=>$d(e),option:e=>{e.addAction()},condition:e=>{e.addAction(e)},config:e=>{e.addAction(e)}},remove:{attrs:e=>{e.removeAction()},options:e=>{e.removeAction()},conditions:e=>{e.removeAction()}},click:{btn:e=>{e.action()}},save:{form:gn}},ve={init:function(e){const i=Object.keys(Pr);return this.opts=i.reduce((t,n)=>(t[n]={...Pr[n],...e[n]},t),e),this},add:{attrs:e=>ve.opts.add.attr(e),options:e=>ve.opts.add.option(e),conditions:e=>(e.template=e.template||qn(),ve.opts.add.condition(e)),config:e=>ve.opts.add.config(e)},remove:{attrs:e=>ve.opts.remove.attrs(e),options:e=>ve.opts.remove.options(e),conditions:e=>ve.opts.remove.conditions(e)},click:{btn:e=>ve.opts.click.btn(e)},save:{form:e=>(ve.opts.sessionStorage&&Yn.set(Pn,e),Q.formeoSaved({formData:e}),ve.opts.save.form(e))}},Ld={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:yl,iconFont:null,config:{},events:{},actions:{},controls:{container:null},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}},Se={CREATED:"created",LOADING_RESOURCES:"loading",INITIALIZING:"initializing",READY:"ready",ERROR:"error"},xs=class{#e=Se.CREATED;#i=null;#t=null;#n=!1;constructor({formData:e,...i}={},t){const{actions:n,events:m,debug:g,config:f,editorContainer:c,...o}=De(Ld.editor,i);c&&(this.editorContainer=V.resolveContainer(c)||null),this.editorContainerOption=c,this.opts=o,V.setOptions=o,oe.config=f;const h=t||e;this.#t=h?rt(h):null,this.userFormData=this.#t,this.Components=oe,this.dom=V,Q.init({debug:g,...m}),ve.init({debug:g,sessionStorage:o.sessionStorage,...n}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){const i=rt(e);this.#t=i,this.userFormData=i,this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){const e=wt();this.#t=e,this.userFormData=e,this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources),this.#e=Se.LOADING_RESOURCES;const e=[sd(this.opts.svgSprite),ld(this.opts.style),Z.init({preloaded:{"en-US":Ns},...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(fr)})].filter(Boolean);try{await Promise.all(e),this.opts.allowEdit&&this.init()}catch(i){throw this.#e=Se.ERROR,console.error("Failed to load resources:",i),i}}init(){return this.#e===Se.INITIALIZING?this.#i:this.#e===Se.READY?this.#r():(this.#e=Se.INITIALIZING,this.#i=ct.init(this.opts.controls,this.opts.stickyControls).then(e=>(this.controls=e,this.#n||(this.#s(),this.#n=!0),this.formId=oe.get("id"),this.i18n={setLang:this.#o.bind(this)},this.render(),this.#e=Se.READY,this.opts.onLoad?.(this),this.tooltipInstance=new io,this)).catch(e=>{throw this.#e=Se.ERROR,console.error("Failed to initialize editor:",e),e}),this.#i)}async#o(e){globalThis.sessionStorage?.setItem(fr,e),await Z.setCurrent(e),await this.#r()}async#r(){return this.controls=await ct.init(this.opts.controls,this.opts.stickyControls),this.render(),this}#s(){const e=this.#a();this.Components.load(e,this.opts)}#a(){if(this.#t)return He(this.#t);if(this.opts.sessionStorage){const e=Yn.get(Pn);if(e)return e}return wt()}load(e=this.userFormData,i=this.opts){this.Components.load(e,i),this.render()}get initState(){return this.#e}get isReady(){return this.#e===Se.READY}async whenReady(){return this.#e===Se.READY?this:this.#e===Se.ERROR?Promise.reject(new Error("Editor initialization failed")):this.#i?this.#i:new Promise((e,i)=>{const t=()=>{this.#e===Se.READY?e(this):this.#e===Se.ERROR?i(new Error("Editor initialization failed")):globalThis.requestAnimationFrame(t)};t()})}render(){if(!this.controls)return globalThis.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(oe.get("stages")),this.opts.controlOnLeft)for(const t of this.stages)t.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:t})=>t)]};Z.current.dir&&(e.attrs.dir=Z.current.dir,V.dir=Z.current.dir),this.editor=V.create(e);const i=this.controls.container||this.editor;i&&(i!==this.editor&&V.empty(i),i.appendChild(this.controls.dom)),!this.editorContainer&&this.editorContainerOption&&(this.editorContainer=V.resolveContainer(this.editorContainerOption)||null,this.editorContainer||console.warn(`Formeo: editorContainer ${String(this.editorContainerOption)} was not found, so the editor was not added to the page.`)),this.editorContainer&&(V.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Q.formeoLoaded=new globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Q.formeoLoaded)}},Hr=e=>V.resolveContainer(e),Rd=({editorContainer:e,renderContainer:i,formData:t,...n}={})=>{const m={renderContainer:Hr(i),editorContainer:Hr(e),formData:rt(t)};return{elements:{},...n,...m}},ti=e=>e.match(Hl)?.[0]||e,Br=e=>{if(!e||e.hasAttribute("hidden")||e.parentElement?.hasAttribute("hidden"))return!1;const i=window.getComputedStyle(e);return!(i.display==="none"||i.visibility==="hidden"||i.opacity==="0")},_d='input[type="checkbox"], input[type="radio"]',Od=new Set(["checkbox","radio"]),Es=e=>e?.tagName?.toLowerCase(),As=e=>Es(e)==="input"&&Od.has(e.type),sr=e=>{if(!e||As(e)||typeof e.querySelectorAll!="function")return null;const i=e.querySelectorAll(_d);return i.length?Array.from(i):null},Id=e=>!!sr(e),Wr=e=>{if(!e)return;const i=sr(e);if(i){const t=i.filter(n=>n.checked).map(n=>n.value);return i.every(n=>n.type==="radio")?t[0]??"":t}return Es(e)==="select"&&e.multiple?Array.from(e.selectedOptions,t=>t.value):As(e)?e.checked?e.value:"":e.value},jr=e=>{const i=sr(e);return i?i.some(t=>t.checked):!!e?.checked},Vr={isChecked:e=>jr(e),isNotChecked:e=>!jr(e),value:Wr,checked:Wr,isVisible:e=>Br(e),isNotVisible:e=>!Br(e)},Dd=()=>V.btnTemplate({className:"remove-input-group",children:V.icon("remove"),action:{mouseover:({target:e})=>e.parentElement.classList.add("will-remove"),mouseleave:({target:e})=>e.parentElement.classList.remove("will-remove"),click:({target:e})=>e.parentElement.remove()}}),Ur=(e,i)=>Array.isArray(e)?e.some(t=>(0,vn.default)(t,i)):(0,vn.default)(e,i),Gr=(e,i)=>e==null?!1:Array.isArray(e)?e.includes(i):String(e).includes(i),Kr={equals:Ur,notEquals:(e,i)=>!Ur(e,i),contains:Gr,notContains:(e,i)=>!Gr(e,i)},Nd=Object.entries(Ro).reduce((e,[i,t])=>(e[t]=Kr[i],e[i]=Kr[i],e),{}),qr={equals:(e,{targetProperty:i,value:t})=>{e[`_${i}`]=e[i],e[i]=t}},Fd=Object.entries(_o).reduce((e,[i,t])=>(e[t]=qr[i],e[i]=qr[i],e),{}),Yr=e=>{const i=e.closest?.(Ts);i&&V.syncCheckboxGroupRequired(i)},zd={isChecked:e=>{e.checked=!0,Yr(e)},isNotChecked:e=>{e.checked=!1,Yr(e)},value:(e,{assignment:i,...t})=>{const n=Fd[i]?.(e,t),m=new Event("input",{bubbles:!0});return e.dispatchEvent(m),n},isNotVisible:e=>{e.parentElement.setAttribute("hidden",!0),Pd(e)},isVisible:e=>{e.parentElement.removeAttribute("hidden"),Hd(e)}},ks="input, select, textarea",Ts=`[data-${Ei}]`,En=(e,i)=>[...e.matches(i)?[e]:[],...e.querySelectorAll(i)],Pd=e=>{for(const i of En(e,ks))i._required===void 0&&(i._required=i.required),i.required=!1},Hd=e=>{for(const i of En(e,ks))i._required!==void 0&&!i.closest("[hidden]")&&(i.required=i._required,delete i._required);for(const i of En(e,Ts))V.syncCheckboxGroupRequired(i)},Bd=new Set(["&&","and"]),Wd=(e=[])=>e.reduce((i,t,n)=>(n>0&&Bd.has(t.logical)?i[i.length-1].push(t):i.push([t]),i),[]),Ms=class{constructor(e={},i){const{renderContainer:t,elements:n,formData:m,config:g,events:f}=Rd(e);this.container=t,this.form=rt(i||m),this.elements=n,this.config=g,this.events={...f},this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=rt(e)}get userData(){return an(this.container?.querySelector(".formeo-render")||this.renderedForm)}get userFormData(){const e=[];for(const[i,t]of Object.entries(this.userData)){const n={key:i,value:t,label:this.componentByName(i)?.config?.label||""};e.push(n)}return e}componentByName(e){return this.components[ti(e)]||Object.values(this.components).find(i=>i.attrs?.name===e)}set userData(e={}){const i=this.container.querySelector("form");for(const t of Object.keys(e)){const n=i.elements[t],m=jd(n);if(m?.[0].type==="checkbox"){const g=Array.isArray(e[t])?e[t]:[e[t]];for(const c of m)c.checked=g.includes(c.value);const f=m[0].closest(`[data-${Ei}]`);f&&V.syncCheckboxGroupRequired(f)}else if(m?.[0].type==="radio")for(const g of m)g.checked=g.value===e[t];else n.type&&(n.value=e[t])}}render(e=this.form){if(!this.container)throw new Error("FormeoRenderer: renderContainer is required for render(); use getRenderedForm() or html without one");this.form=rt(e);const i=this.getRenderedForm(e),t=this.container.querySelector(".formeo-render");t?t.replaceWith(i):this.container.appendChild(i),this.events.onRender?.({form:i,renderer:this,formData:this.form})}getRenderedForm(e=this.form){this.form=rt(e);const i=document.getElementsByClassName("formeo-render").length,t={...this.config,tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${i}`,children:this.processedData};return this.renderedForm=V.render(t),this.renderedForm.addEventListener("reset",this.syncRequiredGroupsAfterReset),this.applyConditions(),this.bindFormEvents(this.renderedForm),this.renderedForm}syncRequiredGroupsAfterReset=({currentTarget:e})=>{setTimeout(()=>{for(const i of e.querySelectorAll(`[data-${Ei}]`))V.syncCheckboxGroupRequired(i)},0)};bindFormEvents(e){const{onChange:i,onSubmit:t}=this.events;i&&e.addEventListener("input",n=>i({event:n,target:n.target,form:e,userData:an(e)})),t&&e.addEventListener("submit",n=>t({event:n,form:e,userData:an(e)}))}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,i)=>i.reduce((t,n)=>(t.push(this.form[e][n]),t),[]);prefixId=e=>"f-"+e;processColumn=({id:e,...i})=>({...i,id:this.prefixId(e),children:this.processFields(i.children),style:`width: ${i.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((i,t)=>(t&&i.push(this.processRow(t)),i),[]);cacheComponent=e=>(this.components[ti(e.id)]=e,e);processRow=(e,i="row")=>{const{config:t,id:n}=e,m=[`formeo-${i}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(n)};this.cacheComponent(g);const f=[{condition:t.legend,result:()=>({tag:t.fieldset?"legend":"h3",children:t.legend})},{condition:!0,result:()=>g},{condition:t.inputGroup,result:()=>this.addButton(n)}].reduce((c,{condition:o,result:h})=>(o&&c.push(h()),c),[]);return t.inputGroup&&m.push("f-input-group-wrap"),{tag:t.fieldset?"fieldset":"div",className:m,children:f}};cloneComponentData=e=>{const{children:i=[],id:t,attrs:n={},...m}=this.components[e],g={...n,"data-clone-of":t};return m.options&&["checkbox","radio"].includes(n.type)?delete g.name:m.tag==="input"&&(g.name=Cs(this.components[e])),{...m,id:"f-"+Me(t),children:i?.length&&i.map(({id:f})=>this.cloneComponentData(ti(f))),attrs:g}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:i=>{const t=i.target.parentElement,n=V.create(this.cloneComponentData(e));t.insertBefore(n,t.lastChild);const m=V.create(Dd());n.appendChild(m)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(i=>this.cacheComponent(this.processColumn(i)));processFields=e=>this.orderChildren("fields",e).map(({id:i,...t})=>{const n=t.config?.controlId||t.meta?.id,{action:m={},dependencies:g={}}=this.elements[n]||{};g&&gs(g);const f=De({action:m},t);return this.cacheComponent({...f,id:this.prefixId(i)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=kt,this.components[ti(e.id)]=e,e))}applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const i of e)try{this.applyCondition(i)}catch(t){console.error("formeo: condition skipped",i,t)}};applyCondition=({if:e=[],then:i=[]})=>{const t=Wd(e);let n=!1;const m=f=>{if(!n){n=!0;try{if(this.evaluateClauseGroups(t))for(const c of i)this.execResult(c,f)}finally{n=!1}}},g=new Set(e.flatMap(({source:f,target:c})=>[f,c]).filter(Te));for(const f of g){const{component:c,options:o}=this.getComponent(f);this.listenForChanges(o||c,m)}m({target:null})};evaluateClauseGroups=e=>e.some(i=>i.length&&i.every(t=>this.evaluateCondition(t)));listenForChanges=(e,i)=>{if(!e)return;if(Ud(e)){for(const n of e)this.listenForChanges(n,i);return}const t=Kd(e);t&&e.addEventListener(t,i,!1)};evaluateCondition=({source:e,sourceProperty:i,targetProperty:t,comparison:n,target:m})=>{if(!Te(e)||!this.getComponent(e)?.component)return!1;const g=this.getComponentProperty(e,i);if(typeof g=="boolean")return g;const f=String(Te(m)?this.getComponentProperty(m,t):m);return Nd[n]?.(g,f)};execResult=({target:e,targetProperty:i,assignment:t,value:n})=>{if(Te(e)){const{component:m,option:g}=this.getComponent(e),f=g||m;zd[i]?.(f,{targetProperty:i,assignment:t,value:n})}};getComponentProperty=(e,i)=>{const{component:t,option:n}=this.getComponent(e)||{},m=n||t;if(m)return Vr[i]?Vr[i](m):m[i]};getComponent=e=>{const i={component:null};if(!Te(e))return null;const[,t,n,m]=lt(e);let g=null;try{g=this.renderedForm.querySelector(`#f-${t}`)}catch{}if(!g)return i;if(i.component=g,n){const f=g.querySelectorAll("input"),c=f[m];return i.options=f,i.option=c,i}return i};getComponents=e=>{const i=[],t=e.slice(e.indexOf(".")+1);return i.push(...this.renderedForm.querySelectorAll(`[name=f-${t}]`)),i}},an=e=>{if(!e)return{};const i=new FormData(e),t={};for(const[n,m]of i.entries())Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(m):t[n]=[t[n],m]:t[n]=m;return t},Zr=e=>["checkbox","radio"].includes(e?.type),jd=e=>Zr(e)?[e]:e?.length&&Zr(e[0])?Array.from(e):null,Vd=e=>!!e&&typeof e.nodeType=="number",Ud=e=>!!e&&!Vd(e)&&typeof e.length=="number",Qr=e=>e.tagName?.toLowerCase(),Gd=[["change",e=>Id(e)],["change",e=>Qr(e)==="select"||["checkbox","radio"].includes(e.type)],["input",e=>["input","textarea"].includes(Qr(e))]],Kd=e=>{const[i]=Gd.find(t=>t[1](e))||[!1];return i};window!==void 0&&(window.FormeoEditor=xs,window.FormeoRenderer=Ms);var ar=xs,lr=Ms,qd={rows:{all:{events:{onAdd:e=>{if(console.log(`You just added a new row with the id "${e.target.id}"`,e.index),e.index===2){const i=e.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{e.target.addChild()}),i.appendChild(t)}}}}},fields:{all:{panels:{attrs:{}},events:{onRemove:e=>{console.log(`You just removed the field with the id "${e.target.id}"`,e)}}},"text-input":{attrs:{type:[{label:"text",value:"text"},{label:"phone",value:"phone"},{label:"email",value:"email"}]},config:{helpText:"This is a custom help text for text input fields.",hideLabel:!1}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},Yd={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},Zd=".build-form",Qd=".render-form",jt={editorContainer:Zd,actions:{},controls:Yd,config:qd,events:{onSave:console.log,onChange:console.log},style:null,sessionStorage:!0,onLoad:()=>{console.log("demo loaded")}},cr={renderContainer:Qd,elements:{tinymce:{action:{onRender:e=>{if(e.id){const i=`#${e.id}`;globalThis.tinymce.remove(i),globalThis.tinymce.init({selector:i})}}}}}};async function Xd(e){e.innerHTML=`
|
|
12
|
+
`),n={};for(let m,g=0;g<t.length;g++)m=/^(.+?) *?= *?([^\n]+)/.exec(t[g]),m&&(n[m[1]]=m[2].trim());return n}static getInstance(i){return qt||(qt=new ii(i)),qt}static resetInstance(){qt=null}async loadLang(i,t=!0){if(this.loaded.includes(i)&&t)return this.langs[i];const n=`${this.config.location}${i}${this.config.extension}`;try{const m=await(async function(f){try{const c=await fetch(f);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return await c[f.endsWith(".lang")?"text":"json"]()}catch(c){throw c}})(n),g=ii.processFile(m);return this.applyLanguage(i,g),this.langs[i]}catch{return this.applyLanguage(i)}}applyLanguage(i,t={}){const n=this.config.override[i]||{},m=this.langs[i]||{};return this.langs[i]={...m,...t,...n},this.loaded.push(i),this.langs[i]}get getLangs(){return this.config.langs}async setCurrent(i="en-US"){return this.loaded.includes(i)||await this.loadLang(i),this.locale=i,this.current=this.langs[i],this.current}},{apply:(e,i,t)=>e.getInstance(...t),construct:(e,i)=>new e(...i),get:(e,i)=>e[i]}),Z=eo.getInstance();(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Fs=Object.defineProperty,zs=(e,i,t)=>i in e?Fs(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,Fe=(e,i,t)=>zs(e,typeof i!="symbol"?i+"":i,t),Mt={tooltip:"_3x4ZIcu-",visible:"JIt36hCJ"},Ps={triggerName:"tooltip"},to=class gt{constructor(i=Ps){Fe(this,"triggerName"),Fe(this,"tooltip"),Fe(this,"activeTriggerType",null),Fe(this,"spacing",12),Fe(this,"handleClick",t=>{const n=this.triggerName,m=t.target.closest(`[${n}][${n}-type="click"]`);if(m)if(this.isVisible())this.hide();else{const g=m.getAttribute(`${n}`);this.show(m,g),this.activeTriggerType="click"}else this.hide()}),Fe(this,"handleMouseOver",t=>{const n=this.triggerName,m=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&m?.getAttribute(`${n}-type`)!=="click"){const g=m?.getAttribute(`${n}`);g&&(this.show(m,g),this.activeTriggerType="hover")}}),Fe(this,"handleMouseOut",t=>{const n=this.triggerName,m=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&m?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Fe(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Fe(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),gt.instance&>.instance.destroy(),this.triggerName=`data-${i.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${Mt.tooltip}`,document.body.appendChild(this.tooltip),this.setupEventListeners(),gt.instance=this}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),globalThis.addEventListener("resize",this.handleResize),globalThis.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(Mt.visible)}calculatePosition(i){const t=i.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),m=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return m.find(g=>this.fitsInViewport(g,n))||m[0]}fitsInViewport(i,t){return i.x>=0&&i.y>=0&&i.x+t.width<=globalThis.innerWidth&&i.y+t.height<=globalThis.innerHeight?[[i.x,i.y],[i.x+t.width,i.y],[i.x,i.y+t.height],[i.x+t.width,i.y+t.height],[i.x+t.width/2,i.y+t.height/2]].flatMap(([n,m])=>Array.from(document.elementsFromPoint(n,m))).filter(n=>{if(this.tooltip.contains(n)||n===this.tooltip||n.classList.contains(Mt.tooltip)||getComputedStyle(n).pointerEvents==="none")return!1}).length===0:!1}show(i,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Mt.visible);const n=this.calculatePosition(i);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(Mt.visible),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),globalThis.removeEventListener("resize",this.handleResize),globalThis.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove(),gt.instance===this&&(gt.instance=null)}};Fe(to,"instance",null);var io=to;globalThis!==void 0&&(globalThis.SmartTooltip=io);var Hs=j(((e,i)=>{function t(){this.__data__=[],this.size=0}i.exports=t})),Vt=j(((e,i)=>{function t(n,m){return n===m||n!==n&&m!==m}i.exports=t})),Ai=j(((e,i)=>{var t=Vt();function n(m,g){for(var f=m.length;f--;)if(t(m[f][0],g))return f;return-1}i.exports=n})),Bs=j(((e,i)=>{var t=Ai(),n=Array.prototype.splice;function m(g){var f=this.__data__,c=t(f,g);return c<0?!1:(c==f.length-1?f.pop():n.call(f,c,1),--this.size,!0)}i.exports=m})),Ws=j(((e,i)=>{var t=Ai();function n(m){var g=this.__data__,f=t(g,m);return f<0?void 0:g[f][1]}i.exports=n})),js=j(((e,i)=>{var t=Ai();function n(m){return t(this.__data__,m)>-1}i.exports=n})),Vs=j(((e,i)=>{var t=Ai();function n(m,g){var f=this.__data__,c=t(f,m);return c<0?(++this.size,f.push([m,g])):f[c][1]=g,this}i.exports=n})),ki=j(((e,i)=>{var t=Hs(),n=Bs(),m=Ws(),g=js(),f=Vs();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),Us=j(((e,i)=>{var t=ki();function n(){this.__data__=new t,this.size=0}i.exports=n})),Gs=j(((e,i)=>{function t(n){var m=this.__data__,g=m.delete(n);return this.size=m.size,g}i.exports=t})),Ks=j(((e,i)=>{function t(n){return this.__data__.get(n)}i.exports=t})),qs=j(((e,i)=>{function t(n){return this.__data__.has(n)}i.exports=t})),no=j(((e,i)=>{var t=typeof global=="object"&&global&&global.Object===Object&&global;i.exports=t})),We=j(((e,i)=>{var t=no(),n=typeof self=="object"&&self&&self.Object===Object&&self,m=t||n||Function("return this")();i.exports=m})),Ti=j(((e,i)=>{var t=We().Symbol;i.exports=t})),Ys=j(((e,i)=>{var t=Ti(),n=Object.prototype,m=n.hasOwnProperty,g=n.toString,f=t?t.toStringTag:void 0;function c(o){var h=m.call(o,f),d=o[f];try{o[f]=void 0;var u=!0}catch{}var l=g.call(o);return u&&(h?o[f]=d:delete o[f]),l}i.exports=c})),Zs=j(((e,i)=>{var t=Object.prototype.toString;function n(m){return t.call(m)}i.exports=n})),At=j(((e,i)=>{var t=Ti(),n=Ys(),m=Zs(),g="[object Null]",f="[object Undefined]",c=t?t.toStringTag:void 0;function o(h){return h==null?h===void 0?f:g:c&&c in Object(h)?n(h):m(h)}i.exports=o})),et=j(((e,i)=>{function t(n){var m=typeof n;return n!=null&&(m=="object"||m=="function")}i.exports=t})),kn=j(((e,i)=>{var t=At(),n=et(),m="[object AsyncFunction]",g="[object Function]",f="[object GeneratorFunction]",c="[object Proxy]";function o(h){if(!n(h))return!1;var d=t(h);return d==g||d==f||d==m||d==c}i.exports=o})),Qs=j(((e,i)=>{var t=We()["__core-js_shared__"];i.exports=t})),Xs=j(((e,i)=>{var t=Qs(),n=(function(){var g=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""})();function m(g){return!!n&&n in g}i.exports=m})),ro=j(((e,i)=>{var t=Function.prototype.toString;function n(m){if(m!=null){try{return t.call(m)}catch{}try{return m+""}catch{}}return""}i.exports=n})),Js=j(((e,i)=>{var t=kn(),n=Xs(),m=et(),g=ro(),f=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,o=Function.prototype,h=Object.prototype,d=o.toString,u=h.hasOwnProperty,l=RegExp("^"+d.call(u).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function s(r){return!m(r)||n(r)?!1:(t(r)?l:c).test(g(r))}i.exports=s})),ea=j(((e,i)=>{function t(n,m){return n?.[m]}i.exports=t})),ut=j(((e,i)=>{var t=Js(),n=ea();function m(g,f){var c=n(g,f);return t(c)?c:void 0}i.exports=m})),Tn=j(((e,i)=>{var t=ut()(We(),"Map");i.exports=t})),Mi=j(((e,i)=>{var t=ut()(Object,"create");i.exports=t})),ta=j(((e,i)=>{var t=Mi();function n(){this.__data__=t?t(null):{},this.size=0}i.exports=n})),ia=j(((e,i)=>{function t(n){var m=this.has(n)&&delete this.__data__[n];return this.size-=m?1:0,m}i.exports=t})),na=j(((e,i)=>{var t=Mi(),n="__lodash_hash_undefined__",m=Object.prototype.hasOwnProperty;function g(f){var c=this.__data__;if(t){var o=c[f];return o===n?void 0:o}return m.call(c,f)?c[f]:void 0}i.exports=g})),ra=j(((e,i)=>{var t=Mi(),n=Object.prototype.hasOwnProperty;function m(g){var f=this.__data__;return t?f[g]!==void 0:n.call(f,g)}i.exports=m})),oa=j(((e,i)=>{var t=Mi(),n="__lodash_hash_undefined__";function m(g,f){var c=this.__data__;return this.size+=this.has(g)?0:1,c[g]=t&&f===void 0?n:f,this}i.exports=m})),sa=j(((e,i)=>{var t=ta(),n=ia(),m=na(),g=ra(),f=oa();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),aa=j(((e,i)=>{var t=sa(),n=ki(),m=Tn();function g(){this.size=0,this.__data__={hash:new t,map:new(m||n),string:new t}}i.exports=g})),la=j(((e,i)=>{function t(n){var m=typeof n;return m=="string"||m=="number"||m=="symbol"||m=="boolean"?n!=="__proto__":n===null}i.exports=t})),$i=j(((e,i)=>{var t=la();function n(m,g){var f=m.__data__;return t(g)?f[typeof g=="string"?"string":"hash"]:f.map}i.exports=n})),ca=j(((e,i)=>{var t=$i();function n(m){var g=t(this,m).delete(m);return this.size-=g?1:0,g}i.exports=n})),ua=j(((e,i)=>{var t=$i();function n(m){return t(this,m).get(m)}i.exports=n})),da=j(((e,i)=>{var t=$i();function n(m){return t(this,m).has(m)}i.exports=n})),ha=j(((e,i)=>{var t=$i();function n(m,g){var f=t(this,m),c=f.size;return f.set(m,g),this.size+=f.size==c?0:1,this}i.exports=n})),Mn=j(((e,i)=>{var t=aa(),n=ca(),m=ua(),g=da(),f=ha();function c(o){var h=-1,d=o==null?0:o.length;for(this.clear();++h<d;){var u=o[h];this.set(u[0],u[1])}}c.prototype.clear=t,c.prototype.delete=n,c.prototype.get=m,c.prototype.has=g,c.prototype.set=f,i.exports=c})),pa=j(((e,i)=>{var t=ki(),n=Tn(),m=Mn(),g=200;function f(c,o){var h=this.__data__;if(h instanceof t){var d=h.__data__;if(!n||d.length<g-1)return d.push([c,o]),this.size=++h.size,this;h=this.__data__=new m(d)}return h.set(c,o),this.size=h.size,this}i.exports=f})),oo=j(((e,i)=>{var t=ki(),n=Us(),m=Gs(),g=Ks(),f=qs(),c=pa();function o(h){var d=this.__data__=new t(h);this.size=d.size}o.prototype.clear=n,o.prototype.delete=m,o.prototype.get=g,o.prototype.has=f,o.prototype.set=c,i.exports=o})),so=j(((e,i)=>{var t=ut(),n=(function(){try{var m=t(Object,"defineProperty");return m({},"",{}),m}catch{}})();i.exports=n})),$n=j(((e,i)=>{var t=so();function n(m,g,f){g=="__proto__"&&t?t(m,g,{configurable:!0,enumerable:!0,value:f,writable:!0}):m[g]=f}i.exports=n})),ao=j(((e,i)=>{var t=$n(),n=Vt();function m(g,f,c){(c!==void 0&&!n(g[f],c)||c===void 0&&!(f in g))&&t(g,f,c)}i.exports=m})),fa=j(((e,i)=>{function t(n){return function(m,g,f){for(var c=-1,o=Object(m),h=f(m),d=h.length;d--;){var u=h[n?d:++c];if(g(o[u],u,o)===!1)break}return m}}i.exports=t})),ga=j(((e,i)=>{var t=fa()();i.exports=t})),ma=j(((e,i)=>{var t=We(),n=typeof e=="object"&&e&&!e.nodeType&&e,m=n&&typeof i=="object"&&i&&!i.nodeType&&i,g=m&&m.exports===n?t.Buffer:void 0,f=g?g.allocUnsafe:void 0;function c(o,h){if(h)return o.slice();var d=o.length,u=f?f(d):new o.constructor(d);return o.copy(u),u}i.exports=c})),lo=j(((e,i)=>{var t=We().Uint8Array;i.exports=t})),va=j(((e,i)=>{var t=lo();function n(m){var g=new m.constructor(m.byteLength);return new t(g).set(new t(m)),g}i.exports=n})),ya=j(((e,i)=>{var t=va();function n(m,g){var f=g?t(m.buffer):m.buffer;return new m.constructor(f,m.byteOffset,m.length)}i.exports=n})),ba=j(((e,i)=>{function t(n,m){var g=-1,f=n.length;for(m||(m=Array(f));++g<f;)m[g]=n[g];return m}i.exports=t})),wa=j(((e,i)=>{var t=et(),n=Object.create,m=(function(){function g(){}return function(f){if(!t(f))return{};if(n)return n(f);g.prototype=f;var c=new g;return g.prototype=void 0,c}})();i.exports=m})),co=j(((e,i)=>{function t(n,m){return function(g){return n(m(g))}}i.exports=t})),uo=j(((e,i)=>{var t=co()(Object.getPrototypeOf,Object);i.exports=t})),Ln=j(((e,i)=>{var t=Object.prototype;function n(m){var g=m&&m.constructor;return m===(typeof g=="function"&&g.prototype||t)}i.exports=n})),Ca=j(((e,i)=>{var t=wa(),n=uo(),m=Ln();function g(f){return typeof f.constructor=="function"&&!m(f)?t(n(f)):{}}i.exports=g})),dt=j(((e,i)=>{function t(n){return n!=null&&typeof n=="object"}i.exports=t})),Sa=j(((e,i)=>{var t=At(),n=dt(),m="[object Arguments]";function g(f){return n(f)&&t(f)==m}i.exports=g})),ho=j(((e,i)=>{var t=Sa(),n=dt(),m=Object.prototype,g=m.hasOwnProperty,f=m.propertyIsEnumerable,c=t((function(){return arguments})())?t:function(o){return n(o)&&g.call(o,"callee")&&!f.call(o,"callee")};i.exports=c})),ht=j(((e,i)=>{var t=Array.isArray;i.exports=t})),po=j(((e,i)=>{var t=9007199254740991;function n(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=t}i.exports=n})),Li=j(((e,i)=>{var t=kn(),n=po();function m(g){return g!=null&&n(g.length)&&!t(g)}i.exports=m})),xa=j(((e,i)=>{var t=Li(),n=dt();function m(g){return n(g)&&t(g)}i.exports=m})),Ea=j(((e,i)=>{function t(){return!1}i.exports=t})),Rn=j(((e,i)=>{var t=We(),n=Ea(),m=typeof e=="object"&&e&&!e.nodeType&&e,g=m&&typeof i=="object"&&i&&!i.nodeType&&i,f=g&&g.exports===m?t.Buffer:void 0,c=(f?f.isBuffer:void 0)||n;i.exports=c})),Aa=j(((e,i)=>{var t=At(),n=uo(),m=dt(),g="[object Object]",f=Function.prototype,c=Object.prototype,o=f.toString,h=c.hasOwnProperty,d=o.call(Object);function u(l){if(!m(l)||t(l)!=g)return!1;var s=n(l);if(s===null)return!0;var r=h.call(s,"constructor")&&s.constructor;return typeof r=="function"&&r instanceof r&&o.call(r)==d}i.exports=u})),ka=j(((e,i)=>{var t=At(),n=po(),m=dt(),g="[object Arguments]",f="[object Array]",c="[object Boolean]",o="[object Date]",h="[object Error]",d="[object Function]",u="[object Map]",l="[object Number]",s="[object Object]",r="[object RegExp]",a="[object Set]",p="[object String]",v="[object WeakMap]",y="[object ArrayBuffer]",k="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",M="[object Int16Array]",L="[object Int32Array]",R="[object Uint8Array]",$="[object Uint8ClampedArray]",D="[object Uint16Array]",T="[object Uint32Array]",E={};E[x]=E[w]=E[S]=E[M]=E[L]=E[R]=E[$]=E[D]=E[T]=!0,E[g]=E[f]=E[y]=E[c]=E[k]=E[o]=E[h]=E[d]=E[u]=E[l]=E[s]=E[r]=E[a]=E[p]=E[v]=!1;function C(b){return m(b)&&n(b.length)&&!!E[t(b)]}i.exports=C})),Ta=j(((e,i)=>{function t(n){return function(m){return n(m)}}i.exports=t})),Ma=j(((e,i)=>{var t=no(),n=typeof e=="object"&&e&&!e.nodeType&&e,m=n&&typeof i=="object"&&i&&!i.nodeType&&i,g=m&&m.exports===n&&t.process,f=(function(){try{var c=m&&m.require&&m.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();i.exports=f})),_n=j(((e,i)=>{var t=ka(),n=Ta(),m=Ma(),g=m&&m.isTypedArray,f=g?n(g):t;i.exports=f})),fo=j(((e,i)=>{function t(n,m){if(!(m==="constructor"&&typeof n[m]=="function")&&m!="__proto__")return n[m]}i.exports=t})),go=j(((e,i)=>{var t=$n(),n=Vt(),m=Object.prototype.hasOwnProperty;function g(f,c,o){var h=f[c];(!(m.call(f,c)&&n(h,o))||o===void 0&&!(c in f))&&t(f,c,o)}i.exports=g})),$a=j(((e,i)=>{var t=go(),n=$n();function m(g,f,c,o){var h=!c;c||(c={});for(var d=-1,u=f.length;++d<u;){var l=f[d],s=o?o(c[l],g[l],l,c,g):void 0;s===void 0&&(s=g[l]),h?n(c,l,s):t(c,l,s)}return c}i.exports=m})),La=j(((e,i)=>{function t(n,m){for(var g=-1,f=Array(n);++g<n;)f[g]=m(g);return f}i.exports=t})),On=j(((e,i)=>{var t=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function m(g,f){var c=typeof g;return f=f??t,!!f&&(c=="number"||c!="symbol"&&n.test(g))&&g>-1&&g%1==0&&g<f}i.exports=m})),mo=j(((e,i)=>{var t=La(),n=ho(),m=ht(),g=Rn(),f=On(),c=_n(),o=Object.prototype.hasOwnProperty;function h(d,u){var l=m(d),s=!l&&n(d),r=!l&&!s&&g(d),a=!l&&!s&&!r&&c(d),p=l||s||r||a,v=p?t(d.length,String):[],y=v.length;for(var k in d)(u||o.call(d,k))&&!(p&&(k=="length"||r&&(k=="offset"||k=="parent")||a&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||f(k,y)))&&v.push(k);return v}i.exports=h})),Ra=j(((e,i)=>{function t(n){var m=[];if(n!=null)for(var g in Object(n))m.push(g);return m}i.exports=t})),_a=j(((e,i)=>{var t=et(),n=Ln(),m=Ra(),g=Object.prototype.hasOwnProperty;function f(c){if(!t(c))return m(c);var o=n(c),h=[];for(var d in c)d=="constructor"&&(o||!g.call(c,d))||h.push(d);return h}i.exports=f})),vo=j(((e,i)=>{var t=mo(),n=_a(),m=Li();function g(f){return m(f)?t(f,!0):n(f)}i.exports=g})),Oa=j(((e,i)=>{var t=$a(),n=vo();function m(g){return t(g,n(g))}i.exports=m})),Ia=j(((e,i)=>{var t=ao(),n=ma(),m=ya(),g=ba(),f=Ca(),c=ho(),o=ht(),h=xa(),d=Rn(),u=kn(),l=et(),s=Aa(),r=_n(),a=fo(),p=Oa();function v(y,k,x,w,S,M,L){var R=a(y,x),$=a(k,x),D=L.get($);if(D){t(y,x,D);return}var T=M?M(R,$,x+"",y,k,L):void 0,E=T===void 0;if(E){var C=o($),b=!C&&d($),A=!C&&!b&&r($);T=$,C||b||A?o(R)?T=R:h(R)?T=g(R):b?(E=!1,T=n($,!0)):A?(E=!1,T=m($,!0)):T=[]:s($)||c($)?(T=R,c(R)?T=p(R):(!l(R)||u(R))&&(T=f($))):E=!1}E&&(L.set($,T),S(T,$,w,M,L),L.delete($)),t(y,x,T)}i.exports=v})),Da=j(((e,i)=>{var t=oo(),n=ao(),m=ga(),g=Ia(),f=et(),c=vo(),o=fo();function h(d,u,l,s,r){d!==u&&m(u,function(a,p){if(r||(r=new t),f(a))g(d,u,p,l,h,s,r);else{var v=s?s(o(d,p),a,p+"",d,u,r):void 0;v===void 0&&(v=a),n(d,p,v)}},c)}i.exports=h})),yo=j(((e,i)=>{function t(n){return n}i.exports=t})),Na=j(((e,i)=>{function t(n,m,g){switch(g.length){case 0:return n.call(m);case 1:return n.call(m,g[0]);case 2:return n.call(m,g[0],g[1]);case 3:return n.call(m,g[0],g[1],g[2])}return n.apply(m,g)}i.exports=t})),Fa=j(((e,i)=>{var t=Na(),n=Math.max;function m(g,f,c){return f=n(f===void 0?g.length-1:f,0),function(){for(var o=arguments,h=-1,d=n(o.length-f,0),u=Array(d);++h<d;)u[h]=o[f+h];h=-1;for(var l=Array(f+1);++h<f;)l[h]=o[h];return l[f]=c(u),t(g,this,l)}}i.exports=m})),za=j(((e,i)=>{function t(n){return function(){return n}}i.exports=t})),Pa=j(((e,i)=>{var t=za(),n=so(),m=yo(),g=n?function(f,c){return n(f,"toString",{configurable:!0,enumerable:!1,value:t(c),writable:!0})}:m;i.exports=g})),Ha=j(((e,i)=>{var t=800,n=16,m=Date.now;function g(f){var c=0,o=0;return function(){var h=m(),d=n-(h-o);if(o=h,d>0){if(++c>=t)return arguments[0]}else c=0;return f.apply(void 0,arguments)}}i.exports=g})),Ba=j(((e,i)=>{var t=Pa(),n=Ha()(t);i.exports=n})),Wa=j(((e,i)=>{var t=yo(),n=Fa(),m=Ba();function g(f,c){return m(n(f,c,t),f+"")}i.exports=g})),ja=j(((e,i)=>{var t=Vt(),n=Li(),m=On(),g=et();function f(c,o,h){if(!g(h))return!1;var d=typeof o;return(d=="number"?n(h)&&m(o,h.length):d=="string"&&o in h)?t(h[o],c):!1}i.exports=f})),Va=j(((e,i)=>{var t=Wa(),n=ja();function m(g){return t(function(f,c){var o=-1,h=c.length,d=h>1?c[h-1]:void 0,u=h>2?c[2]:void 0;for(d=g.length>3&&typeof d=="function"?(h--,d):void 0,u&&n(c[0],c[1],u)&&(d=h<3?void 0:d,h=1),f=Object(f);++o<h;){var l=c[o];l&&g(f,l,o,d)}return f})}i.exports=m})),Ua=j(((e,i)=>{var t=Da(),n=Va()(function(m,g,f,c){t(m,g,f,c)});i.exports=n})),Ga=Et(Ua(),1),Ka="formeo",qa="5.3.0",Ya="module",Za="dist/formeo.cjs.js",Qa="dist/formeo.es.js",Xa="dist/formeo.umd.js",Ja={".":{import:"./dist/formeo.es.js",require:"./dist/formeo.cjs.js",default:"./dist/formeo.umd.js"},"./dist/formeo.min.css":{import:"./dist/formeo.min.css",require:"./dist/formeo.min.css",default:"./dist/formeo.min.css"}},el=["dist/*","demo/**/*"],tl="https://formeo.io",il={url:"https://github.com/Draggable/formeo",type:"git"},nl="Draggable https://draggable.io",rl=[{name:"Kevin Chappell",email:"kevin@chappell.dev",url:"https://kevin-chappell.com"}],ol={url:"https://github.com/draggable/formeo/issues"},sl="A zero dependency JavaScript module for drag and drop form creation.",al=["drag and drop","form builder","form maker","forms"];var ll=["**/*","node_modules","test"],cl={files:{test:["test/**/*.spec.js"],"formeo-editor":{js:"src/js/editor.js"},"formeo-renderer":{js:"src/js/renderer.js"},site:["demo/assets/sass/site.scss"]}},ul={dev:"vite --mode development",preview:"vite preview","prebuild:lib":`node -e "require('node:fs').rmSync('dist', { recursive: true, force: true })"`,"build:lib":"npm-run-all -p build:lib:unminified build:lib:minified","build:lib:unminified":"vite build --config vite.config.lib.mjs --mode production","build:lib:minified":"vite build --config vite.config.lib.mjs --mode production-minified",build:"npm-run-all -p build:icons build:demo",prebuild:"npm run build:lib",postbuild:"npm run generate:jsonSchema","build:demo":"vite build --mode demo","postbuild:demo":"node --no-warnings tools/copy-assets.mjs","build:demo:watch":"vite build --mode demo --watch","build:icons":"node ./tools/generate-sprite",lint:"biome check ./src && node tools/check-color-literals.mjs && node tools/check-doc-links.mjs","lint:fix":"biome check --write ./src",format:"biome format --write .",test:"node --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:watch":"node --watch --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:updateSnapshots":"node --loader=./tools/svg-loader.mjs --import=./tools/__mocks__/sprite-init.mjs --experimental-test-snapshots --test-update-snapshots --require ./tools/test-setup.cjs --test --no-warnings src/**/*.test.{js,mjs}","test:ci":"npm test --coverage",start:"npm-run-all build:icons dev","semantic-release":"semantic-release --ci --debug","copy:lang":"node ./tools/copy-directory.mjs ./node_modules/formeo-i18n/dist/lang ./src/demo/assets/lang","travis-deploy-once":"travis-deploy-once --pro","playwright:test":"playwright test","playwright:test:ui":"playwright test --ui","playwright:test:report":"playwright show-report","playwright:test:ci":"playwright test --reporter=dot",prepush:"npm test",prepare:"lefthook install",postmerge:"lefthook install","generate:jsonSchema":"node --experimental-strip-types --no-warnings ./tools/generate-json-schema.ts"},dl={"@biomejs/biome":"^2.3.3","@commitlint/cli":"^21.0.1","@commitlint/config-conventional":"^21.0.1","@playwright/test":"^1.49.1","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.8","@semantic-release/npm":"^13.1.3","@types/node":"^25.8.0","ace-builds":"^1.36.5",esbuild:"^0.28.0",jsdom:"^29.1.1",lefthook:"^2.1.6","npm-run-all":"^4.1.5","sass-embedded":"^1.80.1","semantic-release":"^25.0.2","svg-sprite":"^2.0.4",vite:"^8.0.13","vite-plugin-banner":"^0.8.0","vite-plugin-compression":"^0.5.1","vite-plugin-html":"^3.2.2",zod:"^4.4.3"},hl={"@draggable/formeo-languages":"^3.4.1","@draggable/i18n":"^1.0.7","@draggable/tooltip":"^1.2.2",lodash:"^4.17.21",sortablejs:"^1.15.3"},pl={branches:["main"],verifyConditions:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"],prepare:["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],publish:["@semantic-release/npm","@semantic-release/github"],success:["@semantic-release/github"],fail:["@semantic-release/github"]},fl={extends:["@commitlint/config-conventional"],rules:{"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]]}},bo={name:Ka,version:qa,type:Ya,main:Za,module:Qa,unpkg:Xa,exports:Ja,files:el,homepage:tl,repository:il,author:nl,contributors:rl,bugs:ol,description:sl,keywords:al,license:"MIT",ignore:ll,config:cl,scripts:ul,devDependencies:dl,dependencies:hl,release:pl,commitlint:fl},gl='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acprefix__rect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="acprefix__layer1"><g id="acprefix__text4203"><g id="acprefix__g4212" transform="translate(0.10112835,0.1001358)"><path id="acprefix__path4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acprefix__path4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agprefix__rect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="aiprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="aiprefix__rect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqprefix__g4220"><rect id="aqprefix__rect4191" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqprefix__g4220-6"><rect id="aqprefix__rect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><path d="M2 7h2v2H2zM7 7h2v2H7zM12 7h2v2h-2zM2 12h2v2H2zM7 12h2v2H7zM12 12h2v2h-2z" transform="rotate(90 9.25 9.25)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><path d="M9.5-6.5h2v2h-2zm-5 0h2v2h-2zm5-5h2v2h-2zm-5 0h2v2h-2z" transform="rotate(90)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Zm10-5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-stage" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5h2v2H2zM7 4.5h2v2H7zM12 4.5h2v2h-2zM2 9.5h2v2H2zM7 9.5h2v2H7zM12 9.5h2v2h-2zM2-.5h2v2H2zM7-.5h2v2H7zM12-.5h2v2h-2z" transform="translate(0 2.5)"/></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="arprefix__icomoon-ignore"/><path d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h1v-1H0Zm15-7h1V4h-1zm-1 7h1v-1h-1zm-2 0h1v-1h-1zm-2 0h1v-1h-1Zm-2 0h1v-1H8Zm-2 0h1v-1H6Zm-2 0h1v-1H4Zm-2 0h1v-1H2Zm13-1h1v-1h-1ZM0 10h1V9H0Zm15-1h1V8h-1ZM0 8h1V7H0Zm15-1h1V6h-1ZM0 6h1V5H0Zm13-1h1V4h-1zm-2 0h1V4h-1ZM9 5h1V4H9ZM7 5h1V4H7ZM5 5h1V4H5ZM3 5h1V4H3ZM1 5h1V4H1Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 32 32" id="f-i-info-circle" xmlns="http://www.w3.org/2000/svg"><path d="m17.962 24.725 1.806.096v2.531h-7.534v-2.406l1.045-.094c.568-.063.916-.254.916-1.014v-8.801c0-.699-.188-.92-.791-.92l-1.106-.062v-2.626h5.666zM15.747 4.648c1.394 0 2.405 1.047 2.405 2.374 0 1.331-1.014 2.313-2.438 2.313-1.454 0-2.404-.982-2.404-2.313 0-1.327.95-2.374 2.437-2.374M16 32C7.178 32 0 24.822 0 16S7.178 0 16 0c8.82 0 16 7.178 16 16s-7.18 16-16 16m0-29C8.832 3 3 8.832 3 16s5.832 13 13 13 13-5.832 13-13S23.168 3 16 3"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="avprefix__icomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L18 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-plus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12H18M12 6V18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><path d="M193.694-139.2h87.322v510.916h-87.322zM-18.103 159.92V72.597h510.915v87.322z" transform="rotate(45 77.994 208.636)"/></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="bfprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="bfprefix__g7209"><path id="bfprefix__rect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bgprefix__XMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bhprefix__icomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="biprefix__XMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bjprefix__XMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="boprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',In=bo.name,Dn=bo.version,Ri=In,ml="formeo-sprite",vl=`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/${ml}.svg`,yl=`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/formeo.min.css`,bl="https://draggable.github.io/formeo/assets/css/formeo.min.css",wo="f-panel",ot="control-group",kt=`${Ri}-stage`,Ue=`${Ri}-row`,Ge=`${Ri}-column`,Tt=`${Ri}-field`,hn="custom-column-widths",Co="column-preset",Pi="resizing-columns",wl=new Map([[kt,Ue],[Ue,Ge],[Ge,Tt]]),Nn=["stage","row","column","field"],Fn=Nn.map(e=>`${e}s`),yp=new Map(Fn.map((e,i)=>[e,Nn[i]])),Cl=new RegExp(`^${Fn.join("|")}.`),So=[...Nn],xo=[...Fn],Sl=new Map(xo.map((e,i)=>[e,So[i]])),bp=new RegExp(`^${xo.join("|")}.`),Hi=So.reduce((e,i)=>(e[i]=i,e),{}),xl=[{name:"controls",className:ot},{name:"stage",className:kt},{name:"row",className:Ue},{name:"column",className:Ge},{name:"field",className:Tt}],zn={controls:ot,stage:kt,row:Ue,column:Ge,field:Tt},El=Object.entries(zn).reduce((e,[i,t])=>(e[t]=i,e),{}),Al=Object.values(zn),kl=new RegExp(`${Al.join("|")}`,"g"),{childTypeMapVals:Eo,childTypeIndexMapVals:Tl}=xl.reduce((e,{name:i},t,n)=>{const{name:m}=n[t+1]||{};return m&&(e.childTypeMapVals.push([i,m]),e.childTypeIndexMapVals.push([`${i}s`,`${m}s`])),e},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Ml=Eo.slice().map(e=>e.slice().reverse()).reverse(),pr=new Map(Eo),$l=new Map(Tl),Ll=new Map(Ml.slice()),Rl=[[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]],_l=new Map(Rl.reduce((e,i,t)=>(e.push([t,i]),e),[])),Pn=`${In}-formData`,fr=`${In}-locale`;var st=Math.round(333/2),Hn=Math.round(333*2),wp=Math.round(333/5),Ao="formeoSaved",Bn="formeoUpdated",Ol="formeoChanged",ko="formeoUpdatedStage",To="formeoUpdatedRow",Mo="formeoUpdatedColumn",$o="formeoUpdatedField",Il="formeoCleared",Lo="formeoOnRender",Dl="formeoConditionUpdated",Wn="formeoAddedRow",jn="formeoAddedColumn",Vn="formeoAddedField",Un="formeoRemovedRow",Gn="formeoRemovedColumn",Kn="formeoRemovedField",Ro={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Nl={and:"&&",or:"||"},_o={equals:"="},Fl=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],gr=["isChecked","isNotChecked"],mr=["isVisible","isNotVisible"],ni=["value"],zl={comparison:Ro,assignment:_o,logical:Nl};var Pl="then",qn=()=>({if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[Pl]:[{target:"",targetProperty:"",assignment:"",value:""}]}),Hl=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,pn=/\bcol-\w+-\d+/g,Oo="f-i-",wt=()=>({id:Me(),stages:{[Me()]:{}},rows:{},columns:{},fields:{}}),fi=["selected","checked"],Bl=fi.toReversed(),Wl=new Map([["config",new Set(["label","helpText","hideLabel","labelAfter","disableHtmlLabel","tooltip"])]]),jl=()=>crypto.randomUUID().slice(0,8),Vl=()=>jl().slice(0,8),vr=(e="",i)=>{if(!i)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof i=="string"?[i]:i;n=n.map(g=>g==="*"?"":g.replace(t,"\\$&"));let m=!0;return n.length&&(m=!new RegExp(n.join("|"),"i").exec(e)),m},Ul=(e,i)=>{const t=e.indexOf(i);t!==-1&&e.splice(t,1)},be=e=>{const i=e.className?.match(kl);return i&&El[i[0]]},at=e=>Array.from(new Set(e)),Me=e=>e?.attrs?.id||e?.id||Vl(),De=(e,i)=>{const t=(n,m)=>{if(Array.isArray(n))return m!=null?at(n.concat(m)):m;if(Array.isArray(m))return n!=null?at(m.concat(n)):m};return(0,Ga.default)({},e,i,t)},He=e=>{let i;const t=e instanceof Promise;if(e===null||typeof e!="object"||t)return e;if(e instanceof Date)return i=new Date,i.setTime(e.getTime()),i;if(Array.isArray(e)){i=[];for(let n=0,m=e.length;n<m;n++)i[n]=He(e[n]);return i}if(e instanceof Object){i={};for(const n in e)Object.hasOwn(e,n)&&(i[n]=He(e[n]));return i}throw new Error("Unable to copy Object, type not supported.")},Bi=(e,i)=>e/i*100,fn=e=>`${e.toString()}%`,Yn=Object.create(null,{get:{value:e=>{const i=window.sessionStorage?.getItem(e);try{return JSON.parse(i)}catch{return i}}},set:{value:(e,i)=>{try{return window.sessionStorage?.setItem(e,JSON.stringify(i))}catch(t){console.error(t)}}}}),Te=e=>/^(stage|row|column|field)s./.test(e),Gl=e=>Cl.test(e);function Io(e,i=Hn,{trailing:t=!1}={}){let n=0,m=null,g=null;return function(...f){const c=i-(Date.now()-n);if(c<=0){clearTimeout(m),m=null,n=Date.now(),e.apply(this,f);return}t&&(g=f,m||(m=setTimeout(()=>{m=null,n=Date.now(),e.apply(this,g)},c)))}}function gi(e,i=st){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>e.apply(this,n),i)}}function gn(e){return e}function mn(){}function _i(e=Object.create(null)){if(typeof e=="string")try{return JSON.parse(e)}catch(i){return console.error("Invalid JSON string provided:",i),Object.create(null)}return e}var rt=e=>e?He(_i(e)):wt();function Do(e,i,t,n={}){if(!i||!e[t][i])return n;const m=`${t}.${i}`;n[m]=e[t][i];const g=$l.get(t);if(g){const f=e[t][i].data?.children||[];for(const c of f)Do(e,c,g,n)}return n}var Kl="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(e=>String.raw`\s${e}\s`),ql=new RegExp(String.raw`(?!${Kl.join("|")})\w\S*`,"g"),Yl=/\s+/g;function je(e){return typeof e!="string"||e.trim().match(Yl)?e:e.replace(ql,i=>i.charAt(0).toUpperCase()+i.substring(1).replace(/[A-Z]/g,t=>` ${t}`))}var No=(e,i="-")=>e.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,i),lt=e=>{if(Array.isArray(e))return e;const i=/[.[\]]/g,t=[];let n=0,m=i.exec(e);for(;m!==null;)t.push(e.slice(n,m.index)),n=m.index+m[0].length,m=i.exec(e);return n<e.length&&t.push(e.slice(n)),t.filter(Boolean)},yr=(e,i="-")=>lt(e).join(i),Zl=e=>{const i=document.createElement("div");return i.innerHTML=e,i.textContent||i.innerText||""},Ql=(e,i,t="…")=>{if(e.length<=i)return e;const n=e.slice(0,i),m=n.lastIndexOf(" ");let g=`${m>0?n.slice(0,m):n}`;return t&&(g+=t),g},Xl=/^attrs\.|^meta\.|^options\.|^config\./g;function mi(e){return e.replaceAll(Xl,"")}var Yt="no-transition",Jl={debug:!1,bubbles:!0,formeoLoaded:e=>{},onAdd:()=>{},onRemove:()=>{},onChange:e=>Q.opts?.debug&&console.log(e),onUpdate:e=>Q.opts?.debug&&console.log(e),onUpdateStage:e=>Q.opts?.debug&&console.log(e),onUpdateRow:e=>Q.opts?.debug&&console.log(e),onUpdateColumn:e=>Q.opts?.debug&&console.log(e),onUpdateField:e=>Q.opts?.debug&&console.log(e),onAddRow:e=>Q.opts?.debug&&console.log(e),onAddColumn:e=>Q.opts?.debug&&console.log(e),onAddField:e=>Q.opts?.debug&&console.log(e),onRemoveRow:e=>Q.opts?.debug&&console.log(e),onRemoveColumn:e=>Q.opts?.debug&&console.log(e),onRemoveField:e=>Q.opts?.debug&&console.log(e),onRender:e=>Q.opts?.debug&&console.log(e),onSave:e=>{},confirmClearAll:e=>{globalThis.confirm(e.confirmationMessage)&&e.clearAllAction(e)}},_e=({src:e,...i},t=Bn)=>{const n=new globalThis.CustomEvent(t,{detail:i,bubbles:Q.opts?.debug||Q.opts?.bubbles});if(n.data=(e||document).dispatchEvent(n),t==="formeoUpdated"){const m=new globalThis.CustomEvent(Ol,{detail:i,bubbles:Q.opts?.debug||Q.opts?.bubbles});(e||document).dispatchEvent(m)}return n},Q={init:function(e){return this.opts={...Jl,...e},this},formeoSaved:e=>_e(e,Ao),formeoUpdated:(e,i)=>_e(e,i||"formeoUpdated"),formeoCleared:e=>_e(e,Il),formeoOnRender:e=>_e(e,Lo),formeoConditionUpdated:e=>_e(e,Dl),formeoAddedRow:e=>_e(e,Wn),formeoAddedColumn:e=>_e(e,jn),formeoAddedField:e=>_e(e,Vn),formeoRemovedRow:e=>_e(e,Un),formeoRemovedColumn:e=>_e(e,Gn),formeoRemovedField:e=>_e(e,Kn)},ec=Io(()=>{const e={timeStamp:globalThis.performance.now(),type:Bn,detail:oe.formData};Q.opts.onUpdate(e),Q.opts.onChange!==Q.opts.onUpdate&&Q.opts.onChange(e)},st,{trailing:!0});document.addEventListener(Bn,ec);document.addEventListener(ko,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateStage(m)});document.addEventListener(To,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateRow(m)});document.addEventListener(Mo,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateColumn(m)});document.addEventListener($o,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onUpdate(m),Q.opts.onUpdateField(m)});document.addEventListener(Wn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddRow(m)});document.addEventListener(jn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddColumn(m)});document.addEventListener(Vn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onAdd(m),Q.opts.onAddField(m)});document.addEventListener(Un,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveRow(m)});document.addEventListener(Gn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveColumn(m)});document.addEventListener(Kn,e=>{const{timeStamp:i,type:t,detail:n}=e,m={timeStamp:i,type:t,detail:n};Q.opts.onRemove(m),Q.opts.onRemoveField(m)});document.addEventListener(Lo,e=>{const{timeStamp:i,type:t,detail:n}=e;Q.opts.onRender({timeStamp:i,type:t,detail:n})});document.addEventListener("confirmClearAll",e=>{e={timeStamp:e.timeStamp,type:e.type,confirmationMessage:e.detail.confirmationMessage,clearAllAction:e.detail.clearAllAction,btnCoords:e.detail.btnCoords},Q.opts.confirmClearAll(e)});document.addEventListener(Ao,({timeStamp:e,type:i,detail:{formData:t}})=>{const n={timeStamp:e,type:i,formData:t};Q.opts.onSave(n)});document.addEventListener("formeoLoaded",e=>{Q.opts.formeoLoaded(e.detail.formeo)});var Wi;function tc(){Wi=Wi||window.requestAnimationFrame(()=>{Wi=!1;for(const e of Object.values(Ht.data))e.dom.classList.add(Yt),Bt.dom.classList.add(Yt),Bt.panels.nav.refresh(),e.refreshFieldPanels(),Io(()=>{e.dom.classList.remove(Yt),Bt.dom.classList.remove(Yt)},333)})}window.addEventListener("resize",tc);var Zn=j(((e,i)=>{var t=At(),n=dt(),m="[object Symbol]";function g(f){return typeof f=="symbol"||n(f)&&t(f)==m}i.exports=g})),ic=j(((e,i)=>{var t=ht(),n=Zn(),m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function f(c,o){if(t(c))return!1;var h=typeof c;return h=="number"||h=="symbol"||h=="boolean"||c==null||n(c)?!0:g.test(c)||!m.test(c)||o!=null&&c in Object(o)}i.exports=f})),nc=j(((e,i)=>{var t=Mn(),n="Expected a function";function m(g,f){if(typeof g!="function"||f!=null&&typeof f!="function")throw new TypeError(n);var c=function(){var o=arguments,h=f?f.apply(this,o):o[0],d=c.cache;if(d.has(h))return d.get(h);var u=g.apply(this,o);return c.cache=d.set(h,u)||d,u};return c.cache=new(m.Cache||t),c}m.Cache=t,i.exports=m})),rc=j(((e,i)=>{var t=nc(),n=500;function m(g){var f=t(g,function(o){return c.size===n&&c.clear(),o}),c=f.cache;return f}i.exports=m})),oc=j(((e,i)=>{var t=rc(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m=/\\(\\)?/g,g=t(function(f){var c=[];return f.charCodeAt(0)===46&&c.push(""),f.replace(n,function(o,h,d,u){c.push(d?u.replace(m,"$1"):h||o)}),c});i.exports=g})),sc=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length,c=Array(f);++g<f;)c[g]=m(n[g],g,n);return c}i.exports=t})),ac=j(((e,i)=>{var t=Ti(),n=sc(),m=ht(),g=Zn(),f=1/0,c=t?t.prototype:void 0,o=c?c.toString:void 0;function h(d){if(typeof d=="string")return d;if(m(d))return n(d,h)+"";if(g(d))return o?o.call(d):"";var u=d+"";return u=="0"&&1/d==-f?"-0":u}i.exports=h})),Oi=j(((e,i)=>{var t=ac();function n(m){return m==null?"":t(m)}i.exports=n})),Fo=j(((e,i)=>{var t=ht(),n=ic(),m=oc(),g=Oi();function f(c,o){return t(c)?c:n(c,o)?[c]:m(g(c))}i.exports=f})),zo=j(((e,i)=>{var t=Zn(),n=1/0;function m(g){if(typeof g=="string"||t(g))return g;var f=g+"";return f=="0"&&1/g==-n?"-0":f}i.exports=m})),lc=j(((e,i)=>{var t=Fo(),n=zo();function m(g,f){f=t(f,g);for(var c=0,o=f.length;g!=null&&c<o;)g=g[n(f[c++])];return c&&c==o?g:void 0}i.exports=m})),cc=j(((e,i)=>{var t=lc();function n(m,g,f){var c=m==null?void 0:t(m,g);return c===void 0?f:c}i.exports=n})),uc=j(((e,i)=>{var t=go(),n=Fo(),m=On(),g=et(),f=zo();function c(o,h,d,u){if(!g(o))return o;h=n(h,o);for(var l=-1,s=h.length,r=s-1,a=o;a!=null&&++l<s;){var p=f(h[l]),v=d;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(l!=r){var y=a[p];v=u?u(y,p,a):void 0,v===void 0&&(v=g(y)?y:m(h[l+1])?[]:{})}t(a,p,v),a=a[p]}return o}i.exports=c})),dc=j(((e,i)=>{var t=uc();function n(m,g,f){return m==null?m:t(m,g,f)}i.exports=n})),hc=Et(cc(),1),pc=Et(dc(),1),we=hc.default,Ii=pc.default;function fc(e,i={}){const t={...e};for(const n in i)Object.hasOwn(i,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(i[n]):t[n]=[t[n],i[n]]:t[n]=i[n]);return t}function ri(...e){return e.flat().reduce((i,t)=>(i[t]=t,i),{})}var gc=j(((e,i)=>{var t="__lodash_hash_undefined__";function n(m){return this.__data__.set(m,t),this}i.exports=n})),mc=j(((e,i)=>{function t(n){return this.__data__.has(n)}i.exports=t})),vc=j(((e,i)=>{var t=Mn(),n=gc(),m=mc();function g(f){var c=-1,o=f==null?0:f.length;for(this.__data__=new t;++c<o;)this.add(f[c])}g.prototype.add=g.prototype.push=n,g.prototype.has=m,i.exports=g})),yc=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length;++g<f;)if(m(n[g],g,n))return!0;return!1}i.exports=t})),bc=j(((e,i)=>{function t(n,m){return n.has(m)}i.exports=t})),Po=j(((e,i)=>{var t=vc(),n=yc(),m=bc(),g=1,f=2;function c(o,h,d,u,l,s){var r=d&g,a=o.length,p=h.length;if(a!=p&&!(r&&p>a))return!1;var v=s.get(o),y=s.get(h);if(v&&y)return v==h&&y==o;var k=-1,x=!0,w=d&f?new t:void 0;for(s.set(o,h),s.set(h,o);++k<a;){var S=o[k],M=h[k];if(u)var L=r?u(M,S,k,h,o,s):u(S,M,k,o,h,s);if(L!==void 0){if(L)continue;x=!1;break}if(w){if(!n(h,function(R,$){if(!m(w,$)&&(S===R||l(S,R,d,u,s)))return w.push($)})){x=!1;break}}else if(!(S===M||l(S,M,d,u,s))){x=!1;break}}return s.delete(o),s.delete(h),x}i.exports=c})),wc=j(((e,i)=>{function t(n){var m=-1,g=Array(n.size);return n.forEach(function(f,c){g[++m]=[c,f]}),g}i.exports=t})),Cc=j(((e,i)=>{function t(n){var m=-1,g=Array(n.size);return n.forEach(function(f){g[++m]=f}),g}i.exports=t})),Sc=j(((e,i)=>{var t=Ti(),n=lo(),m=Vt(),g=Po(),f=wc(),c=Cc(),o=1,h=2,d="[object Boolean]",u="[object Date]",l="[object Error]",s="[object Map]",r="[object Number]",a="[object RegExp]",p="[object Set]",v="[object String]",y="[object Symbol]",k="[object ArrayBuffer]",x="[object DataView]",w=t?t.prototype:void 0,S=w?w.valueOf:void 0;function M(L,R,$,D,T,E,C){switch($){case x:if(L.byteLength!=R.byteLength||L.byteOffset!=R.byteOffset)return!1;L=L.buffer,R=R.buffer;case k:return!(L.byteLength!=R.byteLength||!E(new n(L),new n(R)));case d:case u:case r:return m(+L,+R);case l:return L.name==R.name&&L.message==R.message;case a:case v:return L==R+"";case s:var b=f;case p:var A=D&o;if(b||(b=c),L.size!=R.size&&!A)return!1;var _=C.get(L);if(_)return _==R;D|=h,C.set(L,R);var O=g(b(L),b(R),D,T,E,C);return C.delete(L),O;case y:if(S)return S.call(L)==S.call(R)}return!1}i.exports=M})),xc=j(((e,i)=>{function t(n,m){for(var g=-1,f=m.length,c=n.length;++g<f;)n[c+g]=m[g];return n}i.exports=t})),Ec=j(((e,i)=>{var t=xc(),n=ht();function m(g,f,c){var o=f(g);return n(g)?o:t(o,c(g))}i.exports=m})),Ac=j(((e,i)=>{function t(n,m){for(var g=-1,f=n==null?0:n.length,c=0,o=[];++g<f;){var h=n[g];m(h,g,n)&&(o[c++]=h)}return o}i.exports=t})),kc=j(((e,i)=>{function t(){return[]}i.exports=t})),Tc=j(((e,i)=>{var t=Ac(),n=kc(),m=Object.prototype.propertyIsEnumerable,g=Object.getOwnPropertySymbols,f=g?function(c){return c==null?[]:(c=Object(c),t(g(c),function(o){return m.call(c,o)}))}:n;i.exports=f})),Mc=j(((e,i)=>{var t=co()(Object.keys,Object);i.exports=t})),$c=j(((e,i)=>{var t=Ln(),n=Mc(),m=Object.prototype.hasOwnProperty;function g(f){if(!t(f))return n(f);var c=[];for(var o in Object(f))m.call(f,o)&&o!="constructor"&&c.push(o);return c}i.exports=g})),Lc=j(((e,i)=>{var t=mo(),n=$c(),m=Li();function g(f){return m(f)?t(f):n(f)}i.exports=g})),Rc=j(((e,i)=>{var t=Ec(),n=Tc(),m=Lc();function g(f){return t(f,m,n)}i.exports=g})),_c=j(((e,i)=>{var t=Rc(),n=1,m=Object.prototype.hasOwnProperty;function g(f,c,o,h,d,u){var l=o&n,s=t(f),r=s.length;if(r!=t(c).length&&!l)return!1;for(var a=r;a--;){var p=s[a];if(!(l?p in c:m.call(c,p)))return!1}var v=u.get(f),y=u.get(c);if(v&&y)return v==c&&y==f;var k=!0;u.set(f,c),u.set(c,f);for(var x=l;++a<r;){p=s[a];var w=f[p],S=c[p];if(h)var M=l?h(S,w,p,c,f,u):h(w,S,p,f,c,u);if(!(M===void 0?w===S||d(w,S,o,h,u):M)){k=!1;break}x||(x=p=="constructor")}if(k&&!x){var L=f.constructor,R=c.constructor;L!=R&&"constructor"in f&&"constructor"in c&&!(typeof L=="function"&&L instanceof L&&typeof R=="function"&&R instanceof R)&&(k=!1)}return u.delete(f),u.delete(c),k}i.exports=g})),Oc=j(((e,i)=>{var t=ut()(We(),"DataView");i.exports=t})),Ic=j(((e,i)=>{var t=ut()(We(),"Promise");i.exports=t})),Dc=j(((e,i)=>{var t=ut()(We(),"Set");i.exports=t})),Nc=j(((e,i)=>{var t=ut()(We(),"WeakMap");i.exports=t})),Fc=j(((e,i)=>{var t=Oc(),n=Tn(),m=Ic(),g=Dc(),f=Nc(),c=At(),o=ro(),h="[object Map]",d="[object Object]",u="[object Promise]",l="[object Set]",s="[object WeakMap]",r="[object DataView]",a=o(t),p=o(n),v=o(m),y=o(g),k=o(f),x=c;(t&&x(new t(new ArrayBuffer(1)))!=r||n&&x(new n)!=h||m&&x(m.resolve())!=u||g&&x(new g)!=l||f&&x(new f)!=s)&&(x=function(w){var S=c(w),M=S==d?w.constructor:void 0,L=M?o(M):"";if(L)switch(L){case a:return r;case p:return h;case v:return u;case y:return l;case k:return s}return S}),i.exports=x})),zc=j(((e,i)=>{var t=oo(),n=Po(),m=Sc(),g=_c(),f=Fc(),c=ht(),o=Rn(),h=_n(),d=1,u="[object Arguments]",l="[object Array]",s="[object Object]",r=Object.prototype.hasOwnProperty;function a(p,v,y,k,x,w){var S=c(p),M=c(v),L=S?l:f(p),R=M?l:f(v);L=L==u?s:L,R=R==u?s:R;var $=L==s,D=R==s,T=L==R;if(T&&o(p)){if(!o(v))return!1;S=!0,$=!1}if(T&&!$)return w||(w=new t),S||h(p)?n(p,v,y,k,x,w):m(p,v,L,y,k,x,w);if(!(y&d)){var E=$&&r.call(p,"__wrapped__"),C=D&&r.call(v,"__wrapped__");if(E||C){var b=E?p.value():p,A=C?v.value():v;return w||(w=new t),x(b,A,y,k,w)}}return T?(w||(w=new t),g(p,v,y,k,x,w)):!1}i.exports=a})),Pc=j(((e,i)=>{var t=zc(),n=dt();function m(g,f,c,o,h){return g===f?!0:g==null||f==null||!n(g)&&!n(f)?g!==g&&f!==f:t(g,f,c,o,m,h)}i.exports=m})),Hc=j(((e,i)=>{var t=Pc();function n(m,g){return t(m,g)}i.exports=n})),vn=Et(Hc(),1),Bc=(e,i)=>e===void 0?"added":i===void 0?"removed":(0,vn.default)(e,i)?"unchanged":"changed",Qn=class{constructor(e,i=Object.create(null)){this.name=e,this.data=i,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,i)=>JSON.stringify(e,null,i);get=e=>we(this.data,e);set(e,i){const t=we(this.data,e),n=Ii(this.data,e,i),m=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(m)),f={newVal:i,oldVal:t,path:e};for(const c of g)for(const o of this.setCallbacks[c])o(f);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:i,data:n,changeType:Bc(t,i),src:this.dom};if(t&&(c.previousValue=t),Q.formeoUpdated(c),this.name){const o={stage:ko,row:To,column:Mo,field:$o}[this.name];o&&Q.formeoUpdated(c,o)}}return n}addSetCallback(e,i){this.setCallbacks[e]?this.setCallbacks[e].push(i):this.setCallbacks[e]=[i]}removeSetCallback(e,i){this.setCallbacks[e]=this.setCallbacks[e].filter(t=>t!==i)}add=(e,i=Object.create(null))=>{const{id:t}=i,n=e||t||Me();return this.set(n,i)};remove=e=>{const i=lt(e),t=i.pop(),n=this.get(i);return Array.isArray(n)?n.splice(Number(t),1):n&&delete n[t],n};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[i,t])=>(e[i]=t?.data?t.getData():t,e),{});setCallbacks={};configVal=Object.create(null)},Di=class extends Qn{load=e=>{const i=_i(e);this.empty();for(const[t,n]of Object.entries(i))this.add(t,n);return this.data};get=e=>e?we(this.data,e):this.add();add=(e,i=Object.create(null))=>{const t=e||Me(),n=this.Component({...i,id:t});this.data[t]=n,this.active=n;const m={row:Wn,column:jn,field:Vn}[this.name];return m&&Q.formeoUpdated({entity:n,componentId:t,componentType:this.name,data:n.data},m),n};remove=e=>{if(Array.isArray(e))for(const i of e)this.get(i).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const i=Object.values(this.data).map(t=>t.empty(e));return Promise.all(i)};set config(e){this.configVal=De(this.configVal,He(e))}get config(){return this.configVal}conditionMap=new Map};function Wc(e,i,t){return(i=Gc(i))in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Ke.apply(null,arguments)}function br(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),t.push.apply(t,n)}return t}function Be(e){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?br(Object(t),!0).forEach(function(n){Wc(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):br(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function jc(e,i){if(e==null)return{};var t,n,m=Vc(e,i);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(e);for(n=0;n<g.length;n++)t=g[n],i.indexOf(t)===-1&&{}.propertyIsEnumerable.call(e,t)&&(m[t]=e[t])}return m}function Vc(e,i){if(e==null)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(i.indexOf(n)!==-1)continue;t[n]=e[n]}return t}function Uc(e,i){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,i||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(e)}function Gc(e){var i=Uc(e,"string");return typeof i=="symbol"?i:i+""}function yn(e){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},yn(e)}var Kc="1.15.7";function Ve(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Ye=Ve(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ut=Ve(/Edge/i),wr=Ve(/firefox/i),Dt=Ve(/safari/i)&&!Ve(/chrome/i)&&!Ve(/android/i),Xn=Ve(/iP(ad|od|hone)/i),Ho=Ve(/chrome/i)&&Ve(/android/i),Bo={capture:!1,passive:!1};function re(e,i,t){e.addEventListener(i,t,!Ye&&Bo)}function ne(e,i,t){e.removeEventListener(i,t,!Ye&&Bo)}function vi(e,i){if(i){if(i[0]===">"&&(i=i.substring(1)),e)try{if(e.matches)return e.matches(i);if(e.msMatchesSelector)return e.msMatchesSelector(i);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(i)}catch{return!1}return!1}}function Wo(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function Ie(e,i,t,n){if(e){t=t||document;do{if(i!=null&&(i[0]===">"?e.parentNode===t&&vi(e,i):vi(e,i))||n&&e===t)return e;if(e===t)break}while(e=Wo(e))}return null}var Cr=/\s+/g;function xe(e,i,t){e&&i&&(e.classList?e.classList[t?"add":"remove"](i):e.className=((" "+e.className+" ").replace(Cr," ").replace(" "+i+" "," ")+(t?" "+i:"")).replace(Cr," "))}function ee(e,i,t){var n=e&&e.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),i===void 0?t:t[i];!(i in n)&&i.indexOf("webkit")===-1&&(i="-webkit-"+i),n[i]=t+(typeof t=="string"?"":"px")}}function Ct(e,i){var t="";if(typeof e=="string")t=e;else do{var n=ee(e,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!i&&(e=e.parentNode));var m=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return m&&new m(t)}function jo(e,i,t){if(e){var n=e.getElementsByTagName(i),m=0,g=n.length;if(t)for(;m<g;m++)t(n[m],m);return n}return[]}function Pe(){var e=document.scrollingElement;return e||document.documentElement}function de(e,i,t,n,m){if(!(!e.getBoundingClientRect&&e!==window)){var g,f,c,o,h,d,u;if(e!==window&&e.parentNode&&e!==Pe()?(g=e.getBoundingClientRect(),f=g.top,c=g.left,o=g.bottom,h=g.right,d=g.height,u=g.width):(f=0,c=0,o=window.innerHeight,h=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(i||t)&&e!==window&&(m=m||e.parentNode,!Ye))do if(m&&m.getBoundingClientRect&&(ee(m,"transform")!=="none"||t&&ee(m,"position")!=="static")){var l=m.getBoundingClientRect();f-=l.top+parseInt(ee(m,"border-top-width")),c-=l.left+parseInt(ee(m,"border-left-width")),o=f+g.height,h=c+g.width;break}while(m=m.parentNode);if(n&&e!==window){var s=Ct(m||e),r=s&&s.a,a=s&&s.d;s&&(f/=a,c/=r,u/=r,d/=a,o=f+d,h=c+u)}return{top:f,left:c,bottom:o,right:h,width:u,height:d}}}function Sr(e,i,t){for(var n=Xe(e,!0),m=de(e)[i];n;){var g=de(n)[t],f=void 0;if(t==="top"||t==="left"?f=m>=g:f=m<=g,!f)return n;if(n===Pe())break;n=Xe(n,!1)}return!1}function St(e,i,t,n){for(var m=0,g=0,f=e.children;g<f.length;){if(f[g].style.display!=="none"&&f[g]!==J.ghost&&(n||f[g]!==J.dragged)&&Ie(f[g],t.draggable,e,!1)){if(m===i)return f[g];m++}g++}return null}function Jn(e,i){for(var t=e.lastElementChild;t&&(t===J.ghost||ee(t,"display")==="none"||i&&!vi(t,i));)t=t.previousElementSibling;return t||null}function ke(e,i){var t=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==J.clone&&(!i||vi(e,i))&&t++;return t}function xr(e){var i=0,t=0,n=Pe();if(e)do{var m=Ct(e),g=m.a,f=m.d;i+=e.scrollLeft*g,t+=e.scrollTop*f}while(e!==n&&(e=e.parentNode));return[i,t]}function qc(e,i){for(var t in e)if(e.hasOwnProperty(t)){for(var n in i)if(i.hasOwnProperty(n)&&i[n]===e[t][n])return Number(t)}return-1}function Xe(e,i){if(!e||!e.getBoundingClientRect)return Pe();var t=e,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var m=ee(t);if(t.clientWidth<t.scrollWidth&&(m.overflowX=="auto"||m.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(m.overflowY=="auto"||m.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Pe();if(n||i)return t;n=!0}}while(t=t.parentNode);return Pe()}function Yc(e,i){if(e&&i)for(var t in i)i.hasOwnProperty(t)&&(e[t]=i[t]);return e}function ji(e,i){return Math.round(e.top)===Math.round(i.top)&&Math.round(e.left)===Math.round(i.left)&&Math.round(e.height)===Math.round(i.height)&&Math.round(e.width)===Math.round(i.width)}var Nt;function Vo(e,i){return function(){if(!Nt){var t=arguments,n=this;t.length===1?e.call(n,t[0]):e.apply(n,t),Nt=setTimeout(function(){Nt=void 0},i)}}}function Zc(){clearTimeout(Nt),Nt=void 0}function Uo(e,i,t){e.scrollLeft+=i,e.scrollTop+=t}function Go(e){var i=window.Polymer,t=window.jQuery||window.Zepto;return i&&i.dom?i.dom(e).cloneNode(!0):t?t(e).clone(!0)[0]:e.cloneNode(!0)}function Ko(e,i,t){var n={};return Array.from(e.children).forEach(function(m){var g,f,c,o;if(!(!Ie(m,i.draggable,e,!1)||m.animated||m===t)){var h=de(m);n.left=Math.min((g=n.left)!==null&&g!==void 0?g:1/0,h.left),n.top=Math.min((f=n.top)!==null&&f!==void 0?f:1/0,h.top),n.right=Math.max((c=n.right)!==null&&c!==void 0?c:-1/0,h.right),n.bottom=Math.max((o=n.bottom)!==null&&o!==void 0?o:-1/0,h.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Ce="Sortable"+new Date().getTime();function Qc(){var e=[],i;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(n){if(!(ee(n,"display")==="none"||n===J.ghost)){e.push({target:n,rect:de(n)});var m=Be({},e[e.length-1].rect);if(n.thisAnimationDuration){var g=Ct(n,!0);g&&(m.top-=g.f,m.left-=g.e)}n.fromRect=m}})},addAnimationState:function(n){e.push(n)},removeAnimationState:function(n){e.splice(qc(e,{target:n}),1)},animateAll:function(n){var m=this;if(!this.options.animation){clearTimeout(i),typeof n=="function"&&n();return}var g=!1,f=0;e.forEach(function(c){var o=0,h=c.target,d=h.fromRect,u=de(h),l=h.prevFromRect,s=h.prevToRect,r=c.rect,a=Ct(h,!0);a&&(u.top-=a.f,u.left-=a.e),h.toRect=u,h.thisAnimationDuration&&ji(l,u)&&!ji(d,u)&&(r.top-u.top)/(r.left-u.left)===(d.top-u.top)/(d.left-u.left)&&(o=Jc(r,l,s,m.options)),ji(u,d)||(h.prevFromRect=d,h.prevToRect=u,o||(o=m.options.animation),m.animate(h,r,u,o)),o&&(g=!0,f=Math.max(f,o),clearTimeout(h.animationResetTimer),h.animationResetTimer=setTimeout(function(){h.animationTime=0,h.prevFromRect=null,h.fromRect=null,h.prevToRect=null,h.thisAnimationDuration=null},o),h.thisAnimationDuration=o)}),clearTimeout(i),g?i=setTimeout(function(){typeof n=="function"&&n()},f):typeof n=="function"&&n(),e=[]},animate:function(n,m,g,f){if(f){ee(n,"transition",""),ee(n,"transform","");var c=Ct(this.el),o=c&&c.a,h=c&&c.d,d=(m.left-g.left)/(o||1),u=(m.top-g.top)/(h||1);n.animatingX=!!d,n.animatingY=!!u,ee(n,"transform","translate3d("+d+"px,"+u+"px,0)"),this.forRepaintDummy=Xc(n),ee(n,"transition","transform "+f+"ms"+(this.options.easing?" "+this.options.easing:"")),ee(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ee(n,"transition",""),ee(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},f)}}}}function Xc(e){return e.offsetWidth}function Jc(e,i,t,n){return Math.sqrt(Math.pow(i.top-e.top,2)+Math.pow(i.left-e.left,2))/Math.sqrt(Math.pow(i.top-t.top,2)+Math.pow(i.left-t.left,2))*n.animation}var pt=[],Vi={initializeByDefault:!0},Gt={mount:function(i){for(var t in Vi)Vi.hasOwnProperty(t)&&!(t in i)&&(i[t]=Vi[t]);pt.forEach(function(n){if(n.pluginName===i.pluginName)throw"Sortable: Cannot mount plugin ".concat(i.pluginName," more than once")}),pt.push(i)},pluginEvent:function(i,t,n){var m=this;this.eventCanceled=!1,n.cancel=function(){m.eventCanceled=!0};var g=i+"Global";pt.forEach(function(f){t[f.pluginName]&&(t[f.pluginName][g]&&t[f.pluginName][g](Be({sortable:t},n)),t.options[f.pluginName]&&t[f.pluginName][i]&&t[f.pluginName][i](Be({sortable:t},n)))})},initializePlugins:function(i,t,n,m){pt.forEach(function(c){var o=c.pluginName;if(!(!i.options[o]&&!c.initializeByDefault)){var h=new c(i,t,i.options);h.sortable=i,h.options=i.options,i[o]=h,Ke(n,h.defaults)}});for(var g in i.options)if(i.options.hasOwnProperty(g)){var f=this.modifyOption(i,g,i.options[g]);typeof f<"u"&&(i.options[g]=f)}},getEventProperties:function(i,t){var n={};return pt.forEach(function(m){typeof m.eventProperties=="function"&&Ke(n,m.eventProperties.call(t[m.pluginName],i))}),n},modifyOption:function(i,t,n){var m;return pt.forEach(function(g){i[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[t]=="function"&&(m=g.optionListeners[t].call(i[g.pluginName],n))}),m}};function eu(e){var i=e.sortable,t=e.rootEl,n=e.name,m=e.targetEl,g=e.cloneEl,f=e.toEl,c=e.fromEl,o=e.oldIndex,h=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,l=e.originalEvent,s=e.putSortable,r=e.extraEventProperties;if(i=i||t&&t[Ce],!!i){var a,p=i.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!Ye&&!Ut?a=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(a=document.createEvent("Event"),a.initEvent(n,!0,!0)),a.to=f||t,a.from=c||t,a.item=m||t,a.clone=g,a.oldIndex=o,a.newIndex=h,a.oldDraggableIndex=d,a.newDraggableIndex=u,a.originalEvent=l,a.pullMode=s?s.lastPutMode:void 0;var y=Be(Be({},r),Gt.getEventProperties(n,i));for(var k in y)a[k]=y[k];t&&t.dispatchEvent(a),p[v]&&p[v].call(i,a)}}var tu=["evt"],ye=function(i,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m=n.evt,g=jc(n,tu);Gt.pluginEvent.bind(J)(i,t,Be({dragEl:K,parentEl:ce,ghostEl:ie,rootEl:se,nextEl:nt,lastDownEl:oi,cloneEl:ae,cloneHidden:Qe,dragStarted:_t,putSortable:pe,activeSortable:J.active,originalEvent:m,oldIndex:yt,oldDraggableIndex:Ft,newIndex:Ee,newDraggableIndex:Ze,hideGhostForTarget:Qo,unhideGhostForTarget:Xo,cloneNowHidden:function(){Qe=!0},cloneNowShown:function(){Qe=!1},dispatchSortableEvent:function(c){me({sortable:t,name:c,originalEvent:m})}},g))};function me(e){eu(Be({putSortable:pe,cloneEl:ae,targetEl:K,rootEl:se,oldIndex:yt,oldDraggableIndex:Ft,newIndex:Ee,newDraggableIndex:Ze},e))}var K,ce,ie,se,nt,oi,ae,Qe,yt,Ee,Ft,Ze,Zt,pe,mt=!1,yi=!1,bi=[],tt,Oe,Ui,Gi,Er,Ar,_t,ft,zt,Pt=!1,Qt=!1,si,fe,Ki=[],bn=!1,wi=[],Ni=typeof document<"u",Xt=Xn,kr=Ut||Ye?"cssFloat":"float",iu=Ni&&!Ho&&!Xn&&"draggable"in document.createElement("div"),qo=(function(){if(Ni){if(Ye)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Yo=function(i,t){var n=ee(i),m=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),g=St(i,0,t),f=St(i,1,t),c=g&&ee(g),o=f&&ee(f),h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+de(g).width,d=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+de(f).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&c.float&&c.float!=="none"){var u=c.float==="left"?"left":"right";return f&&(o.clear==="both"||o.clear===u)?"vertical":"horizontal"}return g&&(c.display==="block"||c.display==="flex"||c.display==="table"||c.display==="grid"||h>=m&&n[kr]==="none"||f&&n[kr]==="none"&&h+d>m)?"vertical":"horizontal"},nu=function(i,t,n){var m=n?i.left:i.top,g=n?i.right:i.bottom,f=n?i.width:i.height,c=n?t.left:t.top,o=n?t.right:t.bottom,h=n?t.width:t.height;return m===c||g===o||m+f/2===c+h/2},ru=function(i,t){var n;return bi.some(function(m){var g=m[Ce].options.emptyInsertThreshold;if(!(!g||Jn(m))){var f=de(m),c=i>=f.left-g&&i<=f.right+g,o=t>=f.top-g&&t<=f.bottom+g;if(c&&o)return n=m}}),n},Zo=function(i){function t(g,f){return function(c,o,h,d){var u=c.options.group.name&&o.options.group.name&&c.options.group.name===o.options.group.name;if(g==null&&(f||u))return!0;if(g==null||g===!1)return!1;if(f&&g==="clone")return g;if(typeof g=="function")return t(g(c,o,h,d),f)(c,o,h,d);var l=(f?c:o).options.group.name;return g===!0||typeof g=="string"&&g===l||g.join&&g.indexOf(l)>-1}}var n={},m=i.group;(!m||yn(m)!="object")&&(m={name:m}),n.name=m.name,n.checkPull=t(m.pull,!0),n.checkPut=t(m.put),n.revertClone=m.revertClone,i.group=n},Qo=function(){!qo&&ie&&ee(ie,"display","none")},Xo=function(){!qo&&ie&&ee(ie,"display","")};Ni&&!Ho&&document.addEventListener("click",function(e){if(yi)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),yi=!1,!1},!0);var it=function(i){if(K){i=i.touches?i.touches[0]:i;var t=ru(i.clientX,i.clientY);if(t){var n={};for(var m in i)i.hasOwnProperty(m)&&(n[m]=i[m]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Ce]._onDragOver(n)}}},ou=function(i){K&&K.parentNode[Ce]._isOutsideThisEl(i.target)};function J(e,i){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=i=Ke({},i),e[Ce]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Yo(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,c){f.setData("Text",c.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:J.supportPointer!==!1&&"PointerEvent"in window&&(!Dt||Xn),emptyInsertThreshold:5};Gt.initializePlugins(this,e,t);for(var n in t)!(n in i)&&(i[n]=t[n]);Zo(i);for(var m in this)m.charAt(0)==="_"&&typeof this[m]=="function"&&(this[m]=this[m].bind(this));this.nativeDraggable=i.forceFallback?!1:iu,this.nativeDraggable&&(this.options.touchStartThreshold=1),i.supportPointer?re(e,"pointerdown",this._onTapStart):(re(e,"mousedown",this._onTapStart),re(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(re(e,"dragover",this),re(e,"dragenter",this)),bi.push(this.el),i.store&&i.store.get&&this.sort(i.store.get(this)||[]),Ke(this,Qc())}J.prototype={constructor:J,_isOutsideThisEl:function(i){!this.el.contains(i)&&i!==this.el&&(ft=null)},_getDirection:function(i,t){return typeof this.options.direction=="function"?this.options.direction.call(this,i,t,K):this.options.direction},_onTapStart:function(i){if(i.cancelable){var t=this,n=this.el,m=this.options,g=m.preventOnFilter,f=i.type,c=i.touches&&i.touches[0]||i.pointerType&&i.pointerType==="touch"&&i,o=(c||i).target,h=i.target.shadowRoot&&(i.path&&i.path[0]||i.composedPath&&i.composedPath()[0])||o,d=m.filter;if(pu(n),!K&&!(/mousedown|pointerdown/.test(f)&&i.button!==0||m.disabled)&&!h.isContentEditable&&!(!this.nativeDraggable&&Dt&&o&&o.tagName.toUpperCase()==="SELECT")&&(o=Ie(o,m.draggable,n,!1),!(o&&o.animated)&&oi!==o)){if(yt=ke(o),Ft=ke(o,m.draggable),typeof d=="function"){if(d.call(this,i,o,this)){me({sortable:t,rootEl:h,name:"filter",targetEl:o,toEl:n,fromEl:n}),ye("filter",t,{evt:i}),g&&i.preventDefault();return}}else if(d&&(d=d.split(",").some(function(u){if(u=Ie(h,u.trim(),n,!1),u)return me({sortable:t,rootEl:u,name:"filter",targetEl:o,fromEl:n,toEl:n}),ye("filter",t,{evt:i}),!0}),d)){g&&i.preventDefault();return}m.handle&&!Ie(h,m.handle,n,!1)||this._prepareDragStart(i,c,o)}}},_prepareDragStart:function(i,t,n){var m=this,g=m.el,f=m.options,c=g.ownerDocument,o;if(n&&!K&&n.parentNode===g){var h=de(n);if(se=g,K=n,ce=K.parentNode,nt=K.nextSibling,oi=n,Zt=f.group,J.dragged=K,tt={target:K,clientX:(t||i).clientX,clientY:(t||i).clientY},Er=tt.clientX-h.left,Ar=tt.clientY-h.top,this._lastX=(t||i).clientX,this._lastY=(t||i).clientY,K.style["will-change"]="all",o=function(){if(ye("delayEnded",m,{evt:i}),J.eventCanceled){m._onDrop();return}m._disableDelayedDragEvents(),!wr&&m.nativeDraggable&&(K.draggable=!0),m._triggerDragStart(i,t),me({sortable:m,name:"choose",originalEvent:i}),xe(K,f.chosenClass,!0)},f.ignore.split(",").forEach(function(d){jo(K,d.trim(),qi)}),re(c,"dragover",it),re(c,"mousemove",it),re(c,"touchmove",it),f.supportPointer?(re(c,"pointerup",m._onDrop),!this.nativeDraggable&&re(c,"pointercancel",m._onDrop)):(re(c,"mouseup",m._onDrop),re(c,"touchend",m._onDrop),re(c,"touchcancel",m._onDrop)),wr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),ye("delayStart",this,{evt:i}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ut||Ye))){if(J.eventCanceled){this._onDrop();return}f.supportPointer?(re(c,"pointerup",m._disableDelayedDrag),re(c,"pointercancel",m._disableDelayedDrag)):(re(c,"mouseup",m._disableDelayedDrag),re(c,"touchend",m._disableDelayedDrag),re(c,"touchcancel",m._disableDelayedDrag)),re(c,"mousemove",m._delayedDragTouchMoveHandler),re(c,"touchmove",m._delayedDragTouchMoveHandler),f.supportPointer&&re(c,"pointermove",m._delayedDragTouchMoveHandler),m._dragStartTimer=setTimeout(o,f.delay)}else o()}},_delayedDragTouchMoveHandler:function(i){var t=i.touches?i.touches[0]:i;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){K&&qi(K),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var i=this.el.ownerDocument;ne(i,"mouseup",this._disableDelayedDrag),ne(i,"touchend",this._disableDelayedDrag),ne(i,"touchcancel",this._disableDelayedDrag),ne(i,"pointerup",this._disableDelayedDrag),ne(i,"pointercancel",this._disableDelayedDrag),ne(i,"mousemove",this._delayedDragTouchMoveHandler),ne(i,"touchmove",this._delayedDragTouchMoveHandler),ne(i,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(i,t){t=t||i.pointerType=="touch"&&i,!this.nativeDraggable||t?this.options.supportPointer?re(document,"pointermove",this._onTouchMove):t?re(document,"touchmove",this._onTouchMove):re(document,"mousemove",this._onTouchMove):(re(K,"dragend",this),re(se,"dragstart",this._onDragStart));try{document.selection?ai(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(i,t){if(mt=!1,se&&K){ye("dragStarted",this,{evt:t}),this.nativeDraggable&&re(document,"dragover",ou);var n=this.options;!i&&xe(K,n.dragClass,!1),xe(K,n.ghostClass,!0),J.active=this,i&&this._appendGhost(),me({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Oe){this._lastX=Oe.clientX,this._lastY=Oe.clientY,Qo();for(var i=document.elementFromPoint(Oe.clientX,Oe.clientY),t=i;i&&i.shadowRoot&&(i=i.shadowRoot.elementFromPoint(Oe.clientX,Oe.clientY),i!==t);)t=i;if(K.parentNode[Ce]._isOutsideThisEl(i),t)do{if(t[Ce]){var n=void 0;if(n=t[Ce]._onDragOver({clientX:Oe.clientX,clientY:Oe.clientY,target:i,rootEl:t}),n&&!this.options.dragoverBubble)break}i=t}while(t=Wo(t));Xo()}},_onTouchMove:function(i){if(tt){var t=this.options,n=t.fallbackTolerance,m=t.fallbackOffset,g=i.touches?i.touches[0]:i,f=ie&&Ct(ie,!0),c=ie&&f&&f.a,o=ie&&f&&f.d,h=Xt&&fe&&xr(fe),d=(g.clientX-tt.clientX+m.x)/(c||1)+(h?h[0]-Ki[0]:0)/(c||1),u=(g.clientY-tt.clientY+m.y)/(o||1)+(h?h[1]-Ki[1]:0)/(o||1);if(!J.active&&!mt){if(n&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<n)return;this._onDragStart(i,!0)}if(ie){f?(f.e+=d-(Ui||0),f.f+=u-(Gi||0)):f={a:1,b:0,c:0,d:1,e:d,f:u};var l="matrix(".concat(f.a,",").concat(f.b,",").concat(f.c,",").concat(f.d,",").concat(f.e,",").concat(f.f,")");ee(ie,"webkitTransform",l),ee(ie,"mozTransform",l),ee(ie,"msTransform",l),ee(ie,"transform",l),Ui=d,Gi=u,Oe=g}i.cancelable&&i.preventDefault()}},_appendGhost:function(){if(!ie){var i=this.options.fallbackOnBody?document.body:se,t=de(K,!0,Xt,!0,i),n=this.options;if(Xt){for(fe=i;ee(fe,"position")==="static"&&ee(fe,"transform")==="none"&&fe!==document;)fe=fe.parentNode;fe!==document.body&&fe!==document.documentElement?(fe===document&&(fe=Pe()),t.top+=fe.scrollTop,t.left+=fe.scrollLeft):fe=Pe(),Ki=xr(fe)}ie=K.cloneNode(!0),xe(ie,n.ghostClass,!1),xe(ie,n.fallbackClass,!0),xe(ie,n.dragClass,!0),ee(ie,"transition",""),ee(ie,"transform",""),ee(ie,"box-sizing","border-box"),ee(ie,"margin",0),ee(ie,"top",t.top),ee(ie,"left",t.left),ee(ie,"width",t.width),ee(ie,"height",t.height),ee(ie,"opacity","0.8"),ee(ie,"position",Xt?"absolute":"fixed"),ee(ie,"zIndex","100000"),ee(ie,"pointerEvents","none"),J.ghost=ie,i.appendChild(ie),ee(ie,"transform-origin",Er/parseInt(ie.style.width)*100+"% "+Ar/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(i,t){var n=this,m=i.dataTransfer,g=n.options;if(ye("dragStart",this,{evt:i}),J.eventCanceled){this._onDrop();return}ye("setupClone",this),J.eventCanceled||(ae=Go(K),ae.removeAttribute("id"),ae.draggable=!1,ae.style["will-change"]="",this._hideClone(),xe(ae,this.options.chosenClass,!1),J.clone=ae),n.cloneId=ai(function(){ye("clone",n),!J.eventCanceled&&(n.options.removeCloneOnHide||se.insertBefore(ae,K),n._hideClone(),me({sortable:n,name:"clone"}))}),!t&&xe(K,g.dragClass,!0),t?(yi=!0,n._loopId=setInterval(n._emulateDragOver,50)):(ne(document,"mouseup",n._onDrop),ne(document,"touchend",n._onDrop),ne(document,"touchcancel",n._onDrop),m&&(m.effectAllowed="move",g.setData&&g.setData.call(n,m,K)),re(document,"drop",n),ee(K,"transform","translateZ(0)")),mt=!0,n._dragStartId=ai(n._dragStarted.bind(n,t,i)),re(document,"selectstart",n),_t=!0,window.getSelection().removeAllRanges(),Dt&&ee(document.body,"user-select","none")},_onDragOver:function(i){var t=this.el,n=i.target,m,g,f,c=this.options,o=c.group,h=J.active,d=Zt===o,u=c.sort,l=pe||h,s,r=this,a=!1;if(bn)return;function p(O,I){ye(O,r,Be({evt:i,isOwner:d,axis:s?"vertical":"horizontal",revert:f,dragRect:m,targetRect:g,canSort:u,fromSortable:l,target:n,completed:y,onMove:function(F,z){return Jt(se,t,K,m,F,de(F),i,z)},changed:k},I))}function v(){p("dragOverAnimationCapture"),r.captureAnimationState(),r!==l&&l.captureAnimationState()}function y(O){return p("dragOverCompleted",{insertion:O}),O&&(d?h._hideClone():h._showClone(r),r!==l&&(xe(K,pe?pe.options.ghostClass:h.options.ghostClass,!1),xe(K,c.ghostClass,!0)),pe!==r&&r!==J.active?pe=r:r===J.active&&pe&&(pe=null),l===r&&(r._ignoreWhileAnimating=n),r.animateAll(function(){p("dragOverAnimationComplete"),r._ignoreWhileAnimating=null}),r!==l&&(l.animateAll(),l._ignoreWhileAnimating=null)),(n===K&&!K.animated||n===t&&!n.animated)&&(ft=null),!c.dragoverBubble&&!i.rootEl&&n!==document&&(K.parentNode[Ce]._isOutsideThisEl(i.target),!O&&it(i)),!c.dragoverBubble&&i.stopPropagation&&i.stopPropagation(),a=!0}function k(){Ee=ke(K),Ze=ke(K,c.draggable),me({sortable:r,name:"change",toEl:t,newIndex:Ee,newDraggableIndex:Ze,originalEvent:i})}if(i.preventDefault!==void 0&&i.cancelable&&i.preventDefault(),n=Ie(n,c.draggable,t,!0),p("dragOver"),J.eventCanceled)return a;if(K.contains(i.target)||n.animated&&n.animatingX&&n.animatingY||r._ignoreWhileAnimating===n)return y(!1);if(yi=!1,h&&!c.disabled&&(d?u||(f=ce!==se):pe===this||(this.lastPutMode=Zt.checkPull(this,h,K,i))&&o.checkPut(this,h,K,i))){if(s=this._getDirection(i,n)==="vertical",m=de(K),p("dragOverValid"),J.eventCanceled)return a;if(f)return ce=se,v(),this._hideClone(),p("revert"),J.eventCanceled||(nt?se.insertBefore(K,nt):se.appendChild(K)),y(!0);var x=Jn(t,c.draggable);if(!x||cu(i,s,this)&&!x.animated){if(x===K)return y(!1);if(x&&t===i.target&&(n=x),n&&(g=de(n)),Jt(se,t,K,m,n,g,i,!!n)!==!1)return v(),x&&x.nextSibling?t.insertBefore(K,x.nextSibling):t.appendChild(K),ce=t,k(),y(!0)}else if(x&&lu(i,s,this)){var w=St(t,0,c,!0);if(w===K)return y(!1);if(n=w,g=de(n),Jt(se,t,K,m,n,g,i,!1)!==!1)return v(),t.insertBefore(K,w),ce=t,k(),y(!0)}else if(n.parentNode===t){g=de(n);var S=0,M,L=K.parentNode!==t,R=!nu(K.animated&&K.toRect||m,n.animated&&n.toRect||g,s),$=s?"top":"left",D=Sr(n,"top","top")||Sr(K,"top","top"),T=D?D.scrollTop:void 0;ft!==n&&(M=g[$],Pt=!1,Qt=!R&&c.invertSwap||L),S=uu(i,n,g,s,R?1:c.swapThreshold,c.invertedSwapThreshold==null?c.swapThreshold:c.invertedSwapThreshold,Qt,ft===n);var E;if(S!==0){var C=ke(K);do C-=S,E=ce.children[C];while(E&&(ee(E,"display")==="none"||E===ie))}if(S===0||E===n)return y(!1);ft=n,zt=S;var b=n.nextElementSibling,A=!1;A=S===1;var _=Jt(se,t,K,m,n,g,i,A);if(_!==!1)return(_===1||_===-1)&&(A=_===1),bn=!0,setTimeout(au,30),v(),A&&!b?t.appendChild(K):n.parentNode.insertBefore(K,A?b:n),D&&Uo(D,0,T-D.scrollTop),ce=K.parentNode,M!==void 0&&!Qt&&(si=Math.abs(M-de(n)[$])),k(),y(!0)}if(t.contains(K))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ne(document,"mousemove",this._onTouchMove),ne(document,"touchmove",this._onTouchMove),ne(document,"pointermove",this._onTouchMove),ne(document,"dragover",it),ne(document,"mousemove",it),ne(document,"touchmove",it)},_offUpEvents:function(){var i=this.el.ownerDocument;ne(i,"mouseup",this._onDrop),ne(i,"touchend",this._onDrop),ne(i,"pointerup",this._onDrop),ne(i,"pointercancel",this._onDrop),ne(i,"touchcancel",this._onDrop),ne(document,"selectstart",this)},_onDrop:function(i){var t=this.el,n=this.options;if(Ee=ke(K),Ze=ke(K,n.draggable),ye("drop",this,{evt:i}),ce=K&&K.parentNode,Ee=ke(K),Ze=ke(K,n.draggable),J.eventCanceled){this._nulling();return}mt=!1,Qt=!1,Pt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wn(this.cloneId),wn(this._dragStartId),this.nativeDraggable&&(ne(document,"drop",this),ne(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dt&&ee(document.body,"user-select",""),ee(K,"transform",""),i&&(_t&&(i.cancelable&&i.preventDefault(),!n.dropBubble&&i.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(se===ce||pe&&pe.lastPutMode!=="clone")&&ae&&ae.parentNode&&ae.parentNode.removeChild(ae),K&&(this.nativeDraggable&&ne(K,"dragend",this),qi(K),K.style["will-change"]="",_t&&!mt&&xe(K,pe?pe.options.ghostClass:this.options.ghostClass,!1),xe(K,this.options.chosenClass,!1),me({sortable:this,name:"unchoose",toEl:ce,newIndex:null,newDraggableIndex:null,originalEvent:i}),se!==ce?(Ee>=0&&(me({rootEl:ce,name:"add",toEl:ce,fromEl:se,originalEvent:i}),me({sortable:this,name:"remove",toEl:ce,originalEvent:i}),me({rootEl:ce,name:"sort",toEl:ce,fromEl:se,originalEvent:i}),me({sortable:this,name:"sort",toEl:ce,originalEvent:i})),pe&&pe.save()):Ee!==yt&&Ee>=0&&(me({sortable:this,name:"update",toEl:ce,originalEvent:i}),me({sortable:this,name:"sort",toEl:ce,originalEvent:i})),J.active&&((Ee==null||Ee===-1)&&(Ee=yt,Ze=Ft),me({sortable:this,name:"end",toEl:ce,originalEvent:i}),this.save()))),this._nulling()},_nulling:function(){ye("nulling",this),se=K=ce=ie=nt=ae=oi=Qe=tt=Oe=_t=Ee=Ze=yt=Ft=ft=zt=pe=Zt=J.dragged=J.ghost=J.clone=J.active=null;var i=this.el;wi.forEach(function(t){i.contains(t)&&(t.checked=!0)}),wi.length=Ui=Gi=0},handleEvent:function(i){switch(i.type){case"drop":case"dragend":this._onDrop(i);break;case"dragenter":case"dragover":K&&(this._onDragOver(i),su(i));break;case"selectstart":i.preventDefault();break}},toArray:function(){for(var i=[],t,n=this.el.children,m=0,g=n.length,f=this.options;m<g;m++)t=n[m],Ie(t,f.draggable,this.el,!1)&&i.push(t.getAttribute(f.dataIdAttr)||hu(t));return i},sort:function(i,t){var n={},m=this.el;this.toArray().forEach(function(g,f){var c=m.children[f];Ie(c,this.options.draggable,m,!1)&&(n[g]=c)},this),t&&this.captureAnimationState(),i.forEach(function(g){n[g]&&(m.removeChild(n[g]),m.appendChild(n[g]))}),t&&this.animateAll()},save:function(){var i=this.options.store;i&&i.set&&i.set(this)},closest:function(i,t){return Ie(i,t||this.options.draggable,this.el,!1)},option:function(i,t){var n=this.options;if(t===void 0)return n[i];var m=Gt.modifyOption(this,i,t);typeof m<"u"?n[i]=m:n[i]=t,i==="group"&&Zo(n)},destroy:function(){ye("destroy",this);var i=this.el;i[Ce]=null,ne(i,"mousedown",this._onTapStart),ne(i,"touchstart",this._onTapStart),ne(i,"pointerdown",this._onTapStart),this.nativeDraggable&&(ne(i,"dragover",this),ne(i,"dragenter",this)),Array.prototype.forEach.call(i.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bi.splice(bi.indexOf(this.el),1),this.el=i=null},_hideClone:function(){if(!Qe){if(ye("hideClone",this),J.eventCanceled)return;ee(ae,"display","none"),this.options.removeCloneOnHide&&ae.parentNode&&ae.parentNode.removeChild(ae),Qe=!0}},_showClone:function(i){if(i.lastPutMode!=="clone"){this._hideClone();return}if(Qe){if(ye("showClone",this),J.eventCanceled)return;K.parentNode==se&&!this.options.group.revertClone?se.insertBefore(ae,K):nt?se.insertBefore(ae,nt):se.appendChild(ae),this.options.group.revertClone&&this.animate(K,ae),ee(ae,"display",""),Qe=!1}}};function su(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Jt(e,i,t,n,m,g,f,c){var o,h=e[Ce],d=h.options.onMove,u;return window.CustomEvent&&!Ye&&!Ut?o=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(o=document.createEvent("Event"),o.initEvent("move",!0,!0)),o.to=i,o.from=e,o.dragged=t,o.draggedRect=n,o.related=m||i,o.relatedRect=g||de(i),o.willInsertAfter=c,o.originalEvent=f,e.dispatchEvent(o),d&&(u=d.call(h,o,f)),u}function qi(e){e.draggable=!1}function au(){bn=!1}function lu(e,i,t){var n=de(St(t.el,0,t.options,!0)),m=Ko(t.el,t.options,ie),g=10;return i?e.clientX<m.left-g||e.clientY<n.top&&e.clientX<n.right:e.clientY<m.top-g||e.clientY<n.bottom&&e.clientX<n.left}function cu(e,i,t){var n=de(Jn(t.el,t.options.draggable)),m=Ko(t.el,t.options,ie),g=10;return i?e.clientX>m.right+g||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>m.bottom+g||e.clientX>n.right&&e.clientY>n.top}function uu(e,i,t,n,m,g,f,c){var o=n?e.clientY:e.clientX,h=n?t.height:t.width,d=n?t.top:t.left,u=n?t.bottom:t.right,l=!1;if(!f){if(c&&si<h*m){if(!Pt&&(zt===1?o>d+h*g/2:o<u-h*g/2)&&(Pt=!0),Pt)l=!0;else if(zt===1?o<d+si:o>u-si)return-zt}else if(o>d+h*(1-m)/2&&o<u-h*(1-m)/2)return du(i)}return l=l||f,l&&(o<d+h*g/2||o>u-h*g/2)?o>d+h/2?1:-1:0}function du(e){return ke(K)<ke(e)?1:-1}function hu(e){for(var i=e.tagName+e.className+e.src+e.href+e.textContent,t=i.length,n=0;t--;)n+=i.charCodeAt(t);return n.toString(36)}function pu(e){wi.length=0;for(var i=e.getElementsByTagName("input"),t=i.length;t--;){var n=i[t];n.checked&&wi.push(n)}}function ai(e){return setTimeout(e,0)}function wn(e){return clearTimeout(e)}Ni&&re(document,"touchmove",function(e){(J.active||mt)&&e.cancelable&&e.preventDefault()});J.utils={on:re,off:ne,css:ee,find:jo,is:function(i,t){return!!Ie(i,t,i,!1)},extend:Yc,throttle:Vo,closest:Ie,toggleClass:xe,clone:Go,index:ke,nextTick:ai,cancelNextTick:wn,detectDirection:Yo,getChild:St,expando:Ce};J.get=function(e){return e[Ce]};J.mount=function(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];i[0].constructor===Array&&(i=i[0]),i.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(J.utils=Be(Be({},J.utils),n.utils)),Gt.mount(n)})};J.create=function(e,i){return new J(e,i)};J.version=Kc;var ue=[],Ot,Cn,Sn=!1,Yi,Zi,Ci,It;function fu(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}return e.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?re(document,"dragover",this._handleAutoScroll):this.options.supportPointer?re(document,"pointermove",this._handleFallbackAutoScroll):n.touches?re(document,"touchmove",this._handleFallbackAutoScroll):re(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?ne(document,"dragover",this._handleAutoScroll):(ne(document,"pointermove",this._handleFallbackAutoScroll),ne(document,"touchmove",this._handleFallbackAutoScroll),ne(document,"mousemove",this._handleFallbackAutoScroll)),Tr(),li(),Zc()},nulling:function(){Ci=Cn=Ot=Sn=It=Yi=Zi=null,ue.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var m=this,g=(t.touches?t.touches[0]:t).clientX,f=(t.touches?t.touches[0]:t).clientY,c=document.elementFromPoint(g,f);if(Ci=t,n||this.options.forceAutoScrollFallback||Ut||Ye||Dt){Qi(t,this.options,c,n);var o=Xe(c,!0);Sn&&(!It||g!==Yi||f!==Zi)&&(It&&Tr(),It=setInterval(function(){var h=Xe(document.elementFromPoint(g,f),!0);h!==o&&(o=h,li()),Qi(t,m.options,h,n)},10),Yi=g,Zi=f)}else{if(!this.options.bubbleScroll||Xe(c,!0)===Pe()){li();return}Qi(t,this.options,Xe(c,!1),!1)}}},Ke(e,{pluginName:"scroll",initializeByDefault:!0})}function li(){ue.forEach(function(e){clearInterval(e.pid)}),ue=[]}function Tr(){clearInterval(It)}var Qi=Vo(function(e,i,t,n){if(i.scroll){var m=(e.touches?e.touches[0]:e).clientX,g=(e.touches?e.touches[0]:e).clientY,f=i.scrollSensitivity,c=i.scrollSpeed,o=Pe(),h=!1,d;Cn!==t&&(Cn=t,li(),Ot=i.scroll,d=i.scrollFn,Ot===!0&&(Ot=Xe(t,!0)));var u=0,l=Ot;do{var s=l,r=de(s),a=r.top,p=r.bottom,v=r.left,y=r.right,k=r.width,x=r.height,w=void 0,S=void 0,M=s.scrollWidth,L=s.scrollHeight,R=ee(s),$=s.scrollLeft,D=s.scrollTop;s===o?(w=k<M&&(R.overflowX==="auto"||R.overflowX==="scroll"||R.overflowX==="visible"),S=x<L&&(R.overflowY==="auto"||R.overflowY==="scroll"||R.overflowY==="visible")):(w=k<M&&(R.overflowX==="auto"||R.overflowX==="scroll"),S=x<L&&(R.overflowY==="auto"||R.overflowY==="scroll"));var T=w&&(Math.abs(y-m)<=f&&$+k<M)-(Math.abs(v-m)<=f&&!!$),E=S&&(Math.abs(p-g)<=f&&D+x<L)-(Math.abs(a-g)<=f&&!!D);if(!ue[u])for(var C=0;C<=u;C++)ue[C]||(ue[C]={});(ue[u].vx!=T||ue[u].vy!=E||ue[u].el!==s)&&(ue[u].el=s,ue[u].vx=T,ue[u].vy=E,clearInterval(ue[u].pid),(T!=0||E!=0)&&(h=!0,ue[u].pid=setInterval(function(){n&&this.layer===0&&J.active._onTouchMove(Ci);var b=ue[this.layer].vy?ue[this.layer].vy*c:0,A=ue[this.layer].vx?ue[this.layer].vx*c:0;typeof d=="function"&&d.call(J.dragged.parentNode[Ce],A,b,e,Ci,ue[this.layer].el)!=="continue"||Uo(ue[this.layer].el,A,b)}.bind({layer:u}),24))),u++}while(i.bubbleScroll&&l!==o&&(l=Xe(l,!1)));Sn=h}},30),Jo=function(i){var t=i.originalEvent,n=i.putSortable,m=i.dragEl,g=i.activeSortable,f=i.dispatchSortableEvent,c=i.hideGhostForTarget,o=i.unhideGhostForTarget;if(t){var h=n||g;c();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(d.clientX,d.clientY);o(),h&&!h.el.contains(u)&&(f("spill"),this.onSpill({dragEl:m,putSortable:n}))}};function er(){}er.prototype={startIndex:null,dragStart:function(i){var t=i.oldDraggableIndex;this.startIndex=t},onSpill:function(i){var t=i.dragEl,n=i.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var m=St(this.sortable.el,this.startIndex,this.options);m?this.sortable.el.insertBefore(t,m):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Jo};Ke(er,{pluginName:"revertOnSpill"});function tr(){}tr.prototype={onSpill:function(i){var t=i.dragEl,n=i.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Jo};Ke(tr,{pluginName:"removeOnSpill"});J.mount(new fu);J.mount(tr,er);var es=e=>Number.isInteger(Number(e)),Je=e=>{let i=0,t=e;for(;t?.previousElementSibling;)t=t.previousElementSibling,i++;return i},Si=(e,i,t)=>{const n=t.split("||");return at(at(i).map(m=>e.find(g=>{const f=n.find(c=>!!we(g,c));return f&&we(g,f)===m})).filter(Boolean).concat(e))},Fi=(e,i,t)=>{for(let n=0;n<e.length;n++)i.call(t,e[n],n)},ir=(e,i)=>{const t=[];return Fi(e,(n,m)=>t.push(i(n,m))),t},Xi={},ts=e=>{const i={className:"class"};if(Xi[e])return Xi[e];const t=(i[e]||e).replace(/^\d+/,"").replace(/[^a-zA-Z0-9_:-]/g,"");return Xi[e]=t,t},is=e=>e.replace(/\b\w/g,i=>i.toUpperCase()),gu=e=>window.JSON.parse(window.JSON.stringify(e)),mu=(e,i)=>i.filter(t=>!~e.indexOf(t)),Ae={capitalize:is,safeAttrName:ts,forEach:Fi,copyObj:gu,map:ir,subtract:mu,indexOfNode:Je,isInt:es,get:we,orderObjectsBy:Si},ge={getStyle:(e,i=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(e,null):e.currentStyle&&(t=e.currentStyle),i?t[i]:t},fadeOut:(e,i=250)=>{const t=1/(i/60);e.style.opacity=1,(function n(){const m=Number(e.style.opacity)-t;m>0?(e.style.opacity=m,window.requestAnimationFrame(n)):e.remove()})()},slideDown:(e,i=250,t=!1)=>{e.style.display="block";const n=ge.getStyle(e),m=Number.parseInt(n.height,10),g=m/(i/60);e.style.height="0px",(function f(){const c=Number.parseFloat(e.style.height),o=c+g;c<m?(e.style.height=`${o}px`,window.requestAnimationFrame(f)):(e.style.height="auto",t&&t(e))})()},slideUp:(e,i=250,t=!1)=>{const n=ge.getStyle(e),m=Number.parseInt(n.height,10),g=n.overflow;e.style.overflow="hidden",e.style.height=`${m}px`;const f=n.minHeight;e.style.minHeight="auto";const c=parseFloat(m/(i/60)).toFixed(2);(function o(){const h=Number.parseInt(e.style.height,10)-c;h>0?(e.style.height=`${h}px`,window.requestAnimationFrame(o)):(e.style.overflow=g,e.style.display="none",e.style.minHeight=f,delete e.style.height,t&&t(e))})()},slideToggle:(e,i=250,t=ge.getStyle(e,"display")==="none")=>{t?ge.slideDown(e,i):ge.slideUp(e,i)}},bt="f-autocomplete",vu=`${bt}-display-field`,nr=`${bt}-list`,$t="highlight-component",xi=`${nr}-item`,yu=(e,i)=>{const t=e.reduce((n,m)=>n+(m===i),0);return t>1?`(${t})`:""},ns=["config.label","config.controlId"],bu=["config.legend","name"],wu=[...ns,...bu],Ji=e=>ns.reduce((i,t)=>i||e.get(t),null),Mr=e=>wu.reduce((i,t)=>i||e.get(t),null)||je(e.name),Cu=new Map([["condition.source",Ji],["if.condition.source",Ji],["if.condition.target",Ji],["then.condition.target",Mr],["condition.target",Mr]]),rs=({id:e,...i},t)=>{const{name:n,label:m}=i;return n?Cu.get(t)(i):m},Su=({selectedId:e,...i})=>(i.value===e&&(i.selected=!0),i),en=e=>(e.classList.contains(xi)||(e=e.parentElement),e),os=({value:e,textLabel:i,htmlLabel:t,componentType:n,depth:m=0},g)=>{const f={tag:"li",children:t,dataset:{value:e,label:i},className:[xi,`${xi}-depth-${m}`,`component-type-${n}`],action:{mousedown:({target:c})=>{c=en(c),g.setValue(c),g.selectOption(c),g.hideList()},mouseover:({target:c})=>{c=en(c),g.removeHighlight(),g.highlightComponent(c)},mouseleave:({target:c})=>{c=en(c),g.removeHighlight()}}};return V.create(f)},xu=(e,i)=>{const t=e.data.options.map((n,m)=>{const g=`${e.address}.options[${m}]`,f=n.label,c=n.label;return os({value:g,textLabel:f,htmlLabel:c,componentType:"option",depth:1},i)});return V.create({tag:"ul",attrs:{className:[nr,"options-list"]},children:t})},Eu=e=>{const i=e.value,t=[],n=oe.flatList();return Object.entries(n).reduce((m,[g,f])=>{const c=rs(f,e.key);if(c){const o=f.name,h={tag:"span",content:` ${je(o)}`,className:"component-type"},d=`${o}.${c}`;t.push(d);const u=yu(t,d),l={tag:"span",content:u,className:"component-label-count"},s=[`${c} `,l,h],r=[c,u].join(" ").trim();if(f.isCheckable){const p=xu(f,e);s.push(p)}const a=Su({value:g,textLabel:r,htmlLabel:s,componentType:o,selectedId:i});m.push(os(a,e))}return m},[])},Au=class{lastCache=Date.now();optionsCache=null;constructor({key:e,value:i,className:t,onChange:n=mn}){this.key=e,this.className=[t||this.key.replace(/\./g,"-")].flat(),this.value=i,this.onChange=n||mn,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,i){if(i in e)return e[i];if(i in e.dom){const t=e.dom[i];return typeof t=="function"?t.bind(e.dom):t}},set(e,i,t){return i in e?e[i]=t:e.dom[i]=t,!0}})}get isAddress(){return Te(this.value)}get valueComponent(){return Te(this.value)&&oe.getAddress(this.value)}build(){const e=t=>{const n=this.list,m=this.getActiveOption();let g=new Map([[38,()=>{const f=this.getPreviousOption(m);f&&this.selectOption(f)}],[40,()=>{const f=this.getNextOption(m);f&&this.selectOption(f)}],[13,()=>{m&&(this.selectOption(m),this.setValue(m),n.style.display==="none"?this.showList(m):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return g||(g=()=>!1),g()},i={focus:({target:t})=>{this.updateOptions(),t.parentElement.classList.add(`${bt}-focused`);const n=V.toggleElementsByStr(this.list.querySelectorAll(`.${xi}-depth-0`),t.value);t.addEventListener("keydown",e);const m=this.list.querySelector(".active-option")||n[0];this.showList(m)},blur:({target:t})=>{t.parentElement.classList.remove(`${bt}-focused`),t.removeEventListener("keydown",e),this.hideList()},input:t=>{const{value:n}=t.target,m=V.toggleElementsByStr(this.list.querySelectorAll("li"),n);if(n.length===0&&this.clearValue(),m.length===0)this.hideList();else{const g=this.getActiveOption()||m[0];this.showList(g)}this.setValue({dataset:{label:n,value:n}})}};return this.displayField=V.create({tag:"input",autocomplete:"off",action:i,attrs:{type:"text",className:vu,value:this.label||this.value,placeholder:Z.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:bt,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:nr}}),this.clearButton=V.create({tag:"span",content:V.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=V.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[bt,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Te(this.value))return this.value;const e=this.value&&oe.getAddress(this.value);return e&&rs(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const i=Date.now();(i-this.lastCache>Hn*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=i),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=Eu(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:i}=this.displayField,t=this.displayField.closest(".formeo-stage").getBoundingClientRect(),n=this.displayField.getBoundingClientRect(),m={position:"absolute",top:`${n.y+e-t.y}px`,left:`${n.x+window.scrollX-t.x+2}px`,width:`${i}px`};Object.assign(this.list.style,m)}showList(e,i=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),ge.slideDown(i,st)}hideList(e=this.list){ge.slideUp(e,st),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const i=e.querySelector(".active-option");return i?.style.display!=="none"?i:null}getPreviousOption(e){let i=e;do i=i?i.previousSibling:null;while(i!=null&&i.style.display==="none");return i}getNextOption(e){let i=e;do i=i?i.nextSibling:null;while(i!=null&&i.style.display==="none");return i}selectOption(e,i=this.list){const t=i.querySelectorAll("li");for(const n of t){const{dataset:{value:m}}=n;n.classList.remove("active-option"),Te(m)&&oe.getAddress(m)?.dom?.classList.remove($t)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName($t);for(const i of e)i.classList.remove($t)}highlightComponent(e){const{dataset:{value:i}}=e;if(Te(i)){const{componentAddress:t,isOptionAddress:n,optionIndex:m}=lt(i).reduce((f,c)=>c==="options"?(f.isOptionAddress=!0,f):f.isOptionAddress?(f.optionIndex=+c,f):(f.componentAddress.push(c),f),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=oe.getAddress(t);g?.dom&&(g.dom.classList.add($t),n&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[m]?.classList.add($t))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:i,value:t}=e.dataset;this.displayField.value=i,this.hiddenField.value=t,this.value=t,this.clearButton.classList.toggle("hidden",!t.length),this.onChange?.({target:this.hiddenField})}},ss=e=>Z.get(`${e}.placeholder`)||je(mi(e)),rr=e=>e.replaceAll(".","-"),$r=new Map([["config.helpText",(...e)=>Lr(...e)],["config.tooltip",(...e)=>Lr(...e)]]);function tn({key:e,value:i,type:t="text",checked:n}){const m={tag:"input",attrs:{type:t,value:i,placeholder:ss(e)},className:[rr(e)],config:{}};return n&&(m.attrs.checked=!0),m}function Lr({key:e,value:i}){return{tag:"textarea",attrs:{placeholder:ss(e)},className:[rr(e)],config:{},textContent:i}}function ze(e){const i=Z.get(e);if(i)return i;const t=mi(e);return Z.get(t)||je(t)}var xt={autocomplete:(...e)=>new Au(...e).createProxy(),string:({key:e,value:i})=>$r.has(e)?$r.get(e)({key:e,value:i}):tn({key:e,value:i}),boolean:({key:e,value:i})=>tn({key:e,value:i,type:e==="selected"?"radio":"checkbox",checked:!!i}),number:({key:e,value:i})=>tn({key:e,value:i,type:"number"}),array:({key:e,value:i})=>({tag:"select",attrs:{placeholder:ze(`placeholder.${e}`)},className:[rr(e)],options:i}),object:e=>Object.entries(e).map(([i,t])=>xt[V.childType(t)]({key:i,value:t}))},ku={boolean:(e,i)=>({click:({target:t})=>{if(t.type==="radio"){const n=i.data.options.map(m=>({...m,selected:!1}));i.set("options",n)}i.set(e,t.checked),i.updatePreview()}}),string:(e,i)=>({input:({target:{value:t}})=>{i.set(e,t),i.debouncedUpdatePreview()}}),number:(e,i)=>({input:({target:{value:t}})=>{i.set(e,Number(t)),i.debouncedUpdatePreview()}}),array:(e,i)=>({change:({target:{value:t}})=>{i.set(e,t),i.debouncedUpdatePreview()}}),object:()=>({})},as="hidden-property",Tu="hidden-option",nn=/\.options\[\d+\]$/,Mu={"if-sourceProperty":ri(ni,gr,mr),"if-targetProperty":ri(ni),"then-targetProperty":ri(ni,gr,mr),...Object.entries(zl).reduce((e,[i,t])=>(e[`if-${i}`]=t,e[`then-${i}`]=t,e),{})},ls={assignment:Lt,comparison:Lt,logical:Lt,source:({key:e,value:i,onChange:t,conditionType:n})=>xt.autocomplete({key:`${n}.condition.${e}`,value:i,onChange:t,className:`condition-${e}`}),sourceProperty:Lt,targetProperty:Lt,target:e=>ls.source(e),value:({key:e,value:i,onChange:t},n)=>{const m=xt.string({key:`condition.${e}`,value:i});return m.action={input:t},m}};function $u({key:e,value:i,conditionType:t}){return Object.entries(Mu[`${t}-${e}`]||{}).map(([n,m])=>Lu({fieldName:e,fieldValue:i,key:n,optionValue:m}))}function Lu({fieldName:e,fieldValue:i,key:t,optionValue:n}){return{label:Z.get(`${e}.${t}`)||je(t).toLowerCase(),value:n,selected:n===i}}function Lt({key:e,value:i,onChange:t,conditionType:n}){const m=$u({key:e,value:i,conditionType:n}),g=xt.array({key:`condition.${e}`,value:m});return g.action={change:t},g}var Ru=e=>!e?.classList.contains(as),_u={sourceProperty:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i.value;return _r(!!i.value.match(nn),t),!n},comparison:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i.value,m=!!i.value.match(nn);return!n||m||t.value!=="value"},assignment:e=>{const i=e.get("target"),t=e.get("targetProperty");return!i.value||t.value.startsWith("is")},targetProperty:e=>{const i=e.get("target"),t=e.get("targetProperty");return _r(!!i.value.match(nn),t),!Gl(i.value)},target:e=>{const i=e.get("source"),t=e.get("sourceProperty"),n=!!i?.value;return t&&!n?!0:t&&t?.value!=="value"},value:e=>{const i=e.get("target"),t=e.get("targetProperty");return t===void 0?!1:i&&!i.value||!Ru(e.get("comparison"))||t.value===cs?!0:t.value.startsWith("is")}},Rr=e=>{for(const[i,t]of e){const n=!!_u[i]?.(e)||!1;t.classList.toggle(as,n)}},cs="isChecked",rn=e=>e.value.endsWith("Checked"),_r=(e,i)=>{if(e&&rn(i))return null;const t=Array.from(i.querySelectorAll("option")),n=[];for(const m of t){const g=rn(m),f=e?!g:g;f&&n.push(m.value),m.classList.toggle(Tu,f)}n.includes(i.value)&&(i.value=e?cs:t.find(m=>!rn(m))?.value||i.value)};function Ou(e,i=Fl){return i.reduce((t,n)=>(e[n]!==void 0&&t.push([n,e[n]]),t),[])}var Iu=class{constructor({conditionValues:e,conditionType:i,conditionCount:t,index:n},m){this.values=new Map(Ou(e)),this.conditionType=i,this.parent=m,this.baseAddress=`${m.address}.${i}`,this.fields=new Map,this.conditionCount=t,this.index=n,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=oe.getAddress(this.baseAddress);e.splice(this.index,1),oe.setAddress(this.baseAddress,e),ge.slideUp(this.dom,st,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:Z.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[t,n]of this.values){const m=o=>this.onChangeCondition({key:t,target:o.target}),g={key:t,value:n,conditionType:this.conditionType,onChange:m},f=ls[t](g,this.values),c=f.dom||V.create(f);this.fields.set(t,f.dom?f:c),e.push(c)}const i={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return V.create(i)}generateConditionTypeActionButtons(){const e=[],i="manage-condition-type",t=g=>`${g}-condition-type`,n=V.btnTemplate({title:Z.get(`remove${this.conditionType}Condition`),className:[i,t("remove")],content:V.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(n);const m=V.btnTemplate({title:Z.get(`add${this.conditionType}Condition`),className:[i,t("add")],content:V.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),f={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(f)}}});return e.push(m),e}get value(){return Array.from(this.fields).reduce((e,[i,t])=>(e[i]=t.value,e),{})}processUiState(){Rr(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=gi(e=>{Q.formeoUpdated(e),oe.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:i})=>{const t={changedProperty:e,dataPath:this.address,value:this.value,src:i};Rr(this.fields),this.updateDataDebounced(t)}},Du=new Map([["attrs",({itemKey:e})=>e],["options",({itemKey:e,key:i})=>`${e}.${i}`]]),us=(e,i)=>{if(i.controlId==="select"){const t=i.editPanels.get("options"),[n,m]=e?fi:Bl,g=t.data.map(({[n]:f,...c})=>({[m]:f,...c}));t.setData(g)}},Nu=new Map([["attrs-multiple",e=>({change:({target:i})=>{e.field.controlId==="select"&&us(i.checked,e.field)}})]]),Rt=class{constructor({key:e,index:i,field:t,panel:n,data:m}){this.field=t,this.itemKey=e,this.itemIndex=i,this.panel=n,this.panelName=n.name,this.isDisabled=t.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&t.config.panels[this.panelName].hideDisabled,this.isLocked=t.isLockedProp(e,this.panelName),this.address=`${t.indexName}.${t.id}.${e}`,this.itemSlug=yr(e),this.conditionTypeWrap=new Map,m!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,m);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=V.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?Si(Object.entries(e),fi,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let i=this.conditionTypeWrap.get(e);return i||(i=V.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,i),i)}itemInputs(){const e=V.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([i,t])=>this.panelName==="conditions"?this.generateConditionFields(i,t):this.itemInput(i,t))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,i)=>{const t=this.findOrCreateConditionTypeWrap(e);let n=i;if(!n){const[g]=qn()[e],f=t.children.length;e==="if"&&(g.logical="||"),n={conditionValues:g,conditionCount:f,index:f}}const m=new Iu({conditionType:e,...n},this);return t.appendChild(m.dom),m};removeConditionType=(e,i)=>{const t=this.conditionTypeWrap.get(e).children[i];t.destroy(),t.dom.remove()};generateConditionFields=(e,i)=>(this.conditions=new Map,i.forEach((t,n)=>{const m=this.addConditionType(e,{index:n,conditionCount:i.length,conditionValues:t});this.conditions.set(n,m)}),this.findOrCreateConditionTypeWrap(e));removeItem=()=>{this.field.remove(this.itemKey),this.dom.remove(),this.panel.updateProps(),this.field.debouncedUpdatePreview?.()};get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{ge.slideUp(this.dom,333,this.removeItem)},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:V.icon("remove")},i=this.panelName==="options"&&{tag:"button",attrs:{type:"button",className:"prop-order prop-control",title:Z.get("reorderOption")||"Drag to reorder","aria-label":Z.get("reorderOption")||"Drag to reorder"},content:V.icon("move-vertical")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e,i].filter(Boolean)}}getConfigAttrOptions(e){const i=e.split(".").pop(),t=this.field.config?.attrs?.[i];return Array.isArray(t)?t:null}itemInput(e,i){if(this.isDisabled)return null;let t=V.childType(i)||"string",n=i;if(this.panelName==="attrs"){const s=this.getConfigAttrOptions(e);s&&(n=s.map(r=>({...r,selected:r.value===i})),t="array")}const m=Du.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,g=m.split(".").filter(Number.isNaN).join(".")||e,f=xt[t]({key:e,value:n}),c=`${this.field.shortId}-${yr(m).replaceAll(/-\d+-(selected)/g,"-$1")}`,o={label:this.panelName!=="options"&&ze(g),labelAfter:!1,inputWrap:["f-input-wrap",this.isLocked&&"locked-prop",this.isDisabled&&"disabled-prop"].filter(Boolean).join(" ")},h={name:f.attrs.type==="checkbox"?`${c}[]`:c};h.disabled=this.isDisabled,h.readonly=this.isLocked;const d=Nu.get(this.itemSlug)?.(this),u=fc(ku[t](m,this.field),d||{}),l=De(xt[t]({key:e,value:n}),{action:u,attrs:h,config:o});return fi.includes(e)?{className:"f-addon",children:l}:l}},Fu={multiple:(e,i)=>{us(!!e,i)}},zu=[{label:ze("config.label"),value:"label"},{label:ze("config.hideLabel"),value:"hideLabel"},{label:ze("config.helpText"),value:"helpText"},{label:ze("config.labelAfter"),value:"labelAfter"},{label:ze("config.disableHtmlLabel"),value:"disableHtmlLabel"},{label:ze("config.tooltip"),value:"tooltip"}],Pu={label:"New Field",hideLabel:!1,helpText:"",labelAfter:!1,disableHtmlLabel:!1,tooltip:""},Hu=class{constructor(e,i,t){this.type=V.childType(e),this.name=i,this.component=t,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:Z.get(`panel.label.${this.name}`)},attrs:{className:`${wo} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,m)=>{const g=this.type==="array",f=n[0],c=g?`[${m}]`:`.${n[0]}`,o=g?n:{[n[0]]:n[1]},h=`${this.name}${c}`,d=this.component.isDisabledProp(h,this.name),u=Wl.get(this.name)?.has(f)??!0;return d||!u?null:new Rt({key:h,data:o,field:this.component,index:m,panel:this})}).filter(Boolean);const i={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},content:this.editPanelItems},t=V.create(i);return this.name==="options"&&(this.sortable?.destroy(),this.sortable=J.create(t,{animation:150,handle:".prop-order",draggable:".prop-wrap",forceFallback:!0,onEnd:({oldIndex:n,newIndex:m})=>window.requestAnimationFrame(()=>this.moveOption(n,m))})),t}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}moveOption=(e,i)=>{const t=this.component.get("options");if(!Array.isArray(t)||!Number.isInteger(e)||!Number.isInteger(i)||e===i||e<0||e>=t.length||i<0||i>=t.length)return;const n=[...t],[m]=n.splice(e,1);n.splice(i,0,m),this.component.set("options",n),this.updateProps(),this.component.debouncedUpdatePreview?.()};createEditButtons(){const e=this.name,i={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition,config:this.addConfiguration},t=[];if(e==="conditions"){Z.current&&!Z.current.clearAll&&Z.put("clearAll","Clear All");const g={...V.btnTemplate({content:[V.icon("bin"),Z.get("clearAll")],title:Z.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};t.push(g)}const n=Z.get(`panelEditButtons.${e}`)||`+ Add ${je(e)}`,m={...V.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:g=>{const f={btnCoords:V.coords(g.target),addAction:i[e]};e==="attrs"&&(f.isDisabled=this.component.isDisabledProp,f.isLocked=this.component.isLockedProp,f.message={attr:Z.get(`action.add.${e}.attr`),value:Z.get(`action.add.${e}.value`)});const c=je(e),o=new globalThis.CustomEvent(`onAdd${c}`,{detail:f});ve.add[e](f),document.dispatchEvent(o)}}};return t.push(m),{className:"panel-action-buttons",content:t}}addAttribute=(e,i)=>{let t=i;const n=ts(e),m=`attrs.${n}`;Z.current[m]||Z.put(m,is(e)),typeof t=="string"&&["true","false"].includes(t)&&(t=JSON.parse(t)),this.component.set(`attrs.${e}`,t),Fu[n]?.(t,this.component);const g=`${this.component.name}-attrs-${n}`,f=Array.from(this.props.children).find(o=>o.classList.contains(g)),c=new Rt({key:m,data:{[n]:t},field:this.component,panel:this});f?f.replaceWith(c.dom):this.props.appendChild(c.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,i=this.component.get("options"),t=e==="select"?"option":e,n=Z.get("newOptionLabel",{type:t})||"New Option",m=`${this.name}[${this.data.length}]`,g=i[i.length-1],f={...i.length?g:{},label:n};e!=="button"&&(f.value=No(n));const c=new Rt({key:m,data:f,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(c),this.props.appendChild(c.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const i=`conditions[${this.component.get("conditions").length}]`,t=new Rt({key:i,data:e.template,field:this.component,panel:this});this.props.appendChild(t.dom),this.component.set(i,e.template),this.component.resizePanelWrap()};addConfiguration=()=>{const e=this.component.get("config");new Ss({className:"config-item-dialog",content:[{tag:"select",config:{label:Z.get("selectConfigKey")||"Select Configuration Key"},attrs:{name:"selectConfigKey",required:!0,className:"config-key-select"},options:zu.filter(i=>!(i.value in e))}],onConfirm:i=>{const t=i.get("selectConfigKey").trim(),n=`config.${t}`;if(t){const m=new Rt({key:n,data:Pu[t],field:this.component,panel:this});this.editPanelItems.push(m),this.props.appendChild(m.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()}}}).open()};clearAllItems=()=>{const e=this.type==="array"?[]:{},i={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};ve.remove[this.name](i);const t=je(this.name),n=new globalThis.CustomEvent(`onRemove${t}`,{detail:i});document.dispatchEvent(n)};setData(e){this.component.set(this.name,e),this.updateProps()}},Or=Object.freeze({type:"field",displayType:"slider"}),ei=e=>({transform:`translateX(${e?`${e}px`:0})`}),ds=class{constructor(e){this.opts=De(Or,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const i=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const t=new window.ResizeObserver(([{contentRect:{width:m}}])=>{this.currentWidth!==m&&(this.toggleTabbedLayout(),this.currentWidth=m,this.nav.setTranslateX(this.activePanelIndex,!1))}),n=window.setTimeout(()=>{t.observe(i),window.clearTimeout(n)},Hn)}getPanelDisplay(){const e=this.panelsWrap,i=Number.parseInt(V.getStyle(e,"width"),10)>390?"tabbed":"slider",t=this.opts.displayType==="auto";return this.panelDisplay=t?i:this.opts.displayType||Or.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=V.create({className:"panels",content:this.opts.panels.map(({config:i,...t})=>t)});return this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}createPanelNavLabels(){const e=this.opts.panels.map(n=>({tag:"h5",action:{click:m=>{const g=Je(m.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:n.config.label})),i={className:"panel-labels",content:{content:e}},[t]=e;return t.className="active-tab",V.create(i)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:Z.get("controlGroups.nextGroup"),type:"button"},action:{click:t=>this.nav.nextGroup(t)},content:V.icon("triangle-right")},i={tag:"button",attrs:{className:"prev-group",title:Z.get("controlGroups.prevGroup"),type:"button"},action:{click:t=>this.nav.prevGroup(t)},content:V.icon("triangle-left")};return V.create({tag:"nav",attrs:{className:"panel-nav"},content:[i,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},i=this.currentPanel.parentElement,t=this.labels.firstChild,n=t.children,m=this.currentPanel.parentElement.childNodes;this.activePanelIndex=Je(this.currentPanel);let g={nav:0,panel:0},f={...g};e.groupChange=h=>(this.activePanelIndex=h,this.currentPanel=m[h],V.removeClasses(m,"active-panel"),V.removeClasses(n,"active-tab"),this.currentPanel.classList.add("active-panel"),n[h].classList.add("active-tab"),this.currentPanel);const c=h=>({nav:-t.offsetWidth*h,panel:-i.offsetWidth*h}),o=({offset:h,reset:d,duration:u=st,animate:l=!this.isTabbed})=>{const s=[ei(f.panel),ei(h.panel)],r=[ei(f.nav),ei(this.isTabbed?0:h.nav)];if(d){const[y]=s,[k]=r;s.push(y),r.push(k)}const a={easing:"ease-in-out",duration:l?u:0,fill:"forwards"},p=i.animate(s,a);t.animate(r,a);const v=()=>{p.removeEventListener("finish",v),d||(f=h)};p.addEventListener("finish",v)};return e.setTranslateX=(h=this.activePanelIndex,d=!0)=>{g=c(h),o({offset:g,animate:d})},e.refresh=(h=this.activePanelIndex)=>{this.activePanelIndex!==h&&e.groupChange(h),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const h=this.activePanelIndex+1;if(h!==m.length){const d=m[h];g={nav:-t.offsetWidth*h,panel:-d.offsetLeft},o({offset:g}),e.groupChange(h)}else g={nav:f.nav-8,panel:f.panel-8},o({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const h=this.activePanelIndex-1,d=m[h];g={nav:-t.offsetWidth*h,panel:-d.offsetLeft},o({offset:g}),e.groupChange(h)}else g={nav:8,panel:8},o({offset:g,reset:!0})},e}},Bu="modulepreload",Wu=function(e){return"/formeo/"+e},Ir={},vt=function(i,t,n){let m=Promise.resolve();if(t&&t.length>0){let h=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};const f=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),o=c?.nonce||c?.getAttribute("nonce");m=h(t.map(d=>{if(d=Wu(d,n),d in Ir)return;Ir[d]=!0;const u=d.endsWith(".css"),l=u?'[rel="stylesheet"]':"";if(n)for(let r=f.length-1;r>=0;r--){const a=f[r];if(a.href===d&&(!u||a.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${l}`))return;const s=document.createElement("link");if(s.rel=u?"stylesheet":Bu,u||(s.as="script"),s.crossOrigin="",s.href=d,o&&s.setAttribute("nonce",o),document.head.appendChild(s),u)return new Promise((r,a)=>{s.addEventListener("load",r),s.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${d}`)))})}))}function g(f){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=f,window.dispatchEvent(c),!c.defaultPrevented)throw f}return m.then(f=>{for(const c of f||[])c.status==="rejected"&&g(c.reason);return i().catch(g)})},on=null,sn=ri(ni),zi=class extends Qn{constructor(e,i={}){const t={...i,id:i.id||Me()};super(e,t),this.id=t.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config={...t.config,...oe[`${this.name}s`].config},this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach(([e,i])=>{this.addEventListener(e,i)})}addEventListener(e,i){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(i)}removeEventListener(e,i){if(!this.eventListeners?.has(e))return;const t=this.eventListeners.get(e),n=t.indexOf(i);n>-1&&t.splice(n,1)}dispatchComponentEvent(e,i={}){const t={component:this,target:this,type:e,timestamp:Date.now(),...i};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(n=>{try{typeof n=="function"&&n(t)}catch(m){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,m)}}),t}set(e,i){const t=this.get(e),n=super.set(e,i);return t!==i&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:t,newValue:i}),n}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const c=lt(e),o=c.pop(),h=this.get(c),d=h?.[o];return Array.isArray(h)?es(o)?(h.splice(Number(o),1),this.dispatchRemovedPath(e,d)):this.set(c,h.filter(u=>u!==o)):(delete h[o],this.dispatchRemovedPath(e,d)),h}if(this.name==="stage")return null;const i=this.parent,t=this.children,n=`${i.name}s.${i.id}.children`,m=[...oe.getAddress(n)||[]];this.dispatchComponentEvent("onRemove",{path:e,parent:i,children:[...t]}),Fi(t,c=>c.remove()),this.dom.remove(),Ul(oe.getAddress(n),this.id),i.children.length||i.emptyClass(),i.name==="row"&&i.autoColumnWidths();const g={row:Un,column:Gn,field:Kn}[this.name];g&&Q.formeoUpdated({componentId:this.id,componentType:this.name,parent:i},g);const f=oe[`${this.name}s`].delete(this.id);return Q.formeoUpdated({entity:this,componentId:this.id,componentType:this.name,dataPath:`${i.name}s.${i.id}`,changePath:n,value:[...oe.getAddress(n)||[]],previousValue:m,changeType:"removed"}),f};dispatchRemovedPath=(e,i)=>{const t=Array.isArray(e)?e.join("."):e;Q.formeoUpdated({entity:this,dataPath:this.address,changePath:`${this.address}.${t}`,value:void 0,previousValue:i,changeType:"removed",data:this.data})};empty(){const e=this.children.map(i=>(i.remove(),i));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{oe.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:i})=>{this.dom.classList.remove(...e),oe.stages.active.dom.classList.remove(`active-hover-${this.name}`),i.removeAttribute("style")}},children:[{...V.btnTemplate({content:V.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>V.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[V.icon(`handle-${this.name}`),je(this.name)].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const i=this.dom,t="editing",n=`${t}-${this.name}`,m=this.dom.querySelector(`.${this.name}-edit`);ge.slideToggle(m,333,e),this.name==="field"&&(ge.slideToggle(this.preview,333,!e),i.parentElement.classList.toggle(`column-${n}`,e)),i.classList.toggle(t,e),i.classList.toggle(n,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(m=`handle-${this.name}`)=>({...V.btnTemplate({content:V.icon(m)}),className:["component-handle"]}),move:(m="move")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-move"],meta:{id:"move"}}),edit:(m="edit")=>({...V.btnTemplate({content:V.icon(m)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(m="remove")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{ge.slideUp(this.dom,333,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(m="copy")=>({...V.btnTemplate({content:V.icon(m)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:i,disabled:t}=this.config.actionButtons,n=i.filter(m=>!t.includes(m)).map(m=>e[m]?.()||m);return this.actionButtons=n,this.actionButtons}get index(){return Je(this.dom)}removeClasses=e=>{const i={string:()=>this.dom.classList.remove(e),array:()=>e.map(t=>this.dom.classList.remove(t))};return i.object=i.string,i[V.childType(e)](this.dom)};get parentType(){return Ll.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const i=this.dom.closest(`.${zn[e]}`);return i&&V.asComponent(i)}get children(){if(!this.dom)return[];const e=this.domChildren,i=pr.get(this.name);return ir(e,t=>oe.getAddress(`${i}s.${t.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(i=>this.addChild({id:i}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},i=this.domChildren.length){let t=e;typeof e!="object"&&(t={id:t});const n=this.dom.querySelector(".children"),{id:m=Me()}=t,g=pr.get(this.name);if(!g)return null;const f=`${g}s`,c=oe.getAddress(`${f}.${m}`)||oe[f].add(m,t);i>=n.children.length?n.appendChild(c.dom):n.children[i].before(c.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:c,child:c,index:i}),c.dispatchComponentEvent("onAdd",{parent:this,target:c,index:i,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:c});const o=c.get("children");return o?.length&&c.loadChildren(o),this.removeClasses("empty"),this.saveChildOrder(),c}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:i})=>i);return this.set("children",e),e};onAdd({from:e,to:i,item:t,newIndex:n}){e.classList.contains("control-group")||(e=e.parentElement);const m=be(e),g=be(i.parentElement),f=()=>{this.saveChildOrder(),this.removeClasses("empty")},c=new Map([[-2,()=>{const h=this.addChild({},n).addChild();return h.addChild.bind(h)}],[-1,()=>{const h=this.addChild({},n);return h.addChild.bind(h)}],[0,()=>this.addChild.bind(this)],[1,h=>{const d=Je(this.dom);return()=>this.parent.addChild(h,d+1)}],[2,h=>()=>this.parent.parent.addChild(h)]]),o={controls:async()=>{if(!on){const{default:p}=await vt(async()=>{const{default:v}=await Promise.resolve().then(()=>dd);return{default:v}},void 0);on=p}const{controlData:{meta:{id:h},...d}}=on.get(t.id);Ii(d,"config.controlId",h);const u=h.startsWith("layout-"),l=u?h.replace(/^layout-/,""):"field",s=u?{}:d,r=we({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${l}`),a=c.get(r)();return V.remove(t),a(s,n)},row:()=>(c.get({stage:-1,row:0,column:1}[g])||gn)()?.({id:t.id},n),column:()=>(c.get({stage:-2,row:-1}[g])||gn)()?.(t.id)}[m]?.(t,n);return this.dispatchComponentEvent("onAdd",{from:e,to:i,item:t,newIndex:n,fromType:m,toType:g,addedComponent:o,addedVia:"dragDrop"}),f(),o}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(Ge)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:i}})=>{e?.classList.remove(`hovering-${be(e)}`),i?.classList.remove(`hovering-${be(i)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&V.onRender(this.dom,e.onRender)}set config(e){const i=we(e,"all"),t=we(this.data,"config.controlId"),n=[i,t&&we(e,t),we(e,this.id)].reduce((m,g)=>g?De(m,g):m,this.configVal);this.configVal=n}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(i=>{const t=this.processConditions(i.if),n=this.processResults(i.then);return t.map(m=>this.evaluateConditions(m)&&this.execResults(n))}):null};getComponent(e){const[i,t]=e.split("."),n=oe[i];return t===this.id?this:n?.get(t)}value=(e,i)=>{const t=e.split("."),n=this.getComponent(e),m=n&&t.slice(2,t.length).join(".");return[!n,!m,!sn[m]].some(Boolean)?e:i?n.set(sn[m],i):n.get(sn[m])};getResult=e=>({"=":(i,t,n)=>i.set(t,n)})[e];processResults=e=>e.map(({operator:i,target:t,value:n})=>{const m=this.getComponent(t);return{target:m,propertyPath:m&&t.split(".").slice(2,t.length).join("."),action:this.getResult(i),value:this.value(n)}});execResults=e=>{const i=e.map(t=>this.execResult(t));return Promise.all(i)};execResult=({target:e,action:i,value:t,_propertyPath:n})=>new Promise((m,g)=>{try{return m(i(e,t))}catch(f){return g(f)}});cloneData=()=>{const e={...He(this.data),id:Me()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const i=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(i),this.dispatchComponentEvent("onClone",{original:this,clone:i,parent:e}),i};cloneChildren(e){for(const i of this.children)i?.clone(e)}createChildWrap=e=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Hi.row}get isColumn(){return this.name===Hi.column}get isField(){return this.name===Hi.field}isDisabledProp=(e,i="attrs")=>{if(we(this.config,e))return!1;if((this.config?.disabled||[]).includes(e))return!0;const t=mi(e);return(this.config?.panels[i]?.disabled||[]).includes(t)};isLockedProp=(e,i="attrs")=>{if((this.config?.locked||[]).includes(e))return!0;const t=mi(e);return!!(this.config?.panels[i]?.locked||[]).includes(t)};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},i=this.editPanels.size;return i&&(e.className.push(`panel-count-${i}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(i===0){const t=this.dom.querySelector(".edit-toggle"),n=this.dom.querySelector(`.${this.name}-actions`),m=n.getElementsByTagName("button");n.style.maxWidth=`${m.length*m[0].clientWidth}px`,V.remove(t)}else this.resizePanelWrap()}},V.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=new Set(["object","array"]),i=at([...this.config.panels.order,...Object.keys(this.data)]),t=new Set(["children","meta","action","events",...this.config.panels.disabled]),n=i.filter(g=>!t.has(g));for(const g of n){const f=this.get(g),c=V.childType(f);if(e.has(c)){const o=new Hu(f,g,this);this.editPanels.set(o.name,o)}}const m={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new ds(m),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}},ju=class{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const i=e.querySelector(".children");if(!i)return 0;const t=i.children.length,n=V.getStyle(i,"gap")||"0px",m=parseFloat(n,10)||0;return this.totalGapWidth=m*(t-1),i.offsetWidth-this.totalGapWidth}validateResizeTarget(e,i){return e&&i&&e.offsetWidth&&i.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const i=e.target.parentElement,t=i.nextSibling||i.previousSibling,n=i.closest(`.${Ue}`);if(!this.validateResizeTarget(i,t)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,n.classList.add(Pi),this.columnPreset=n.querySelector(`.${Co}`),this.originalColumnClass=i.className,this.originalSiblingClass=t.className,i.className=i.className.replace(pn,""),t.className=t.className.replace(pn,""),this.colStartWidth=i.offsetWidth,this.sibStartWidth=t.offsetWidth,this.rowWidth=this.getRowWidth(n),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=i,this.sibling=t,this.row=n;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(m){console.error("Failed to initialize resize listeners:",m),this.cleanup()}}calculateNewWidths(e){const i=this.colStartWidth+e-this.startX,t=this.sibStartWidth-e+this.startX,n=parseFloat(Bi(i,this.rowWidth)),m=parseFloat(Bi(t,this.rowWidth));return n<10||m<10?null:{colWidth:fn(n.toFixed(1)),siblingColWidth:fn(m.toFixed(1))}}onMove(e){e.preventDefault();const{column:i,sibling:t}=this,n=e.type==="touchmove"?e.touches[0].clientX:e.clientX,m=this.calculateNewWidths(n);if(!m)return;const{colWidth:g,siblingColWidth:f}=m;i.dataset.colWidth=g,t.dataset.colWidth=f,i.style.width=g,t.style.width=f,this.resized=!0}onStop(){const{column:e,sibling:i}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),oe.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),oe.setAddress(`columns.${i.id}.config.width`,i.dataset.colWidth),this.row.classList.remove(Pi),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Pi),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let i=e.querySelector(`.${hn}`);const t=this.row.querySelector(".children").children,n=ir(t,f=>Bi(f.clientWidth,this.rowWidth).toFixed(1)),m=n.join(","),g=n.join(" | ");return i||(i=V.create({tag:"option",attrs:{className:hn,value:m,selected:!0},content:g}),e.append(i)),i.value=m,i.textContent=g,m}},Vu=()=>Object.freeze({config:{width:"100%"},children:[],className:[Ge]}),Dr={resizeHandle:e=>({className:"resize-x-handle",action:{pointerdown:e.onStart.bind(e)},content:[V.icon("triangle-down"),V.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})},Uu=class extends zi{constructor(e){super("column",{...Vu(),...e});const i=this.createChildWrap();this.dom=V.create({tag:"li",className:[Ge,"empty"],dataset:{hoverTag:Z.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Dr.editWindow(),Dr.resizeHandle(new ju),i]}),this.processConfig(),Q.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),J.create(i,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${Tt}`,handle:".item-move"})}processConfig(){const e=Ae.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))},Gu={actionButtons:{buttons:["clone","move","remove"],disabled:[]}},Ku=class extends Di{constructor(e){super("columns",e),this.config={all:Gu}}Component(e){return new Uu(e)}},hs=new Ku,qu=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Ue]}),Yu=class extends zi{constructor(e){super("row",{...qu(),...e});const i=this.createChildWrap();this.dom=V.create({tag:"li",className:[Ue,"empty"],dataset:{hoverTag:Z.get("row"),editingHoverTag:Z.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,i]}),J.create(i,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${Ge}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:Z.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:c}})=>{this.set("config.fieldset",!!c)}},config:{label:Z.get("row.settings.fieldsetWrap")}},i={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:Z.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:c}})=>this.set("config.inputGroup",c)},config:{label:Z.get("row.makeInputGroup"),description:Z.get("row.makeInputGroupDesc")}},t={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:c}})=>this.set("config.legend",c)},className:""}},n=V.formGroup([e,t]),m={tag:"label",content:Z.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=V.create(this.columnPresetControlConfig);const g={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=[i,"hr",n,"hr",V.formGroup([m,g],"row")];return V.create({className:`${this.name}-edit group-config`,action:{onRender:c=>{const o=f.map(h=>V.create(h));c.append(...o)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const i=Number.parseFloat((100/e.length).toFixed(1))/1;for(const t of e){t.removeClasses(pn);const n=t.dom,m=fn(i);t.set("config.width",m),n.style.width=m,n.dataset.colWidth=m;const g=setTimeout(()=>{clearTimeout(g),t.refreshFieldPanels()},st);document.dispatchEvent(Q.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:i,...t})=>V.create({tag:"option",content:i,attrs:t}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((i,t)=>{i.setWidth(`${e[t]}%`),i.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,i=_l.get(e.length-1)||[],t=e.map(n=>{const m=n.get("config.width")||"";return Number(m.replace("%","")).toFixed(1)}).join(",");if(i.length){const n=i.slice();return n.find(m=>m.value===t)||n.push({value:t,label:t.replace(/,/g," | "),className:hn}),n.map(m=>{const g={...m};return g.selected=m.value===t,g})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:Z.get("defineColumnLayout"),className:Co},action:{change:({target:e})=>{const{value:i}=e;this.setColumnWidths(i)}},options:this.getColumnPresetOptions}}},Zu={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}},Qu=class extends Di{constructor(e){super("rows",e),this.config={all:Zu}}Component(e){return new Yu(e)}},or=new Qu,Xu=()=>({conditions:[qn()],children:[]}),Ju=class extends zi{constructor(e){super("stage",{...Xu(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=gi(this.updateEditPanels),Z.get("Untitled Form"),Z.get("Untitled Form"),Z.get("Form Title"),Z.get("Form novalidate"),Z.get("Tags");const i=this.createChildWrap();this.dom=V.create({attrs:{className:[kt,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,i]}),J.create(i,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{Wt.active=this},onSort:this.onSort.bind(this),draggable:`.${Ue}`,handle:".item-move"})}empty(e=!0){return new Promise(i=>{e?(this.dom.classList.add("removing-all-fields"),ge.slideUp(this.dom,333,()=>{i(super.empty(e)),this.dom.classList.remove("removing-all-fields"),ge.slideDown(this.dom,333)})):i(super.empty())})}onAdd(...e){const i=super.onAdd(...e);i?.name==="column"&&i.parent.autoColumnWidths()}},ed=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}),td=class extends Di{constructor(e){super("stages",e),this.config={all:ed()}}Component(e){return new Ju(e)}},Wt=new td,$e={js:new Set,css:new Set,formeoSprite:null},id=1e4,Nr=(e,i,t=mn,n=id)=>new Promise(m=>{const g=typeof AbortSignal<"u"&&AbortSignal.timeout?AbortSignal.timeout(n):void 0;return fetch(e,g?{signal:g}:void 0).then(f=>{if(!f.ok)return m(t(f));m(i?i(f):f)}).catch(f=>m(t(f)))}),ps=(e,i)=>{e.removeEventListener("load",ps),i(e.src)},fs=(e,i)=>{e.removeEventListener("load",fs),i(e.src)},nd=e=>new Promise((i,t)=>{if($e.js.has(e))return i(e);$e.js.add(e);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:e},action:{load:()=>fs(n,i),error:()=>t(new Error(`${e} failed to load.`))}});document.head.appendChild(n)}),xn=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>new Promise((n,m)=>{if($e.css.has(t))return n(t);$e.css.add(t);const g=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>ps(g,n),error:()=>m(new Error(`${t} failed to load.`))}});document.head.appendChild(g)}));return Promise.all(i)},rd=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>nd(t));return Promise.all(i)},od=e=>{e=Array.isArray(e)?e:[e];const i=e.map(t=>xn(t));return Promise.all(i)},Fr=e=>($e.formeoSprite=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,$e.formeoSprite),sd=async(e=null)=>{if($e.formeoSprite)return $e.formeoSprite;if(!e)return Fr(gl);const i=async t=>Fr(await t.text());return Nr(e,i,()=>Nr(vl,i))},ad={js:rd,css:od},gs=e=>{const i=Object.entries(e).map(([t,n])=>ad[t](n));return Promise.all(i)},ld=async e=>{if(e&&!$e.css.has(e)&&(await xn(e),!$e.css.has(e)&&!$e.css.has("https://draggable.github.io/formeo/assets/css/formeo.min.css")))return await xn(bl)},cd=class{controlCache=new Set;constructor({events:e={},dependencies:i={},controlAction:t,...n}){this.events=e,this.controlData=n,this.controlAction=t,this.dependencies=i,this.id=n.id||Me()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:i}=this.controlData,t=this.i18n(i.label)||i.label,n={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:V.icon(e.icon)},{tag:"span",className:"control-label",content:t}],action:{focus:({target:m})=>{const g=m.closest(`.${ot}`);return g&&ct.panels.nav.refresh(Je(g))},click:({target:m})=>{const g=m.closest(".field-control")?.id;g&&ct.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:n,meta:e,action:this.controlAction})}promise(){return gs(this.dependencies)}i18n(e,i){const t=Z.locale,n=this.definition?.i18n?.[t]||{};return(n[e]?.()??n[e])||Z.get(e,i)}},ud=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}}),dd=An({Controls:()=>ms,default:()=>ct}),ms=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const i=e.closest(`.${ot}`);return i&&this.panels.nav.refresh(Je(i))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,i=!1){return await this.applyOptions(e),this.buildDOM(i),this}registerControls(e){return this.controls=[],e.map(i=>{const t=typeof i=="function"?new i:new cd(i);return this.add(t),this.controls.push(t.dom),t.promise()})}groupLabel=e=>Z.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),i=this.controls.slice(),t=[];const n=[];return e=Si(e,this.groupOrder,"id"),e=e.filter(m=>vr(m.id,this.options.disable.groups)),t=e.map(m=>{const g={tag:"ul",attrs:{className:[ot,wo],id:`${m.id}-${ot}`},config:{label:this.groupLabel(m.label)}};if(this.options.elementOrder[m.id]){const f=this.options.elementOrder[m.id];m.elementOrder=at(f.concat(m.elementOrder))}return i=Si(i,m.elementOrder,"meta.id"),g.content=i.filter(f=>{const{controlData:c}=this.get(f.id),o=c.meta.id||"",h=[vr(o,this.options.disable.elements),c.meta.group===m.id,!n.includes(o)];let d=!0;return d=h.every(u=>u===!0),d&&n.push(o),d}),g}),t}add(e=Object.create(null)){const i=He(e);return this.data.set(i.id,i),i.controlData.meta.id&&this.data.set(i.controlData.meta.id,i.controlData),i}get(e){return He(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...V.btnTemplate({content:[V.icon("bin"),Z.get("clear")],title:Z.get("clearAll")}),className:["clear-form"],action:{click:t=>{or.size?(Q.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:Z.get("confirmClearAll"),clearAllAction:()=>{Wt.clearAll().then(()=>{const n={src:t.target};Q.formeoCleared(n)})},btnCoords:V.coords(t.target)}}),document.dispatchEvent(Q.confirmClearAll)):window.alert(Z.get("cannotClearFields"))}}},i={...V.btnTemplate({content:[V.icon("floppy-disk"),Z.get("save")],title:Z.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:n}=await vt(async()=>{const{default:f}=await Promise.resolve().then(()=>vd);return{default:f}},void 0),{formData:m}=n,g={action:()=>{},coords:V.coords(t),message:"",button:t};return ve.click.btn(g),ve.save.form(m)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:i}).reduce((t,[n,m])=>(this.options.disable.formActions.includes(n)||t.push(m),t),[])}}buildDOM(e){const i=this.groupElements(),t=this.formActions(),{displayType:n}=this.options.panels;this.panels=new ds({panels:i,type:"controls",displayType:n});const m=["control-groups","formeo-panels-wrap",`panel-count-${i.length}`],g=V.create({className:m,content:[this.panels.panelNav,this.panels.panelsWrap]}),f=["formeo-controls"];e&&f.push("formeo-sticky");const c=V.create({className:f,content:[g,t]}),o=c.getElementsByClassName("control-group");this.dom=c,this.groups=o;const[h]=o;this.currentGroup=h,this.actions={filter:d=>{const u=d!=="",l=this.controls;let s=g.querySelector(".filtered-term");if(V.toggleElementsByStr(l,d),u){const r=Z.get("controls.filteringTerm",d);c.classList.add("filtered"),s?s.textContent=r:(s=V.create({tag:"h5",className:"filtered-term",content:r}),g.insertBefore(s,g.firstChild))}else s&&(c.classList.remove("filtered"),s.remove())},addElement:this.addElement,addGroup:d=>console.log(d)};for(let d=o.length-1;d>=0;d--){const u=`formeo-controls-${o[d]}`;this.options.sortable||globalThis.localStorage.removeItem(u),J.create(o[d],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:l,item:s})=>{if(l.id=s.id,this.options.ghostPreview){const{controlData:r}=this.get(s.id);vt(async()=>{const{default:a}=await Promise.resolve().then(()=>hd);return{default:a}},void 0).then(({default:a})=>{l.innerHTML="",l.appendChild(new a(r).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const l=globalThis.localStorage.getItem(u);return l?l.split("|"):[]},set:l=>{const s=l.toArray();globalThis.localStorage.setItem(u,s.join("|"))}}})}return c}layoutTypes={row:()=>Wt.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:i,id:t},...n}=we(this.get(e),"controlData");return Ii(n,"config.controlId",t),i==="layout"?this.layoutTypes[t.replace("layout-","")]():this.layoutTypes.field(n)};applyOptions=async(e={})=>{const{container:i,elements:t,groupOrder:n,...m}=De(ud,e);this.container=V.resolveContainer(i),this.groupOrder=at(n.concat(["common","html","layout"])),this.options=m;const[g,f,c]=await Promise.all([vt(()=>import("./layout.min.js"),[]),vt(()=>import("./form.min.js"),[]),vt(()=>import("./html.min.js"),[])]),o=[g.default,f.default,c.default].flat();return Promise.all(this.registerControls([...o,...t]))}},ct=new ms,hd=An({default:()=>vs}),pd=new Set(["checkbox","radio"]),fd=new Set(["radio","checkbox","select-one","select-multiple"]),vs=class extends zi{constructor(e=Object.create(null)){super("field",e),this.debouncedUpdateEditPanels=gi(this.updateEditPanels),this.debouncedUpdatePreview=gi(this.updatePreview),this.label=V.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const i=this.getActionButtons(),t=this.actionButtons.some(m=>m.meta?.id==="edit");this.updateEditPanels();const n=V.create({tag:"li",attrs:{className:Tt},id:this.id,children:[this.label,this.getComponentTag(),i,t&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:Z.get("field")}});this.dom=n,this.isEditing=!1}get labelConfig(){if(this.get("config.hideLabel"))return null;const{label:e,editorLabel:i,disableHtmlLabel:t,helpText:n,tooltip:m}=this.get("config"),{required:g}=this.get("attrs")||{},f=i||e,c={tag:"label",attrs:{}};return t?(c.tag="input",c.attrs.value=f):(c.attrs.contenteditable=!0,c.children=f),{className:"prev-label",children:[{...c,action:{input:({target:{innerHTML:o,value:h}})=>{const d=t?h:o;super.set("config.label",d);const u=this.dom.querySelector(".config-label");u&&(u.value=d)}}},g&&V.requiredMark(),m&&V.tooltip(m),n&&V.helpText(n)]}}setData=(e,i)=>super.set(e,i);set(e,i){return this.setData(e,i)}updateLabel(){const e=V.create(this.labelConfig);(this.label||!e)&&this.label.remove(),e&&(this.data.config?.labelAfter?this.dom.append(e):this.dom.prepend(e)),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:i}=e,{type:t}=i;if(fd.has(t)){const n=this.preview.querySelectorAll(":checked"),m=this.get("options"),g=m?.[0]?.selected===void 0?"checked":"selected",f=m.reduce((c,o)=>(c[o.value]=o,c[o.value][g]=!1,c),{});for(const c of n)f[c.value][g]=c.value===f[c.value].value;return super.set("options",Object.values(f)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const i=e.parentElement.classList;if(i.contains("f-checkbox")||i.contains("f-radio")){const t=e.parentElement,n=Je(t);return this.setData(`options[${n}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...i}=He(this.data);i.id=`prev-${this.id}`,i.action=Object.entries(e).reduce((n,[m,g])=>(n[m]=g.bind(this),n),{}),this.data?.config.editableContent&&(i.attrs={...i.attrs,contenteditable:!0});const t={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:V.create(i,!0),action:this.defaultPreviewActions};return V.create(t,!0)}get isCheckable(){return pd.has(this.get("config.controlId"))}},gd=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}),md=class extends Di{constructor(e){super("fields",e),this.config={all:gd()}}Component(e){return new vs(e)}get=e=>{let i=e&&we(this.data,e);if(!i){const t=ct.get(e);t&&(i=this.add(null,t.controlData))}return i};getData=()=>Object.entries(this.data).reduce((e,[i,t])=>{const{conditions:n,...m}=t?.getData()||t;if(n?.length){let g=!0;if(n.length===1){const[f]=n;g=!!f.if[0].source}g&&(m.conditions=n)}return e[i]=m,e},{});load=(e=Object.create(null))=>{const i=_i(e);this.empty();for(const[t,n]of Object.entries(i)){const{meta:m,...g}=n;m?.id&&Ii(g,"config.controlId",m?.id),this.add(t,g)}return this.data}},ys=new md,vd=An({Columns:()=>Ht,Components:()=>bs,Controls:()=>Bt,Fields:()=>di,Rows:()=>ui,Stages:()=>ci,default:()=>oe}),ci=Wt,ui=or,Ht=hs,di=ys,Bt=ct,yd=(e,i=!1)=>{if(e!=null){const t=_i(e);if(t&&typeof t=="object"){const n=He(t);return{id:n.id||wt().id,stages:n.stages||wt().stages,rows:n.rows||{},columns:n.columns||{},fields:n.fields||{}}}console.warn("Formeo: Invalid formData provided, using default")}if(i){const t=Yn.get(Pn);if(t)return t}return wt()},bs=class extends Qn{constructor(){super("components"),this.disableEvents=!0,this.stages=ci,this.rows=ui,this.columns=Ht,this.fields=di,this.controls=Bt}load=(e,i)=>{this.empty();const t=yd(e,i.sessionStorage);this.opts=i,this.set("id",t.id),this.add("stages",ci.load(t.stages)),this.add("rows",ui.load(t.rows)),this.add("columns",Ht.load(t.columns)),this.add("fields",di.load(t.fields));for(const n of Object.values(this.get("stages")))n.loadChildren();return this.data};flatList(){const e={};for(const i of Object.keys(this.data.stages))Do(this.data,i,"stages",e);return e}getChildData=({type:e,id:i})=>{const t=this.get(e,i);if(t)return t.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Dn}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Wt.getData(),rows:or.getData(),columns:hs.getData(),fields:ys.getData()}}set config(e){const{stages:i,rows:t,columns:n,fields:m}=e;ci.config=i,ui.config=t,Ht.config=n,di.config=m}getIndex(e){return this[e]||this[Sl.get(e)]}setAddress(e,i){if(!Te(e))return;const[t,n,...m]=Array.isArray(e)?e:lt(e),g=this.getIndex(t).get(n);return g?.set(m,i),g}getAddress(e){if(!Te(e))return;const[i,t,...n]=Array.isArray(e)?e:lt(e),m=this.getIndex(i).get(t);if(!(n.length&&!m))return n.length?m.get(n):m}},oe=new bs,bd={glyphicons:e=>`<span class="glyphicon glyphicon-${e}" aria-hidden="true"></span>`,"font-awesome":e=>{const[i,t]=e.split(" ");return`<i class="${i} fa-${t}"></i>`},fontello:e=>`<i class="${Oo}${e}">${e}</i>`},wd=new Set(["input","textarea","select"]),Ei="formeo-required-group",ws=["disabled","form"],Cd=new Set(["type","id","name","className","value","required",...ws]),Sd=(e={})=>Object.fromEntries(Object.entries(e).filter(([i])=>!Cd.has(i))),xd=e=>e.replace(/^on([A-Z])/,(i,t)=>t.toLowerCase()),Ed=new Set(["focus","blur"]),Ad=e=>{const i=xd(e);return(t,n)=>t.addEventListener(i,n,Ed.has(i))},Cs=(e={})=>{let i=e?.attrs?.name||e?.name;if(i)return i;const t=Me(e);let n=e.config?.label||e.attrs?.label||e?.label;return n&&(typeof n=="object"&&(n=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=Zl(n)),i=`${t}-${No(Ql(n,24,null))}`),i||t},kd=class{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=De(this.options,e)}processElemArg(e){let i=e,t;if(typeof i=="string")return t=i,i={tag:t},i;if(i.attrs){const{tag:n,...m}=i.attrs;n&&(typeof n=="string"?t=n:t=(n.find(g=>g.selected===!0)||n[0]).value),i.attrs=m}return i.tag=t||i.tag||"div",i}render=e=>(e.id=`f-${e.id||Me()}`,this.create(e));create=(e,i=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const t=this,n=["children","content"],{className:m,options:g,dataset:f,...c}=this.processElemArg(e);n.push("tag");let o;const{tag:h}=c;let d;const u={attrs:{},className:[Ae.get(c,"config.inputWrap")],children:[],config:{}};let l=document.createElement(h);const s={string:a=>{l.innerHTML+=a},object:a=>a&&l.appendChild(t.create(a,i)),node:a=>l.appendChild(a),component:a=>l.appendChild(a.dom),array:a=>{for(const p of a)o=t.childType(p),s[o](p)},function:a=>{a=a(),o=t.childType(a),s[o](a)},undefined:()=>null,boolean:()=>null};if(m&&(c.attrs=De(c.attrs,{className:m})),g){const a=this.processOptions(g,c,i);if(this.holdsContent(l)&&h!=="button")s.array.call(this,a),c.content=void 0;else{Ae.forEach(a,v=>{u.children.push(t.create(v,i))});const p=c.attrs||{};return p.className&&(u.className=p.className),u.id=c.id,u.attrs=Sd(p),u.config={...c.config,required:!!p.required},!i&&p.type==="checkbox"&&p.required&&(u.attrs[`data-${Ei}`]="true",u.action={change:({currentTarget:v})=>this.syncCheckboxGroupRequired(v)}),this.create(u,i)}n.push("options")}if(c.attrs&&(t.processAttrs(c,l,i),n.push("attrs")),c.config){if(c.config.label&&(c.config.label&&h!=="button"||["radio","checkbox"].includes(Ae.get(c,"attrs.type")))&&!i){const a=t.label(c);if(!c.config.hideLabel){const p=[a,l];t.labelAfter(c)&&p.reverse(),u.children.push(p)}}n.push("config")}if(c.content||c.children){const a=c.content||c.children;o=t.childType(a),s[o]||console.error(`childType: ${o} is not supported`),s[o].call(this,a)}if(f){for(const a in f)Object.hasOwn(f,a)&&(l.dataset[a]=typeof f[a]=="function"?f[a]():f[a]);n.push("dataset")}c.action&&(this.actionHandler(l,c.action),n.push("action"));const r=Ae.subtract(n,Object.keys(c));for(d=r.length-1;d>=0;d--)l[r[d]]=c[r[d]];return u.children.length&&(l=this.create(u)),l};onRender=(e,i,t=333)=>{const n=Date.now(),m=()=>{!e.parentElement&&Date.now()-n<t?window.requestAnimationFrame(m):e.parentElement&&i(e)};m()};actionHandler(e,i){const t={onRender:V.onRender,render:V.onRender};return Object.entries(i).map(([n,m])=>(Array.isArray(m)?m:[m]).map(g=>(t[n]||Ad(n))(e,g)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=$e.formeoSprite.querySelectorAll("svg symbol"),i=t=>{const n=t.getAttribute("viewBox")||"0 0 24 24",m=Array.from(t.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",t.id],viewBox:n,xmlns:"http://www.w3.org/2000/svg"},children:m}};return this.iconSymbols=Array.from(e).reduce((t,n)=>{const m=n.id.replace(Oo,"");return t[m]=i(n),t},{}),this.cachedIcons={},this.iconSymbols}icon(e,i){if(!e)return;const t=`${e}?${new URLSearchParams(i).toString()}`;if(this.cachedIcons?.[t])return this.cachedIcons[t];const n=this.icons[e];if(n){if(i){const m=De(n,i);return this.cachedIcons[t]=V.create(m).outerHTML,this.cachedIcons[t]}return this.cachedIcons[t]=V.create(n).outerHTML,this.cachedIcons[t]}return bd[V.options.iconFont]?.(e)||e}processAttrs(e,i,t){const{attrs:n={}}=e;if(!t&&!n.name&&n.name!==null&&this.isInput(e.tag)){const m=Cs(e);m&&i.setAttribute("name",m)}for(const m of Object.keys(n)){const g=Ae.safeAttrName(m),f=this.processAttrValue(n[m]);if(f!==!1)try{i.setAttribute(g,f)}catch(c){console.warn(`Could not set attribute ${g} with value ${f}`,c)}}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let i=e||"";if(Array.isArray(i))if(typeof i[0]=="object"){const t=i.filter(n=>n.selected===!0);i=t.length?t[0].value:i[0].value}else i=i.join(" ");return i}toggleElementsByStr=(e,i)=>{const t=[],n=(m,g)=>{g?(m.style.display="block",t.push(m)):m.style.display="none"};return V.elementsContainText(e,i,n),t};elementsContainText=(e,i,t)=>{const n=[];return Fi(e,m=>{const g=m.textContent.toLowerCase().indexOf(i.toLowerCase())!==-1;t?.(m,g),g&&n.push(m)}),n};generateOption=({type:e="option",label:i,value:t,i:n=0,selected:m})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:t||`${e}-${n}`,[e==="option"?"selected":"checked"]:m||!n},config:{label:i||Z.get("labelCount",{label:Z.get("option"),count:n})}});processOptions(e,i,t){const{action:n,attrs:m={}}=i,g=m.type||i.tag,f=m.id||i.id,c=!t&&m.name||f,o=Object.fromEntries(ws.filter(d=>d in m).map(d=>[d,m[d]]));m.required&&(o.required=g!=="checkbox"||!e.some(({selected:d,checked:u})=>d||u));const h=(d,u)=>{const{label:l,value:s,...r}=d,a=()=>{const p={tag:"input",attrs:{name:c,type:g,value:s||"",id:`${f}-${u}`,...o,...r},action:n},v={tag:"label",attrs:{for:`${f}-${u}`},children:l},y={children:[p,v],className:[`f-${g}`]};return m.className&&(i.config.inputWrap=m.className),i.config.inline&&y.className.push(`f-${g}-inline`),d.selected&&(p.attrs.checked=!0),t&&(v.attrs.contenteditable=!0),y};return{select:()=>{const p=d.attrs||d,{label:v,checked:y,selected:k,attrs:x}={attrs:p,...d,...p};return{tag:"option",attrs:{...x,selected:!!(y||k)},children:v}},button:p=>{const{type:v,label:y,className:k,id:x}=p;return{...i,attrs:{type:v},className:k,id:x||Me(),options:void 0,children:y,action:i.action}},checkbox:a,radio:a}[g]?.(d)};return e.map(h)}holdsContent(e){return e.outerHTML.includes("/")}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let i=e;return typeof i!="string"&&(i=i.tagName),wd.has(i)}parsedHtml(e){const i=document.createElement("textarea");return i.innerHTML=e,i.textContent}labelAfter(e){const i=Ae.get(e,"attrs.type"),t=Ae.get(e,"config.labelAfter");return t===void 0?i==="checkbox"||i==="radio":t}syncCheckboxGroupRequired(e){const i=Array.from(e.querySelectorAll('input[type="checkbox"]')),t=!!e.closest("[hidden]"),n=!i.some(m=>m.checked);for(const m of i)m.required=!t&&n}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});tooltip=e=>({tag:"span",className:"f-tooltip",dataset:{tooltip:e},content:V.icon("info-circle")});helpText=e=>({tag:"small",className:"f-help-text",children:e});label(e,i){const t=Ae.get(e,"attrs.required")||Ae.get(e,"config.required");let{config:{label:n="",helpText:m="",tooltip:g=null}}=e;const{id:f,attrs:c}=e;typeof n=="function"&&(n=n());const o={tag:"label",attrs:{for:f||c?.id},className:[],children:[n,t&&this.requiredMark(),g&&this.tooltip(g),m&&this.helpText(m)],action:{}};return i&&(o.attrs.for=void 0,o.attrs.contenteditable=!0,o.fMap=i),o}childType(e){return e===void 0?e:[["array",i=>Array.isArray(i)],["node",i=>i instanceof window.Node||i instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(i=>i[1](e))[0]}getStyle(e,i=!1){let t;return window.getComputedStyle?t=window.getComputedStyle(e,null):e.currentStyle&&(t=e.currentStyle),i?t[i]:t}getElement(e){return{node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)}[this.childType(e)]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const i=e.parentElement,t=be(e),n=i.getElementsByClassName(`formeo-${t}`);if(this.remove(e),!n.length)return this.isStage(i)?this.emptyClass(i):this.removeEmpty(i)};remove(e){const i=be(e);return i?oe.remove(`${i}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,i){const t={string:n=>n.classList.remove(i),array:n=>{for(const m of i)n.classList.remove(m)}};t.object=t.string,Ae.forEach(e,t[this.childType(i)])}addClasses(e,i){Ae.forEach(e,{string:t=>t.classList.add(i),array:t=>{for(const n of i)t.classList.add(n)}}[this.childType(i)])}formGroup(e,i=""){return{className:["f-field-group",i],children:e}}coords(e){const i=e.getBoundingClientRect(),t=document.body.getBoundingClientRect();return{pageX:i.left+i.width/2,pageY:i.top-t.top-i.height/2}}clearStage(e){e.classList.add("removing-all-fields");const i=()=>{V.empty(e),e.classList.remove("removing-all-fields"),V.emptyClass(e),ge.slideDown(e,300)};ge.slideUp(e,600,i)}toggleSortable(e,i){let t=i;const n=be(e);if(!n)return;const m=be(e.parentElement),g=V[n].get(e.id).sortable;t||(t=!g.option("disabled")),g.option("disabled",t),m&&["rows","columns","stages"].includes(m)&&this.toggleSortable(e.parentElement,t)}emptyClass(e){const i=e.getElementsByClassName(wl.get(e.classList.item(0)));e.classList.toggle("empty",!i.length)}btnTemplate=({title:e="",...i})=>({tag:"button",attrs:{type:"button",title:e},...i});isControls=e=>be(e)===ot;isStage=e=>be(e)===kt;isRow=e=>be(e)===Ue;isColumn=e=>be(e)===Ge;isField=e=>be(e)===Tt;asComponent=e=>oe[`${be(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}resolveContainer(e){return typeof e=="string"?document.querySelector(e):e?.jquery?e[0]||null:e}},V=new kd,Td=Object.freeze({title:"",content:null,confirmText:()=>ze("save"),cancelText:()=>ze("cancel"),onConfirm:()=>{},onCancel:()=>{},className:"",closeOnEscape:!0,position:"top",triggerElement:null,triggerCoords:null}),Ss=class hi{constructor(i){this.opts=De(Td,i),this.dialog=null}createDialog(){const{title:i,content:t,confirmText:n,cancelText:m,className:g,closeOnEscape:f,position:c}=this.opts,o=`dialog-position-${c}`,h=[];return i&&h.push({tag:"h3",className:"dialog-title",textContent:i}),t&&h.push({tag:"div",className:"dialog-body",children:Array.isArray(t)?t:[t]}),h.push({tag:"div",className:"dialog-actions",children:[{tag:"button",type:"button",className:"btn btn-sm btn-secondary",textContent:typeof m=="function"?m():m,action:{click:()=>this.handleCancel()}},{tag:"button",type:"submit",className:"btn btn-sm btn-primary",textContent:typeof n=="function"?n():n}]}),V.create({tag:"dialog",className:["formeo-dialog","formeo",o,g],children:[{tag:"form",className:"dialog-form",method:"dialog",children:h,action:{submit:d=>this.handleSubmit(d)}}],action:{cancel:d=>{f?this.handleCancel():d.preventDefault()}}})}handleSubmit(i){i.preventDefault();const t=new FormData(i.target);this.opts.onConfirm(t,this),this.close()}handleCancel(){this.opts.onCancel(this),this.close()}setPosition(){const{position:i,triggerElement:t,triggerCoords:n}=this.opts;if(i!=="trigger"||!this.dialog)return;let m=n;if(!m&&t){const g=t.getBoundingClientRect();m={x:g.left+g.width/2,y:g.bottom+8}}if(m){const g=this.dialog.getBoundingClientRect(),f=window.innerWidth,c=window.innerHeight;let o=m.x-g.width/2,h=m.y;const d=16;o=Math.max(d,Math.min(o,f-g.width-d)),h=Math.max(d,Math.min(h,c-g.height-d)),this.dialog.style.left=`${o}px`,this.dialog.style.top=`${h}px`,this.dialog.style.transform="none"}}open(){if(this.dialog||(this.dialog=this.createDialog()),document.body.appendChild(this.dialog),this.dialog.showModal(),this.opts.position==="trigger"){const i=setTimeout(()=>{this.setPosition(),clearTimeout(i)},0)}return this}close(){this.dialog&&(this.dialog.close(),this.dialog.remove(),this.dialog=null)}static alert(i,t=()=>{}){return new hi({content:{tag:"p",className:"dialog-message",textContent:i},confirmText:()=>Z.get("ok")||"OK",cancelText:"",onConfirm:()=>t()})}static confirm(i,t=()=>{},n=()=>{}){return new hi({content:{tag:"p",className:"dialog-message",textContent:i},confirmText:()=>Z.get("confirm")||"Confirm",onConfirm:()=>t(),onCancel:()=>n()})}static prompt(i,t=()=>{},n=""){return new hi({content:[{tag:"label",className:"dialog-prompt-label",children:[{tag:"p",className:"dialog-message",textContent:i},{tag:"input",type:"text",name:"prompt-value",className:"dialog-prompt-input",value:n}]}],onConfirm:m=>{t(m.get("prompt-value"))}})}},Md=/^[A-Za-z_:][-A-Za-z0-9_:]*$/,zr=(e,i)=>{const t=e.trim();return t?!Md.test(t)||i.isDisabled(`attrs.${t}`)?Z.get("attributeNotPermitted",{attribute:t})||`Attribute "${t}" is not permitted`:"":e?Z.get("attributeNameRequired")||"Enter an attribute name":""},$d=e=>new Ss({className:"add-attribute-dialog",content:[{tag:"input",attrs:{type:"text",name:"attrName",className:"attr-name-input",required:!0,autocomplete:"off"},config:{label:e.message.attr},action:{input:({target:i})=>i.setCustomValidity(zr(i.value,e))}},{tag:"input",attrs:{type:"text",name:"attrValue",className:"attr-value-input",autocomplete:"off"},config:{label:e.message.value}}],onConfirm:i=>{const t=String(i.get("attrName")??"").trim();t&&!zr(t,e)&&e.addAction(t,String(i.get("attrValue")??""))}}).open(),Pr={add:{attr:e=>$d(e),option:e=>{e.addAction()},condition:e=>{e.addAction(e)},config:e=>{e.addAction(e)}},remove:{attrs:e=>{e.removeAction()},options:e=>{e.removeAction()},conditions:e=>{e.removeAction()}},click:{btn:e=>{e.action()}},save:{form:gn}},ve={init:function(e){const i=Object.keys(Pr);return this.opts=i.reduce((t,n)=>(t[n]={...Pr[n],...e[n]},t),e),this},add:{attrs:e=>ve.opts.add.attr(e),options:e=>ve.opts.add.option(e),conditions:e=>(e.template=e.template||qn(),ve.opts.add.condition(e)),config:e=>ve.opts.add.config(e)},remove:{attrs:e=>ve.opts.remove.attrs(e),options:e=>ve.opts.remove.options(e),conditions:e=>ve.opts.remove.conditions(e)},click:{btn:e=>ve.opts.click.btn(e)},save:{form:e=>(ve.opts.sessionStorage&&Yn.set(Pn,e),Q.formeoSaved({formData:e}),ve.opts.save.form(e))}},Ld={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:yl,iconFont:null,config:{},events:{},actions:{},controls:{container:null},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}},Se={CREATED:"created",LOADING_RESOURCES:"loading",INITIALIZING:"initializing",READY:"ready",ERROR:"error"},xs=class{#e=Se.CREATED;#i=null;#t=null;#n=!1;constructor({formData:e,...i}={},t){const{actions:n,events:m,debug:g,config:f,editorContainer:c,...o}=De(Ld.editor,i);c&&(this.editorContainer=V.resolveContainer(c)||null),this.editorContainerOption=c,this.opts=o,V.setOptions=o,oe.config=f;const h=t||e;this.#t=h?rt(h):null,this.userFormData=this.#t,this.Components=oe,this.dom=V,Q.init({debug:g,...m}),ve.init({debug:g,sessionStorage:o.sessionStorage,...n}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){const i=rt(e);this.#t=i,this.userFormData=i,this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){const e=wt();this.#t=e,this.userFormData=e,this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources),this.#e=Se.LOADING_RESOURCES;const e=[sd(this.opts.svgSprite),ld(this.opts.style),Z.init({preloaded:{"en-US":Ns},...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(fr)})].filter(Boolean);try{await Promise.all(e),this.opts.allowEdit&&this.init()}catch(i){throw this.#e=Se.ERROR,console.error("Failed to load resources:",i),i}}init(){return this.#e===Se.INITIALIZING?this.#i:this.#e===Se.READY?this.#r():(this.#e=Se.INITIALIZING,this.#i=ct.init(this.opts.controls,this.opts.stickyControls).then(e=>(this.controls=e,this.#n||(this.#s(),this.#n=!0),this.formId=oe.get("id"),this.i18n={setLang:this.#o.bind(this)},this.render(),this.#e=Se.READY,this.opts.onLoad?.(this),this.tooltipInstance=new io,this)).catch(e=>{throw this.#e=Se.ERROR,console.error("Failed to initialize editor:",e),e}),this.#i)}async#o(e){globalThis.sessionStorage?.setItem(fr,e),await Z.setCurrent(e),await this.#r()}async#r(){return this.controls=await ct.init(this.opts.controls,this.opts.stickyControls),this.render(),this}#s(){const e=this.#a();this.Components.load(e,this.opts)}#a(){if(this.#t)return He(this.#t);if(this.opts.sessionStorage){const e=Yn.get(Pn);if(e)return e}return wt()}load(e=this.userFormData,i=this.opts){this.Components.load(e,i),this.render()}get initState(){return this.#e}get isReady(){return this.#e===Se.READY}async whenReady(){return this.#e===Se.READY?this:this.#e===Se.ERROR?Promise.reject(new Error("Editor initialization failed")):this.#i?this.#i:new Promise((e,i)=>{const t=()=>{this.#e===Se.READY?e(this):this.#e===Se.ERROR?i(new Error("Editor initialization failed")):globalThis.requestAnimationFrame(t)};t()})}render(){if(!this.controls)return globalThis.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(oe.get("stages")),this.opts.controlOnLeft)for(const t of this.stages)t.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:t})=>t)]};Z.current.dir&&(e.attrs.dir=Z.current.dir,V.dir=Z.current.dir),this.editor=V.create(e);const i=this.controls.container||this.editor;i&&(i!==this.editor&&V.empty(i),i.appendChild(this.controls.dom)),!this.editorContainer&&this.editorContainerOption&&(this.editorContainer=V.resolveContainer(this.editorContainerOption)||null,this.editorContainer||console.warn(`Formeo: editorContainer ${String(this.editorContainerOption)} was not found, so the editor was not added to the page.`)),this.editorContainer&&(V.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Q.formeoLoaded=new globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Q.formeoLoaded)}},Hr=e=>V.resolveContainer(e),Rd=({editorContainer:e,renderContainer:i,formData:t,...n}={})=>{const m={renderContainer:Hr(i),editorContainer:Hr(e),formData:rt(t)};return{elements:{},...n,...m}},ti=e=>e.match(Hl)?.[0]||e,Br=e=>{if(!e||e.hasAttribute("hidden")||e.parentElement?.hasAttribute("hidden"))return!1;const i=window.getComputedStyle(e);return!(i.display==="none"||i.visibility==="hidden"||i.opacity==="0")},_d='input[type="checkbox"], input[type="radio"]',Od=new Set(["checkbox","radio"]),Es=e=>e?.tagName?.toLowerCase(),As=e=>Es(e)==="input"&&Od.has(e.type),sr=e=>{if(!e||As(e)||typeof e.querySelectorAll!="function")return null;const i=e.querySelectorAll(_d);return i.length?Array.from(i):null},Id=e=>!!sr(e),Wr=e=>{if(!e)return;const i=sr(e);if(i){const t=i.filter(n=>n.checked).map(n=>n.value);return i.every(n=>n.type==="radio")?t[0]??"":t}return Es(e)==="select"&&e.multiple?Array.from(e.selectedOptions,t=>t.value):As(e)?e.checked?e.value:"":e.value},jr=e=>{const i=sr(e);return i?i.some(t=>t.checked):!!e?.checked},Vr={isChecked:e=>jr(e),isNotChecked:e=>!jr(e),value:Wr,checked:Wr,isVisible:e=>Br(e),isNotVisible:e=>!Br(e)},Dd=()=>V.btnTemplate({className:"remove-input-group",children:V.icon("remove"),action:{mouseover:({target:e})=>e.parentElement.classList.add("will-remove"),mouseleave:({target:e})=>e.parentElement.classList.remove("will-remove"),click:({target:e})=>e.parentElement.remove()}}),Ur=(e,i)=>Array.isArray(e)?e.some(t=>(0,vn.default)(t,i)):(0,vn.default)(e,i),Gr=(e,i)=>e==null?!1:Array.isArray(e)?e.includes(i):String(e).includes(i),Kr={equals:Ur,notEquals:(e,i)=>!Ur(e,i),contains:Gr,notContains:(e,i)=>!Gr(e,i)},Nd=Object.entries(Ro).reduce((e,[i,t])=>(e[t]=Kr[i],e[i]=Kr[i],e),{}),qr={equals:(e,{targetProperty:i,value:t})=>{e[`_${i}`]=e[i],e[i]=t}},Fd=Object.entries(_o).reduce((e,[i,t])=>(e[t]=qr[i],e[i]=qr[i],e),{}),Yr=e=>{const i=e.closest?.(Ts);i&&V.syncCheckboxGroupRequired(i)},zd={isChecked:e=>{e.checked=!0,Yr(e)},isNotChecked:e=>{e.checked=!1,Yr(e)},value:(e,{assignment:i,...t})=>{const n=Fd[i]?.(e,t),m=new Event("input",{bubbles:!0});return e.dispatchEvent(m),n},isNotVisible:e=>{e.parentElement.setAttribute("hidden",!0),Pd(e)},isVisible:e=>{e.parentElement.removeAttribute("hidden"),Hd(e)}},ks="input, select, textarea",Ts=`[data-${Ei}]`,En=(e,i)=>[...e.matches(i)?[e]:[],...e.querySelectorAll(i)],Pd=e=>{for(const i of En(e,ks))i._required===void 0&&(i._required=i.required),i.required=!1},Hd=e=>{for(const i of En(e,ks))i._required!==void 0&&!i.closest("[hidden]")&&(i.required=i._required,delete i._required);for(const i of En(e,Ts))V.syncCheckboxGroupRequired(i)},Bd=new Set(["&&","and"]),Wd=(e=[])=>e.reduce((i,t,n)=>(n>0&&Bd.has(t.logical)?i[i.length-1].push(t):i.push([t]),i),[]),Ms=class{constructor(e={},i){const{renderContainer:t,elements:n,formData:m,config:g,events:f}=Rd(e);this.container=t,this.form=rt(i||m),this.elements=n,this.config=g,this.events={...f},this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=rt(e)}get userData(){return an(this.container?.querySelector(".formeo-render")||this.renderedForm)}get userFormData(){const e=[];for(const[i,t]of Object.entries(this.userData)){const n={key:i,value:t,label:this.componentByName(i)?.config?.label||""};e.push(n)}return e}componentByName(e){return this.components[ti(e)]||Object.values(this.components).find(i=>i.attrs?.name===e)}set userData(e={}){const i=this.container.querySelector("form");for(const t of Object.keys(e)){const n=i.elements[t],m=jd(n);if(m?.[0].type==="checkbox"){const g=Array.isArray(e[t])?e[t]:[e[t]];for(const c of m)c.checked=g.includes(c.value);const f=m[0].closest(`[data-${Ei}]`);f&&V.syncCheckboxGroupRequired(f)}else if(m?.[0].type==="radio")for(const g of m)g.checked=g.value===e[t];else n.type&&(n.value=e[t])}}render(e=this.form){if(!this.container)throw new Error("FormeoRenderer: renderContainer is required for render(); use getRenderedForm() or html without one");this.form=rt(e);const i=this.getRenderedForm(e),t=this.container.querySelector(".formeo-render");t?t.replaceWith(i):this.container.appendChild(i),this.events.onRender?.({form:i,renderer:this,formData:this.form})}getRenderedForm(e=this.form){this.form=rt(e);const i=document.getElementsByClassName("formeo-render").length,t={...this.config,tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${i}`,children:this.processedData};return this.renderedForm=V.render(t),this.renderedForm.addEventListener("reset",this.syncRequiredGroupsAfterReset),this.applyConditions(),this.bindFormEvents(this.renderedForm),this.renderedForm}syncRequiredGroupsAfterReset=({currentTarget:e})=>{setTimeout(()=>{for(const i of e.querySelectorAll(`[data-${Ei}]`))V.syncCheckboxGroupRequired(i)},0)};bindFormEvents(e){const{onChange:i,onSubmit:t}=this.events;i&&e.addEventListener("input",n=>i({event:n,target:n.target,form:e,userData:an(e)})),t&&e.addEventListener("submit",n=>t({event:n,form:e,userData:an(e)}))}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,i)=>i.reduce((t,n)=>(t.push(this.form[e][n]),t),[]);prefixId=e=>"f-"+e;processColumn=({id:e,...i})=>({...i,id:this.prefixId(e),children:this.processFields(i.children),style:`width: ${i.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((i,t)=>(t&&i.push(this.processRow(t)),i),[]);cacheComponent=e=>(this.components[ti(e.id)]=e,e);processRow=(e,i="row")=>{const{config:t,id:n}=e,m=[`formeo-${i}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(n)};this.cacheComponent(g);const f=[{condition:t.legend,result:()=>({tag:t.fieldset?"legend":"h3",children:t.legend})},{condition:!0,result:()=>g},{condition:t.inputGroup,result:()=>this.addButton(n)}].reduce((c,{condition:o,result:h})=>(o&&c.push(h()),c),[]);return t.inputGroup&&m.push("f-input-group-wrap"),{tag:t.fieldset?"fieldset":"div",className:m,children:f}};cloneComponentData=e=>{const{children:i=[],id:t,attrs:n={},...m}=this.components[e],g={...n,"data-clone-of":t};return m.options&&["checkbox","radio"].includes(n.type)?delete g.name:m.tag==="input"&&(g.name=Cs(this.components[e])),{...m,id:"f-"+Me(t),children:i?.length&&i.map(({id:f})=>this.cloneComponentData(ti(f))),attrs:g}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:i=>{const t=i.target.parentElement,n=V.create(this.cloneComponentData(e));t.insertBefore(n,t.lastChild);const m=V.create(Dd());n.appendChild(m)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(i=>this.cacheComponent(this.processColumn(i)));processFields=e=>this.orderChildren("fields",e).map(({id:i,...t})=>{const n=t.config?.controlId||t.meta?.id,{action:m={},dependencies:g={}}=this.elements[n]||{};g&&gs(g);const f=De({action:m},t);return this.cacheComponent({...f,id:this.prefixId(i)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=kt,this.components[ti(e.id)]=e,e))}applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const i of e)try{this.applyCondition(i)}catch(t){console.error("formeo: condition skipped",i,t)}};applyCondition=({if:e=[],then:i=[]})=>{const t=Wd(e);let n=!1;const m=f=>{if(!n){n=!0;try{if(this.evaluateClauseGroups(t))for(const c of i)this.execResult(c,f)}finally{n=!1}}},g=new Set(e.flatMap(({source:f,target:c})=>[f,c]).filter(Te));for(const f of g){const{component:c,options:o}=this.getComponent(f);this.listenForChanges(o||c,m)}m({target:null})};evaluateClauseGroups=e=>e.some(i=>i.length&&i.every(t=>this.evaluateCondition(t)));listenForChanges=(e,i)=>{if(!e)return;if(Ud(e)){for(const n of e)this.listenForChanges(n,i);return}const t=Kd(e);t&&e.addEventListener(t,i,!1)};evaluateCondition=({source:e,sourceProperty:i,targetProperty:t,comparison:n,target:m})=>{if(!Te(e)||!this.getComponent(e)?.component)return!1;const g=this.getComponentProperty(e,i);if(typeof g=="boolean")return g;const f=String(Te(m)?this.getComponentProperty(m,t):m);return Nd[n]?.(g,f)};execResult=({target:e,targetProperty:i,assignment:t,value:n})=>{if(Te(e)){const{component:m,option:g}=this.getComponent(e),f=g||m;zd[i]?.(f,{targetProperty:i,assignment:t,value:n})}};getComponentProperty=(e,i)=>{const{component:t,option:n}=this.getComponent(e)||{},m=n||t;if(m)return Vr[i]?Vr[i](m):m[i]};getComponent=e=>{const i={component:null};if(!Te(e))return null;const[,t,n,m]=lt(e);let g=null;try{g=this.renderedForm.querySelector(`#f-${t}`)}catch{}if(!g)return i;if(i.component=g,n){const f=g.querySelectorAll("input"),c=f[m];return i.options=f,i.option=c,i}return i};getComponents=e=>{const i=[],t=e.slice(e.indexOf(".")+1);return i.push(...this.renderedForm.querySelectorAll(`[name=f-${t}]`)),i}},an=e=>{if(!e)return{};const i=new FormData(e),t={};for(const[n,m]of i.entries())Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(m):t[n]=[t[n],m]:t[n]=m;return t},Zr=e=>["checkbox","radio"].includes(e?.type),jd=e=>Zr(e)?[e]:e?.length&&Zr(e[0])?Array.from(e):null,Vd=e=>!!e&&typeof e.nodeType=="number",Ud=e=>!!e&&!Vd(e)&&typeof e.length=="number",Qr=e=>e.tagName?.toLowerCase(),Gd=[["change",e=>Id(e)],["change",e=>Qr(e)==="select"||["checkbox","radio"].includes(e.type)],["input",e=>["input","textarea"].includes(Qr(e))]],Kd=e=>{const[i]=Gd.find(t=>t[1](e))||[!1];return i};window!==void 0&&(window.FormeoEditor=xs,window.FormeoRenderer=Ms);var ar=xs,lr=Ms,qd={rows:{all:{events:{onAdd:e=>{if(console.log(`You just added a new row with the id "${e.target.id}"`,e.index),e.index===2){const i=e.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{e.target.addChild()}),i.appendChild(t)}}}}},fields:{all:{panels:{attrs:{}},events:{onRemove:e=>{console.log(`You just removed the field with the id "${e.target.id}"`,e)}}},"text-input":{attrs:{type:[{label:"text",value:"text"},{label:"phone",value:"phone"},{label:"email",value:"email"}]},config:{helpText:"This is a custom help text for text input fields.",hideLabel:!1}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},Yd={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},Zd=".build-form",Qd=".render-form",jt={editorContainer:Zd,actions:{},controls:Yd,config:qd,events:{onSave:console.log,onChange:console.log},style:null,sessionStorage:!0,onLoad:()=>{console.log("demo loaded")}},cr={renderContainer:Qd,elements:{tinymce:{action:{onRender:e=>{if(e.id){const i=`#${e.id}`;globalThis.tinymce.remove(i),globalThis.tinymce.init({selector:i})}}}}}};async function Xd(e){e.innerHTML=`
|
|
13
13
|
<div class="angular-demo">
|
|
14
14
|
<h3>Angular Integration Demo</h3>
|
|
15
15
|
<p>Demonstrating Formeo integration patterns for Angular applications</p>
|