@eodash/eodash 5.0.0-alpha

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.
Files changed (38) hide show
  1. package/README.md +26 -0
  2. package/bin/app.js +153 -0
  3. package/dist/.gitkeep +0 -0
  4. package/dist/assets/Dashboard-4233cc52.css +1 -0
  5. package/dist/assets/Dashboard-d7d438a6.js +1 -0
  6. package/dist/assets/DashboardLayout-5ab6c4a5.js +29 -0
  7. package/dist/assets/DashboardLayout-739135c5.css +1 -0
  8. package/dist/assets/DynamicWebComponent-1b7b527a.js +1 -0
  9. package/dist/assets/Footer-0fe1887a.css +1 -0
  10. package/dist/assets/Footer-7e1ca735.js +1 -0
  11. package/dist/assets/Header-9cac598d.css +1 -0
  12. package/dist/assets/Header-ae17296c.js +1 -0
  13. package/dist/assets/IframeWrapper-b2c05ffd.js +1 -0
  14. package/dist/assets/MobileLayout-1b3cb89b.js +1 -0
  15. package/dist/assets/MobileLayout-ad647682.css +1 -0
  16. package/dist/assets/VMain-d6216866.css +1 -0
  17. package/dist/assets/VMain-f6b3f120.js +1 -0
  18. package/dist/assets/WidgetsContainer-cdad3d50.js +1 -0
  19. package/dist/assets/color-6039ab34.js +1 -0
  20. package/dist/assets/eox-chart-3b122ba4.js +142 -0
  21. package/dist/assets/eox-itemfilter-a63da0da.js +981 -0
  22. package/dist/assets/eox-jsonform-98c2af62.js +239 -0
  23. package/dist/assets/eox-layercontrol-f5e35702.js +1126 -0
  24. package/dist/assets/eox-map-7f82b0d4.js +178 -0
  25. package/dist/assets/eox-stacinfo-65a8d8f3.js +388 -0
  26. package/dist/assets/eox-timecontrol-4be63aa2.js +237 -0
  27. package/dist/assets/index-52c9d989.js +34 -0
  28. package/dist/assets/index-5d2400e5.css +5 -0
  29. package/dist/assets/materialdesignicons-webfont-48d3eec6.woff +0 -0
  30. package/dist/assets/materialdesignicons-webfont-861aea05.eot +0 -0
  31. package/dist/assets/materialdesignicons-webfont-bd725a7a.ttf +0 -0
  32. package/dist/assets/materialdesignicons-webfont-e52d60f6.woff2 +0 -0
  33. package/dist/assets/ssrBoot-0b8754a9.css +1 -0
  34. package/dist/assets/ssrBoot-d383eb61.js +1 -0
  35. package/dist/assets/webfontloader-523643f5.js +1 -0
  36. package/dist/index.html +17 -0
  37. package/dist/types/index.d.ts +124 -0
  38. package/package.json +67 -0
@@ -0,0 +1,1126 @@
1
+ var Sl=Object.defineProperty,Tl=(r,t,e)=>t in r?Sl(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,_t=(r,t,e)=>(Tl(r,typeof t!="symbol"?t+"":t,e),e),Nr=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},st=(r,t,e)=>(Nr(r,t,"read from private field"),e?e.call(r):t.get(r)),W=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},We=(r,t,e,i)=>(Nr(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e),Ct=(r,t,e)=>(Nr(r,t,"access private method"),e);/**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const Vi=globalThis,Mr=Vi.ShadowRoot&&(Vi.ShadyCSS===void 0||Vi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tn=Symbol(),Eo=new WeakMap;let $l=class{constructor(r,t,e){if(this._$cssResult$=!0,e!==tn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=t}get styleSheet(){let r=this.o;const t=this.t;if(Mr&&r===void 0){const e=t!==void 0&&t.length===1;e&&(r=Eo.get(t)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),e&&Eo.set(t,r))}return r}toString(){return this.cssText}};const Ol=r=>new $l(typeof r=="string"?r:r+"",void 0,tn),Pl=(r,t)=>{if(Mr)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=Vi.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},ko=Mr?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Ol(e)})(r):r;/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const{is:Bl,defineProperty:Il,getOwnPropertyDescriptor:Nl,getOwnPropertyNames:Ml,getOwnPropertySymbols:Hl,getPrototypeOf:Rl}=Object,Ge=globalThis,Lo=Ge.trustedTypes,Dl=Lo?Lo.emptyScript:"",Ao=Ge.reactiveElementPolyfillSupport,ai=(r,t)=>r,sr={toAttribute(r,t){switch(t){case Boolean:r=r?Dl:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},en=(r,t)=>!Bl(r,t),jo={attribute:!0,type:String,converter:sr,reflect:!1,hasChanged:en};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Ge.litPropertyMetadata??(Ge.litPropertyMetadata=new WeakMap);class De extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jo){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Il(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=Nl(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return s==null?void 0:s.call(this)},set(n){const a=s==null?void 0:s.call(this);o.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jo}static _$Ei(){if(this.hasOwnProperty(ai("elementProperties")))return;const t=Rl(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ai("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ai("properties"))){const e=this.properties,i=[...Ml(e),...Hl(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(ko(s))}else t!==void 0&&e.push(ko(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Pl(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var i;const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){const n=(((i=s.converter)==null?void 0:i.toAttribute)!==void 0?s.converter:sr).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const n=s.getPropertyOptions(o),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)==null?void 0:i.fromAttribute)!==void 0?n.converter:sr;this._$Em=o,this[o]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??en)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,n]of s)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}De.elementStyles=[],De.shadowRootOptions={mode:"open"},De[ai("elementProperties")]=new Map,De[ai("finalized")]=new Map,Ao==null||Ao({ReactiveElement:De}),(Ge.reactiveElementVersions??(Ge.reactiveElementVersions=[])).push("2.0.4");/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const ts=globalThis,es=ts.trustedTypes,So=es?es.createPolicy("lit-html",{createHTML:r=>r}):void 0,Hr="$lit$",le=`lit$${(Math.random()+"").slice(9)}$`,Rr="?"+le,Vl=`<${Rr}>`,Oe=document,mi=()=>Oe.createComment(""),gi=r=>r===null||typeof r!="object"&&typeof r!="function",sn=Array.isArray,rn=r=>sn(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",Fs=`[
14
+ \f\r]`,Ke=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,To=/-->/g,$o=/>/g,Ee=RegExp(`>|${Fs}(?:([^\\s"'>=/]+)(${Fs}*=${Fs}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Oo=/'/g,Po=/"/g,on=/^(?:script|style|textarea|title)$/i,Fl=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),z=Fl(1),Xt=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),Bo=new WeakMap,Te=Oe.createTreeWalker(Oe,129);function nn(r,t){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return So!==void 0?So.createHTML(t):t}const an=(r,t)=>{const e=r.length-1,i=[];let s,o=t===2?"<svg>":"",n=Ke;for(let a=0;a<e;a++){const l=r[a];let h,c,p=-1,b=0;for(;b<l.length&&(n.lastIndex=b,c=n.exec(l),c!==null);)b=n.lastIndex,n===Ke?c[1]==="!--"?n=To:c[1]!==void 0?n=$o:c[2]!==void 0?(on.test(c[2])&&(s=RegExp("</"+c[2],"g")),n=Ee):c[3]!==void 0&&(n=Ee):n===Ee?c[0]===">"?(n=s??Ke,p=-1):c[1]===void 0?p=-2:(p=n.lastIndex-c[2].length,h=c[1],n=c[3]===void 0?Ee:c[3]==='"'?Po:Oo):n===Po||n===Oo?n=Ee:n===To||n===$o?n=Ke:(n=Ee,s=void 0);const g=n===Ee&&r[a+1].startsWith("/>")?" ":"";o+=n===Ke?l+Vl:p>=0?(i.push(h),l.slice(0,p)+Hr+l.slice(p)+le+g):l+le+(p===-2?a:g)}return[nn(r,o+(r[e]||"<?>")+(t===2?"</svg>":"")),i]};class bi{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const a=t.length-1,l=this.parts,[h,c]=an(t,e);if(this.el=bi.createElement(h,i),Te.currentNode=this.el.content,e===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=Te.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Hr)){const b=c[n++],g=s.getAttribute(p).split(le),y=/([.?@])?(.*)/.exec(b);l.push({type:1,index:o,name:y[2],strings:g,ctor:y[1]==="."?hn:y[1]==="?"?dn:y[1]==="@"?cn:vi}),s.removeAttribute(p)}else p.startsWith(le)&&(l.push({type:6,index:o}),s.removeAttribute(p));if(on.test(s.tagName)){const p=s.textContent.split(le),b=p.length-1;if(b>0){s.textContent=es?es.emptyScript:"";for(let g=0;g<b;g++)s.append(p[g],mi()),Te.nextNode(),l.push({type:2,index:++o});s.append(p[b],mi())}}}else if(s.nodeType===8)if(s.data===Rr)l.push({type:2,index:o});else{let p=-1;for(;(p=s.data.indexOf(le,p+1))!==-1;)l.push({type:7,index:o}),p+=le.length-1}o++}}static createElement(t,e){const i=Oe.createElement("template");return i.innerHTML=t,i}}function Pe(r,t,e=r,i){var s,o;if(t===Xt)return t;let n=i!==void 0?(s=e._$Co)==null?void 0:s[i]:e._$Cl;const a=gi(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==a&&((o=n==null?void 0:n._$AO)==null||o.call(n,!1),a===void 0?n=void 0:(n=new a(r),n._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=n:e._$Cl=n),n!==void 0&&(t=Pe(r,n._$AS(r,t.values),n,i)),t}class ln{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??Oe).importNode(e,!0);Te.currentNode=s;let o=Te.nextNode(),n=0,a=0,l=i[0];for(;l!==void 0;){if(n===l.index){let h;l.type===2?h=new Je(o,o.nextSibling,this,t):l.type===1?h=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(h=new pn(o,this,t)),this._$AV.push(h),l=i[++a]}n!==(l==null?void 0:l.index)&&(o=Te.nextNode(),n++)}return Te.currentNode=Oe,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Je{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Pe(this,t,e),gi(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Xt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):rn(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==tt&&gi(this._$AH)?this._$AA.nextSibling.data=t:this.T(Oe.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=bi.createElement(nn(s.h,s.h[0]),this.options)),s);if(((e=this._$AH)==null?void 0:e._$AD)===o)this._$AH.p(i);else{const n=new ln(o,this),a=n.u(this.options);n.p(i),this.T(a),this._$AH=n}}_$AC(t){let e=Bo.get(t.strings);return e===void 0&&Bo.set(t.strings,e=new bi(t)),e}k(t){sn(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new Je(this.S(mi()),this.S(mi()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class vi{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tt}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(o===void 0)t=Pe(this,t,e,0),n=!gi(t)||t!==this._$AH&&t!==Xt,n&&(this._$AH=t);else{const a=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=Pe(this,a[i+l],e,l),h===Xt&&(h=this._$AH[l]),n||(n=!gi(h)||h!==this._$AH[l]),h===tt?t=tt:t!==tt&&(t+=(h??"")+o[l+1]),this._$AH[l]=h}n&&!s&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class hn extends vi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class dn extends vi{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class cn extends vi{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=Pe(this,t,e,0)??tt)===Xt)return;const i=this._$AH,s=t===tt&&i!==tt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==tt&&(i===tt||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class pn{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Pe(this,t)}}const zl={P:Hr,A:le,C:Rr,M:1,L:an,R:ln,D:rn,V:Pe,I:Je,H:vi,N:dn,U:cn,B:hn,F:pn},Io=ts.litHtmlPolyfillSupport;Io==null||Io(bi,Je),(ts.litHtmlVersions??(ts.litHtmlVersions=[])).push("3.1.2");const ql=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new Je(t.insertBefore(mi(),o),o,void 0,e??{})}return s._$AI(r),s};/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */let Ft=class extends De{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const t=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=t.firstChild),t}update(r){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=ql(t,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return Xt}};var No;Ft._$litElement$=!0,Ft.finalized=!0,(No=globalThis.litElementHydrateSupport)==null||No.call(globalThis,{LitElement:Ft});const Mo=globalThis.litElementPolyfillSupport;Mo==null||Mo({LitElement:Ft});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
20
+ * @license
21
+ * Copyright 2021 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */function ie(r,t,e){return r?t(r):e==null?void 0:e(r)}/**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */const fe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dr=r=>(...t)=>({_$litDirective$:r,values:t});class Vr{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
28
+ * @license
29
+ * Copyright 2020 Google LLC
30
+ * SPDX-License-Identifier: BSD-3-Clause
31
+ */const{I:Ul}=zl,Wl=r=>r.strings===void 0,Ho=()=>document.createComment(""),ti=(r,t,e)=>{var i;const s=r._$AA.parentNode,o=t===void 0?r._$AB:t._$AA;if(e===void 0){const n=s.insertBefore(Ho(),o),a=s.insertBefore(Ho(),o);e=new Ul(n,a,r,r.options)}else{const n=e._$AB.nextSibling,a=e._$AM,l=a!==r;if(l){let h;(i=e._$AQ)==null||i.call(e,r),e._$AM=r,e._$AP!==void 0&&(h=r._$AU)!==a._$AU&&e._$AP(h)}if(n!==o||l){let h=e._$AA;for(;h!==n;){const c=h.nextSibling;s.insertBefore(h,o),h=c}}}return e},ke=(r,t,e=r)=>(r._$AI(t,e),r),Gl={},un=(r,t=Gl)=>r._$AH=t,Zl=r=>r._$AH,zs=r=>{var t;(t=r._$AP)==null||t.call(r,!1,!0);let e=r._$AA;const i=r._$AB.nextSibling;for(;e!==i;){const s=e.nextSibling;e.remove(),e=s}};/**
32
+ * @license
33
+ * Copyright 2017 Google LLC
34
+ * SPDX-License-Identifier: BSD-3-Clause
35
+ */const Ro=(r,t,e)=>{const i=new Map;for(let s=t;s<=e;s++)i.set(r[s],s);return i},Jl=Dr(class extends Vr{constructor(r){if(super(r),r.type!==fe.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const s=[],o=[];let n=0;for(const a of r)s[n]=i?i(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:s}}render(r,t,e){return this.dt(r,t,e).values}update(r,[t,e,i]){const s=Zl(r),{values:o,keys:n}=this.dt(t,e,i);if(!Array.isArray(s))return this.ut=n,o;const a=this.ut??(this.ut=[]),l=[];let h,c,p=0,b=s.length-1,g=0,y=o.length-1;for(;p<=b&&g<=y;)if(s[p]===null)p++;else if(s[b]===null)b--;else if(a[p]===n[g])l[g]=ke(s[p],o[g]),p++,g++;else if(a[b]===n[y])l[y]=ke(s[b],o[y]),b--,y--;else if(a[p]===n[y])l[y]=ke(s[p],o[y]),ti(r,l[y+1],s[p]),p++,y--;else if(a[b]===n[g])l[g]=ke(s[b],o[g]),ti(r,s[p],s[b]),b--,g++;else if(h===void 0&&(h=Ro(n,g,y),c=Ro(a,p,b)),h.has(a[p]))if(h.has(a[b])){const w=c.get(n[g]),A=w!==void 0?s[w]:null;if(A===null){const G=ti(r,s[p]);ke(G,o[g]),l[g]=G}else l[g]=ke(A,o[g]),ti(r,s[p],A),s[w]=null;g++}else zs(s[b]),b--;else zs(s[p]),p++;for(;g<=y;){const w=ti(r,l[y+1]);ke(w,o[g]),l[g++]=w}for(;p<=b;){const w=s[p++];w!==null&&zs(w)}return this.ut=n,un(r,l),Xt}});/**
36
+ * wms-capabilities @0.6.0
37
+ * @description WMS service Capabilities > JSON, based on openlayers
38
+ * @license BSD-2-Clause
39
+ * @preserve
40
+ */var V=r=>r!==void 0,mn=(r,t,e)=>t in r?r[t]:r[t]=e;const fi={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};class Yl{constructor(t){this._parser=new t}toDocument(t){return this._parser.parseFromString(t,"application/xml")}getAllTextContent(t,e){return cs(t,e).join("")}}function cs(r,t){return gn(r,t,[]).join("")}function gn(r,t,e){if(r.nodeType===fi.CDATA_SECTION||r.nodeType===fi.TEXT)t?e.push(String(r.nodeValue).replace(/(\r\n|\r|\n)/g,"")):e.push(r.nodeValue);else{var i;for(i=r.firstChild;i;i=i.nextSibling)gn(i,t,e)}return e}function Xl(r,t,e,i){for(var s=Ql(t);s;s=Kl(s)){var o=s.namespaceURI||null,n=r[o];if(V(n)){var a=n[s.localName];V(a)&&a.call(i,s,e)}}}function Ql(r){let t=r.firstElementChild||r.firstChild;for(;t&&t.nodeType!==fi.ELEMENT;)t=t.nextSibling;return t}function Kl(r){let t=r.nextElementSibling||r.nextSibling;for(;t&&t.nodeType!==fi.ELEMENT;)t=t.nextSibling;return t}function jt(r,t,e){return th(r,t,e)}function th(r,t,e){var i=V(e)?e:{},s,o;for(s=0,o=r.length;s<o;++s)i[r[s]]=t;return i}function bn(r,t){return function(e,i){var s=r.call(V(t)?t:this,e,i);if(V(s)){var o=i[i.length-1];o.push(s)}}}function Et(r,t,e,i,s){return i.push(r),Xl(t,e,i,s),i.pop()}function L(r,t,e){return function(i,s){let o=r.call(V(e)?e:this,i,s);if(V(o)){var n=s[s.length-1],a=V(t)?t:i.localName;n[a]=o}}}function Vt(r,t,e){return function(i,s){var o=r.call(V(e)?e:this,i,s);if(V(o)){var n=s[s.length-1],a=V(t)?t:i.localName,l=mn(n,a,[]);l.push(o)}}}const eh=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function ih(r){return r.replace(eh,"")}function $e(r){const t=/^\s*(true|1)|(false|0)\s*$/.exec(r);if(t)return V(t[1])||!1}function Fe(r){return he(cs(r,!1))}function he(r){const t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r);if(t)return parseFloat(t[1])}function qs(r){return is(cs(r,!1))}function is(r){const t=/^\s*(\d+)\s*$/.exec(r);if(t)return parseInt(t[1],10)}function J(r){return ih(cs(r,!1))}const sh="http://www.w3.org/1999/xlink";function Fr(r){return r.getAttributeNS(sh,"href")}function rh(r,t){return Et({},$h,r,t)}function fn(r){return[he(r.getAttribute("minx")),he(r.getAttribute("miny")),he(r.getAttribute("maxx")),he(r.getAttribute("maxy"))]}function oh(r,t){const e=fn(r),i=[he(r.getAttribute("resx")),he(r.getAttribute("resy"))];return{crs:r.getAttribute("CRS")||r.getAttribute("SRS"),extent:e,res:i}}function nh(r,t){const e=fn(r);if(!(!V(e[0])||!V(e[1])||!V(e[2])||!V(e[3])))return e}function ah(r,t){const e=parseFloat(r.getAttribute("min")),i=parseFloat(r.getAttribute("max"));return{min:e,max:i}}function lh(r,t){const e=Et({},Oh,r,t);if(!V(e))return;const i=e.westBoundLongitude,s=e.southBoundLatitude,o=e.eastBoundLongitude,n=e.northBoundLatitude;if(!(!V(i)||!V(s)||!V(o)||!V(n)))return[i,s,o,n]}function hh(r,t){return Et({},kh,r,t)}function dh(r,t){return Et({},Lh,r,t)}function ch(r,t){return Et({},Ah,r,t)}function ph(r,t){return Et({},jh,r,t)}function uh(r,t){return Et({},Sh,r,t)}function mh(r,t){return Et([],Th,r,t)}function gh(r,t){const e=$e(r.getAttribute("queryable"));return Et({queryable:V(e)?e:!1},_n,r,t)}function bh(r,t){var e=t[t.length-1];const i=Et({},_n,r,t);if(!V(i))return;let s=$e(r.getAttribute("queryable"));V(s)||(s=e.queryable),i.queryable=V(s)?s:!1;let o=is(r.getAttribute("cascaded"));V(o)||(o=e.cascaded),i.cascaded=o;let n=$e(r.getAttribute("opaque"));V(n)||(n=e.opaque),i.opaque=V(n)?n:!1;let a=$e(r.getAttribute("noSubsets"));V(a)||(a=e.noSubsets),i.noSubsets=V(a)?a:!1;let l=he(r.getAttribute("fixedWidth"));V(l)||(l=e.fixedWidth),i.fixedWidth=l;let h=he(r.getAttribute("fixedHeight"));V(h)||(h=e.fixedHeight),i.fixedHeight=h;const c=["Style","CRS","AuthorityURL"];for(let b=0,g=c.length;b<g;b++){const y=c[b],w=e[y];if(V(w)){let A=mn(i,y,[]);A=A.concat(w),i[y]=A}}const p=["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"];for(let b=0,g=p.length;b<g;b++){const y=p[b],w=i[y];if(!V(w)){const A=e[y];i[y]=A}}return i}function fh(r,t){return{name:r.getAttribute("name"),units:r.getAttribute("units"),unitSymbol:r.getAttribute("unitSymbol"),default:r.getAttribute("default"),multipleValues:$e(r.getAttribute("multipleValues")),nearestValue:$e(r.getAttribute("nearestValue")),current:$e(r.getAttribute("current")),values:J(r)}}function ce(r,t){return Et({},Hh,r,t)}function yh(r,t){return Et({},Ph,r,t)}function vh(r,t){return Et({},Ih,r,t)}function _h(r,t){return Et({},Nh,r,t)}function Us(r,t){return Et({},Bh,r,t)}function yn(r,t){var e=ce(r,t);if(V(e)){const i=[is(r.getAttribute("width")),is(r.getAttribute("height"))];return e.size=i,e}}function wh(r,t){var e=ce(r,t);if(V(e))return e.name=r.getAttribute("name"),e}function xh(r,t){var e=ce(r,t);if(V(e))return e.type=r.getAttribute("type"),e}function Ch(r,t){return Et({},Mh,r,t)}function vn(r,t){return Et([],Rh,r,t)}const St=[null,"http://www.opengis.net/wms"],Eh=jt(St,{Service:L(dh),Capability:L(hh)}),kh=jt(St,{Request:L(yh),Exception:L(mh),Layer:L(gh)}),Lh=jt(St,{Name:L(J),Title:L(J),Abstract:L(J),KeywordList:L(vn),OnlineResource:L(Fr),ContactInformation:L(ch),Fees:L(J),AccessConstraints:L(J),LayerLimit:L(qs),MaxWidth:L(qs),MaxHeight:L(qs)}),Ah=jt(St,{ContactPersonPrimary:L(ph),ContactPosition:L(J),ContactAddress:L(uh),ContactVoiceTelephone:L(J),ContactFacsimileTelephone:L(J),ContactElectronicMailAddress:L(J)}),jh=jt(St,{ContactPerson:L(J),ContactOrganization:L(J)}),Sh=jt(St,{AddressType:L(J),Address:L(J),City:L(J),StateOrProvince:L(J),PostCode:L(J),Country:L(J)}),Th=jt(St,{Format:bn(J)}),_n=jt(St,{Name:L(J),Title:L(J),Abstract:L(J),KeywordList:L(vn),CRS:Vt(J),SRS:Vt(J),EX_GeographicBoundingBox:L(lh),LatLonBoundingBox:L(nh),BoundingBox:Vt(oh),Dimension:Vt(fh),Attribution:L(rh),AuthorityURL:Vt(wh),Identifier:Vt(J),MetadataURL:Vt(xh),DataURL:Vt(ce),FeatureListURL:Vt(ce),Style:Vt(Ch),MinScaleDenominator:L(Fe),MaxScaleDenominator:L(Fe),ScaleHint:L(ah),Layer:Vt(bh)}),$h=jt(St,{Title:L(J),OnlineResource:L(Fr),LogoURL:L(yn)}),Oh=jt(St,{westBoundLongitude:L(Fe),eastBoundLongitude:L(Fe),southBoundLatitude:L(Fe),northBoundLatitude:L(Fe)}),Ph=jt(St,{GetCapabilities:L(Us),GetMap:L(Us),GetFeatureInfo:L(Us)}),Bh=jt(St,{Format:Vt(J),DCPType:Vt(vh)}),Ih=jt(St,{HTTP:L(_h)}),Nh=jt(St,{Get:L(ce),Post:L(ce)}),Mh=jt(St,{Name:L(J),Title:L(J),Abstract:L(J),LegendURL:Vt(yn),StyleSheetURL:L(ce),StyleURL:L(ce)}),Hh=jt(St,{Format:L(J),OnlineResource:L(Fr)}),Rh=jt(St,{Keyword:bn(J)});class Dh{constructor(t,e){!e&&typeof window<"u"&&(e=window.DOMParser),this.version=void 0,this._parser=new Yl(e),this._data=t}data(t){return this._data=t,this}toJSON(t){return t=t||this._data,this.parse(t)}parse(t){return this.readFromDocument(this._parser.toDocument(t))}readFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==fi.ELEMENT)return this.readFromNode(e);return null}readFromNode(t){return this.version=t.getAttribute("version"),Et({version:this.version},Eh,t,[])||null}}async function Vh(r){let t=new URL(r),e=t.searchParams;e.set("SERVICE","WMS"),e.set("REQUEST","GetCapabilities");let i=t.toString();const s=await fetch(i);if(s.ok){const o=await s.text();return new Dh(o).toJSON()}else throw new Error(`Error: ${s.status}`)}function zr(r){const t=/\b(?:wms|ows)\b/i,e=/{(?:z|x|y-?)}\/{(?:z|x|y-?)}\/{(?:z|x|y-?)}/i;return t.test(r)?"TileWMS":e.test(r)?"XYZ":!1}function Fh(r){const t=/^(?:(?:https?|ftp):\/\/|\/\/)?(?:localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+[\w-]*\.)+\w+)(?::\d+)?(?:\/\S*)?$/.test(r),e=zr(r);return!!(r&&t&&e)}function wn(r){return r.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": ').replace(/,\s*}/g,"}").replace(/,\s*]/g,"]").replace(/\s*(\{|}|\[|\]|,)\s*/g,"$1").replaceAll('": //',"://")}function zh(r){try{return JSON.parse(wn(r)),!!r}catch{return!1}}function qh(r,t){const e=new URL(r).searchParams;Object.entries(t).forEach(([o,n])=>{typeof n=="object"&&!Array.isArray(n)&&n!==null?Object.keys(n).forEach(a=>{e.set(a,n[a])}):e.set(o,n)});const i=r.split("?")[0],s=e.toString();return`${i}?${s}`}/**!
41
+ * Sortable 1.15.2
42
+ * @author RubaXa <trash@rubaxa.org>
43
+ * @author owenm <owen23355@gmail.com>
44
+ * @license MIT
45
+ */function Do(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),e.push.apply(e,i)}return e}function ne(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Do(Object(e),!0).forEach(function(i){Uh(r,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Do(Object(e)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(e,i))})}return r}function Fi(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fi=function(t){return typeof t}:Fi=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(r)}function Uh(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function pe(){return pe=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},pe.apply(this,arguments)}function Wh(r,t){if(r==null)return{};var e={},i=Object.keys(r),s,o;for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&(e[s]=r[s]);return e}function Gh(r,t){if(r==null)return{};var e=Wh(r,t),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(s=0;s<o.length;s++)i=o[s],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(e[i]=r[i])}return e}var Zh="1.15.2";function de(r){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(r)}var ue=de(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),_i=de(/Edge/i),Vo=de(/firefox/i),li=de(/safari/i)&&!de(/chrome/i)&&!de(/android/i),xn=de(/iP(ad|od|hone)/i),Cn=de(/chrome/i)&&de(/android/i),En={capture:!1,passive:!1};function X(r,t,e){r.addEventListener(t,e,!ue&&En)}function Z(r,t,e){r.removeEventListener(t,e,!ue&&En)}function ss(r,t){if(t){if(t[0]===">"&&(t=t.substring(1)),r)try{if(r.matches)return r.matches(t);if(r.msMatchesSelector)return r.msMatchesSelector(t);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(t)}catch{return!1}return!1}}function Jh(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function ee(r,t,e,i){if(r){e=e||document;do{if(t!=null&&(t[0]===">"?r.parentNode===e&&ss(r,t):ss(r,t))||i&&r===e)return r;if(r===e)break}while(r=Jh(r))}return null}var Fo=/\s+/g;function zt(r,t,e){if(r&&t)if(r.classList)r.classList[e?"add":"remove"](t);else{var i=(" "+r.className+" ").replace(Fo," ").replace(" "+t+" "," ");r.className=(i+(e?" "+t:"")).replace(Fo," ")}}function O(r,t,e){var i=r&&r.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(e=r.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function qe(r,t){var e="";if(typeof r=="string")e=r;else do{var i=O(r,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(r=r.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function kn(r,t,e){if(r){var i=r.getElementsByTagName(t),s=0,o=i.length;if(e)for(;s<o;s++)e(i[s],s);return i}return[]}function oe(){var r=document.scrollingElement;return r||document.documentElement}function yt(r,t,e,i,s){if(!(!r.getBoundingClientRect&&r!==window)){var o,n,a,l,h,c,p;if(r!==window&&r.parentNode&&r!==oe()?(o=r.getBoundingClientRect(),n=o.top,a=o.left,l=o.bottom,h=o.right,c=o.height,p=o.width):(n=0,a=0,l=window.innerHeight,h=window.innerWidth,c=window.innerHeight,p=window.innerWidth),(t||e)&&r!==window&&(s=s||r.parentNode,!ue))do if(s&&s.getBoundingClientRect&&(O(s,"transform")!=="none"||e&&O(s,"position")!=="static")){var b=s.getBoundingClientRect();n-=b.top+parseInt(O(s,"border-top-width")),a-=b.left+parseInt(O(s,"border-left-width")),l=n+o.height,h=a+o.width;break}while(s=s.parentNode);if(i&&r!==window){var g=qe(s||r),y=g&&g.a,w=g&&g.d;g&&(n/=w,a/=y,p/=y,c/=w,l=n+c,h=a+p)}return{top:n,left:a,bottom:l,right:h,width:p,height:c}}}function zo(r,t,e){for(var i=_e(r,!0),s=yt(r)[t];i;){var o=yt(i)[e],n=void 0;if(e==="top"||e==="left"?n=s>=o:n=s<=o,!n)return i;if(i===oe())break;i=_e(i,!1)}return!1}function Ze(r,t,e,i){for(var s=0,o=0,n=r.children;o<n.length;){if(n[o].style.display!=="none"&&n[o]!==P.ghost&&(i||n[o]!==P.dragged)&&ee(n[o],e.draggable,r,!1)){if(s===t)return n[o];s++}o++}return null}function qr(r,t){for(var e=r.lastElementChild;e&&(e===P.ghost||O(e,"display")==="none"||t&&!ss(e,t));)e=e.previousElementSibling;return e||null}function Yt(r,t){var e=0;if(!r||!r.parentNode)return-1;for(;r=r.previousElementSibling;)r.nodeName.toUpperCase()!=="TEMPLATE"&&r!==P.clone&&(!t||ss(r,t))&&e++;return e}function qo(r){var t=0,e=0,i=oe();if(r)do{var s=qe(r),o=s.a,n=s.d;t+=r.scrollLeft*o,e+=r.scrollTop*n}while(r!==i&&(r=r.parentNode));return[t,e]}function Yh(r,t){for(var e in r)if(r.hasOwnProperty(e)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===r[e][i])return Number(e)}return-1}function _e(r,t){if(!r||!r.getBoundingClientRect)return oe();var e=r,i=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var s=O(e);if(e.clientWidth<e.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return oe();if(i||t)return e;i=!0}}while(e=e.parentNode);return oe()}function Xh(r,t){if(r&&t)for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);return r}function Ws(r,t){return Math.round(r.top)===Math.round(t.top)&&Math.round(r.left)===Math.round(t.left)&&Math.round(r.height)===Math.round(t.height)&&Math.round(r.width)===Math.round(t.width)}var hi;function Ln(r,t){return function(){if(!hi){var e=arguments,i=this;e.length===1?r.call(i,e[0]):r.apply(i,e),hi=setTimeout(function(){hi=void 0},t)}}}function Qh(){clearTimeout(hi),hi=void 0}function An(r,t,e){r.scrollLeft+=t,r.scrollTop+=e}function jn(r){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(r).cloneNode(!0):e?e(r).clone(!0)[0]:r.cloneNode(!0)}function Sn(r,t,e){var i={};return Array.from(r.children).forEach(function(s){var o,n,a,l;if(!(!ee(s,t.draggable,r,!1)||s.animated||s===e)){var h=yt(s);i.left=Math.min((o=i.left)!==null&&o!==void 0?o:1/0,h.left),i.top=Math.min((n=i.top)!==null&&n!==void 0?n:1/0,h.top),i.right=Math.max((a=i.right)!==null&&a!==void 0?a:-1/0,h.right),i.bottom=Math.max((l=i.bottom)!==null&&l!==void 0?l:-1/0,h.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var Ut="Sortable"+new Date().getTime();function Kh(){var r=[],t;return{captureAnimationState:function(){if(r=[],!!this.options.animation){var e=[].slice.call(this.el.children);e.forEach(function(i){if(!(O(i,"display")==="none"||i===P.ghost)){r.push({target:i,rect:yt(i)});var s=ne({},r[r.length-1].rect);if(i.thisAnimationDuration){var o=qe(i,!0);o&&(s.top-=o.f,s.left-=o.e)}i.fromRect=s}})}},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(Yh(r,{target:e}),1)},animateAll:function(e){var i=this;if(!this.options.animation){clearTimeout(t),typeof e=="function"&&e();return}var s=!1,o=0;r.forEach(function(n){var a=0,l=n.target,h=l.fromRect,c=yt(l),p=l.prevFromRect,b=l.prevToRect,g=n.rect,y=qe(l,!0);y&&(c.top-=y.f,c.left-=y.e),l.toRect=c,l.thisAnimationDuration&&Ws(p,c)&&!Ws(h,c)&&(g.top-c.top)/(g.left-c.left)===(h.top-c.top)/(h.left-c.left)&&(a=ed(g,p,b,i.options)),Ws(c,h)||(l.prevFromRect=h,l.prevToRect=c,a||(a=i.options.animation),i.animate(l,g,c,a)),a&&(s=!0,o=Math.max(o,a),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},a),l.thisAnimationDuration=a)}),clearTimeout(t),s?t=setTimeout(function(){typeof e=="function"&&e()},o):typeof e=="function"&&e(),r=[]},animate:function(e,i,s,o){if(o){O(e,"transition",""),O(e,"transform","");var n=qe(this.el),a=n&&n.a,l=n&&n.d,h=(i.left-s.left)/(a||1),c=(i.top-s.top)/(l||1);e.animatingX=!!h,e.animatingY=!!c,O(e,"transform","translate3d("+h+"px,"+c+"px,0)"),this.forRepaintDummy=td(e),O(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),O(e,"transform","translate3d(0,0,0)"),typeof e.animated=="number"&&clearTimeout(e.animated),e.animated=setTimeout(function(){O(e,"transition",""),O(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},o)}}}}function td(r){return r.offsetWidth}function ed(r,t,e,i){return Math.sqrt(Math.pow(t.top-r.top,2)+Math.pow(t.left-r.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*i.animation}var He=[],Gs={initializeByDefault:!0},wi={mount:function(r){for(var t in Gs)Gs.hasOwnProperty(t)&&!(t in r)&&(r[t]=Gs[t]);He.forEach(function(e){if(e.pluginName===r.pluginName)throw"Sortable: Cannot mount plugin ".concat(r.pluginName," more than once")}),He.push(r)},pluginEvent:function(r,t,e){var i=this;this.eventCanceled=!1,e.cancel=function(){i.eventCanceled=!0};var s=r+"Global";He.forEach(function(o){t[o.pluginName]&&(t[o.pluginName][s]&&t[o.pluginName][s](ne({sortable:t},e)),t.options[o.pluginName]&&t[o.pluginName][r]&&t[o.pluginName][r](ne({sortable:t},e)))})},initializePlugins:function(r,t,e,i){He.forEach(function(n){var a=n.pluginName;if(!(!r.options[a]&&!n.initializeByDefault)){var l=new n(r,t,r.options);l.sortable=r,l.options=r.options,r[a]=l,pe(e,l.defaults)}});for(var s in r.options)if(r.options.hasOwnProperty(s)){var o=this.modifyOption(r,s,r.options[s]);typeof o<"u"&&(r.options[s]=o)}},getEventProperties:function(r,t){var e={};return He.forEach(function(i){typeof i.eventProperties=="function"&&pe(e,i.eventProperties.call(t[i.pluginName],r))}),e},modifyOption:function(r,t,e){var i;return He.forEach(function(s){r[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[t]=="function"&&(i=s.optionListeners[t].call(r[s.pluginName],e))}),i}};function id(r){var t=r.sortable,e=r.rootEl,i=r.name,s=r.targetEl,o=r.cloneEl,n=r.toEl,a=r.fromEl,l=r.oldIndex,h=r.newIndex,c=r.oldDraggableIndex,p=r.newDraggableIndex,b=r.originalEvent,g=r.putSortable,y=r.extraEventProperties;if(t=t||e&&e[Ut],!!t){var w,A=t.options,G="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!ue&&!_i?w=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(i,!0,!0)),w.to=n||e,w.from=a||e,w.item=s||e,w.clone=o,w.oldIndex=l,w.newIndex=h,w.oldDraggableIndex=c,w.newDraggableIndex=p,w.originalEvent=b,w.pullMode=g?g.lastPutMode:void 0;var it=ne(ne({},y),wi.getEventProperties(i,t));for(var nt in it)w[nt]=it[nt];e&&e.dispatchEvent(w),A[G]&&A[G].call(t,w)}}var sd=["evt"],Dt=function(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.evt,s=Gh(e,sd);wi.pluginEvent.bind(P)(r,t,ne({dragEl:x,parentEl:dt,ghostEl:M,rootEl:at,nextEl:je,lastDownEl:zi,cloneEl:ht,cloneHidden:ve,dragStarted:ei,putSortable:At,activeSortable:P.active,originalEvent:i,oldIndex:ze,oldDraggableIndex:di,newIndex:qt,newDraggableIndex:ye,hideGhostForTarget:Pn,unhideGhostForTarget:Bn,cloneNowHidden:function(){ve=!0},cloneNowShown:function(){ve=!1},dispatchSortableEvent:function(o){Nt({sortable:t,name:o,originalEvent:i})}},s))};function Nt(r){id(ne({putSortable:At,cloneEl:ht,targetEl:x,rootEl:at,oldIndex:ze,oldDraggableIndex:di,newIndex:qt,newDraggableIndex:ye},r))}var x,dt,M,at,je,zi,ht,ve,ze,qt,di,ye,Ni,At,Ve=!1,rs=!1,os=[],Le,te,Zs,Js,Uo,Wo,ei,Re,ci,pi=!1,Mi=!1,qi,Pt,Ys=[],rr=!1,ns=[],ps=typeof document<"u",Hi=xn,Go=_i||ue?"cssFloat":"float",rd=ps&&!Cn&&!xn&&"draggable"in document.createElement("div"),Tn=function(){if(ps){if(ue)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),$n=function(r,t){var e=O(r),i=parseInt(e.width)-parseInt(e.paddingLeft)-parseInt(e.paddingRight)-parseInt(e.borderLeftWidth)-parseInt(e.borderRightWidth),s=Ze(r,0,t),o=Ze(r,1,t),n=s&&O(s),a=o&&O(o),l=n&&parseInt(n.marginLeft)+parseInt(n.marginRight)+yt(s).width,h=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+yt(o).width;if(e.display==="flex")return e.flexDirection==="column"||e.flexDirection==="column-reverse"?"vertical":"horizontal";if(e.display==="grid")return e.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&n.float&&n.float!=="none"){var c=n.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===c)?"vertical":"horizontal"}return s&&(n.display==="block"||n.display==="flex"||n.display==="table"||n.display==="grid"||l>=i&&e[Go]==="none"||o&&e[Go]==="none"&&l+h>i)?"vertical":"horizontal"},od=function(r,t,e){var i=e?r.left:r.top,s=e?r.right:r.bottom,o=e?r.width:r.height,n=e?t.left:t.top,a=e?t.right:t.bottom,l=e?t.width:t.height;return i===n||s===a||i+o/2===n+l/2},nd=function(r,t){var e;return os.some(function(i){var s=i[Ut].options.emptyInsertThreshold;if(!(!s||qr(i))){var o=yt(i),n=r>=o.left-s&&r<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;if(n&&a)return e=i}}),e},On=function(r){function t(s,o){return function(n,a,l,h){var c=n.options.group.name&&a.options.group.name&&n.options.group.name===a.options.group.name;if(s==null&&(o||c))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return t(s(n,a,l,h),o)(n,a,l,h);var p=(o?n:a).options.group.name;return s===!0||typeof s=="string"&&s===p||s.join&&s.indexOf(p)>-1}}var e={},i=r.group;(!i||Fi(i)!="object")&&(i={name:i}),e.name=i.name,e.checkPull=t(i.pull,!0),e.checkPut=t(i.put),e.revertClone=i.revertClone,r.group=e},Pn=function(){!Tn&&M&&O(M,"display","none")},Bn=function(){!Tn&&M&&O(M,"display","")};ps&&!Cn&&document.addEventListener("click",function(r){if(rs)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),rs=!1,!1},!0);var Ae=function(r){if(x){r=r.touches?r.touches[0]:r;var t=nd(r.clientX,r.clientY);if(t){var e={};for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i]);e.target=e.rootEl=t,e.preventDefault=void 0,e.stopPropagation=void 0,t[Ut]._onDragOver(e)}}},ad=function(r){x&&x.parentNode[Ut]._isOutsideThisEl(r.target)};function P(r,t){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=t=pe({},t),r[Ut]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return $n(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,n){o.setData("Text",n.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:P.supportPointer!==!1&&"PointerEvent"in window&&!li,emptyInsertThreshold:5};wi.initializePlugins(this,r,e);for(var i in e)!(i in t)&&(t[i]=e[i]);On(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:rd,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?X(r,"pointerdown",this._onTapStart):(X(r,"mousedown",this._onTapStart),X(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(X(r,"dragover",this),X(r,"dragenter",this)),os.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),pe(this,Kh())}P.prototype={constructor:P,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(Re=null)},_getDirection:function(r,t){return typeof this.options.direction=="function"?this.options.direction.call(this,r,t,x):this.options.direction},_onTapStart:function(r){if(r.cancelable){var t=this,e=this.el,i=this.options,s=i.preventOnFilter,o=r.type,n=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,a=(n||r).target,l=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||a,h=i.filter;if(gd(e),!x&&!(/mousedown|pointerdown/.test(o)&&r.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&li&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=ee(a,i.draggable,e,!1),!(a&&a.animated)&&zi!==a)){if(ze=Yt(a),di=Yt(a,i.draggable),typeof h=="function"){if(h.call(this,r,a,this)){Nt({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:e,fromEl:e}),Dt("filter",t,{evt:r}),s&&r.cancelable&&r.preventDefault();return}}else if(h&&(h=h.split(",").some(function(c){if(c=ee(l,c.trim(),e,!1),c)return Nt({sortable:t,rootEl:c,name:"filter",targetEl:a,fromEl:e,toEl:e}),Dt("filter",t,{evt:r}),!0}),h)){s&&r.cancelable&&r.preventDefault();return}i.handle&&!ee(l,i.handle,e,!1)||this._prepareDragStart(r,n,a)}}},_prepareDragStart:function(r,t,e){var i=this,s=i.el,o=i.options,n=s.ownerDocument,a;if(e&&!x&&e.parentNode===s){var l=yt(e);if(at=s,x=e,dt=x.parentNode,je=x.nextSibling,zi=e,Ni=o.group,P.dragged=x,Le={target:x,clientX:(t||r).clientX,clientY:(t||r).clientY},Uo=Le.clientX-l.left,Wo=Le.clientY-l.top,this._lastX=(t||r).clientX,this._lastY=(t||r).clientY,x.style["will-change"]="all",a=function(){if(Dt("delayEnded",i,{evt:r}),P.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Vo&&i.nativeDraggable&&(x.draggable=!0),i._triggerDragStart(r,t),Nt({sortable:i,name:"choose",originalEvent:r}),zt(x,o.chosenClass,!0)},o.ignore.split(",").forEach(function(h){kn(x,h.trim(),Xs)}),X(n,"dragover",Ae),X(n,"mousemove",Ae),X(n,"touchmove",Ae),X(n,"mouseup",i._onDrop),X(n,"touchend",i._onDrop),X(n,"touchcancel",i._onDrop),Vo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,x.draggable=!0),Dt("delayStart",this,{evt:r}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(_i||ue))){if(P.eventCanceled){this._onDrop();return}X(n,"mouseup",i._disableDelayedDrag),X(n,"touchend",i._disableDelayedDrag),X(n,"touchcancel",i._disableDelayedDrag),X(n,"mousemove",i._delayedDragTouchMoveHandler),X(n,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&X(n,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(r){var t=r.touches?r.touches[0]:r;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(){x&&Xs(x),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;Z(r,"mouseup",this._disableDelayedDrag),Z(r,"touchend",this._disableDelayedDrag),Z(r,"touchcancel",this._disableDelayedDrag),Z(r,"mousemove",this._delayedDragTouchMoveHandler),Z(r,"touchmove",this._delayedDragTouchMoveHandler),Z(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,t){t=t||r.pointerType=="touch"&&r,!this.nativeDraggable||t?this.options.supportPointer?X(document,"pointermove",this._onTouchMove):t?X(document,"touchmove",this._onTouchMove):X(document,"mousemove",this._onTouchMove):(X(x,"dragend",this),X(at,"dragstart",this._onDragStart));try{document.selection?Ui(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,t){if(Ve=!1,at&&x){Dt("dragStarted",this,{evt:t}),this.nativeDraggable&&X(document,"dragover",ad);var e=this.options;!r&&zt(x,e.dragClass,!1),zt(x,e.ghostClass,!0),P.active=this,r&&this._appendGhost(),Nt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(te){this._lastX=te.clientX,this._lastY=te.clientY,Pn();for(var r=document.elementFromPoint(te.clientX,te.clientY),t=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(te.clientX,te.clientY),r!==t);)t=r;if(x.parentNode[Ut]._isOutsideThisEl(r),t)do{if(t[Ut]){var e=void 0;if(e=t[Ut]._onDragOver({clientX:te.clientX,clientY:te.clientY,target:r,rootEl:t}),e&&!this.options.dragoverBubble)break}r=t}while(t=t.parentNode);Bn()}},_onTouchMove:function(r){if(Le){var t=this.options,e=t.fallbackTolerance,i=t.fallbackOffset,s=r.touches?r.touches[0]:r,o=M&&qe(M,!0),n=M&&o&&o.a,a=M&&o&&o.d,l=Hi&&Pt&&qo(Pt),h=(s.clientX-Le.clientX+i.x)/(n||1)+(l?l[0]-Ys[0]:0)/(n||1),c=(s.clientY-Le.clientY+i.y)/(a||1)+(l?l[1]-Ys[1]:0)/(a||1);if(!P.active&&!Ve){if(e&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<e)return;this._onDragStart(r,!0)}if(M){o?(o.e+=h-(Zs||0),o.f+=c-(Js||0)):o={a:1,b:0,c:0,d:1,e:h,f:c};var p="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");O(M,"webkitTransform",p),O(M,"mozTransform",p),O(M,"msTransform",p),O(M,"transform",p),Zs=h,Js=c,te=s}r.cancelable&&r.preventDefault()}},_appendGhost:function(){if(!M){var r=this.options.fallbackOnBody?document.body:at,t=yt(x,!0,Hi,!0,r),e=this.options;if(Hi){for(Pt=r;O(Pt,"position")==="static"&&O(Pt,"transform")==="none"&&Pt!==document;)Pt=Pt.parentNode;Pt!==document.body&&Pt!==document.documentElement?(Pt===document&&(Pt=oe()),t.top+=Pt.scrollTop,t.left+=Pt.scrollLeft):Pt=oe(),Ys=qo(Pt)}M=x.cloneNode(!0),zt(M,e.ghostClass,!1),zt(M,e.fallbackClass,!0),zt(M,e.dragClass,!0),O(M,"transition",""),O(M,"transform",""),O(M,"box-sizing","border-box"),O(M,"margin",0),O(M,"top",t.top),O(M,"left",t.left),O(M,"width",t.width),O(M,"height",t.height),O(M,"opacity","0.8"),O(M,"position",Hi?"absolute":"fixed"),O(M,"zIndex","100000"),O(M,"pointerEvents","none"),P.ghost=M,r.appendChild(M),O(M,"transform-origin",Uo/parseInt(M.style.width)*100+"% "+Wo/parseInt(M.style.height)*100+"%")}},_onDragStart:function(r,t){var e=this,i=r.dataTransfer,s=e.options;if(Dt("dragStart",this,{evt:r}),P.eventCanceled){this._onDrop();return}Dt("setupClone",this),P.eventCanceled||(ht=jn(x),ht.removeAttribute("id"),ht.draggable=!1,ht.style["will-change"]="",this._hideClone(),zt(ht,this.options.chosenClass,!1),P.clone=ht),e.cloneId=Ui(function(){Dt("clone",e),!P.eventCanceled&&(e.options.removeCloneOnHide||at.insertBefore(ht,x),e._hideClone(),Nt({sortable:e,name:"clone"}))}),!t&&zt(x,s.dragClass,!0),t?(rs=!0,e._loopId=setInterval(e._emulateDragOver,50)):(Z(document,"mouseup",e._onDrop),Z(document,"touchend",e._onDrop),Z(document,"touchcancel",e._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(e,i,x)),X(document,"drop",e),O(x,"transform","translateZ(0)")),Ve=!0,e._dragStartId=Ui(e._dragStarted.bind(e,t,r)),X(document,"selectstart",e),ei=!0,li&&O(document.body,"user-select","none")},_onDragOver:function(r){var t=this.el,e=r.target,i,s,o,n=this.options,a=n.group,l=P.active,h=Ni===a,c=n.sort,p=At||l,b,g=this,y=!1;if(rr)return;function w(we,ms){Dt(we,g,ne({evt:r,isOwner:h,axis:b?"vertical":"horizontal",revert:o,dragRect:i,targetRect:s,canSort:c,fromSortable:p,target:e,completed:G,onMove:function(Ci,gs){return Ri(at,t,x,i,Ci,yt(Ci),r,gs)},changed:it},ms))}function A(){w("dragOverAnimationCapture"),g.captureAnimationState(),g!==p&&p.captureAnimationState()}function G(we){return w("dragOverCompleted",{insertion:we}),we&&(h?l._hideClone():l._showClone(g),g!==p&&(zt(x,At?At.options.ghostClass:l.options.ghostClass,!1),zt(x,n.ghostClass,!0)),At!==g&&g!==P.active?At=g:g===P.active&&At&&(At=null),p===g&&(g._ignoreWhileAnimating=e),g.animateAll(function(){w("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(e===x&&!x.animated||e===t&&!e.animated)&&(Re=null),!n.dragoverBubble&&!r.rootEl&&e!==document&&(x.parentNode[Ut]._isOutsideThisEl(r.target),!we&&Ae(r)),!n.dragoverBubble&&r.stopPropagation&&r.stopPropagation(),y=!0}function it(){qt=Yt(x),ye=Yt(x,n.draggable),Nt({sortable:g,name:"change",toEl:t,newIndex:qt,newDraggableIndex:ye,originalEvent:r})}if(r.preventDefault!==void 0&&r.cancelable&&r.preventDefault(),e=ee(e,n.draggable,t,!0),w("dragOver"),P.eventCanceled)return y;if(x.contains(r.target)||e.animated&&e.animatingX&&e.animatingY||g._ignoreWhileAnimating===e)return G(!1);if(rs=!1,l&&!n.disabled&&(h?c||(o=dt!==at):At===this||(this.lastPutMode=Ni.checkPull(this,l,x,r))&&a.checkPut(this,l,x,r))){if(b=this._getDirection(r,e)==="vertical",i=yt(x),w("dragOverValid"),P.eventCanceled)return y;if(o)return dt=at,A(),this._hideClone(),w("revert"),P.eventCanceled||(je?at.insertBefore(x,je):at.appendChild(x)),G(!0);var nt=qr(t,n.draggable);if(!nt||cd(r,b,this)&&!nt.animated){if(nt===x)return G(!1);if(nt&&t===r.target&&(e=nt),e&&(s=yt(e)),Ri(at,t,x,i,e,s,r,!!e)!==!1)return A(),nt&&nt.nextSibling?t.insertBefore(x,nt.nextSibling):t.appendChild(x),dt=t,it(),G(!0)}else if(nt&&dd(r,b,this)){var It=Ze(t,0,n,!0);if(It===x)return G(!1);if(e=It,s=yt(e),Ri(at,t,x,i,e,s,r,!1)!==!1)return A(),t.insertBefore(x,It),dt=t,it(),G(!0)}else if(e.parentNode===t){s=yt(e);var ct=0,q,gt=x.parentNode!==t,kt=!od(x.animated&&x.toRect||i,e.animated&&e.toRect||s,b),rt=b?"top":"left",j=zo(e,"top","top")||zo(x,"top","top"),R=j?j.scrollTop:void 0;Re!==e&&(q=s[rt],pi=!1,Mi=!kt&&n.invertSwap||gt),ct=pd(r,e,s,b,kt?1:n.swapThreshold,n.invertedSwapThreshold==null?n.swapThreshold:n.invertedSwapThreshold,Mi,Re===e);var lt;if(ct!==0){var Tt=Yt(x);do Tt-=ct,lt=dt.children[Tt];while(lt&&(O(lt,"display")==="none"||lt===M))}if(ct===0||lt===e)return G(!1);Re=e,ci=ct;var wt=e.nextElementSibling,$t=!1;$t=ct===1;var Zt=Ri(at,t,x,i,e,s,r,$t);if(Zt!==!1)return(Zt===1||Zt===-1)&&($t=Zt===1),rr=!0,setTimeout(hd,30),A(),$t&&!wt?t.appendChild(x):e.parentNode.insertBefore(x,$t?wt:e),j&&An(j,0,R-j.scrollTop),dt=x.parentNode,q!==void 0&&!Mi&&(qi=Math.abs(q-yt(e)[rt])),it(),G(!0)}if(t.contains(x))return G(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Z(document,"mousemove",this._onTouchMove),Z(document,"touchmove",this._onTouchMove),Z(document,"pointermove",this._onTouchMove),Z(document,"dragover",Ae),Z(document,"mousemove",Ae),Z(document,"touchmove",Ae)},_offUpEvents:function(){var r=this.el.ownerDocument;Z(r,"mouseup",this._onDrop),Z(r,"touchend",this._onDrop),Z(r,"pointerup",this._onDrop),Z(r,"touchcancel",this._onDrop),Z(document,"selectstart",this)},_onDrop:function(r){var t=this.el,e=this.options;if(qt=Yt(x),ye=Yt(x,e.draggable),Dt("drop",this,{evt:r}),dt=x&&x.parentNode,qt=Yt(x),ye=Yt(x,e.draggable),P.eventCanceled){this._nulling();return}Ve=!1,Mi=!1,pi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),or(this.cloneId),or(this._dragStartId),this.nativeDraggable&&(Z(document,"drop",this),Z(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),li&&O(document.body,"user-select",""),O(x,"transform",""),r&&(ei&&(r.cancelable&&r.preventDefault(),!e.dropBubble&&r.stopPropagation()),M&&M.parentNode&&M.parentNode.removeChild(M),(at===dt||At&&At.lastPutMode!=="clone")&&ht&&ht.parentNode&&ht.parentNode.removeChild(ht),x&&(this.nativeDraggable&&Z(x,"dragend",this),Xs(x),x.style["will-change"]="",ei&&!Ve&&zt(x,At?At.options.ghostClass:this.options.ghostClass,!1),zt(x,this.options.chosenClass,!1),Nt({sortable:this,name:"unchoose",toEl:dt,newIndex:null,newDraggableIndex:null,originalEvent:r}),at!==dt?(qt>=0&&(Nt({rootEl:dt,name:"add",toEl:dt,fromEl:at,originalEvent:r}),Nt({sortable:this,name:"remove",toEl:dt,originalEvent:r}),Nt({rootEl:dt,name:"sort",toEl:dt,fromEl:at,originalEvent:r}),Nt({sortable:this,name:"sort",toEl:dt,originalEvent:r})),At&&At.save()):qt!==ze&&qt>=0&&(Nt({sortable:this,name:"update",toEl:dt,originalEvent:r}),Nt({sortable:this,name:"sort",toEl:dt,originalEvent:r})),P.active&&((qt==null||qt===-1)&&(qt=ze,ye=di),Nt({sortable:this,name:"end",toEl:dt,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){Dt("nulling",this),at=x=dt=M=je=ht=zi=ve=Le=te=ei=qt=ye=ze=di=Re=ci=At=Ni=P.dragged=P.ghost=P.clone=P.active=null,ns.forEach(function(r){r.checked=!0}),ns.length=Zs=Js=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":x&&(this._onDragOver(r),ld(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],t,e=this.el.children,i=0,s=e.length,o=this.options;i<s;i++)t=e[i],ee(t,o.draggable,this.el,!1)&&r.push(t.getAttribute(o.dataIdAttr)||md(t));return r},sort:function(r,t){var e={},i=this.el;this.toArray().forEach(function(s,o){var n=i.children[o];ee(n,this.options.draggable,i,!1)&&(e[s]=n)},this),t&&this.captureAnimationState(),r.forEach(function(s){e[s]&&(i.removeChild(e[s]),i.appendChild(e[s]))}),t&&this.animateAll()},save:function(){var r=this.options.store;r&&r.set&&r.set(this)},closest:function(r,t){return ee(r,t||this.options.draggable,this.el,!1)},option:function(r,t){var e=this.options;if(t===void 0)return e[r];var i=wi.modifyOption(this,r,t);typeof i<"u"?e[r]=i:e[r]=t,r==="group"&&On(e)},destroy:function(){Dt("destroy",this);var r=this.el;r[Ut]=null,Z(r,"mousedown",this._onTapStart),Z(r,"touchstart",this._onTapStart),Z(r,"pointerdown",this._onTapStart),this.nativeDraggable&&(Z(r,"dragover",this),Z(r,"dragenter",this)),Array.prototype.forEach.call(r.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),os.splice(os.indexOf(this.el),1),this.el=r=null},_hideClone:function(){if(!ve){if(Dt("hideClone",this),P.eventCanceled)return;O(ht,"display","none"),this.options.removeCloneOnHide&&ht.parentNode&&ht.parentNode.removeChild(ht),ve=!0}},_showClone:function(r){if(r.lastPutMode!=="clone"){this._hideClone();return}if(ve){if(Dt("showClone",this),P.eventCanceled)return;x.parentNode==at&&!this.options.group.revertClone?at.insertBefore(ht,x):je?at.insertBefore(ht,je):at.appendChild(ht),this.options.group.revertClone&&this.animate(x,ht),O(ht,"display",""),ve=!1}}};function ld(r){r.dataTransfer&&(r.dataTransfer.dropEffect="move"),r.cancelable&&r.preventDefault()}function Ri(r,t,e,i,s,o,n,a){var l,h=r[Ut],c=h.options.onMove,p;return window.CustomEvent&&!ue&&!_i?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=r,l.dragged=e,l.draggedRect=i,l.related=s||t,l.relatedRect=o||yt(t),l.willInsertAfter=a,l.originalEvent=n,r.dispatchEvent(l),c&&(p=c.call(h,l,n)),p}function Xs(r){r.draggable=!1}function hd(){rr=!1}function dd(r,t,e){var i=yt(Ze(e.el,0,e.options,!0)),s=Sn(e.el,e.options,M),o=10;return t?r.clientX<s.left-o||r.clientY<i.top&&r.clientX<i.right:r.clientY<s.top-o||r.clientY<i.bottom&&r.clientX<i.left}function cd(r,t,e){var i=yt(qr(e.el,e.options.draggable)),s=Sn(e.el,e.options,M),o=10;return t?r.clientX>s.right+o||r.clientY>i.bottom&&r.clientX>i.left:r.clientY>s.bottom+o||r.clientX>i.right&&r.clientY>i.top}function pd(r,t,e,i,s,o,n,a){var l=i?r.clientY:r.clientX,h=i?e.height:e.width,c=i?e.top:e.left,p=i?e.bottom:e.right,b=!1;if(!n){if(a&&qi<h*s){if(!pi&&(ci===1?l>c+h*o/2:l<p-h*o/2)&&(pi=!0),pi)b=!0;else if(ci===1?l<c+qi:l>p-qi)return-ci}else if(l>c+h*(1-s)/2&&l<p-h*(1-s)/2)return ud(t)}return b=b||n,b&&(l<c+h*o/2||l>p-h*o/2)?l>c+h/2?1:-1:0}function ud(r){return Yt(x)<Yt(r)?1:-1}function md(r){for(var t=r.tagName+r.className+r.src+r.href+r.textContent,e=t.length,i=0;e--;)i+=t.charCodeAt(e);return i.toString(36)}function gd(r){ns.length=0;for(var t=r.getElementsByTagName("input"),e=t.length;e--;){var i=t[e];i.checked&&ns.push(i)}}function Ui(r){return setTimeout(r,0)}function or(r){return clearTimeout(r)}ps&&X(document,"touchmove",function(r){(P.active||Ve)&&r.cancelable&&r.preventDefault()});P.utils={on:X,off:Z,css:O,find:kn,is:function(r,t){return!!ee(r,t,r,!1)},extend:Xh,throttle:Ln,closest:ee,toggleClass:zt,clone:jn,index:Yt,nextTick:Ui,cancelNextTick:or,detectDirection:$n,getChild:Ze};P.get=function(r){return r[Ut]};P.mount=function(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(P.utils=ne(ne({},P.utils),i.utils)),wi.mount(i)})};P.create=function(r,t){return new P(r,t)};P.version=Zh;var ft=[],ii,nr,ar=!1,Qs,Ks,as,si;function bd(){function r(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return r.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?X(document,"dragover",this._handleAutoScroll):this.options.supportPointer?X(document,"pointermove",this._handleFallbackAutoScroll):e.touches?X(document,"touchmove",this._handleFallbackAutoScroll):X(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;!this.options.dragOverBubble&&!e.rootEl&&this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Z(document,"dragover",this._handleAutoScroll):(Z(document,"pointermove",this._handleFallbackAutoScroll),Z(document,"touchmove",this._handleFallbackAutoScroll),Z(document,"mousemove",this._handleFallbackAutoScroll)),Zo(),Wi(),Qh()},nulling:function(){as=nr=ii=ar=si=Qs=Ks=null,ft.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,n=document.elementFromPoint(s,o);if(as=t,e||this.options.forceAutoScrollFallback||_i||ue||li){tr(t,this.options,n,e);var a=_e(n,!0);ar&&(!si||s!==Qs||o!==Ks)&&(si&&Zo(),si=setInterval(function(){var l=_e(document.elementFromPoint(s,o),!0);l!==a&&(a=l,Wi()),tr(t,i.options,l,e)},10),Qs=s,Ks=o)}else{if(!this.options.bubbleScroll||_e(n,!0)===oe()){Wi();return}tr(t,this.options,_e(n,!1),!1)}}},pe(r,{pluginName:"scroll",initializeByDefault:!0})}function Wi(){ft.forEach(function(r){clearInterval(r.pid)}),ft=[]}function Zo(){clearInterval(si)}var tr=Ln(function(r,t,e,i){if(t.scroll){var s=(r.touches?r.touches[0]:r).clientX,o=(r.touches?r.touches[0]:r).clientY,n=t.scrollSensitivity,a=t.scrollSpeed,l=oe(),h=!1,c;nr!==e&&(nr=e,Wi(),ii=t.scroll,c=t.scrollFn,ii===!0&&(ii=_e(e,!0)));var p=0,b=ii;do{var g=b,y=yt(g),w=y.top,A=y.bottom,G=y.left,it=y.right,nt=y.width,It=y.height,ct=void 0,q=void 0,gt=g.scrollWidth,kt=g.scrollHeight,rt=O(g),j=g.scrollLeft,R=g.scrollTop;g===l?(ct=nt<gt&&(rt.overflowX==="auto"||rt.overflowX==="scroll"||rt.overflowX==="visible"),q=It<kt&&(rt.overflowY==="auto"||rt.overflowY==="scroll"||rt.overflowY==="visible")):(ct=nt<gt&&(rt.overflowX==="auto"||rt.overflowX==="scroll"),q=It<kt&&(rt.overflowY==="auto"||rt.overflowY==="scroll"));var lt=ct&&(Math.abs(it-s)<=n&&j+nt<gt)-(Math.abs(G-s)<=n&&!!j),Tt=q&&(Math.abs(A-o)<=n&&R+It<kt)-(Math.abs(w-o)<=n&&!!R);if(!ft[p])for(var wt=0;wt<=p;wt++)ft[wt]||(ft[wt]={});(ft[p].vx!=lt||ft[p].vy!=Tt||ft[p].el!==g)&&(ft[p].el=g,ft[p].vx=lt,ft[p].vy=Tt,clearInterval(ft[p].pid),(lt!=0||Tt!=0)&&(h=!0,ft[p].pid=setInterval((function(){i&&this.layer===0&&P.active._onTouchMove(as);var $t=ft[this.layer].vy?ft[this.layer].vy*a:0,Zt=ft[this.layer].vx?ft[this.layer].vx*a:0;typeof c=="function"&&c.call(P.dragged.parentNode[Ut],Zt,$t,r,as,ft[this.layer].el)!=="continue"||An(ft[this.layer].el,Zt,$t)}).bind({layer:p}),24))),p++}while(t.bubbleScroll&&b!==l&&(b=_e(b,!1)));ar=h}},30),In=function(r){var t=r.originalEvent,e=r.putSortable,i=r.dragEl,s=r.activeSortable,o=r.dispatchSortableEvent,n=r.hideGhostForTarget,a=r.unhideGhostForTarget;if(t){var l=e||s;n();var h=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(h.clientX,h.clientY);a(),l&&!l.el.contains(c)&&(o("spill"),this.onSpill({dragEl:i,putSortable:e}))}};function Ur(){}Ur.prototype={startIndex:null,dragStart:function(r){var t=r.oldDraggableIndex;this.startIndex=t},onSpill:function(r){var t=r.dragEl,e=r.putSortable;this.sortable.captureAnimationState(),e&&e.captureAnimationState();var i=Ze(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),e&&e.animateAll()},drop:In};pe(Ur,{pluginName:"revertOnSpill"});function Wr(){}Wr.prototype={onSpill:function(r){var t=r.dragEl,e=r.putSortable,i=e||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:In};pe(Wr,{pluginName:"removeOnSpill"});P.mount(new bd);P.mount(Wr,Ur);const fd=r=>{const t=r.item;let e=Array.prototype.slice.call(t.parentNode.childNodes);return e=e.filter(i=>i.nodeType!=Node.ELEMENT_NODE||!i.classList.contains("sortable-fallback")),e},yd=(r,t,e,i,s,o)=>{const n=r.item.parentNode;for(const y of e)n.appendChild(y);if(r.oldIndex==r.newIndex)return;const a=i.getArray(),l=r.item.querySelector("eox-layercontrol-layer").layer.get(s),h=a.find(y=>y.get(s)===l),c=o.dataset.layer,p=a.find(y=>y.get(s)==c);let b,g;for(b=0;b<a.length;b++)if(a[b]==h){i.removeAt(b);break}for(g=0;g<a.length;g++)if(a[g]===p){b>g?i.insertAt(g,h):i.insertAt(g+1,h);break}t.requestUpdate()};function vd(r,t,e,i){let s=[],o=null;r._sortable=P.create(r,{handle:".drag-handle",filter:".drag-handle.disabled",swapThreshold:.5,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onStart:n=>s=fd(n),onMove:n=>{o=n.related},onEnd:n=>yd(n,i,s,t,e,o)})}function _d(r,t,e,i){const s=r.getArray();let o=!1;s.forEach(n=>{const a=n.ol_uid;n.get(t)||(n.set(t,a),o=!0),n.get(e)||(n.set(e,`layer ${a}`),o=!0),o&&i.requestUpdate()})}function Gr(r,t,e){let i=[];const s=(o,n,a)=>{i=[...i,...o.filter(h=>h.get(n)===a)];const l=o.filter(h=>h.getLayers);return l.length>0&&l.forEach(h=>s(h.getLayers().getArray(),n,a)),i};return s(r,t,e),i}function wd(r,t,e){if(!r||!t)return!1;if(!Nn(r,e))return!0;const i=r.get("minZoom"),s=r.get("maxZoom"),o=t.getView().getZoom();return o>i&&o<s}function Nn(r,t){const e=r.get("minZoom"),i=r.get("maxZoom");return!!(t&&(e!==-1/0||i!==1/0))}function xd(r,t){var e,i,s;return!r||!t?void 0:r.getLayers?"group":(s=(e=t.getInteractions().getArray().filter(o=>o.freehand_!==void 0).map(o=>o.source_))==null?void 0:e.ol_uid)!=null&&s.includes(r.getSource?(i=r.getSource())==null?void 0:i.ol_uid:void 0)?"draw":r.declutter_!==void 0?"vector":"raster"}function Mn(r,t){var e;let i={};for(const s in r){const o=r[s].type;if(o&&o!=="object")i[s]=o==="number"?Number(t[s]):t[s];else if(typeof r[s]=="object"&&(e=r[s])!=null&&e.properties){const n=Mn(r[s].properties,t);Object.keys(n).length>0&&(i[s]=n)}}return i}function Cd(r,t){var e;if(!t||!r.getSource().getTileUrlFunction())return null;const i=new URL(r.getSource().getTileUrlFunction()([0,0,0])),s=Object.fromEntries(i.searchParams.entries()),o=Mn(((e=t.schema)==null?void 0:e.properties)||t.schema,s);return Object.keys(o).length?o:null}const Ed=(r,t)=>r==null?void 0:r.filter(e=>["remove","sort"].filter(i=>t!=null&&t.get("layerControlDisable")?i!=="sort":!0).includes(e)),kd=(r,t)=>r==null?void 0:r.filter(e=>{let i=!0;return["remove","sort"].includes(e)&&(i=!1),e==="info"&&(i=t.get("description")),e==="config"&&(i=t.get("layerConfig")),i}),Ld=(r,t)=>z`
46
+ <button slot="${r}-icon" class="icon">${t?r:tt}</button>
47
+ `,Ad=r=>z`
48
+ <button
49
+ class="remove-icon icon"
50
+ @click=${()=>{const{layer:t}=r;t==null||t.set("layerControlOptional",!0),t==null||t.setVisible(!1),r.dispatchEvent(new CustomEvent("changed",{detail:t,bubbles:!0}))}}
51
+ >
52
+ ${r.unstyled?"x":tt}
53
+ </button>
54
+ `,jd=r=>z`
55
+ <span class="button sort-icon icon drag-handle">
56
+ ${r?"═":tt}
57
+ </span>
58
+ `,Hn=r=>{var t;const e=["layerControlHide","layerControlOptional"];return(t=r==null?void 0:r.getArray())==null?void 0:t.filter(i=>e.every(s=>!i.get(s)))};/**
59
+ * @license
60
+ * Copyright 2020 Google LLC
61
+ * SPDX-License-Identifier: BSD-3-Clause
62
+ */const Rn=Dr(class extends Vr{constructor(r){if(super(r),r.type!==fe.PROPERTY&&r.type!==fe.ATTRIBUTE&&r.type!==fe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Wl(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[t]){if(t===Xt||t===tt)return t;const e=r.element,i=r.name;if(r.type===fe.PROPERTY){if(t===e[i])return Xt}else if(r.type===fe.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Xt}else if(r.type===fe.ATTRIBUTE&&e.getAttribute(i)===t+"")return Xt;return un(r),t}});/**
63
+ * @license
64
+ * Copyright 2017 Google LLC
65
+ * SPDX-License-Identifier: BSD-3-Clause
66
+ */class lr extends Vr{constructor(t){if(super(t),this.it=tt,t.type!==fe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===tt||t==null)return this._t=void 0,this.it=t;if(t===Xt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}lr.directiveName="unsafeHTML",lr.resultType=1;const Sd=Dr(lr);/**
67
+ * @license
68
+ * Copyright 2021 Google LLC
69
+ * SPDX-License-Identifier: BSD-3-Clause
70
+ */function*Gi(r,t){if(r!==void 0){let e=0;for(const i of r)yield t(i,e++)}}const Td=r=>typeof r.type!="string"&&"multiple",$d=r=>typeof r.type=="string"&&"string",Od=r=>!r.type&&r.properties&&"object",Pd=r=>typeof r.type=="string"&&["string","number","integer","boolean","null","array","object"].includes(r.type)&&r.type,Bd=r=>r.type==="string"&&r.format==="signature"&&"signature",Id=r=>{if(r.type==="boolean")return r.format==="checkbox"||r.options&&r.options.checkbox?"checkbox":r.format==="select2"?"select2":r.format==="selectize"?"selectize":r.format==="choices"?"choices":"select"},Nd=r=>r.type==="any"&&"multiple",Md=r=>r.type==="string"&&r.media&&r.media.binaryEncoding==="base64"&&"base64",Hd=r=>r.type==="string"&&r.format==="url"&&window.FileReader&&r.options&&r.options.upload===Object(r.options.upload)&&"upload",Rd=r=>r.type==="array"&&r.format==="table"&&"table",Dd=r=>{if(r.enumSource)return r.format==="radio"?"radio":r.format==="select2"?"select2":r.format==="selectize"?"selectize":r.format==="choices"?"choices":"select"},Vd=r=>{if(r.enum){if(r.type==="array"||r.type==="object")return"enum";if(r.type==="number"||r.type==="integer"||r.type==="string")return r.format==="radio"?"radio":r.format==="select2"?"select2":r.format==="selectize"?"selectize":r.format==="choices"?"choices":"select"}},Fd=(r,t)=>{if(r.items&&(r.items=t.expandSchema(r.items)),r.type==="array"&&r.items&&!Array.isArray(r.items)&&["string","number","integer"].includes(r.items.type)){if(r.format==="choices")return"arrayChoices";if(r.uniqueItems){if(r.format==="selectize")return"arraySelectize";if(r.format==="select2")return"arraySelect2";if(r.items.enum)return"multiselect"}}},zd=r=>(r.oneOf||r.anyOf)&&"multiple",qd=r=>r.if&&"multiple",Ud=r=>["string","integer"].includes(r.type)&&["date","time","datetime-local"].includes(r.format)&&"datetime",Wd=r=>["string","integer"].includes(r.type)&&["starrating","rating"].includes(r.format)&&"starrating",Gd=r=>{if(r.links){for(let t=0;t<r.links.length;t++)if(r.links[t].rel&&r.links[t].rel.toLowerCase()==="describedby")return"describedBy"}},Zd=r=>{if((r.type==="integer"||r.type==="number")&&r.format==="stepper")return"stepper"},Jd=r=>r.format==="button"&&"button",Yd=r=>r.format==="info"&&"info",Xd=r=>r.type==="string"&&r.format==="uuid"&&"uuid",Qd=r=>r.type==="string"&&r.format==="autocomplete"&&"autocomplete",Kd=r=>r.type==="string"&&r.format==="jodit"&&"jodit",tc=r=>r.type==="string"&&r.format==="markdown"&&"simplemde",ec=r=>r.type==="string"&&["xhtml","bbcode"].includes(r.format)&&"sceditor",ic=["actionscript","batchfile","c","c++","cpp","coffee","csharp","css","dart","django","ejs","erlang","golang","groovy","handlebars","haskell","haxe","html","ini","jade","java","javascript","json","less","lisp","lua","makefile","matlab","mysql","objectivec","pascal","perl","pgsql","php","python","prql","r","ruby","rust","sass","scala","scss","sh","smarty","sql","sqlserver","stylus","svg","typescript","twig","vbscript","xml","yaml","zig"],sc=r=>r.type==="string"&&ic.includes(r.format)&&"ace",rc=r=>r.type==="string"&&["ip","ipv4","ipv6","hostname"].includes(r.format)&&"ip",oc=r=>r.type==="string"&&r.format==="color"&&"colorpicker",nc=[oc,rc,sc,ec,tc,Kd,Qd,Xd,Yd,Jd,Zd,Gd,Wd,Ud,zd,qd,Fd,Vd,Dd,Rd,Hd,Md,Nd,Id,Bd,Pd,Od,Td,$d];function Dn(r){return!(r===null||typeof r!="object"||r.nodeType||r===r.window||r.constructor&&!Wt(r.constructor.prototype,"isPrototypeOf"))}function Vn(r){return Dn(r)?$({},r):Array.isArray(r)?r.map(Vn):r}function $(r,...t){return t.forEach(e=>{e&&Object.keys(e).forEach(i=>{e[i]&&Dn(e[i])?(Wt(r,i)||(r[i]={}),$(r[i],e[i])):Array.isArray(e[i])?r[i]=Vn(e[i]):r[i]=e[i]})}),r}function se(r,t){const e=document.createEvent("HTMLEvents");e.initEvent(t,!0,!0),r.dispatchEvent(e)}function Fn(r){return r&&(r.toString()==="[object ShadowRoot]"?r:Fn(r.parentNode))}function Wt(r,t){return r&&Object.prototype.hasOwnProperty.call(r,t)}const ac=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;function lc(r){if(typeof r>"u"||r===null)return!1;const t=r.match(ac),e=parseFloat(r);return t!==null&&!isNaN(e)&&isFinite(e)}const hc=/^\s*(-|\+)?(\d+)\s*$/;function dc(r){if(typeof r>"u"||r===null)return!1;const t=r.match(hc),e=parseInt(r);return t!==null&&!isNaN(e)&&isFinite(e)}function yi(){let r=new Date().getTime();return typeof performance<"u"&&typeof performance.now=="function"&&(r+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(t==="x"?e:e&3|8).toString(16)})}function er(r){return r&&typeof r=="object"&&!Array.isArray(r)}function ls(r,...t){if(!t.length)return r;const e=t.shift();if(er(r)&&er(e))for(const i in e)er(e[i])?(r[i]||Object.assign(r,{[i]:{}}),ls(r[i],e[i])):Object.assign(r,{[i]:e[i]});return ls(r,...t)}function cc(r,t){return Object.keys(t).forEach(function(e){e in r&&(r[e]=t[e])}),r}class Bt{constructor(t,e){this.defaults=e,this.jsoneditor=t.jsoneditor,this.theme=this.jsoneditor.theme,this.template_engine=this.jsoneditor.template,this.iconlib=this.jsoneditor.iconlib,this.translate=this.jsoneditor.translate||this.defaults.translate,this.translateProperty=this.jsoneditor.translateProperty||this.defaults.translateProperty,this.original_schema=t.schema,this.schema=this.jsoneditor.expandSchema(this.original_schema),this.active=!0,this.isUiOnly=!1,this.options=$({},this.options||{},this.schema.options||{},t.schema.options||{},t),this.formname=this.jsoneditor.options.form_name_root||"root",!t.path&&!this.schema.id&&(this.schema.id=this.formname),this.path=t.path||this.formname,this.formname=t.formname||this.path.replace(/\.([^.]+)/g,"[$1]"),this.parent=t.parent,this.key=this.parent!==void 0?this.path.split(".").slice(this.parent.path.split(".").length).join("."):this.path,this.link_watchers=[],this.watchLoop=!1,t.container&&this.setContainer(t.container),this.registerDependencies()}onChildEditorChange(t){this.onChange(!0)}notify(){this.path&&this.jsoneditor.notifyWatchers(this.path)}change(){this.parent?this.parent.onChildEditorChange(this):this.jsoneditor&&this.jsoneditor.onChange()}onChange(t){this.notify(),this.watch_listener&&this.watch_listener(),t&&this.change()}register(){if(this.jsoneditor.registerEditor(this),this.input&&!this.label){const t=this.getTitle()||this.formname;this.input.setAttribute("aria-label",t)}this.onChange()}unregister(){this.jsoneditor&&this.jsoneditor.unregisterEditor(this)}getNumColumns(){return 12}isActive(){return this.active}activate(){this.active=!0,this.optInCheckbox.checked=!0,this.enable(),this.change()}deactivate(){this.isRequired()||(this.active=!1,this.optInCheckbox.checked=!1,this.disable(),this.change())}registerDependencies(){this.dependenciesFulfilled=!0;const t=this.options.dependencies;t&&Object.keys(t).forEach(e=>{let i;e.startsWith(this.jsoneditor.root.path)?i=e:(i=this.path.split("."),i[i.length-1]=e,i=i.join(".")),this.jsoneditor.watch(i,()=>{this.evaluateDependencies()})})}evaluateDependencies(){const t=this.container||this.control;if(!t||this.jsoneditor===null)return;const e=this.options.dependencies;if(!e)return;const i=this.dependenciesFulfilled;this.dependenciesFulfilled=!0,Object.keys(e).forEach(o=>{let n;o.startsWith(this.jsoneditor.root.path)?n=o:(n=this.path.split("."),n[n.length-1]=o,n=n.join("."));const a=e[o];this.checkDependency(n,a)}),this.dependenciesFulfilled!==i&&this.notify();let s=this.dependenciesFulfilled?"block":"none";this.options.hidden&&(s="none"),t.tagName==="TD"?Object.keys(t.childNodes).forEach(o=>t.childNodes[o].style.display=s):t.style.display=s}checkDependency(t,e){if(this.path===t||this.jsoneditor===null)return;const i=this.jsoneditor.getEditor(t),s=i?i.getValue():void 0;!i||!i.dependenciesFulfilled?this.dependenciesFulfilled=!1:Array.isArray(e)?this.dependenciesFulfilled=e.some(o=>{if(JSON.stringify(s)===JSON.stringify(o))return!0}):typeof e=="object"?typeof s!="object"?this.dependenciesFulfilled=e===s:Object.keys(e).some(o=>{if(!Wt(e,o))return!1;if(!Wt(s,o)||e[o]!==s[o])return this.dependenciesFulfilled=!1,!0}):typeof e=="string"||typeof e=="number"?this.dependenciesFulfilled=this.dependenciesFulfilled&&s===e:typeof e=="boolean"&&(e?this.dependenciesFulfilled=this.dependenciesFulfilled&&(s||s.length>0):this.dependenciesFulfilled=this.dependenciesFulfilled&&(!s||s.length===0))}setContainer(t){this.container=t,this.setContainerAttributes(),this.schema.id&&this.container.setAttribute("data-schemaid",this.schema.id),this.schema.type&&typeof this.schema.type=="string"&&this.container.setAttribute("data-schematype",this.schema.type),this.container.setAttribute("data-schemapath",this.path)}setOptInCheckbox(t){this.optInLabel=this.theme.getHiddenLabel(this.formname+" opt-in"),this.optInLabel.setAttribute("for",this.formname+"-opt-in"),this.optInCheckbox=document.createElement("input"),this.optInCheckbox.setAttribute("type","checkbox"),this.optInCheckbox.setAttribute("style","margin: 0 10px 0 0;"),this.optInCheckbox.setAttribute("id",this.formname+"-opt-in"),this.optInCheckbox.classList.add("json-editor-opt-in"),this.optInCheckbox.addEventListener("click",()=>{this.isActive()?this.deactivate():this.activate()});const e=this.jsoneditor.options.show_opt_in,i=typeof this.parent.options.show_opt_in<"u",s=i&&this.parent.options.show_opt_in===!0,o=i&&this.parent.options.show_opt_in===!1;(s||!o&&e||!i&&e)&&this.parent&&this.parent.schema.type==="object"&&!this.isRequired()&&this.header&&(this.header.appendChild(this.optInLabel),this.header.appendChild(this.optInCheckbox),this.header.insertBefore(this.optInCheckbox,this.header.firstChild))}preBuild(){}build(){}postBuild(){this.setupWatchListeners(),this.addLinks(),this.register(),this.setValue(this.getDefault(),!0),this.updateHeaderText(),this.onWatchedFieldChange(),this.options.titleHidden&&(this.theme.visuallyHidden(this.label),this.theme.visuallyHidden(this.header))}setupWatchListeners(){if(this.watched={},this.schema.vars&&(this.schema.watch=this.schema.vars),this.watched_values={},this.watch_listener=()=>{this.refreshWatchedFieldValues()&&this.onWatchedFieldChange()},Wt(this.schema,"watch")){let t,e,i,s,o;const n=this.container.getAttribute("data-schemapath");Object.keys(this.schema.watch).forEach(a=>{if(t=this.schema.watch[a],Array.isArray(t)){if(t.length<2)return;e=[t[0]].concat(t[1].split("."))}else e=t.split("."),this.theme.closest(this.container,`[data-schemaid="${e[0]}"]`)||e.unshift("#");if(i=e.shift(),i==="#"&&(i=this.jsoneditor.schema.id||this.jsoneditor.root.formname),s=this.theme.closest(this.container,`[data-schemaid="${i}"]`),!s)throw new Error(`Could not find ancestor node with id ${i}`);o=`${s.getAttribute("data-schemapath")}.${e.join(".")}`,n.startsWith(o)&&(this.watchLoop=!0),this.jsoneditor.watch(o,this.watch_listener),this.watched[a]=o})}this.schema.headerTemplate&&(this.header_template=this.jsoneditor.compileTemplate(this.schema.headerTemplate,this.template_engine))}addLinks(){if(!this.no_link_holder&&(this.link_holder=this.theme.getLinksHolder(),typeof this.description<"u"?this.description.parentNode.insertBefore(this.link_holder,this.description):this.container.appendChild(this.link_holder),this.schema.links))for(let t=0;t<this.schema.links.length;t++)this.addLink(this.getLink(this.schema.links[t]))}onMove(){}getButton(t,e,i,s=[]){const o=`json-editor-btn-${e}`;this.iconlib?e=this.iconlib.getIcon(e):e=null,t=this.translate(t,s),i=this.translate(i,s),!e&&i&&(t=i,i=null);const n=this.theme.getButton(t,e,i);return n.classList.add(o),n}setButtonText(t,e,i,s,o=[]){return this.iconlib?i=this.iconlib.getIcon(i):i=null,e=this.translate(e,o),s=this.translate(s,o),!i&&s&&(e=s,s=null),this.theme.setButtonText(t,e,i,s)}addLink(t){this.link_holder&&this.link_holder.appendChild(t)}getLink(t){let e,i;const s=(t.mediaType||"application/javascript").split("/")[0],o=this.jsoneditor.compileTemplate(t.href,this.template_engine),n=this.jsoneditor.compileTemplate(t.rel?t.rel:t.href,this.template_engine);let a=null;if(t.download&&(a=t.download),a&&a!==!0&&(a=this.jsoneditor.compileTemplate(a,this.template_engine)),s==="image"){e=this.theme.getBlockLinkHolder(),i=document.createElement("a"),i.setAttribute("target","_blank");const l=document.createElement("img");this.theme.createImageLink(e,i,l),this.link_watchers.push(h=>{const c=o(h),p=n(h);i.setAttribute("href",c),i.setAttribute("title",p||c),l.setAttribute("src",c)})}else if(["audio","video"].includes(s)){e=this.theme.getBlockLinkHolder(),i=this.theme.getBlockLink(),i.setAttribute("target","_blank");const l=document.createElement(s);l.setAttribute("controls","controls"),this.theme.createMediaLink(e,i,l),this.link_watchers.push(h=>{const c=o(h),p=n(h);i.setAttribute("href",c),i.textContent=p||c,l.setAttribute("src",c)})}else i=e=this.theme.getBlockLink(),e.setAttribute("target","_blank"),e.textContent=t.rel,e.style.display="none",this.link_watchers.push(l=>{const h=o(l),c=n(l);h&&(e.style.display=""),e.setAttribute("href",h),e.textContent=c||h});return a&&i&&(a===!0?i.setAttribute("download",""):this.link_watchers.push(l=>{i.setAttribute("download",a(l))})),t.class&&i.classList.add(t.class),e}refreshWatchedFieldValues(){if(!this.watched_values)return;const t={};let e=!1;return this.watched&&Object.keys(this.watched).forEach(i=>{const s=this.jsoneditor.getEditor(this.watched[i]),o=s?s.getValue():null;this.watched_values[i]!==o&&(e=!0),t[i]=o}),t.self=this.getValue(),this.watched_values.self!==t.self&&(e=!0),this.watched_values=t,e}getWatchedFieldValues(){return this.watched_values}updateHeaderText(){if(this.header){const t=this.getHeaderText();if(this.header.children.length){for(let e=0;e<this.header.childNodes.length;e++)if(this.header.childNodes[e].nodeType===3){this.header.childNodes[e].nodeValue=this.cleanText(t);break}}else window.DOMPurify?this.header.innerHTML=window.DOMPurify.sanitize(t):this.header.textContent=this.cleanText(t)}}getHeaderText(t){return this.header_text?this.header_text:t?this.translateProperty(this.schema.title):this.getTitle()}getPathDepth(){return this.path.split(".").length}cleanText(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText}onWatchedFieldChange(){let t;if(this.header_template){t=$(this.getWatchedFieldValues(),{key:this.key,i:this.key,i0:this.key*1,i1:this.key*1+1,title:this.getTitle()}),this.editors&&Object.keys(this.editors).length&&(t.properties={},Object.keys(this.editors).forEach(i=>{const s=this.editors[i];if(s.schema&&s.schema.enum&&s.schema.options&&s.schema.options.enum_titles){const o=s.schema.enum.indexOf(s.value),n=s.options.enum_titles[o];t.properties[i]={enumTitle:n}}}));const e=this.header_template(t);e!==this.header_text&&(this.header_text=e,this.updateHeaderText(),this.notify())}if(this.link_watchers.length){t=this.getWatchedFieldValues();for(let e=0;e<this.link_watchers.length;e++)this.link_watchers[e](t)}}setValue(t){this.value=t}getValue(){if(this.dependenciesFulfilled)return this.value}refreshValue(){}getChildEditors(){return!1}destroy(){this.unregister(this),this.watched&&Object.values(this.watched).forEach(t=>this.jsoneditor.unwatch(t,this.watch_listener)),this.watched=null,this.watched_values=null,this.watch_listener=null,this.header_text=null,this.header_template=null,this.value=null,this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.jsoneditor=null,this.schema=null,this.path=null,this.key=null,this.parent=null}isDefaultRequired(){return this.isRequired()||!!this.jsoneditor.options.use_default_values}getDefault(){if(typeof this.schema.default<"u")return this.schema.default;if(typeof this.schema.enum<"u")return this.schema.enum[0];let t=this.schema.type||this.schema.oneOf;if(t&&Array.isArray(t)&&(t=t[0]),t&&typeof t=="object"&&(t=t.type),t&&Array.isArray(t)&&(t=t[0]),typeof t=="string"){if(t==="number")return this.isDefaultRequired()?0:void 0;if(t==="boolean")return this.isDefaultRequired()?!1:void 0;if(t==="integer")return this.isDefaultRequired()?0:void 0;if(t==="string")return this.isDefaultRequired()?"":void 0;if(t==="null")return null;if(t==="object")return{};if(t==="array")return[]}}getTitle(){return this.translateProperty(this.schema.title||this.key||this.formname)}enable(){this.disabled=!1}disable(){this.disabled=!0}isEnabled(){return!this.disabled}isRequired(){return typeof this.schema.required=="boolean"?this.schema.required:this.parent&&this.parent.schema&&Array.isArray(this.parent.schema.required)?this.parent.schema.required.includes(this.key):!!this.jsoneditor.options.required_by_default}getDisplayText(t){const e=[],i={};t.forEach(o=>{o.title&&(i[o.title]=i[o.title]||0,i[o.title]++),o.description&&(i[o.description]=i[o.description]||0,i[o.description]++),o.format&&(i[o.format]=i[o.format]||0,i[o.format]++),o.type&&(i[o.type]=i[o.type]||0,i[o.type]++)}),t.forEach(o=>{let n;typeof o=="string"?n=o:o.title&&i[o.title]<=1?n=o.title:o.format&&i[o.format]<=1?n=o.format:o.type&&i[o.type]<=1?n=o.type:o.description&&i[o.description]<=1?n=o.description:o.title?n=o.title:o.format?n=o.format:o.type?n=o.type:o.description?n=o.description:JSON.stringify(o).length<500?n=JSON.stringify(o):n="type",e.push(n)});const s={};return e.forEach((o,n)=>{s[o]=s[o]||0,s[o]++,i[o]>1&&(e[n]=`${o} ${s[o]}`)}),e}getValidId(t){return t=t===void 0?"":t.toString(),t.replace(/\s+/g,"-")}setInputAttributes(t){if(this.schema.options&&this.schema.options.inputAttributes){const e=this.schema.options.inputAttributes,i=["name","type"].concat(t);Object.keys(e).forEach(s=>{i.includes(s.toLowerCase())||this.input.setAttribute(s,e[s])})}}setContainerAttributes(){if(this.schema.options&&this.schema.options.containerAttributes){const t=this.schema.options.containerAttributes,e=["data-schemapath","data-schematype","data-schemaid"];Object.keys(t).forEach(i=>{e.includes(i.toLowerCase())||this.container.setAttribute(i,t[i])})}}expandCallbacks(t,e){const i=this.defaults.callbacks[t];return Object.entries(e).forEach(([s,o])=>{o===Object(o)?e[s]=this.expandCallbacks(t,o):typeof o=="string"&&typeof i=="object"&&typeof i[o]=="function"&&(e[s]=i[o].bind(null,this))}),e}showValidationErrors(t){}}class Gt extends Bt{register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&(this.input.removeAttribute("name"),this.input.removeAttribute("aria-label"))}setValue(t,e,i){if(this.template&&!i||(!this.shouldBeUnset()&&(t===null||typeof t>"u")?t="":typeof t=="object"?t=JSON.stringify(t):!this.shouldBeUnset()&&typeof t!="string"&&(t=`${t}`),t===this.serialized))return;const s=this.sanitize(t);if(this.input.value===s)return;if(this.setValueToInputField(s),this.format==="range"){const n=this.control.querySelector("output");n&&(n.value=s)}const o=i||this.getValue()!==t;return this.refreshValue(),e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input),i||this.onChange(o),{changed:o,value:s}}setValueToInputField(t){this.input.value=t===void 0?"":t}getNumColumns(){const t=Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5);let e;return this.input_type==="textarea"?e=6:["text","email"].includes(this.input_type)?e=4:e=2,Math.min(12,Math.max(t,e))}build(){if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.format=this.schema.format,!this.format&&this.schema.media&&this.schema.media.type&&(this.format=this.schema.media.type.replace(/(^(application|text)\/(x-)?(script\.)?)|(-source$)/g,"")),!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.format)if(this.format==="textarea")this.input_type="textarea",this.input=this.theme.getTextareaInput();else if(this.format==="range"){this.input_type="range";let e=this.schema.minimum||0,i=this.schema.maximum||Math.max(100,e+1),s=1;this.schema.multipleOf&&(e%this.schema.multipleOf&&(e=Math.ceil(e/this.schema.multipleOf)*this.schema.multipleOf),i%this.schema.multipleOf&&(i=Math.floor(i/this.schema.multipleOf)*this.schema.multipleOf),s=this.schema.multipleOf),this.input=this.theme.getRangeInput(e,i,s,this.description,this.formname),this.input.setAttribute("id",this.formname)}else this.input_type="text",["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","reset","search","submit","tel","text","time","url","week"].includes(this.format)&&(this.input_type=this.format),this.input=this.theme.getFormInputField(this.input_type);else this.input_type="text",this.input=this.theme.getFormInputField(this.input_type);typeof this.schema.maxLength<"u"&&this.input.setAttribute("maxlength",this.schema.maxLength),typeof this.schema.pattern<"u"?this.input.setAttribute("pattern",this.schema.pattern):typeof this.schema.minLength<"u"&&this.input.setAttribute("pattern",`.{${this.schema.minLength},}`),this.options.compact?this.container.classList.add("compact"):this.options.input_width&&(this.input.style.width=this.options.input_width),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.disable(!0),this.input.setAttribute("readonly","true")),this.setInputAttributes(["maxlength","pattern","readonly","min","max","step"]),this.input.addEventListener("change",e=>{if(e.preventDefault(),e.stopPropagation(),this.schema.template){e.currentTarget.value=this.value;return}const i=e.currentTarget.value,s=this.sanitize(i);i!==s&&(e.currentTarget.value=s),this.is_dirty=!0,this.refreshValue(),this.onChange(!0)}),this.options.input_height&&(this.input.style.height=this.options.input_height),this.options.expand_height&&(this.adjust_height=e=>{if(!e)return;let i,s=e.offsetHeight;if(e.offsetHeight<e.scrollHeight)for(i=0;e.offsetHeight<e.scrollHeight+3&&!(i>100);)i++,s++,e.style.height=`${s}px`;else{for(i=0;e.offsetHeight>=e.scrollHeight+3&&!(i>100);)i++,s--,e.style.height=`${s}px`;e.style.height=`${s+1}px`}},this.input.addEventListener("keyup",e=>{this.adjust_height(e.currentTarget)}),this.input.addEventListener("change",e=>{this.adjust_height(e.currentTarget)}),this.adjust_height()),this.format&&this.input.setAttribute("data-schemaformat",this.format);let{input:t}=this;if(this.format==="range"&&(t=this.theme.getRangeControl(this.input,this.theme.getRangeOutput(this.input,this.schema.default||Math.max(this.schema.minimum||0,0)))),this.control=this.theme.getFormControl(this.label,t,this.description,this.infoButton,this.formname),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{if(this.input.parentNode&&this.afterInputReady(),this.adjust_height&&this.adjust_height(this.input),this.format==="range"){const e=this.control.querySelector("output");e.value=this.input.value}}),this.schema.template){const e=this.expandCallbacks("template",{template:this.schema.template});typeof e.template=="function"?this.template=e.template:this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()}else this.refreshValue()}setupCleave(t){const e=this.expandCallbacks("cleave",$({},this.defaults.options.cleave||{},this.options.cleave||{}));typeof e=="object"&&Object.keys(e).length>0&&(this.cleave_instance=new window.Cleave(t,e))}setupImask(t){const e=this.expandCallbacks("imask",$({},this.defaults.options.imask||{},this.options.imask||{}));typeof e=="object"&&Object.keys(e).length>0&&(this.imask_instance=window.IMask(t,this.ajustIMaskOptions(e)))}ajustIMaskOptions(t){return Object.keys(t).forEach(e=>{if(t[e]===Object(t[e]))t[e]=this.ajustIMaskOptions(t[e]);else if(e==="mask")if(t[e].substr(0,6)==="regex:"){const i=t[e].match(/^regex:\/(.*)\/([gimsuy]*)$/);if(i!==null)try{t[e]=new RegExp(i[1],i[2])}catch{}}else t[e]=this.getGlobalPropertyFromString(t[e])}),t}getGlobalPropertyFromString(t){if(t.includes(".")){const e=t.split("."),i=e[0],s=e[1];if(typeof window[i]<"u"&&typeof window[i][s]<"u")return window[i][s]}else if(typeof window[t]<"u")return window[t];return t}shouldBeUnset(){return!this.jsoneditor.options.use_default_values&&!this.is_dirty}getValue(){const t=!!(this.input&&this.input.value);if(!(this.shouldBeUnset()&&!t))return this.imask_instance&&this.dependenciesFulfilled&&this.options.imask.returnUnmasked?this.imask_instance.unmaskedValue:super.getValue()}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}afterInputReady(){this.theme.afterInputReady(this.input),window.Cleave&&!this.cleave_instance?this.setupCleave(this.input):window.IMask&&!this.imask_instance&&this.setupImask(this.input)}refreshValue(){this.input&&(this.value=this.input.value,typeof this.value!="string"&&!this.shouldBeUnset()&&(this.value=""),this.serialized=this.value)}destroy(){this.cleave_instance&&this.cleave_instance.destroy(),this.imask_instance&&this.imask_instance.destroy(),this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}sanitize(t){return t}onWatchedFieldChange(){let t;this.template&&(t=this.getWatchedFieldValues(),this.setValue(this.template(t),!1,!0)),super.onWatchedFieldChange()}showValidationErrors(t){if(this.jsoneditor.options.show_errors!=="always"&&!this.is_dirty&&this.previous_error_setting===this.jsoneditor.options.show_errors)return;this.previous_error_setting=this.jsoneditor.options.show_errors;const e=(s,o)=>(o.path===this.path&&s.push(o.message),s),i=t.reduce(e,[]);i.length?this.theme.addInputError(this.input,`${i.join(". ")}.`):this.theme.removeInputError(this.input)}}class pc extends Gt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.ace_editor_instance&&(this.ace_editor_instance.setValue(s.value),this.ace_editor_instance.session.getSelection().clearSelection(),this.ace_editor_instance.resize())}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;if(window.ace){let e=this.input_type;(e==="cpp"||e==="c++"||e==="c")&&(e="c_cpp"),t=this.expandCallbacks("ace",$({},{selectionStyle:"text",minLines:30,maxLines:30},this.defaults.options.ace||{},this.options.ace||{},{mode:`ace/mode/${e}`})),this.ace_container=document.createElement("div"),this.ace_container.style.width="100%",this.ace_container.style.position="relative",this.input.parentNode.insertBefore(this.ace_container,this.input),this.input.style.display="none",this.ace_editor_instance=window.ace.edit(this.ace_container,t),this.ace_editor_instance.setValue(this.getValue()),this.ace_editor_instance.session.getSelection().clearSelection(),this.ace_editor_instance.resize(),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&this.ace_editor_instance.setReadOnly(!0),this.ace_editor_instance.on("change",()=>{this.input.value=this.ace_editor_instance.getValue(),this.refreshValue(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)}else super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.ace_editor_instance&&this.ace_editor_instance.setReadOnly(!1),super.enable()}disable(t){this.ace_editor_instance&&this.ace_editor_instance.setReadOnly(!0),super.disable(t)}destroy(){this.ace_editor_instance&&(this.ace_editor_instance.destroy(),this.ace_editor_instance=null),super.destroy()}}const uc={".json-editor-btntype-toggle":"margin:0%2010px%200%200",".je-array-control-btn":"width:100%25;text-align:left;margin-bottom:3px"};class Zr extends Bt{askConfirmation(){return!(this.jsoneditor.options.prompt_before_delete===!0&&window.confirm(this.translate("button_delete_node_warning"))===!1)}getDefault(){return this.schema.default||[]}register(){super.register(),this.rows&&this.rows.forEach(t=>t.register())}unregister(){super.unregister(),this.rows&&this.rows.forEach(t=>t.unregister())}getNumColumns(){const t=this.getItemInfo(0);return this.tabs_holder&&this.schema.format!=="tabs-top"?Math.max(Math.min(12,t.width+2),4):t.width}enable(){this.always_disabled||(this.setAvailability(this,!1),this.rows&&this.rows.forEach(t=>{t.enable(),this.setAvailability(t,!1)}),super.enable())}disable(t){t&&(this.always_disabled=!0),this.setAvailability(this,!0),this.rows&&this.rows.forEach(e=>{e.disable(t),this.setAvailability(e,!0)}),super.disable()}setAvailability(t,e){t.add_row_button&&(t.add_row_button.disabled=e),t.remove_all_rows_button&&(t.remove_all_rows_button.disabled=e),t.delete_last_row_button&&(t.delete_last_row_button.disabled=e),t.copy_button&&(t.copy_button.disabled=e),t.delete_button&&(t.delete_button.disabled=e),t.moveup_button&&(t.moveup_button.disabled=e),t.movedown_button&&(t.movedown_button.disabled=e)}preBuild(){super.preBuild(),this.rows=[],this.row_cache=[],this.hide_delete_buttons=this.options.disable_array_delete||this.jsoneditor.options.disable_array_delete,this.hide_delete_all_rows_buttons=this.hide_delete_buttons||this.options.disable_array_delete_all_rows||this.jsoneditor.options.disable_array_delete_all_rows,this.hide_delete_last_row_buttons=this.hide_delete_buttons||this.options.disable_array_delete_last_row||this.jsoneditor.options.disable_array_delete_last_row,this.hide_move_buttons=this.options.disable_array_reorder||this.jsoneditor.options.disable_array_reorder,this.hide_add_button=this.options.disable_array_add||this.jsoneditor.options.disable_array_add,this.show_copy_button=this.options.enable_array_copy||this.jsoneditor.options.enable_array_copy,this.array_controls_top=this.options.array_controls_top||this.jsoneditor.options.array_controls_top}build(){this.options.compact?(this.title=this.theme.getHeader("",this.getPathDepth()),this.container.appendChild(this.title),this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder)):(this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.container.appendChild(this.title),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText)),this.container.appendChild(this.infoButton)),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.schema.format==="tabs-top"?(this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.tabs_holder=this.theme.getTopTabHolder(this.getValidId(this.getItemTitle())),this.container.appendChild(this.tabs_holder),this.row_holder=this.theme.getTopTabContentHolder(this.tabs_holder),this.active_tab=null):this.schema.format==="tabs"?(this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.tabs_holder=this.theme.getTabHolder(this.getValidId(this.getItemTitle())),this.container.appendChild(this.tabs_holder),this.row_holder=this.theme.getTabContentHolder(this.tabs_holder),this.active_tab=null):(this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder),this.controls=this.theme.getButtonHolder(),this.array_controls_top?this.title.appendChild(this.controls):this.panel.appendChild(this.controls))),this.addControls()}postBuild(){super.postBuild(),(this.schema.readOnly||this.schema.readonly)&&this.disable()}onChildEditorChange(t){this.refreshValue(),this.refreshTabs(!0),super.onChildEditorChange(t)}getItemTitle(){if(!this.item_title)if(this.schema.items&&!Array.isArray(this.schema.items)){const t=this.jsoneditor.expandRefs(this.schema.items);this.item_title=this.translateProperty(t.title)||this.translate("default_array_item_title")}else this.item_title=this.translate("default_array_item_title");return this.cleanText(this.item_title)}getItemSchema(t){if(Array.isArray(this.schema.items))if(t>=this.schema.items.length){if(this.schema.additionalItems===!0)return{};if(this.schema.additionalItems)return $({},this.schema.additionalItems)}else return $({},this.schema.items[t]);else return this.schema.items?$({},this.schema.items):{}}getItemInfo(t){let e=this.getItemSchema(t);this.item_info=this.item_info||{};const i=JSON.stringify(e);return typeof this.item_info[i]<"u"?this.item_info[i]:(e=this.jsoneditor.expandRefs(e),this.item_info[i]={title:this.translateProperty(e.title)||this.translate("default_array_item_title"),default:e.default,width:12,child_editors:e.properties||e.items},this.item_info[i])}getElementEditor(t){const e=this.getItemInfo(t);let i=this.getItemSchema(t);i=this.jsoneditor.expandRefs(i),i.title=`${e.title} ${t+1}`;const s=this.jsoneditor.getEditorClass(i);let o;this.tabs_holder?(this.schema.format==="tabs-top"?o=this.theme.getTopTabContent():o=this.theme.getTabContent(),o.id=`${this.path}.${t}`):e.child_editors?o=this.theme.getChildEditorHolder():o=this.theme.getIndentedPanel(),this.row_holder.appendChild(o);const n=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:o,path:`${this.path}.${t}`,parent:this,required:!0});return n.preBuild(),n.build(),n.postBuild(),n.title_controls||(n.array_controls=this.theme.getButtonHolder(),o.appendChild(n.array_controls)),n}checkParent(t){return t&&t.parentNode}destroy(){this.empty(!0),this.checkParent(this.title)&&this.title.parentNode.removeChild(this.title),this.checkParent(this.description)&&this.description.parentNode.removeChild(this.description),this.checkParent(this.row_holder)&&this.row_holder.parentNode.removeChild(this.row_holder),this.checkParent(this.controls)&&this.controls.parentNode.removeChild(this.controls),this.checkParent(this.panel)&&this.panel.parentNode.removeChild(this.panel),this.rows=this.row_cache=this.title=this.description=this.row_holder=this.panel=this.controls=null,super.destroy()}empty(t){if(this.rows!==null){if(this.rows.forEach((e,i)=>{t&&(this.checkParent(e.tab)&&e.tab.parentNode.removeChild(e.tab),this.destroyRow(e,!0),this.row_cache[i]=null),this.rows[i]=null}),t)for(let e=this.rows.length;e<this.row_cache.length;e++)this.destroyRow(this.row_cache[e],!0),this.row_cache[e]=null;this.rows=[],t&&(this.row_cache=[])}}destroyRow(t,e){const i=t.container;e?(t.destroy(),i.parentNode&&i.parentNode.removeChild(i),this.checkParent(t.tab)&&t.tab.parentNode.removeChild(t.tab)):(t.tab&&(t.tab.style.display="none"),i.style.display="none",t.unregister())}getMax(){return Array.isArray(this.schema.items)&&this.schema.additionalItems===!1?Math.min(this.schema.items.length,this.schema.maxItems||1/0):this.schema.maxItems||1/0}refreshTabs(t){this.rows.forEach(e=>{e.tab&&(t?e.tab_text.textContent=e.getHeaderText():e.tab===this.active_tab?this.theme.markTabActive(e):this.theme.markTabInactive(e))})}ensureArraySize(t){if(Array.isArray(t)||(t=[t]),this.schema.minItems)for(;t.length<this.schema.minItems;)t.push(this.getItemInfo(t.length).default);return this.getMax()&&t.length>this.getMax()&&(t=t.slice(0,this.getMax())),t}setValue(t=[],e){if(t=this.ensureArraySize(t),JSON.stringify(t)===this.serialized){e&&this.refreshValue(e);return}t.forEach((o,n)=>{if(this.rows[n])this.rows[n].setValue(o,e);else if(this.row_cache[n])this.rows[n]=this.row_cache[n],this.rows[n].setValue(o,e),this.rows[n].container.style.display="",this.rows[n].tab&&(this.rows[n].tab.style.display=""),this.rows[n].register(),this.jsoneditor.trigger("addRow",this.rows[n]);else{const a=this.addRow(o,e);this.jsoneditor.trigger("addRow",a)}});for(let o=t.length;o<this.rows.length;o++)this.destroyRow(this.rows[o]),this.rows[o]=null;this.rows=this.rows.slice(0,t.length);const i=this.rows.find(o=>o.tab===this.active_tab);let s=typeof i<"u"?i.tab:null;!s&&this.rows.length&&(s=this.rows[0].tab),this.active_tab=s,this.refreshValue(e),this.refreshTabs(!0),this.refreshTabs(),this.onChange()}setButtonState(t,e){switch(this.options.button_state_mode||this.jsoneditor.options.button_state_mode){case 1:t.style.display=e?"":"none";break;case 2:t.disabled=!e;break;default:t.style.display=e?"":"none"}}setupButtons(t){const e=[];if(!this.value.length)this.setButtonState(this.delete_last_row_button,!1),this.setButtonState(this.remove_all_rows_button,!1);else if(this.value.length===1){this.setButtonState(this.remove_all_rows_button,!1);const s=!(t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,s),e.push(s)}else{const s=!(t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,s),e.push(s);const o=!(t||this.hide_delete_all_rows_buttons);this.setButtonState(this.remove_all_rows_button,o),e.push(o)}const i=!(this.getMax()&&this.getMax()<=this.rows.length||this.hide_add_button);return this.setButtonState(this.add_row_button,i),e.push(i),e.some(s=>s)}refreshValue(t){const e=this.value?this.value.length:0;if(this.value=this.rows.map(i=>i.getValue()),e!==this.value.length||t){const i=this.schema.minItems&&this.schema.minItems>=this.rows.length;this.rows.forEach((s,o)=>{if(s.movedown_button){const n=o!==this.rows.length-1;this.setButtonState(s.movedown_button,n)}s.delete_button&&this.setButtonState(s.delete_button,!i),this.value[o]=s.getValue()}),this.setupButtons(i)&&!this.collapsed?this.controls.style.display="inline-block":this.controls.style.display="none"}this.serialized=JSON.stringify(this.value)}addRow(t,e){const i=this.rows.length;this.rows[i]=this.getElementEditor(i),this.row_cache[i]=this.rows[i],this.tabs_holder&&(this.rows[i].tab_text=document.createElement("span"),this.rows[i].tab_text.textContent=this.rows[i].getHeaderText(),this.schema.format==="tabs-top"?(this.rows[i].tab=this.theme.getTopTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTopTab(this.tabs_holder,this.rows[i].tab)):(this.rows[i].tab=this.theme.getTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTab(this.tabs_holder,this.rows[i].tab)),this.rows[i].tab.addEventListener("click",o=>{this.active_tab=this.rows[i].tab,this.refreshTabs(),o.preventDefault(),o.stopPropagation()}));const s=this.rows[i].title_controls||this.rows[i].array_controls;return this.hide_delete_buttons||(this.rows[i].delete_button=this._createDeleteButton(i,s)),this.show_copy_button&&(this.rows[i].copy_button=this._createCopyButton(i,s)),i&&!this.hide_move_buttons&&(this.rows[i].moveup_button=this._createMoveUpButton(i,s)),this.hide_move_buttons||(this.rows[i].movedown_button=this._createMoveDownButton(i,s)),typeof t<"u"&&this.rows[i].setValue(t,e),this.refreshTabs(),this.rows[i]}_createDeleteButton(t,e){const i=this.getButton(this.getItemTitle(),"delete","button_delete_row_title",[this.getItemTitle()]);return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{if(s.preventDefault(),s.stopPropagation(),!this.askConfirmation())return!1;const o=s.currentTarget.getAttribute("data-i")*1,n=this.getValue().filter((h,c)=>c!==o);let a=null;const l=this.rows[o].getValue();this.setValue(n),this.rows[o]?a=this.rows[o].tab:this.rows[o-1]&&(a=this.rows[o-1].tab),a&&(this.active_tab=a,this.refreshTabs()),this.onChange(!0),this.jsoneditor.trigger("deleteRow",l)}),e&&e.appendChild(i),i}_createCopyButton(t,e){const i=this.getButton(this.getItemTitle(),"copy","button_copy_row_title",[this.getItemTitle()]),s=this.schema;return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",o=>{const n=this.getValue();o.preventDefault(),o.stopPropagation();const a=o.currentTarget.getAttribute("data-i")*1;n.forEach((l,h)=>{if(h===a){if(s.items.type==="string"&&s.items.format==="uuid")l=yi();else if(s.items.type==="object"&&s.items.properties)for(const c of Object.keys(l))s.items.properties&&s.items.properties[c]&&s.items.properties[c].format==="uuid"&&(l[c]=yi());n.push(l)}}),this.setValue(n),this.refreshValue(!0),this.onChange(!0)}),e.appendChild(i),i}_createMoveUpButton(t,e){const i=this.getButton("",this.schema.format==="tabs-top"?"moveleft":"moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const o=s.currentTarget.getAttribute("data-i")*1;if(o<=0)return;const n=this.getValue(),a=n[o-1];n[o-1]=n[o],n[o]=a,this.setValue(n),this.active_tab=this.rows[o-1].tab,this.refreshTabs(),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[o-1])}),e&&e.appendChild(i),i}_createMoveDownButton(t,e){const i=this.getButton("",this.schema.format==="tabs-top"?"moveright":"movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const o=s.currentTarget.getAttribute("data-i")*1,n=this.getValue();if(o>=n.length-1)return;const a=n[o+1];n[o+1]=n[o],n[o]=a,this.setValue(n),this.active_tab=this.rows[o+1].tab,this.refreshTabs(),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[o+1])}),e&&e.appendChild(i),i}addControls(){this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.options.collapsed&&se(this.toggle_button,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton(),this.tabs&&(this.add_row_button.classList.add("je-array-control-btn"),this.delete_last_row_button.classList.add("je-array-control-btn"),this.remove_all_rows_button.classList.add("je-array-control-btn"))}_createToggleButton(){const t=this.getButton("","collapse","button_collapse");t.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(t,this.title.childNodes[0]);const e=this.row_holder.style.display,i=this.controls.style.display;return t.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.panel&&this.setButtonState(this.panel,this.collapsed),this.tabs_holder&&this.setButtonState(this.tabs_holder,this.collapsed),this.collapsed?(this.collapsed=!1,this.row_holder.style.display=e,this.controls.style.display=i,this.setButtonText(s.currentTarget,"","collapse","button_collapse")):(this.collapsed=!0,this.row_holder.style.display="none",this.controls.style.display="none",this.setButtonText(s.currentTarget,"","expand","button_expand"))}),t}_createAddRowButton(){const t=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-add"),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const i=this.rows.length;let s;this.row_cache[i]?(s=this.rows[i]=this.row_cache[i],this.rows[i].setValue(this.rows[i].getDefault(),!0),this.rows[i].container.style.display="",this.rows[i].tab&&(this.rows[i].tab.style.display=""),this.rows[i].register()):s=this.addRow(),this.active_tab=this.rows[i].tab,this.refreshTabs(),this.refreshValue(),this.onChange(!0),this.jsoneditor.trigger("addRow",s)}),this.controls.appendChild(t),t}_createDeleteLastRowButton(){const t=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-deletelast"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();let s=null;const o=i.pop();this.setValue(i),this.rows[this.rows.length-1]&&(s=this.rows[this.rows.length-1].tab),s&&(this.active_tab=s,this.refreshTabs()),this.onChange(!0),this.jsoneditor.trigger("deleteRow",o)}),this.controls.appendChild(t),t}_createRemoveAllRowsButton(){const t=this.getButton("button_delete_all","delete","button_delete_all_title");return t.classList.add("json-editor-btntype-deleteall"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();this.empty(!0),this.setValue([]),this.onChange(!0),this.jsoneditor.trigger("deleteAllRows",i)}),this.controls.appendChild(t),t}showValidationErrors(t){const e=[],i=[];t.forEach(s=>{s.path===this.path?e.push(s):i.push(s)}),this.error_holder&&(e.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",e.forEach(s=>{this.error_holder.appendChild(this.theme.getErrorMessage(s.message))})):this.error_holder.style.display="none"),this.rows.forEach(s=>s.showValidationErrors(i))}}Zr.rules=uc;class us extends Bt{onInputChange(){this.value=this.input.value,this.onChange(!0)}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){let t=this.getTitle().length;return Object.keys(this.select_values).forEach(e=>t=Math.max(t,`${this.select_values[e]}`.length+4)),Math.min(12,Math.max(t/7,2))}preBuild(){super.preBuild(),this.select_options={},this.select_values={},this.option_titles=[],this.option_keys=[],this.option_enum=[];let t;const e=this.jsoneditor.expandRefs(this.schema.items||{}),i=e.enum||[],s=e.options?e.options.enum||[]:[],o=e.options?e.options.enum_titles||[]:[];for(t=0;t<i.length;t++){if(this.sanitize(i[t])!==i[t])continue;const n=s[t]||{};"title"in n||(n.title=`${o[t]||i[t]}`),this.option_keys.push(`${i[t]}`),this.option_enum.push(n),this.select_values[`${i[t]}`]=i[t]}}build(){let t;if(this.options.compact||(this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),!this.schema.format&&this.option_keys.length<8||this.schema.format==="checkbox"){for(this.input_type="checkboxes",this.inputs={},this.controls={},t=0;t<this.option_keys.length;t++){const e=this.formname+t.toString();this.inputs[this.option_keys[t]]=this.theme.getCheckbox(),this.inputs[this.option_keys[t]].id=e,this.select_options[this.option_keys[t]]=this.inputs[this.option_keys[t]];const i=this.theme.getCheckboxLabel(this.option_enum[t].title);if(i.htmlFor=e,this.option_enum[t].infoText){const s=this.theme.getInfoButton(this.translateProperty(this.option_enum[t].infoText));i.appendChild(s)}this.controls["_"+this.option_keys[t]]=this.theme.getFormControl(i,this.inputs[this.option_keys[t]])}this.control=this.theme.getMultiCheckboxHolder(this.controls,this.label,this.description,this.infoButton),this.inputs.controlgroup=this.inputs.controls=this.control}else{for(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.input_type="select",this.input=this.theme.getSelectInput(this.option_keys,!0),this.theme.setSelectOptions(this.input,this.option_keys,this.option_enum.map(e=>e.title)),this.input.setAttribute("multiple","multiple"),this.input.size=Math.min(10,this.option_keys.length),t=0;t<this.option_keys.length;t++)this.select_options[this.option_keys[t]]=this.input.children[t];this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton,this.formname)}(this.schema.readOnly||this.schema.readonly)&&this.disable(!0),this.container.appendChild(this.control),this.multiselectChangeHandler=e=>{const i=[];for(t=0;t<this.option_keys.length;t++)this.select_options[this.option_keys[t]]&&(this.select_options[this.option_keys[t]].selected||this.select_options[this.option_keys[t]].checked)&&i.push(this.select_values[this.option_keys[t]]);this.updateValue(i),this.onChange(!0)},this.control.addEventListener("change",this.multiselectChangeHandler,!1),window.requestAnimationFrame(()=>{this.afterInputReady()})}postBuild(){super.postBuild()}afterInputReady(){this.theme.afterInputReady(this.input||this.inputs)}setValue(t,e){t=t||[],Array.isArray(t)||(t=[t]),t=t.map(i=>`${i}`),Object.keys(this.select_options).forEach(i=>{this.select_options[i][this.input_type==="select"?"selected":"checked"]=t.includes(i)}),this.updateValue(t),this.onChange(!0)}removeValue(t){t=[].concat(t),this.setValue(this.getValue().filter(e=>!t.includes(e)))}addValue(t){this.setValue(this.getValue().concat(t))}updateValue(t){let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_options[`${t[s]}`]){e=!0;continue}const o=this.sanitize(this.select_values[t[s]]);i.push(o),o!==t[s]&&(e=!0)}return this.value=i,e}sanitize(t){return this.schema.items.type==="boolean"?!!t:this.schema.items.type==="number"?1*t||0:this.schema.items.type==="integer"?Math.floor(t*1||0):`${t}`}enable(){this.always_disabled||(this.input?this.input.disabled=!1:this.inputs&&Object.keys(this.inputs).forEach(t=>this.inputs[t].disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.input?this.input.disabled=!0:this.inputs&&Object.keys(this.inputs).forEach(e=>this.inputs[e].disabled=!0),super.disable()}destroy(){super.destroy()}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}showValidationErrors(t){const e=new RegExp(`^${this.escapeRegExp(this.path)}(\\.\\d+)?$`),i=(o,n)=>(n.path.match(e)&&o.push(n.message),o),s=t.reduce(i,[]);s.length?this.theme.addInputError(this.input||this.inputs,`${s.join(". ")}.`):this.theme.removeInputError(this.input||this.inputs)}}class mc extends us{setValue(t,e){this.choices_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.choices_instance.removeActiveItems(),this.choices_instance.setChoiceByValue(this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){if(window.Choices&&!this.choices_instance){const t=this.expandCallbacks("choices",$({},{removeItems:!0,removeItemButton:!0},this.defaults.options.choices||{},this.options.choices||{},{addItems:!0,editItems:!1,duplicateItemsAllowed:!1}));this.newEnumAllowed=!1,this.choices_instance=new window.Choices(this.input,t),this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=e=>{const i=this.choices_instance.getValue(!0);this.updateValue(i),this.onChange(!0)},this.control.addEventListener("change",this.multiselectChangeHandler,!1)}super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const o=this.sanitize(this.select_values[t[s]]);i.push(o),o!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){return this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.schema.items.enum.push(t),this.choices_instance.setChoices([{value:`${t}`,label:`${t}`}],"value","label",!1),!0}enable(){!this.always_disabled&&this.choices_instance&&this.choices_instance.enable(),super.enable()}disable(t){this.choices_instance&&this.choices_instance.disable(),super.disable(t)}destroy(){this.choices_instance&&(this.choices_instance.destroy(),this.choices_instance=null),super.destroy()}}class gc extends us{setValue(t,e){this.select2_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.select2v4?this.select2_instance.val(this.value).change():this.select2_instance.select2("val",this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){let t;window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2&&!this.select2_instance&&(t=this.expandCallbacks("select2",$({},{tags:!0,width:"100%"},this.defaults.options.select2||{},this.options.select2||{})),this.newEnumAllowed=t.tags=!!t.tags&&this.schema.items&&this.schema.items.type==="string",this.select2_instance=window.jQuery(this.input).select2(t),this.select2v4=Wt(this.select2_instance.select2,"amd"),this.selectChangeHandler=()=>{const e=this.select2v4?this.select2_instance.val():this.select2_instance.select2("val");this.updateValue(e),this.onChange(!0)},this.select2_instance.on("select2-blur",this.selectChangeHandler),this.select2_instance.on("change",this.selectChangeHandler)),super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const o=this.sanitize(this.select_values[t[s]]);i.push(o),o!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.schema.items.enum.push(t);const e=this.input.querySelector(`option[value="${t}"]`);return e?e.removeAttribute("data-select2-tag"):this.input.appendChild(new Option(t,t,!1,!1)).trigger("change"),!0}enable(){!this.always_disabled&&this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!1):this.select2_instance.select2("enable",!0)),super.enable()}disable(t){this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!0):this.select2_instance.select2("enable",!1)),super.disable()}destroy(){this.select2_instance&&(this.select2_instance.select2("destroy"),this.select2_instance=null),super.destroy()}}class bc extends us{setValue(t,e){this.selectize_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.selectize_instance.setValue(this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){let t;if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.selectize&&!this.selectize_instance){t=this.expandCallbacks("selectize",$({},{plugins:["remove_button"],delimiter:!1,createOnBlur:!0,create:!0},this.defaults.options.selectize||{},this.options.selectize||{})),this.newEnumAllowed=t.create=!!t.create&&this.schema.items&&this.schema.items.type==="string",this.selectize_instance=window.jQuery(this.input).selectize(t)[0].selectize,this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=s=>{const o=this.selectize_instance.getValue();this.updateValue(o),this.onChange(!0)},this.selectize_instance.on("change",this.multiselectChangeHandler);const e=this.theme.getHiddenLabel(this.formname);this.input.setAttribute("id",this.formname+"-hidden-input"),e.setAttribute("for",this.formname+"-hidden-input"),this.input.parentNode.insertBefore(e,this.input);const i=this.selectize_instance.$control[0];if(i){const s=this.theme.getHiddenLabel(this.formname);s.setAttribute("for",this.formname+"-selectized"),i.appendChild(s)}}super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const o=this.sanitize(this.select_values[t[s]]);i.push(o),o!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){return this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.selectize_instance.addOption({text:t,value:t}),!0}enable(){!this.always_disabled&&this.selectize_instance&&this.selectize_instance.unlock(),super.enable()}disable(t){this.selectize_instance&&this.selectize_instance.lock(),super.disable(t)}destroy(){this.selectize_instance&&(this.selectize_instance.destroy(),this.selectize_instance=null),super.destroy()}}class fc extends Gt{postBuild(){window.Autocomplete&&(this.autocomplete_wrapper=document.createElement("div"),this.input.parentNode.insertBefore(this.autocomplete_wrapper,this.input.nextSibling),this.autocomplete_wrapper.appendChild(this.input),this.autocomplete_dropdown=document.createElement("ul"),this.input.parentNode.insertBefore(this.autocomplete_dropdown,this.input.nextSibling)),super.postBuild()}afterInputReady(){let t;window.Autocomplete&&!this.autocomplete_instance&&(t=this.expandCallbacks("autocomplete",$({},{search:e=>(console.log(`No "search" callback defined for autocomplete in property "${e.key}"`),[]),onSubmit:()=>{this.input.blur()},baseClass:"autocomplete"},this.defaults.options.autocomplete||{},this.options.autocomplete||{})),this.autocomplete_wrapper.classList.add(t.baseClass),this.autocomplete_dropdown.classList.add(`${t.baseClass}-result-list`),this.autocomplete_instance=new window.Autocomplete(this.autocomplete_wrapper,t)),super.afterInputReady()}destroy(){this.autocomplete_instance&&(this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.autocomplete_dropdown&&this.autocomplete_dropdown.parentNode&&this.autocomplete_dropdown.parentNode.removeChild(this.autocomplete_dropdown),this.autocomplete_wrapper&&this.autocomplete_wrapper.parentNode&&this.autocomplete_wrapper.parentNode.removeChild(this.autocomplete_wrapper),this.autocomplete_instance=null),super.destroy()}}class yc extends Bt{getNumColumns(){return 4}setFileReaderListener(t){t.addEventListener("load",e=>{if(this.count===this.current_item_index)this.value[this.count][this.key]=e.target.result;else{const i={};for(const s in this.parent.schema.properties)i[s]="";i[this.key]=e.target.result,this.value.splice(this.count,0,i)}this.count+=1,this.count===this.total+this.current_item_index&&this.arrayEditor.setValue(this.value)})}build(){if(this.options.compact||(this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(!window.FileReader)throw new Error("FileReader required for base64 editor");this.uploader=this.theme.getFormInputField("file"),this.uploader.style.display="none",this.schema.options&&this.schema.options.multiple&&this.schema.options.multiple===!0&&this.parent&&this.parent.schema.type==="object"&&this.parent.parent&&this.parent.parent.schema.type==="array"&&this.uploader.setAttribute("multiple",""),this.uploader.addEventListener("change",e=>{if(e.preventDefault(),e.stopPropagation(),e.currentTarget.files&&e.currentTarget.files.length)if(e.currentTarget.files.length>1&&this.schema.options&&this.schema.options.multiple&&this.schema.options.multiple===!0&&this.parent&&this.parent.schema.type==="object"&&this.parent.parent&&this.parent.parent.schema.type==="array"){this.arrayEditor=this.jsoneditor.getEditor(this.parent.parent.path),this.value=this.arrayEditor.getValue(),this.total=e.currentTarget.files.length,this.current_item_index=parseInt(this.parent.key),this.count=this.current_item_index;for(let i=0;i<this.total;i++){const s=new FileReader;this.setFileReaderListener(s),s.readAsDataURL(e.currentTarget.files[i])}}else{let i=new FileReader;i.onload=s=>{this.value=s.target.result,this.refreshPreview(),this.onChange(!0),i=null},i.readAsDataURL(e.currentTarget.files[0])}})}this.preview=this.theme.getFormInputDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.preview),this.control=this.theme.getFormControl(this.label,this.uploader||this.input,this.preview,this.infoButton),this.container.appendChild(this.control);const t=this.getButton("button_upload","upload","button_upload");t.addEventListener("click",()=>{this.uploader.click()}),this.control.appendChild(t)}refreshPreview(){if(this.last_preview===this.value||(this.last_preview=this.value,this.preview.innerHTML="",!this.value))return;let t=this.value.match(/^data:([^;,]+)[;,]/);if(t&&(t=t[1]),!t)this.preview.innerHTML="<em>Invalid data URI</em>";else if(this.preview.innerHTML=`<strong>Type:</strong> ${t}, <strong>Size:</strong> ${Math.floor((this.value.length-this.value.split(",")[0].length-1)/1.33333)} bytes`,t.substr(0,5)==="image"){this.preview.innerHTML+="<br>";const e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.src=this.value,this.preview.appendChild(e)}}enable(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),super.disable()}setValue(t){this.value!==t&&(this.schema.readOnly&&this.schema.enum&&!this.schema.enum.includes(t)?this.value=this.schema.enum[0]:this.value=t,this.input.value=this.value,this.refreshPreview(),this.onChange())}destroy(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),super.destroy()}}class zn extends Bt{constructor(t,e){super(t,e),this.active=!1,this.isUiOnly=!0,this.parent&&this.parent.schema&&(Array.isArray(this.parent.schema.required)?this.parent.schema.required.includes(this.key)||this.parent.schema.required.push(this.key):this.parent.schema.required=[this.key])}build(){this.options.compact=!0;const t=this.expandCallbacks("button",$({},{icon:"",validated:!1,align:"left",action:(i,s)=>{window.alert(`No button action defined for "${i.path}"`)}},this.defaults.options.button||{},this.options.button||{})),e=this.translateProperty(t.text||this.schema.title)||this.key;this.input=this.getButton(e,t.icon,e),typeof t.action!="function"?window.alert(`No button action defined for "${this.path}"`):this.input.addEventListener("click",t.action,!1),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.disable(!0),this.input.setAttribute("readonly","true")),this.setInputAttributes(["readonly"]),this.control=this.theme.getFormButtonHolder(t.align),this.control.appendChild(this.input),this.container.appendChild(this.control),this.changeHandler=()=>{this.jsoneditor.validate(this.jsoneditor.getValue()).length>0?this.disable():this.enable()},t.validated&&this.jsoneditor.on("change",this.changeHandler)}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}getNumColumns(){return 2}activate(){this.active=!1,this.enable()}deactivate(){this.isRequired()||(this.active=!1,this.disable())}destroy(){this.jsoneditor.off("change",this.changeHandler),this.changeHandler=null,super.destroy()}}class vc extends Bt{setValue(t,e){t=!!t;const i=this.getValue()!==t;this.value=t,this.input.checked=this.value,e||(this.is_dirty=!0),this.onChange(i)}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){return Math.min(12,Math.max(this.getTitle().length/7,2))}build(){this.parent.options.table_row||(this.label=this.header=this.theme.getCheckboxLabel(this.getTitle(),this.isRequired()),this.label.htmlFor=this.formname),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&!this.options.compact&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.input=this.theme.getCheckbox(),this.input.id=this.formname,this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.input.addEventListener("change",t=>{t.preventDefault(),t.stopPropagation(),this.value=t.currentTarget.checked,this.is_dirty=!0,this.onChange(!0)}),this.container.appendChild(this.control)}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}showValidationErrors(t){const e=this.jsoneditor.options.show_errors;if(e==="never"||(e==="change"||e==="interaction")&&!this.is_dirty)return;const s=(n,a)=>(a.path===this.path&&n.push(a.message),n),o=t.reduce(s,[]);this.input.controlgroup=this.control,o.length?this.theme.addInputError(this.input,`${o.join(". ")}.`):this.theme.removeInputError(this.input)}}class xi extends Bt{setValue(t,e){let i=this.typecast(t);const s=!!this.jsoneditor.options.use_default_values||typeof this.schema.default<"u";(this.enum_options.length>0&&!this.enum_values.includes(i)||e&&!this.isRequired()&&!s)&&(i=this.enum_values[0]),this.value!==i&&(this.input.value=this.enum_options[this.enum_values.indexOf(i)],this.value=i,e||(this.is_dirty=!0),this.onChange(),this.change())}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){if(!this.enum_options)return 3;let t=this.getTitle().length;for(let e=0;e<this.enum_options.length;e++)t=Math.max(t,this.enum_options[e].length+4);return Math.min(12,Math.max(t/7,2))}typecast(t){return this.schema.type==="boolean"?t==="undefined"||t===void 0?void 0:!!t:this.schema.type==="number"?1*t||0:this.schema.type==="integer"?Math.floor(t*1||0):this.schema.enum&&t===void 0?void 0:`${t}`}getValue(){if(this.dependenciesFulfilled)return this.typecast(this.value)}preBuild(){this.input_type="select",this.enum_options=[],this.enum_values=[],this.enum_display=[];let t,e;if(this.schema.enum){const i=this.schema.options&&this.schema.options.enum_titles||[];this.schema.enum.forEach((s,o)=>{this.enum_options[o]=`${s}`,this.enum_display[o]=`${this.translateProperty(i[o])||s}`,this.enum_values[o]=this.typecast(s)})}else if(this.schema.type==="boolean")this.enum_display=this.schema.options&&this.schema.options.enum_titles||["true","false"],this.enum_options=["1",""],this.enum_values=[!0,!1],this.isRequired()||(this.enum_display.unshift(" "),this.enum_options.unshift("undefined"),this.enum_values.unshift(void 0));else if(this.schema.enumSource){if(this.enumSource=[],this.enum_display=[],this.enum_options=[],this.enum_values=[],!Array.isArray(this.schema.enumSource))this.schema.enumValue?this.enumSource=[{source:this.schema.enumSource,value:this.schema.enumValue}]:this.enumSource=[{source:this.schema.enumSource}];else for(t=0;t<this.schema.enumSource.length;t++)typeof this.schema.enumSource[t]=="string"?this.enumSource[t]={source:this.schema.enumSource[t]}:Array.isArray(this.schema.enumSource[t])?this.enumSource[t]=this.schema.enumSource[t]:this.enumSource[t]=$({},this.schema.enumSource[t]);for(t=0;t<this.enumSource.length;t++)this.enumSource[t].value&&(e=this.expandCallbacks("template",{template:this.enumSource[t].value}),typeof e.template=="function"?this.enumSource[t].value=e.template:this.enumSource[t].value=this.jsoneditor.compileTemplate(this.enumSource[t].value,this.template_engine)),this.enumSource[t].title&&(e=this.expandCallbacks("template",{template:this.enumSource[t].title}),typeof e.template=="function"?this.enumSource[t].title=e.template:this.enumSource[t].title=this.jsoneditor.compileTemplate(this.enumSource[t].title,this.template_engine)),this.enumSource[t].filter&&this.enumSource[t].value&&(e=this.expandCallbacks("template",{template:this.enumSource[t].filter}),typeof e.template=="function"?this.enumSource[t].filter=e.template:this.enumSource[t].filter=this.jsoneditor.compileTemplate(this.enumSource[t].filter,this.template_engine))}else throw new Error("'select' editor requires the enum property to be set.")}build(){this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.input=this.theme.getSelectInput(this.enum_options,!1),this.theme.setSelectOptions(this.input,this.enum_options,this.enum_display),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.setInputAttributes([]),this.input.addEventListener("change",t=>{t.preventDefault(),t.stopPropagation(),this.onInputChange()}),this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton,this.formname),this.container.appendChild(this.control),this.value=this.enum_values[0],window.requestAnimationFrame(()=>{this.input.parentNode&&this.afterInputReady()})}afterInputReady(){this.theme.afterInputReady(this.input)}onInputChange(){const t=this.typecast(this.input.value);let e;this.enum_values.includes(t)?e=this.enum_values[this.enum_values.indexOf(t)]:e=this.enum_values[0],e!==this.value&&(this.is_dirty=!0,this.value=e,this.onChange(!0))}onWatchedFieldChange(){let t,e,i=[],s=[];if(this.enumSource){t=this.getWatchedFieldValues();for(let n=0;n<this.enumSource.length;n++)if(Array.isArray(this.enumSource[n]))i=i.concat(this.enumSource[n]),s=s.concat(this.enumSource[n]);else{let a=[];if(Array.isArray(this.enumSource[n].source)?a=this.enumSource[n].source:a=t[this.enumSource[n].source],a){if(this.enumSource[n].slice&&(a=Array.prototype.slice.apply(a,this.enumSource[n].slice)),this.enumSource[n].filter){const c=[];for(e=0;e<a.length;e++)this.enumSource[n].filter({i:e,item:a[e],watched:t})&&c.push(a[e]);a=c}const l=[],h=[];for(e=0;e<a.length;e++){const c=a[e];this.enumSource[n].value?h[e]=this.typecast(this.enumSource[n].value({i:e,item:c})):h[e]=a[e],this.enumSource[n].title?l[e]=this.enumSource[n].title({i:e,item:c}):l[e]=h[e]}this.enumSource[n].sort&&((c,p,b)=>{c.map((g,y)=>({v:g,t:p[y]})).sort((g,y)=>g.v<y.v?-b:g.v===y.v?0:b).forEach((g,y)=>{c[y]=g.v,p[y]=g.t})}).bind(null,h,l,this.enumSource[n].sort==="desc"?1:-1)(),i=i.concat(h),s=s.concat(l)}}const o=this.value;this.theme.setSelectOptions(this.input,i,s),this.enum_options=i,this.enum_display=s,this.enum_values=i,i.includes(o)||this.jsoneditor.options.enum_source_value_auto_select!==!1?(this.input.value=o,this.value=o):(this.input.value=i[0],this.value=this.typecast(i[0]||""),this.parent&&!this.watchLoop?this.parent.onChildEditorChange(this):this.jsoneditor.onChange(),this.jsoneditor.notifyWatchers(this.path))}super.onWatchedFieldChange()}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable(t)}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}showValidationErrors(t){const e=this.jsoneditor.options.show_errors;if(e==="never"||(e==="change"||e==="interaction")&&!this.is_dirty)return;const s=(n,a)=>(a.path===this.path&&n.push(a.message),n),o=t.reduce(s,[]);o.length?this.theme.addInputError(this.input,`${o.join(". ")}.`):this.theme.removeInputError(this.input)}}const _c={".choices > *":"box-sizing:border-box"};class qn extends xi{setValue(t,e){if(this.choices_instance){let i=this.typecast(t||"");if(this.enum_values.includes(i)||(i=this.enum_values[0]),this.value===i)return;e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.input.value=this.enum_options[this.enum_values.indexOf(i)],this.choices_instance.setChoiceByValue(this.input.value),this.value=i,this.onChange()}else super.setValue(t,e)}afterInputReady(){if(window.Choices&&!this.choices_instance){const t=this.expandCallbacks("choices",$({},this.defaults.options.choices||{},this.options.choices||{}));this.choices_instance=new window.Choices(this.input,t)}super.afterInputReady()}onWatchedFieldChange(){if(super.onWatchedFieldChange(),this.choices_instance){const t=this.enum_options.map((e,i)=>({value:e,label:this.enum_display[i]}));this.choices_instance.setChoices(t,"value","label",!0),this.choices_instance.setChoiceByValue(`${this.value}`)}}enable(){!this.always_disabled&&this.choices_instance&&this.choices_instance.enable(),super.enable()}disable(t){this.choices_instance&&this.choices_instance.disable(),super.disable(t)}destroy(){this.choices_instance&&(this.choices_instance.destroy(),this.choices_instance=null),super.destroy()}}qn.rules=_c;class wc extends Gt{build(){if(super.build(),!!this.input&&(this.schema.max&&typeof this.schema.max=="string"&&this.input.setAttribute("max",this.schema.max),this.schema.min&&typeof this.schema.max=="string"&&this.input.setAttribute("min",this.schema.min),window.flatpickr&&typeof this.options.flatpickr=="object")){this.options.flatpickr.enableTime=this.schema.format!=="date",this.options.flatpickr.noCalendar=this.schema.format==="time",this.schema.type==="integer"&&(this.options.flatpickr.mode="single"),this.input.setAttribute("data-input","");let{input:t}=this;if(this.options.flatpickr.wrap===!0){const e=[];if(this.options.flatpickr.showToggleButton!==!1){const n=this.getButton("",this.schema.format==="time"?"time":"calendar","flatpickr_toggle_button");n.setAttribute("data-toggle",""),e.push(n)}if(this.options.flatpickr.showClearButton!==!1){const n=this.getButton("","clear","flatpickr_clear_button");n.setAttribute("data-clear",""),e.push(n)}const{parentNode:i}=this.input,{nextSibling:s}=this.input,o=this.theme.getInputGroup(this.input,e);o!==void 0?(this.options.flatpickr.inline=!1,i.insertBefore(o,s),t=o):this.options.flatpickr.wrap=!1}this.flatpickr=window.flatpickr(t,this.options.flatpickr),this.options.flatpickr.inline===!0&&this.options.flatpickr.inlineHideInput===!0&&this.input.setAttribute("type","hidden")}}getValue(){if(!this.dependenciesFulfilled)return;if(this.schema.type==="string")return this.value;if(this.value===""||this.value===void 0)return;const t=this.schema.format==="time"?`1970-01-01 ${this.value}`:this.value;return parseInt(new Date(t).getTime()/1e3)}setValue(t,e,i){if(this.schema.type==="string")super.setValue(t,e,i),this.flatpickr&&this.flatpickr.setDate(t);else if(t>0){const s=new Date(t*1e3),o=s.getFullYear(),n=this.zeroPad(s.getMonth()+1),a=this.zeroPad(s.getDate()),l=this.zeroPad(s.getHours()),h=this.zeroPad(s.getMinutes()),c=this.zeroPad(s.getSeconds()),p=[o,n,a].join("-"),b=[l,h,c].join(":");let g=`${p}T${b}`;this.schema.format==="date"?g=p:this.schema.format==="time"&&(g=b),this.input.value=g,this.refreshValue(),this.flatpickr&&this.flatpickr.setDate(g)}}destroy(){this.flatpickr&&this.flatpickr.destroy(),this.flatpickr=null,super.destroy()}zeroPad(t){return`0${t}`.slice(-2)}}class xc extends Bt{register(){if(this.editors){for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister();this.editors[this.currentEditor]&&this.editors[this.currentEditor].register()}super.register()}unregister(){if(super.unregister(),this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister()}getNumColumns(){return this.editors[this.currentEditor]?Math.max(this.editors[this.currentEditor].getNumColumns(),4):4}enable(){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].enable();super.enable()}disable(){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].disable();super.disable()}switchEditor(){const t=this.getWatchedFieldValues();if(!t)return;const e=document.location.origin+document.location.pathname+this.template(t);this.editors[this.refs[e]]||this.buildChildEditor(e),this.currentEditor=this.refs[e],this.register(),this.editors.forEach((i,s)=>{i&&(this.currentEditor===s?i.container.style.display="":i.container.style.display="none")}),this.refreshValue(),this.onChange(!0)}buildChildEditor(t){this.refs[t]=this.editors.length;const e=this.theme.getChildEditorHolder();this.editor_holder.appendChild(e);const i=$({},this.schema,this.jsoneditor.refs[t]),s=this.jsoneditor.getEditorClass(i,this.jsoneditor),o=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:e,path:this.path,parent:this,required:!0});this.editors.push(o),o.preBuild(),o.build(),o.postBuild()}preBuild(){this.refs={},this.editors=[],this.currentEditor="";let t;for(t=0;t<this.schema.links.length;t++)if(this.schema.links[t].rel.toLowerCase()==="describedby"){this.template=this.jsoneditor.compileTemplate(this.schema.links[t].href,this.template_engine);break}this.schema.links=this.schema.links.slice(0,t).concat(this.schema.links.slice(t+1)),this.schema.links.length===0&&delete this.schema.links,this.baseSchema=$({},this.schema)}build(){this.editor_holder=document.createElement("div"),this.container.appendChild(this.editor_holder),this.switchEditor()}onWatchedFieldChange(){this.switchEditor()}onChildEditorChange(t){this.editors[this.currentEditor]&&this.refreshValue(),super.onChildEditorChange(t)}refreshValue(){this.editors[this.currentEditor]&&(this.value=this.editors[this.currentEditor].getValue())}setValue(t,e){this.editors[this.currentEditor]&&(this.editors[this.currentEditor].setValue(t,e),this.refreshValue(),this.onChange())}destroy(){this.editors.forEach(t=>{t&&t.destroy()}),this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),super.destroy()}showValidationErrors(t){this.editors.forEach(e=>{e&&e.showValidationErrors(t)})}}class Cc extends Bt{getNumColumns(){return 4}build(){this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.container.appendChild(this.title),this.options.enum_titles=this.options.enum_titles||[],this.enum=this.schema.enum,this.selected=0,this.select_options=[],this.html_values=[];for(let t=0;t<this.enum.length;t++)this.select_options[t]=this.options.enum_titles[t]||`Value ${t+1}`,this.html_values[t]=this.getHTML(this.enum[t]);this.switcher=this.theme.getSwitcher(this.select_options),this.container.appendChild(this.switcher),this.display_area=this.theme.getIndentedPanel(),this.container.appendChild(this.display_area),this.options.hide_display&&(this.display_area.style.display="none"),this.switcher.addEventListener("change",t=>{this.selected=this.select_options.indexOf(t.currentTarget.value),this.value=this.enum[this.selected],this.refreshValue(),this.onChange(!0)}),this.value=this.enum[0],this.refreshValue(),this.enum.length===1&&(this.switcher.style.display="none")}refreshValue(){this.selected=-1;const t=JSON.stringify(this.value);if(this.enum.forEach((e,i)=>{if(t===JSON.stringify(e))return this.selected=i,!1}),this.selected<0){this.setValue(this.enum[0]);return}this.switcher.value=this.select_options[this.selected],this.display_area.innerHTML=this.html_values[this.selected]}enable(){this.always_disabled||(this.switcher.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.switcher.disabled=!0,super.disable()}getHTML(t){const e=(i,s)=>{Array.isArray(i)||typeof i.length=="number"&&i.length>0&&i.length-1 in i?Array.from(i).forEach((o,n)=>s(n,o)):Object.entries(i).forEach(([o,n])=>s(o,n))};if(t===null)return"<em>null</em>";if(typeof t=="object"){let i="";return e(t,(s,o)=>{let n=this.getHTML(o);Array.isArray(t)||(n=`<div><em>${s}</em>: ${n}</div>`),i+=`<li>${n}</li>`}),Array.isArray(t)?i=`<ol>${i}</ol>`:i=`<ul style='margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;'>${i}</ul>`,i}else{if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return t}setValue(t){this.value!==t&&(this.value=t,this.refreshValue(),this.onChange())}destroy(){this.display_area&&this.display_area.parentNode&&this.display_area.parentNode.removeChild(this.display_area),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),super.destroy()}}class Ec extends Bt{register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}setValue(t,e,i){if(this.template&&!i||(t===null||typeof t>"u"?t="":typeof t=="object"?t=JSON.stringify(t):typeof t!="string"&&(t=`${t}`),t===this.serialized))return;const s=this.sanitize(t);if(this.input.value===s)return;this.input.value=s;const o=i||this.getValue()!==t;this.refreshValue(),e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input),this.onChange(o)}getNumColumns(){return 2}enable(){super.enable()}disable(){super.disable()}refreshValue(){this.value=this.input.value,typeof this.value!="string"&&(this.value=""),this.serialized=this.value}destroy(){this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}sanitize(t){return t}onWatchedFieldChange(){let t;this.template&&(t=this.getWatchedFieldValues(),this.setValue(this.template(t),!1,!0)),super.onWatchedFieldChange()}build(){if(this.format=this.schema.format,!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.input_type="hidden",this.input=this.theme.getFormInputField(this.input_type),this.format&&this.input.setAttribute("data-schemaformat",this.format),this.container.appendChild(this.input),this.schema.template){const t=this.expandCallbacks("template",{template:this.schema.template});typeof t.template=="function"?this.template=t.template:this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()}else this.refreshValue()}}class kc extends zn{build(){this.options.compact=!1,this.header=this.label=this.theme.getLabelLike(this.getTitle()),this.description=this.theme.getDescription(this.schema.description||""),this.control=this.theme.getFormControl(this.label,this.description,null),this.container.appendChild(this.control)}getTitle(){return this.translateProperty(this.schema.title)}getNumColumns(){return 12}}class Un extends Gt{build(){if(super.build(),typeof this.schema.minimum<"u"){let{minimum:t}=this.schema;typeof this.schema.exclusiveMinimum<"u"&&(t+=1),this.input.setAttribute("min",t)}if(typeof this.schema.maximum<"u"){let{maximum:t}=this.schema;typeof this.schema.exclusiveMaximum<"u"&&(t-=1),this.input.setAttribute("max",t)}if(typeof this.schema.step<"u"){const t=this.schema.step||1;this.input.setAttribute("step",t)}this.setInputAttributes(["maxlength","pattern","readonly","min","max","step"])}getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)if(!this.schema.default&&!this.jsoneditor.options.use_default_values&&this.value===""){if(this.shouldBeUnset()){this.input.value="";return}}else return lc(this.value)?parseFloat(this.value):this.value}}class Wn extends Un{getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)if(!this.schema.default&&!this.jsoneditor.options.use_default_values&&this.value===""){if(this.shouldBeUnset())return}else return dc(this.value)?parseInt(this.value):this.value}}class Lc extends Gt{preBuild(){if(super.preBuild(),this.schema.options||(this.schema.options={}),!this.schema.options.cleave)switch(this.format){case"ipv6":this.schema.options.cleave={delimiters:[":"],blocks:[4,4,4,4,4,4,4,4],uppercase:!0};break;case"ipv4":this.schema.options.cleave={delimiters:["."],blocks:[3,3,3,3],numericOnly:!0};break}this.options=$(this.options,this.schema.options||{})}}class Ac extends Gt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.jodit_instance&&this.jodit_instance.setEditorValue(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;window.Jodit?(t=this.expandCallbacks("jodit",$({},{height:300},this.defaults.options.jodit||{},this.options.jodit||{})),this.jodit_instance=new window.Jodit(this.input,t),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&this.jodit_instance.setReadOnly(!0),this.jodit_instance.events.on("change",()=>{this.value=this.jodit_instance.getEditorValue(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)):super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.jodit_instance&&this.jodit_instance.setReadOnly(!1),super.enable()}disable(t){this.jodit_instance&&this.jodit_instance.setReadOnly(!0),super.disable(t)}destroy(){this.jodit_instance&&(this.jodit_instance.destruct(),this.jodit_instance=null),super.destroy()}}const jc=r=>{const t=r.split(".");if(t.length!==4)throw new Error("error_ipv4");t.forEach(e=>{if(isNaN(+e)||+e<0||+e>255)throw new Error("error_ipv4")})},Sc=r=>{if(!r.match("^(?:(?:(?:[a-fA-F0-9]{1,4}:){6}|(?=(?:[a-fA-F0-9]{0,4}:){2,6}(?:[0-9]{1,3}.){3}[0-9]{1,3}$)(([0-9a-fA-F]{1,4}:){1,5}|:)((:[0-9a-fA-F]{1,4}){1,5}:|:)|::(?:[a-fA-F0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}|(?=(?:[a-fA-F0-9]{0,4}:){0,7}[a-fA-F0-9]{0,4}$)(([0-9a-fA-F]{1,4}:){1,7}|:)((:[0-9a-fA-F]{1,4}){1,7}|:)|(?:[a-fA-F0-9]{1,4}:){7}:|:(:[a-fA-F0-9]{1,4}){7})$"))throw new Error("error_ipv6")},Tc=r=>{if(!r.match("(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9].)+[a-zA-Z]{2,63}$)"))throw new Error("error_hostname")};function $c(r,t,e,i){try{switch(r.format){case"ipv4":jc(t);break;case"ipv6":Sc(t);break;case"hostname":Tc(t);break}return[]}catch(s){return[{path:e,property:"format",message:i(s.message)}]}}class Gn{constructor(t,e,i,s){this.jsoneditor=t,this.schema=e||this.jsoneditor.schema,this.options=i||{},this.translate=this.jsoneditor.translate||s.translate,this.translateProperty=this.jsoneditor.translateProperty||s.translateProperty,this.defaults=s,this._validateSubSchema={dependentRequired(o,n,a){const l=[];if(typeof o.dependentRequired<"u"){let h=[];Object.keys(o.dependentRequired).forEach(c=>{typeof n[c]<"u"&&(h=o.dependentRequired[c].filter(p=>!Wt(n,p)))}),h.length>0&&l.push({message:"Must have the required properties: "+h.join(", "),path:a})}return l},dependentSchemas(o,n,a){let l=[];return Object.keys(o.dependentSchemas).forEach(h=>{if(typeof n[h]<"u"){const c=o.dependentSchemas[h],p=this._validateSchema(c,n,a);l=[...l,...p]}}),l},contains(o,n,a){const l=[];let h=0;n.forEach(p=>{this._validateSchema(o.contains,p,a).length===0&&h++});const c=h===0;return typeof o.minContains<"u"?h<o.minContains&&l.push({message:this.translate("error_minContains",[h,o.minContains],o),path:a}):c&&l.push({message:this.translate("error_contains",null,o),path:a}),typeof o.maxContains<"u"&&h>o.maxContains&&l.push({message:this.translate("error_maxContains",[h,o.maxContains],o),path:a}),l},if(o,n,a){if(typeof o.then>"u"&&typeof o.else>"u")return[];const l=this._validateSchema(o.if,n,a);let h=[],c=[];return typeof o.then<"u"&&(h=this._validateSchema(o.then,n,a)),typeof o.else<"u"&&(c=this._validateSchema(o.else,n,a)),o.if===!0?h:o.if===!1?c:l.length===0?h:l.length>0?c:[]},const(o,n,a){return JSON.stringify(o.const)===JSON.stringify(n)?[]:[{path:a,property:"const",message:this.translate("error_const",null,o)}]},enum(o,n,a){const l=JSON.stringify(n);return o.enum.some(h=>l===JSON.stringify(h))?[]:[{path:a,property:"enum",message:this.translate("error_enum",null,o)}]},extends(o,n,a){const l=(h,c)=>(h.push(...this._validateSchema(c,n,a)),h);return o.extends.reduce(l,[])},allOf(o,n,a){const l=(h,c)=>(h.push(...this._validateSchema(c,n,a)),h);return o.allOf.reduce(l,[])},anyOf(o,n,a){return o.anyOf.some(l=>!this._validateSchema(l,n,a).length)?[]:[{path:a,property:"anyOf",message:this.translate("error_anyOf",null,o)}]},oneOf(o,n,a){let l=0;const h=[];o.oneOf.forEach((p,b)=>{const g=this._validateSchema(p,n,a);g.length||l++,g.forEach(y=>{y.path=`${a}.oneOf[${b}]${y.path.substr(a.length)}`}),h.push(...g)});const c=[];return l!==1&&(c.push({path:a,property:"oneOf",message:this.translate("error_oneOf",[l],o)}),c.push(...h)),c},not(o,n,a){return this._validateSchema(o.not,n,a).length?[]:[{path:a,property:"not",message:this.translate("error_not",null,o)}]},type(o,n,a){if(Array.isArray(o.type)){if(!o.type.some(l=>this._checkType(l,n)))return[{path:a,property:"type",message:this.translate("error_type_union",null,o)}]}else if(["date","time","datetime-local"].includes(o.format)&&o.type==="integer"){if(!this._checkType("string",`${n}`))return[{path:a,property:"type",message:this.translate("error_type",[o.format],o)}]}else if(!this._checkType(o.type,n))return[{path:a,property:"type",message:this.translate("error_type",[o.type],o)}];return[]},disallow(o,n,a){if(Array.isArray(o.disallow)){if(o.disallow.some(l=>this._checkType(l,n)))return[{path:a,property:"disallow",message:this.translate("error_disallow_union",null,o)}]}else if(this._checkType(o.disallow,n))return[{path:a,property:"disallow",message:this.translate("error_disallow",[o.disallow],o)}];return[]}},this._validateNumberSubSchema={multipleOf(o,n,a){return this._validateNumberSubSchemaMultipleDivisible(o,n,a)},divisibleBy(o,n,a){return this._validateNumberSubSchemaMultipleDivisible(o,n,a)},maximum(o,n,a){let l=o.exclusiveMaximum?n<o.maximum:n<=o.maximum;return window.math?l=window.math[o.exclusiveMaximum?"smaller":"smallerEq"](window.math.bignumber(n),window.math.bignumber(o.maximum)):window.Decimal&&(l=new window.Decimal(n)[o.exclusiveMaximum?"lt":"lte"](new window.Decimal(o.maximum))),l?[]:[{path:a,property:"maximum",message:this.translate(o.exclusiveMaximum?"error_maximum_excl":"error_maximum_incl",[o.maximum],o)}]},minimum(o,n,a){let l=o.exclusiveMinimum?n>o.minimum:n>=o.minimum;return window.math?l=window.math[o.exclusiveMinimum?"larger":"largerEq"](window.math.bignumber(n),window.math.bignumber(o.minimum)):window.Decimal&&(l=new window.Decimal(n)[o.exclusiveMinimum?"gt":"gte"](new window.Decimal(o.minimum))),l?[]:[{path:a,property:"minimum",message:this.translate(o.exclusiveMinimum?"error_minimum_excl":"error_minimum_incl",[o.minimum],o)}]}},this._validateStringSubSchema={maxLength(o,n,a){const l=[];return`${n}`.length>o.maxLength&&l.push({path:a,property:"maxLength",message:this.translate("error_maxLength",[o.maxLength],o)}),l},minLength(o,n,a){return`${n}`.length<o.minLength?[{path:a,property:"minLength",message:this.translate(o.minLength===1?"error_notempty":"error_minLength",[o.minLength],o)}]:[]},pattern(o,n,a){return new RegExp(o.pattern).test(n)?[]:[{path:a,property:"pattern",message:o.options&&o.options.patternmessage?o.options.patternmessage:this.translate("error_pattern",[o.pattern],o)}]}},this._validateArraySubSchema={items(o,n,a){const l=[];if(Array.isArray(o.items))for(let h=0;h<n.length;h++)if(o.items[h])l.push(...this._validateSchema(o.items[h],n[h],`${a}.${h}`));else{if(o.additionalItems===!0)break;if(o.additionalItems)l.push(...this._validateSchema(o.additionalItems,n[h],`${a}.${h}`));else if(o.additionalItems===!1){l.push({path:a,property:"additionalItems",message:this.translate("error_additionalItems",null,o)});break}else break}else n.forEach((h,c)=>{l.push(...this._validateSchema(o.items,h,`${a}.${c}`))});return l},maxItems(o,n,a){return n.length>o.maxItems?[{path:a,property:"maxItems",message:this.translate("error_maxItems",[o.maxItems],o)}]:[]},minItems(o,n,a){return n.length<o.minItems?[{path:a,property:"minItems",message:this.translate("error_minItems",[o.minItems],o)}]:[]},uniqueItems(o,n,a){const l={};for(let h=0;h<n.length;h++){const c=JSON.stringify(n[h]);if(l[c])return[{path:a,property:"uniqueItems",message:this.translate("error_uniqueItems",null,o)}];l[c]=!0}return[]}},this._validateObjectSubSchema={maxProperties(o,n,a){return Object.keys(n).length>o.maxProperties?[{path:a,property:"maxProperties",message:this.translate("error_maxProperties",[o.maxProperties],o)}]:[]},minProperties(o,n,a){return Object.keys(n).length<o.minProperties?[{path:a,property:"minProperties",message:this.translate("error_minProperties",[o.minProperties],o)}]:[]},required(o,n,a){const l=[];return Array.isArray(o.required)&&o.required.forEach(h=>{if(typeof n[h]<"u")return;const c=this.jsoneditor.getEditor(`${a}.${h}`);c&&c.dependenciesFulfilled===!1||c&&["button","info"].includes(c.schema.format||c.schema.type)||l.push({path:a,property:"required",message:this.translate("error_required",[o&&o.properties&&o.properties[h]&&o.properties[h].title?o.properties[h].title:h],o)})}),l},properties(o,n,a,l){const h=[];return Object.entries(o.properties).forEach(([c,p])=>{l[c]=!0,h.push(...this._validateSchema(p,n[c],`${a}.${c}`))}),h},patternProperties(o,n,a,l){const h=[];return Object.entries(o.patternProperties).forEach(([c,p])=>{const b=new RegExp(c);Object.entries(n).forEach(([g,y])=>{b.test(g)&&(l[g]=!0,h.push(...this._validateSchema(p,y,`${a}.${g}`)))})}),h}},this._validateObjectSubSchema2={propertyNames(o,n,a,l){const h=[],c=Object.keys(n);let p=null;for(let b=0;b<c.length;b++){let g="",y=!1;if(p=c[b],typeof o.propertyNames=="boolean"){if(o.propertyNames===!0)continue;h.push({path:a,property:"propertyNames",message:this.translate("error_property_names_false",[p],o)});break}if(y=Object.entries(o.propertyNames).every(([w,A])=>{let G=!1,it=null;switch(w){case"maxLength":if(typeof A!="number"){g="error_property_names_maxlength";break}if(p.length>A){g="error_property_names_exceeds_maxlength";break}return!0;case"const":if(A!==p){g="error_property_names_const_mismatch";break}return!0;case"enum":if(!Array.isArray(A)){g="error_property_names_enum";break}if(A.forEach(nt=>{nt===p&&(G=!0)}),!G){g="error_property_names_enum_mismatch";break}return!0;case"pattern":if(typeof A!="string"){g="error_property_names_pattern";break}if(it=new RegExp(A),!it.test(p)){g="error_property_names_pattern_mismatch";break}return!0;default:return h.push({path:a,property:"propertyNames",message:this.translate("error_property_names_unsupported",[w],o)}),!1}return h.push({path:a,property:"propertyNames",message:this.translate(g,[p],o)}),!1}),!y)break}return h},additionalProperties(o,n,a,l){const h=[],c=Object.keys(n);for(let p=0;p<c.length;p++){const b=c[p];if(!l[b])if(o.additionalProperties){if(o.additionalProperties===!0)break;h.push(...this._validateSchema(o.additionalProperties,n[b],`${a}.${b}`))}else{h.push({path:a,property:"additionalProperties",message:this.translate("error_additional_properties",[b],o)});break}}return h},dependencies(o,n,a){const l=[];return Object.entries(o.dependencies).forEach(([h,c])=>{typeof n[h]>"u"||(Array.isArray(c)?c.forEach(p=>{typeof n[p]>"u"&&l.push({path:a,property:"dependencies",message:this.translate("error_dependency",[p],o)})}):l.push(...this._validateSchema(c,n,a)))}),l}}}fitTest(t,e,i=1e7){const s={match:0,extra:0};if(typeof t=="object"&&t!==null){const o=this._getSchema(e);if(o.anyOf){let n={...s};for(const a of o.anyOf){const l=this.fitTest(t,a,i);(l.match>n.match||l.match===n.match&&l.extra<n.extra)&&(n=l)}return n}else{const n=this._getSchema(e).properties;for(const a in n){if(!Wt(n,a)){s.extra+=i;continue}if(typeof t[a]=="object"&&typeof n[a]=="object"&&typeof n[a].properties=="object"){const l=this.fitTest(t[a],n[a],i/100);s.match+=l.match,s.extra+=l.extra}typeof t[a]<"u"&&(s.match+=i)}}}return s}_getSchema(t){return typeof t>"u"?$({},this.jsoneditor.expandRefs(this.schema)):t}validate(t){return this._validateSchema(this.schema,t)}_validateSchema(t,e,i){const s=[];return i=i||this.jsoneditor.root.formname,t=$({},this.jsoneditor.expandRefs(t)),typeof e>"u"?this._validateV3Required(t,e,i):(Object.keys(t).forEach(o=>{this._validateSubSchema[o]&&s.push(...this._validateSubSchema[o].call(this,t,e,i))}),s.push(...this._validateByValueType(t,e,i)),t.links&&t.links.forEach((o,n)=>{o.rel&&o.rel.toLowerCase()==="describedby"&&(t=this._expandSchemaLink(t,n),s.push(...this._validateSchema(t,e,i,this.translate)))}),["date","time","datetime-local"].includes(t.format)&&s.push(...this._validateDateTimeSubSchema(t,e,i)),["uuid"].includes(t.format)&&s.push(...this._validateUUIDSchema(t,e,i)),s.push(...this._validateCustomValidator(t,e,i)),this._removeDuplicateErrors(s))}_expandSchemaLink(t,e){const i=t.links[e].href,s=this.jsoneditor.root.getValue(),o=this.jsoneditor.compileTemplate(i,this.jsoneditor.template),n=document.location.origin+document.location.pathname+o(s);return t.links=t.links.slice(0,e).concat(t.links.slice(e+1)),$({},t,this.jsoneditor.refs[n])}_validateV3Required(t,e,i){return(typeof t.required<"u"&&t.required===!0||typeof t.required>"u"&&this.jsoneditor.options.required_by_default===!0)&&t.type!=="info"?[{path:i,property:"required",message:this.translate("error_notset",null,t)}]:[]}_validateByValueType(t,e,i){const s=[];if(e===null)return s;if(typeof e=="number")Object.keys(t).forEach(o=>{this._validateNumberSubSchema[o]&&s.push(...this._validateNumberSubSchema[o].call(this,t,e,i))});else if(typeof e=="string")Object.keys(t).forEach(o=>{this._validateStringSubSchema[o]&&s.push(...this._validateStringSubSchema[o].call(this,t,e,i))});else if(Array.isArray(e))Object.keys(t).forEach(o=>{this._validateArraySubSchema[o]&&s.push(...this._validateArraySubSchema[o].call(this,t,e,i))});else if(typeof e=="object"){const o={};Object.keys(t).forEach(n=>{this._validateObjectSubSchema[n]&&s.push(...this._validateObjectSubSchema[n].call(this,t,e,i,o))}),typeof t.additionalProperties>"u"&&this.jsoneditor.options.no_additional_properties&&!t.oneOf&&!t.anyOf&&!t.allOf&&(t.additionalProperties=!1),Object.keys(t).forEach(n=>{typeof this._validateObjectSubSchema2[n]<"u"&&s.push(...this._validateObjectSubSchema2[n].call(this,t,e,i,o))})}return s}_validateUUIDSchema(t,e,i){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?[]:[{path:i,property:"format",message:this.translate("error_pattern",["^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"],t)}]}_validateNumberSubSchemaMultipleDivisible(t,e,i){const s=t.multipleOf||t.divisibleBy;let o=e/s===Math.floor(e/s);return window.math?o=window.math.mod(window.math.bignumber(e),window.math.bignumber(s)).equals(0):window.Decimal&&(o=new window.Decimal(e).mod(new window.Decimal(s)).equals(0)),o?[]:[{path:i,property:t.multipleOf?"multipleOf":"divisibleBy",message:this.translate("error_multipleOf",[s],t)}]}_validateDateTimeSubSchema(t,e,i){const s=(c,p,b)=>p*1<1?[{path:b,property:"format",message:this.translate("error_invalid_epoch",null,c)}]:p!==Math.abs(parseInt(p))?[{path:b,property:"format",message:this.translate(`error_${c.format.replace(/-/g,"_")}`,[h],c)}]:[],o=(c,p,b,g)=>{if(p!==""){let y;if(g.flatpickr.config.mode!=="single"){const w=g.flatpickr.config.mode==="range"?g.flatpickr.l10n.rangeSeparator:", ";y=g.flatpickr.selectedDates.map(A=>g.flatpickr.formatDate(A,g.flatpickr.config.dateFormat)).join(w)}try{if(y){if(y!==p)throw new Error(`${g.flatpickr.config.mode} mismatch`)}else if(g.flatpickr.formatDate(g.flatpickr.parseDate(p,g.flatpickr.config.dateFormat),g.flatpickr.config.dateFormat)!==p)throw new Error("mismatch")}catch{const w=g.flatpickr.config.errorDateFormat!==void 0?g.flatpickr.config.errorDateFormat:g.flatpickr.config.dateFormat;return[{path:b,property:"format",message:this.translate(`error_${g.format.replace(/-/g,"_")}`,[w],c)}]}}return[]},n={date:/^(\d{4}\D\d{2}\D\d{2})$/,time:/^(\d{2}:\d{2}(?::\d{2})?)$/,"datetime-local":/^(\d{4}\D\d{2}\D\d{2}[ T]\d{2}:\d{2}(?::\d{2})?)$/},a={date:'"YYYY-MM-DD"',time:'"HH:MM"',"datetime-local":'"YYYY-MM-DD HH:MM"'},l=this.jsoneditor.getEditor(i),h=l&&l.flatpickr?l.flatpickr.config.dateFormat:a[t.format];if(t.type==="integer")return s(t,e,i);if(!l||!l.flatpickr){if(!n[t.format].test(e))return[{path:i,property:"format",message:this.translate(`error_${t.format.replace(/-/g,"_")}`,[h],t)}]}else if(l)return o(t,e,i,l);return[]}_validateCustomValidator(t,e,i){const s=[];s.push(...$c.call(this,t,e,i,this.translate));const o=n=>{s.push(...n.call(this,t,e,i))};return this.defaults.custom_validators.forEach(o),this.options.custom_validators&&this.options.custom_validators.forEach(o),s}_removeDuplicateErrors(t){return t.reduce((e,i)=>{let s=!0;return e||(e=[]),e.forEach(o=>{o.message===i.message&&o.path===i.path&&o.property===i.property&&(o.errorcount++,s=!1)}),s&&(i.errorcount=1,e.push(i)),e},[])}_checkType(t,e){const i={string:s=>typeof s=="string",number:s=>typeof s=="number",integer:s=>typeof s=="number"&&s===Math.floor(s),boolean:s=>typeof s=="boolean",array:s=>Array.isArray(s),object:s=>s!==null&&!Array.isArray(s)&&typeof s=="object",null:s=>s===null};return typeof t=="string"?i[t]?i[t](e):!0:!this._validateSchema(t,e).length}}class Oc extends Bt{register(){if(this.editors){for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister();this.editors[this.type]&&this.editors[this.type].register()}super.register()}unregister(){if(super.unregister(),this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister()}getNumColumns(){return this.editors[this.type]?Math.max(this.editors[this.type].getNumColumns(),4):4}enable(){if(!this.always_disabled){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].enable();this.switcher.disabled=!1,super.enable()}}disable(t){if(t&&(this.always_disabled=!0),this.editors)for(let e=0;e<this.editors.length;e++)this.editors[e]&&this.editors[e].disable(t);this.switcher.disabled=!0,super.disable()}switchEditor(t){this.lastType=this.type,this.editors[t]||this.buildChildEditor(t);let e=this.getValue();this.type=t,this.register(),this.editors.forEach((i,s)=>{i&&(this.type===s?(this.keep_only_existing_values&&(e=cc(i.getValue(),e)),(this.keep_values||this.if)&&i.setValue(e,!0),i.container.style.display=""):i.container.style.display="none")}),this.refreshValue(),this.refreshHeaderText()}buildChildEditor(t){var e;const i=this.types[t],s=this.theme.getChildEditorHolder();this.editor_holder.appendChild(s);let o;typeof i=="string"?(o=$({},this.schema),o.type=i):(o=$({},this.schema,i),o=this.jsoneditor.expandRefs(o),i&&i.required&&Array.isArray(i.required)&&this.schema.required&&Array.isArray(this.schema.required)&&(o.required=this.schema.required.concat(i.required))),(e=o==null?void 0:o.options)!=null&&e.dependencies&&delete o.options.dependencies;const n=this.jsoneditor.getEditorClass(o);this.editors[t]=this.jsoneditor.createEditor(n,{jsoneditor:this.jsoneditor,schema:o,container:s,path:this.path,parent:this,required:!0}),this.editors[t].preBuild(),this.editors[t].build(),this.editors[t].postBuild(),this.editors[t].header&&this.theme.visuallyHidden(this.editors[t].header),this.editors[t].option=this.switcher_options[t],s.addEventListener("change_header_text",()=>{this.refreshHeaderText()}),t!==this.type&&(s.style.display="none")}preBuild(){if(this.types=[],this.type=0,this.editors=[],this.validators=[],this.keep_values=!0,typeof this.jsoneditor.options.keep_oneof_values<"u"&&(this.keep_values=this.jsoneditor.options.keep_oneof_values),typeof this.options.keep_oneof_values<"u"&&(this.keep_values=this.options.keep_oneof_values),this.keep_only_existing_values=!1,typeof this.jsoneditor.options.keep_only_existing_values<"u"&&(this.keep_only_existing_values=this.jsoneditor.options.keep_only_existing_values),typeof this.options.keep_only_existing_values<"u"&&(this.keep_only_existing_values=this.options.keep_only_existing_values),this.schema.oneOf)this.oneOf=!0,this.types=this.schema.oneOf,delete this.schema.oneOf;else if(this.schema.anyOf)this.anyOf=!0,this.types=this.schema.anyOf,delete this.schema.anyOf;else if(this.schema.if)this.if=!0,this.ifSchema=JSON.parse(JSON.stringify(this.schema.if)),this.thenSchema={title:"then"},this.elseSchema={title:"else"},this.types=[],this.schema.then&&ls(this.thenSchema,this.schema,this.schema.then),this.schema.else&&ls(this.elseSchema,this.schema,this.schema.else),this.types.push(this.thenSchema),this.types.push(this.elseSchema),this.types.forEach(t=>{delete t.if,delete t.then,delete t.else}),delete this.schema.if;else{if(!this.schema.type||this.schema.type==="any"){if(this.types=["string","number","integer","boolean","object","array","null"],this.schema.disallow){let{disallow:t}=this.schema;(typeof t!="object"||!Array.isArray(t))&&(t=[t]);const e=[];this.types.forEach(i=>{t.includes(i)||e.push(i)}),this.types=e}}else Array.isArray(this.schema.type)?this.types=this.schema.type:this.types=[this.schema.type];delete this.schema.type}this.display_text=this.getDisplayText(this.types)}build(){const{container:t}=this;this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired()),this.switcher=this.theme.getSwitcher(this.display_text),this.switcher.setAttribute("id",this.formname+"switcher"),this.switcherLabel=this.theme.getHiddenLabel(this.formname+" switcher"),this.switcherLabel.setAttribute("for",this.formname+"switcher"),this.if||(this.container.appendChild(this.header),t.appendChild(this.switcherLabel),t.appendChild(this.switcher)),this.switcher.addEventListener("change",i=>{i.preventDefault(),i.stopPropagation(),this.switchEditor(this.display_text.indexOf(i.currentTarget.value)),this.onChange(!0)}),this.editor_holder=document.createElement("div"),t.appendChild(this.editor_holder);const e={};this.jsoneditor.options.custom_validators&&(e.custom_validators=this.jsoneditor.options.custom_validators),this.switcher_options=this.theme.getSwitcherOptions(this.switcher),this.types.forEach((i,s)=>{this.editors[s]=!1;let o;typeof i=="string"?(o=$({},this.schema),o.type=i):(o=$({},this.schema,i),i.required&&Array.isArray(i.required)&&this.schema.required&&Array.isArray(this.schema.required)&&(o.required=this.schema.required.concat(i.required))),this.validators[s]=new Gn(this.jsoneditor,o,e,this.defaults)}),this.jsoneditor.on("change",()=>{this.switchIf()}),this.switchEditor(0)}onChildEditorChange(t){this.editors[this.type]&&(this.refreshValue(),this.refreshHeaderText()),super.onChildEditorChange()}refreshHeaderText(){const t=this.getDisplayText(this.types);Array.from(this.switcher_options).forEach((e,i)=>{e.textContent=t[i]})}refreshValue(){this.editors[this.type]&&(this.value=this.editors[this.type].getValue())}switchIf(){if(this.ifSchema&&this.value){const t=this.getIfType(this.value);this.lastType!==t&&(this.switchEditor(t),this.editors[this.type].setValue(this.value,!0)),this.switcher.value=this.display_text[this.type]}}getIfType(t){return this.jsoneditor.validator._validateSchema(this.ifSchema,t).length===0?0:1}setValue(t,e){const i=this.type;let s={match:0,extra:0,i:this.type};const o={match:0,i:null};this.validators.forEach((l,h)=>{let c=null;typeof this.anyOf<"u"&&this.anyOf&&(c=l.fitTest(t),(s.match<c.match||s.match===c.match&&s.extra>c.extra)&&(s=c,s.i=h)),!l.validate(t).length&&o.i===null?(o.i=h,c!==null&&(o.match=c.match)):s=o});let n=o.i;typeof this.anyOf<"u"&&this.anyOf&&o.match<s.match&&(n=s.i),this.if&&(n=this.getIfType(t)),n===null&&(n=this.type),this.type=n,this.switcher.value=this.display_text[n];const a=this.type!==i;a&&(this.switchEditor(this.type),this.editors[this.type].setValue(t,e)),typeof t<"u"&&this.editors[this.type].setValue(t,e),this.refreshValue(),this.onChange(a)}destroy(){this.editors.forEach(t=>{t&&t.destroy()}),this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),super.destroy()}showValidationErrors(t){if(this.oneOf||this.anyOf){const e=this.oneOf?"oneOf":"anyOf";this.editors.forEach((i,s)=>{if(!i)return;const o=`${this.path}.${e}[${s}]`,n=(a,l)=>{if(l.path.startsWith(o)||l.path===o.substr(0,l.path.length)){const h=$({},l);l.path.startsWith(o)&&(h.path=this.path+h.path.substr(o.length)),a.push(h)}return a};i.showValidationErrors(t.reduce(n,[]))})}else this.editors.forEach(e=>{e&&e.showValidationErrors(t)})}addLinks(){}}class Pc extends Bt{getValue(){if(this.dependenciesFulfilled)return null}setValue(){this.onChange()}getNumColumns(){return 2}}const Bc={".je-object__title":"display:inline-block",".je-object__controls":"margin:0%200%200%2010px",".je-object__container":"position:relative",".je-object__property-checkbox":"margin:0;height:auto",".property-selector":"width:295px;max-height:160px;padding:5px%200;overflow-y:auto;overflow-x:hidden;padding-left:5px",".property-selector-input":"width:220px;margin-bottom:0;display:inline-block",".json-editor-btntype-toggle":"margin:0%2010px%200%200",".je-edit-json--textarea":"height:170px;width:300px;display:block"};class Zn extends Bt{constructor(t,e,i){super(t,e),this.currentDepth=i}getDefault(){return $({},this.schema.default||{})}getChildEditors(){return this.editors}register(){super.register(),this.editors&&Object.values(this.editors).forEach(t=>t.register())}unregister(){super.unregister(),this.editors&&Object.values(this.editors).forEach(t=>t.unregister())}getNumColumns(){return Math.max(Math.min(12,this.maxwidth),3)}enable(){this.always_disabled||(this.editjson_control&&(this.editjson_control.disabled=!1),this.addproperty_button&&(this.addproperty_button.disabled=!1),super.enable(),this.editors&&Object.values(this.editors).forEach(t=>{(t.isActive()||t.isUiOnly)&&t.enable(),t.optInCheckbox.disabled=!1}))}disable(t){t&&(this.always_disabled=!0),this.editjson_control&&(this.editjson_control.disabled=!0),this.addproperty_button&&(this.addproperty_button.disabled=!0),this.hideEditJSON(),super.disable(),this.editors&&Object.values(this.editors).forEach(e=>{(e.isActive()||e.isUiOnly)&&e.disable(t),e.optInCheckbox.disabled=!0})}layoutEditors(){let t,e;if(!this.row_container)return;this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort((h,c)=>{let p=this.editors[h].schema.propertyOrder,b=this.editors[c].schema.propertyOrder;return typeof p!="number"&&(p=1e3),typeof b!="number"&&(b=1e3),p-b});let i;const s=this.format==="categories",o=[];let n=null,a=null,l;if(this.format==="grid-strict"){let h=0;if(l=[],this.property_order.forEach(c=>{const p=this.editors[c];if(p.property_removed)return;const b=p.options.hidden?0:p.options.grid_columns||p.getNumColumns(),g=p.options.hidden?0:p.options.grid_offset||0,y=p.options.hidden?!1:p.options.grid_break||!1,w=p.options.hidden?0:p.container.offsetHeight,A={key:c,width:b,offset:g,height:w};l.push(A),o[h]=l,y&&(h++,l=[])}),this.layout===JSON.stringify(o))return!1;for(this.layout=JSON.stringify(o),i=document.createElement("div"),t=0;t<o.length;t++)for(l=this.theme.getGridRow(),i.appendChild(l),e=0;e<o[t].length;e++)n=o[t][e].key,a=this.editors[n],a.options.hidden?a.container.style.display="none":this.theme.setGridColumnSize(a.container,o[t][e].width,o[t][e].offset),l.appendChild(a.container)}else if(this.format==="grid"){for(this.property_order.forEach(h=>{const c=this.editors[h];if(c.property_removed)return;let p=!1;const b=c.options.hidden?0:c.options.grid_columns||c.getNumColumns(),g=c.options.hidden?0:c.container.offsetHeight;for(let y=0;y<o.length;y++)o[y].width+b<=12&&(!g||o[y].minh*.5<g&&o[y].maxh*2>g)&&(p=y);p===!1&&(o.push({width:0,minh:999999,maxh:0,editors:[]}),p=o.length-1),o[p].editors.push({key:h,width:b,height:g}),o[p].width+=b,o[p].minh=Math.min(o[p].minh,g),o[p].maxh=Math.max(o[p].maxh,g)}),t=0;t<o.length;t++)if(o[t].width<12){let h=!1,c=0;for(e=0;e<o[t].editors.length;e++)(h===!1||o[t].editors[e].width>o[t].editors[h].width)&&(h=e),o[t].editors[e].width*=12/o[t].width,o[t].editors[e].width=Math.floor(o[t].editors[e].width),c+=o[t].editors[e].width;c<12&&(o[t].editors[h].width+=12-c),o[t].width=12}if(this.layout===JSON.stringify(o))return!1;for(this.layout=JSON.stringify(o),i=document.createElement("div"),t=0;t<o.length;t++)for(l=this.theme.getGridRow(),i.appendChild(l),e=0;e<o[t].editors.length;e++)n=o[t].editors[e].key,a=this.editors[n],a.options.hidden?a.container.style.display="none":this.theme.setGridColumnSize(a.container,o[t].editors[e].width),l.appendChild(a.container)}else{if(i=document.createElement("div"),s){const h=document.createElement("div"),c=this.theme.getTopTabHolder(this.translateProperty(this.schema.title)),p=this.theme.getTopTabContentHolder(c);for(this.property_order.forEach(y=>{const w=this.editors[y];if(w.property_removed)return;const A=this.theme.getTabContent(),G=w.schema&&(w.schema.type==="object"||w.schema.type==="array");A.isObjOrArray=G;const it=this.theme.getGridRow();w.tab||(typeof this.basicPane>"u"?this.addRow(w,c,A):this.addRow(w,c,this.basicPane)),A.id=this.getValidId(w.tab_text.textContent),G?(A.appendChild(it),p.appendChild(A),this.theme.addTopTab(c,w.tab)):(h.appendChild(it),p.childElementCount>0?p.firstChild.isObjOrArray&&(A.appendChild(h),p.insertBefore(A,p.firstChild),this.theme.insertBasicTopTab(w.tab,c),w.basicPane=A):(A.appendChild(h),p.appendChild(A),this.theme.addTopTab(c,w.tab),w.basicPane=A)),w.options.hidden?w.container.style.display="none":this.theme.setGridColumnSize(w.container,12),it.appendChild(w.container),w.rowPane=A});this.tabPanesContainer.firstChild;)this.tabPanesContainer.removeChild(this.tabPanesContainer.firstChild);const b=this.tabs_holder.parentNode;b.removeChild(b.firstChild),b.appendChild(c),this.tabPanesContainer=p,this.tabs_holder=c;const g=this.theme.getFirstTab(this.tabs_holder);g&&se(g,"click");return}this.property_order.forEach(h=>{const c=this.editors[h];c.property_removed||(l=this.theme.getGridRow(),i.appendChild(l),c.options.hidden?c.container.style.display="none":this.theme.setGridColumnSize(c.container,12),l.appendChild(c.container))})}for(;this.row_container.firstChild;)this.row_container.removeChild(this.row_container.firstChild);this.row_container.appendChild(i)}getPropertySchema(t){let e=this.schema.properties[t]||{};e=$({},e);let i=!!this.schema.properties[t];return this.schema.patternProperties&&Object.keys(this.schema.patternProperties).forEach(s=>{new RegExp(s).test(t)&&(e.allOf=e.allOf||[],e.allOf.push(this.schema.patternProperties[s]),i=!0)}),!i&&this.schema.additionalProperties&&typeof this.schema.additionalProperties=="object"&&(e=$({},this.schema.additionalProperties)),e}preBuild(){if(super.preBuild(),this.editors={},this.cached_editors={},this.format=this.options.layout||this.options.object_layout||this.schema.format||this.jsoneditor.options.object_layout||"normal",this.schema.properties=this.schema.properties||{},this.minwidth=0,this.maxwidth=0,this.options.table_row)Object.entries(this.schema.properties).forEach(([t,e])=>{const i=this.jsoneditor.getEditorClass(e);this.editors[t]=this.jsoneditor.createEditor(i,{jsoneditor:this.jsoneditor,schema:e,path:`${this.path}.${t}`,parent:this,compact:!0,required:!0},this.currentDepth+1),this.editors[t].preBuild();const s=this.editors[t].options.hidden?0:this.editors[t].options.grid_columns||this.editors[t].getNumColumns();this.minwidth+=s,this.maxwidth+=s}),this.no_link_holder=!0;else{if(this.options.table)throw new Error("Not supported yet");this.schema.defaultProperties||(this.jsoneditor.options.display_required_only||this.options.display_required_only?this.schema.defaultProperties=Object.keys(this.schema.properties).filter(t=>this.isRequiredObject({key:t,schema:this.schema.properties[t]})):this.schema.defaultProperties=Object.keys(this.schema.properties)),this.maxwidth+=1,Array.isArray(this.schema.defaultProperties)&&this.schema.defaultProperties.forEach(t=>{this.addObjectProperty(t,!0),this.editors[t]&&(this.minwidth=Math.max(this.minwidth,this.editors[t].options.grid_columns||this.editors[t].getNumColumns()),this.maxwidth+=this.editors[t].options.grid_columns||this.editors[t].getNumColumns())})}this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort((t,e)=>{let i=this.editors[t].schema.propertyOrder,s=this.editors[e].schema.propertyOrder;return typeof i!="number"&&(i=1e3),typeof s!="number"&&(s=1e3),i-s})}addTab(t){const e=this.rows[t].schema&&(this.rows[t].schema.type==="object"||this.rows[t].schema.type==="array");this.tabs_holder&&(this.rows[t].tab_text=document.createElement("span"),e?this.rows[t].tab_text.textContent=this.rows[t].getHeaderText():this.rows[t].tab_text.textContent=typeof this.schema.basicCategoryTitle>"u"?"Basic":this.schema.basicCategoryTitle,this.rows[t].tab=this.theme.getTopTab(this.rows[t].tab_text,this.getValidId(this.rows[t].tab_text.textContent)),this.rows[t].tab.addEventListener("click",i=>{this.active_tab=this.rows[t].tab,this.refreshTabs(),i.preventDefault(),i.stopPropagation()}))}addRow(t,e,i){const s=this.rows.length,o=t.schema.type==="object"||t.schema.type==="array";this.rows[s]=t,this.rows[s].rowPane=i,o?(this.addTab(s),this.theme.addTopTab(e,this.rows[s].tab)):typeof this.basicTab>"u"?(this.addTab(s),this.basicTab=s,this.basicPane=i,this.theme.addTopTab(e,this.rows[s].tab)):(this.rows[s].tab=this.rows[this.basicTab].tab,this.rows[s].tab_text=this.rows[this.basicTab].tab_text,this.rows[s].rowPane=this.rows[this.basicTab].rowPane)}refreshTabs(t){const e=typeof this.basicTab<"u";let i=!1;this.rows.forEach(s=>{!s.tab||!s.rowPane||!s.rowPane.parentNode||e&&s.tab===this.rows[this.basicTab].tab&&i||(t?s.tab_text.textContent=s.getHeaderText():(e&&s.tab===this.rows[this.basicTab].tab&&(i=!0),s.tab===this.active_tab?this.theme.markTabActive(s):this.theme.markTabInactive(s)))})}build(){const t=this.format==="categories";if(this.rows=[],this.active_tab=null,this.options.table_row)this.editor_holder=this.container,Object.entries(this.editors).forEach(([e,i])=>{const s=this.theme.getTableCell();this.editor_holder.appendChild(s),i.setContainer(s),i.build(),i.postBuild(),i.setOptInCheckbox(i.header),i.setValue(i.getDefault(),!0),this.editors[e].options.hidden&&(s.style.display="none"),this.editors[e].options.input_width&&(s.style.width=this.editors[e].options.input_width)});else{if(this.options.table)throw new Error("Not supported yet");{this.header="",this.options.compact||(this.header=document.createElement("span"),this.header.textContent=this.getTitle()),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.title.classList.add("je-object__title"),this.controls=this.theme.getButtonHolder(),this.controls.classList.add("je-object__controls"),this.container.appendChild(this.title),this.container.appendChild(this.controls),this.container.classList.add("je-object__container"),this.editjson_holder=this.theme.getModal(),this.editjson_textarea_label=this.theme.getHiddenLabel(this.translate("button_edit_json")),this.editjson_textarea_label.setAttribute("for",this.path+"-edit-json-textarea"),this.editjson_textarea=this.theme.getTextareaInput(),this.editjson_textarea.setAttribute("id",this.path+"-edit-json-textarea"),this.editjson_textarea.setAttribute("aria-labelledby",this.path+"-edit-json-textarea"),this.editjson_textarea.classList.add("je-edit-json--textarea"),this.editjson_save=this.getButton("button_save","save","button_save"),this.editjson_save.classList.add("json-editor-btntype-save"),this.editjson_save.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.saveJSON()}),this.editjson_copy=this.getButton("button_copy","copy","button_copy"),this.editjson_copy.classList.add("json-editor-btntype-copy"),this.editjson_copy.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.copyJSON()}),this.editjson_cancel=this.getButton("button_cancel","cancel","button_cancel"),this.editjson_cancel.classList.add("json-editor-btntype-cancel"),this.editjson_cancel.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.hideEditJSON()}),this.editjson_holder.appendChild(this.editjson_textarea_label),this.editjson_holder.appendChild(this.editjson_textarea),this.editjson_holder.appendChild(this.editjson_save),this.editjson_holder.appendChild(this.editjson_copy),this.editjson_holder.appendChild(this.editjson_cancel),this.addproperty_holder=this.theme.getModal(),this.addproperty_list=document.createElement("div"),this.addproperty_list.classList.add("property-selector"),this.addproperty_add=this.getButton("button_add","add","button_add"),this.addproperty_add.classList.add("json-editor-btntype-add"),this.addproperty_input=this.theme.getFormInputField("text"),this.addproperty_input.setAttribute("placeholder","Property name..."),this.addproperty_input_label=this.theme.getHiddenLabel(this.translate("button_properties")),this.addproperty_input_label.setAttribute("for",this.path+"-property-selector"),this.addproperty_input.classList.add("property-selector-input"),this.addproperty_input.setAttribute("id",this.path+"-property-selector"),this.addproperty_input.setAttribute("aria-labelledby",this.path+"-property-selector"),this.addproperty_add.addEventListener("click",i=>{if(i.preventDefault(),i.stopPropagation(),this.addproperty_input.value){if(this.editors[this.addproperty_input.value]){window.alert("there is already a property with that name");return}this.addObjectProperty(this.addproperty_input.value),this.editors[this.addproperty_input.value]&&this.editors[this.addproperty_input.value].disable(),this.onChange(!0)}}),this.addproperty_input.addEventListener("input",i=>{i.target.previousSibling.previousSibling.childNodes.forEach(s=>{let o=s.innerText,n=i.target.value;this.options.case_sensitive_property_search||this.jsoneditor.options.case_sensitive_property_search||(o=o.toLowerCase(),n=n.toLowerCase()),o.includes(n)?s.style.display="":s.style.display="none"})}),this.addproperty_holder.appendChild(this.addproperty_list),this.addproperty_holder.appendChild(this.addproperty_input_label),this.addproperty_holder.appendChild(this.addproperty_input),this.addproperty_holder.appendChild(this.addproperty_add);const e=document.createElement("div");e.style.clear="both",this.addproperty_holder.appendChild(e),this.onOutsideModalClickListener=this.onOutsideModalClick.bind(this),document.addEventListener("click",this.onOutsideModalClickListener,!0),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.editor_holder=this.theme.getIndentedPanel(),this.container.appendChild(this.editor_holder),this.row_container=this.theme.getGridContainer(),t?(this.tabs_holder=this.theme.getTopTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTopTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.tabs_holder)):(this.tabs_holder=this.theme.getTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.row_container)),Object.values(this.editors).forEach(i=>{const s=this.theme.getTabContent(),o=this.theme.getGridColumn(),n=!!(i.schema&&(i.schema.type==="object"||i.schema.type==="array"));if(s.isObjOrArray=n,t){if(n){const a=this.theme.getGridContainer();a.appendChild(o),s.appendChild(a),this.tabPanesContainer.appendChild(s),this.row_container=a}else typeof this.row_container_basic>"u"&&(this.row_container_basic=this.theme.getGridContainer(),s.appendChild(this.row_container_basic),this.tabPanesContainer.childElementCount===0?this.tabPanesContainer.appendChild(s):this.tabPanesContainer.insertBefore(s,this.tabPanesContainer.childNodes[1])),this.row_container_basic.appendChild(o);this.addRow(i,this.tabs_holder,s),s.id=this.getValidId(i.schema.title)}else this.row_container.appendChild(o);i.setContainer(o),i.build(),i.postBuild(),i.setOptInCheckbox(i.header)}),this.rows[0]&&se(this.rows[0].tab,"click"),this.collapsed=!1,this.collapse_control=this.getButton("","collapse","button_collapse"),this.collapse_control.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(this.collapse_control,this.title.childNodes[0]),this.collapse_control.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.collapsed?(this.editor_holder.style.display="",this.collapsed=!1,this.setButtonText(this.collapse_control,"","collapse","button_collapse")):(this.editor_holder.style.display="none",this.collapsed=!0,this.setButtonText(this.collapse_control,"","expand","button_expand"))}),this.options.collapsed&&se(this.collapse_control,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.collapse_control.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.collapse_control.style.display="none"),this.editjson_control=this.getButton("JSON","edit","button_edit_json"),this.editjson_control.classList.add("json-editor-btntype-editjson"),this.editjson_control.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.toggleEditJSON()}),this.controls.appendChild(this.editjson_control),this.controls.insertBefore(this.editjson_holder,this.controls.childNodes[0]),this.schema.options&&typeof this.schema.options.disable_edit_json<"u"?this.schema.options.disable_edit_json&&(this.editjson_control.style.display="none"):this.jsoneditor.options.disable_edit_json&&(this.editjson_control.style.display="none"),this.addproperty_button=this.getButton("properties","edit_properties","button_object_properties"),this.addproperty_button.classList.add("json-editor-btntype-properties"),this.addproperty_button.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.toggleAddProperty()}),this.controls.appendChild(this.addproperty_button),this.controls.insertBefore(this.addproperty_holder,this.controls.childNodes[1]),this.refreshAddProperties(),this.deactivateNonRequiredProperties()}}this.options.table_row?(this.editor_holder=this.container,this.property_order.forEach(e=>{this.editor_holder.appendChild(this.editors[e].container)})):(this.layoutEditors(),this.layoutEditors()),(this.schema.readOnly||this.schema.readonly)&&this.disable()}deactivateNonRequiredProperties(){const t=this.jsoneditor.options.show_opt_in,e=typeof this.options.show_opt_in<"u",i=e&&this.options.show_opt_in===!0,s=e&&this.options.show_opt_in===!1;(i||!s&&t||!e&&t)&&Object.entries(this.editors).forEach(([o,n])=>{this.isRequiredObject(n)||this.editors[o].deactivate()})}showEditJSON(){this.editjson_holder&&(this.hideAddProperty(),this.editjson_holder.style.left=`${this.editjson_control.offsetLeft}px`,this.editjson_holder.style.top=`${this.editjson_control.offsetTop+this.editjson_control.offsetHeight}px`,this.editjson_textarea.value=JSON.stringify(this.getValue(),null,2),this.disable(),this.editjson_holder.style.display="",this.editjson_control.disabled=!1,this.editing_json=!0)}hideEditJSON(){this.editjson_holder&&this.editing_json&&(this.editjson_holder.style.display="none",this.enable(),this.editing_json=!1)}copyJSON(){this.editjson_holder&&navigator.clipboard.writeText(this.editjson_textarea.value).catch(t=>window.alert(t))}saveJSON(){if(this.editjson_holder)try{const t=JSON.parse(this.editjson_textarea.value);this.setValue(t),this.hideEditJSON(),this.onChange(!0)}catch(t){throw window.alert("invalid JSON"),t}}toggleEditJSON(){this.editing_json?this.hideEditJSON():this.showEditJSON()}insertPropertyControlUsingPropertyOrder(t,e,i){let s;this.schema.properties[t]&&(s=this.schema.properties[t].propertyOrder),typeof s!="number"&&(s=1e3),e.propertyOrder=s;for(let o=0;o<i.childNodes.length;o++){const n=i.childNodes[o];if(e.propertyOrder<n.propertyOrder){this.addproperty_list.insertBefore(e,n),e=null;break}}e&&this.addproperty_list.appendChild(e)}addPropertyCheckbox(t){let e;const i=this.theme.getCheckbox();this.schema.properties[t]&&this.schema.properties[t].title?e=this.schema.properties[t].title:e=t;const s=this.theme.getCheckboxLabel(e),o=this.theme.getFormControl(s,i,null,null,this.path+"-"+t);return o.style.paddingBottom=o.style.marginBottom=o.style.paddingTop=o.style.marginTop=0,o.style.height="auto",this.insertPropertyControlUsingPropertyOrder(t,o,this.addproperty_list),i.checked=t in this.editors,i.addEventListener("change",()=>{i.checked?this.addObjectProperty(t):this.removeObjectProperty(t),this.onChange(!0)}),this.addproperty_checkboxes[t]=i,i}showAddProperty(){this.addproperty_holder&&(this.hideEditJSON(),this.addproperty_holder.style.left=`${this.addproperty_button.offsetLeft}px`,this.addproperty_holder.style.top=`${this.addproperty_button.offsetTop+this.addproperty_button.offsetHeight}px`,this.disable(),this.adding_property=!0,this.addproperty_button.disabled=!1,this.addproperty_holder.style.display="",this.refreshAddProperties())}hideAddProperty(){this.addproperty_holder&&this.adding_property&&(this.addproperty_holder.style.display="none",this.enable(),this.adding_property=!1)}toggleAddProperty(){this.adding_property?this.hideAddProperty():this.showAddProperty()}removeObjectProperty(t){this.editors[t]&&(this.editors[t].unregister(),delete this.editors[t],this.refreshValue(),this.layoutEditors())}getSchemaOnMaxDepth(t){return Object.keys(t).reduce((e,i)=>{switch(i){case"$ref":return e;case"properties":case"items":return{...e,[i]:{}};case"additionalProperties":case"propertyNames":return{...e,[i]:!0};default:return{...e,[i]:t[i]}}},{})}addObjectProperty(t,e){if(!this.editors[t]){if(this.cached_editors[t]){if(this.editors[t]=this.cached_editors[t],e)return;this.editors[t].register()}else{if(!this.canHaveAdditionalProperties()&&(!this.schema.properties||!this.schema.properties[t])&&(!this.schema.patternProperties||!Object.keys(this.schema.patternProperties).find(n=>new RegExp(n).test(t))))return;const i=this.getPropertySchema(t);typeof i.propertyOrder!="number"&&(i.propertyOrder=Object.keys(this.editors).length+1e3);const s=this.jsoneditor.getEditorClass(i),{max_depth:o}=this.jsoneditor.options;if(this.editors[t]=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:o&&this.currentDepth>=o?this.getSchemaOnMaxDepth(i):i,path:`${this.path}.${t}`,parent:this},this.currentDepth+1),this.editors[t].preBuild(),!e){const n=this.theme.getChildEditorHolder();this.editor_holder.appendChild(n),this.editors[t].setContainer(n),this.editors[t].build(),this.editors[t].postBuild(),this.editors[t].setOptInCheckbox(s.header),this.editors[t].activate()}this.cached_editors[t]=this.editors[t]}e||(this.refreshValue(),this.layoutEditors())}}onOutsideModalClick(t){const e=t.path||t.composedPath&&t.composedPath();this.addproperty_holder&&!this.addproperty_holder.contains(e[0])&&this.adding_property&&(t.preventDefault(),t.stopPropagation(),this.toggleAddProperty())}onChildEditorChange(t){this.refreshValue(),super.onChildEditorChange(t)}canHaveAdditionalProperties(){return typeof this.schema.additionalProperties=="boolean"?this.schema.additionalProperties:typeof this.schema.additionalProperties=="object"&&this.schema.additionalProperties!==null?!0:typeof this.options.no_additional_properties=="boolean"?!this.options.no_additional_properties:typeof this.jsoneditor.options.no_additional_properties=="boolean"?!this.jsoneditor.options.no_additional_properties:!0}destroy(){Object.values(this.cached_editors).forEach(t=>t.destroy()),this.editor_holder&&(this.editor_holder.innerHTML=""),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.error_holder&&this.error_holder.parentNode&&this.error_holder.parentNode.removeChild(this.error_holder),this.editors=null,this.cached_editors=null,this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.editor_holder=null,document.removeEventListener("click",this.onOutsideModalClickListener,!0),super.destroy()}getValue(){if(!this.dependenciesFulfilled)return;const t=super.getValue(),e=i=>typeof i>"u"||i===""||i===Object(i)&&Object.keys(i).length===0&&i.constructor===Object;return t&&(this.jsoneditor.options.remove_empty_properties||this.options.remove_empty_properties)&&Object.keys(t).forEach(i=>{e(t[i])&&delete t[i]}),t}refreshValue(){this.value={},this.editors&&(Object.keys(this.editors).forEach(t=>{this.editors[t].isActive()&&(this.editors[t].refreshValue(),this.value[t]=this.editors[t].getValue())}),Object.keys(this.editors).forEach(t=>{this.editors[t].isActive()&&this.activateDependentRequired(this.editors[t].key)}),this.adding_property&&this.refreshAddProperties())}activateDependentRequired(t){this.getDependentRequired(t).forEach(e=>{let i;Object.entries(this.cached_editors).forEach(([s,o])=>{o.key===e&&(i=o)}),i&&!i.isActive()&&i.activate()})}getDependentRequired(t){return this.schema.dependentRequired&&Wt(this.schema.dependentRequired,t)?this.schema.dependentRequired[t]:[]}refreshAddProperties(){if(this.options.disable_properties||this.options.disable_properties!==!1&&this.jsoneditor.options.disable_properties){this.addproperty_button.style.display="none";return}let t=!1,e=0,i=!1;Object.keys(this.editors).forEach(s=>e++),t=this.canHaveAdditionalProperties()&&!(typeof this.schema.maxProperties<"u"&&e>=this.schema.maxProperties),this.addproperty_checkboxes&&(this.addproperty_list.innerHTML=""),this.addproperty_checkboxes={},Object.keys(this.cached_editors).forEach(s=>{this.addPropertyCheckbox(s),this.isRequiredObject(this.cached_editors[s])&&s in this.editors&&(this.addproperty_checkboxes[s].disabled=!0),typeof this.schema.minProperties<"u"&&e<=this.schema.minProperties?(this.addproperty_checkboxes[s].disabled=this.addproperty_checkboxes[s].checked,this.addproperty_checkboxes[s].checked||(i=!0)):s in this.editors?i=!0:!t&&!Wt(this.schema.properties,s)?this.addproperty_checkboxes[s].disabled=!0:(this.addproperty_checkboxes[s].disabled=!1,i=!0)}),this.canHaveAdditionalProperties()&&(i=!0),Object.keys(this.schema.properties).forEach(s=>{this.cached_editors[s]||(i=!0,this.addPropertyCheckbox(s))}),i?this.canHaveAdditionalProperties()?t?this.addproperty_add.disabled=!1:this.addproperty_add.disabled=!0:(this.addproperty_add.style.display="none",this.addproperty_input.style.display="none"):(this.hideAddProperty(),this.addproperty_button.style.display="none")}isRequiredObject(t){if(t)return typeof t.schema.required=="boolean"?t.schema.required:Array.isArray(this.schema.required)?this.schema.required.includes(t.key):!!this.jsoneditor.options.required_by_default}setValue(t,e){t=t||{},(typeof t!="object"||Array.isArray(t))&&(t={}),Object.entries(this.cached_editors).forEach(([i,s])=>{typeof t[i]<"u"?(this.addObjectProperty(i),s.setValue(t[i],e),s.activate()):!e&&!this.isRequiredObject(s)?this.jsoneditor.options.show_opt_in||this.options.show_opt_in?s.deactivate():this.removeObjectProperty(i):s.setValue(s.getDefault(),e)}),Object.entries(t).forEach(([i,s])=>{this.cached_editors[i]||(this.addObjectProperty(i),this.editors[i]&&this.editors[i].setValue(s,e,!!this.editors[i].template))}),this.refreshValue(),this.layoutEditors(),this.onChange()}showValidationErrors(t){const e=[],i=[];t.forEach(s=>{s.path===this.path?e.push(s):i.push(s)}),this.error_holder&&(e.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",e.forEach(s=>{s.errorcount&&s.errorcount>1&&(s.message+=` (${s.errorcount} errors)`),this.error_holder.appendChild(this.theme.getErrorMessage(s.message))})):this.error_holder.style.display="none"),this.options.table_row&&(e.length?this.theme.addTableRowError(this.container):this.theme.removeTableRowError(this.container)),Object.values(this.editors).forEach(s=>{s.showValidationErrors(i)})}}Zn.rules=Bc;class Ic extends xi{preBuild(){super.preBuild()}build(){this.label="",this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.radioContainer=document.createElement("div"),this.radioGroup=[];const t=i=>{this.setValue(i.currentTarget.value),this.onChange(!0),this.radioGroup.forEach(s=>{s.checked=s.value===this.getValue()})};for(let i=0;i<this.enum_values.length;i++){const s={id:`${this.formname}[${i}]`,value:this.enum_values[i]};this.jsoneditor.options.use_name_attributes&&(s.name=this.formname),this.input=this.theme.getFormRadio(s),this.setInputAttributes(["id","value","name"]),this.input.addEventListener("change",t,!1),this.radioGroup.push(this.input);const o=this.theme.getFormRadioLabel(this.enum_display[i]);o.htmlFor=this.input.id;const n=this.theme.getFormRadioControl(o,this.input,!!(this.options.layout==="horizontal"||this.options.compact));this.radioContainer.appendChild(n)}if(this.schema.readOnly||this.schema.readonly){this.disable(!0);for(let i=0;i<this.radioGroup.length;i++)this.radioGroup[i].disabled=!0;this.radioContainer.classList.add("readonly")}const e=this.theme.getContainer();e.appendChild(this.radioContainer),e.dataset.containerFor="radio",this.input=e,this.control=this.theme.getFormControl(this.label,e,this.description,this.infoButton),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{this.input.parentNode&&this.afterInputReady()})}enable(){if(!this.always_disabled){for(let t=0;t<this.radioGroup.length;t++)this.radioGroup[t].disabled=!1;this.radioContainer.classList.remove("readonly"),super.enable()}}disable(t){t&&(this.always_disabled=!0);for(let e=0;e<this.radioGroup.length;e++)this.radioGroup[e].disabled=!0;this.radioContainer.classList.add("readonly"),super.disable()}destroy(){this.radioContainer.parentNode&&this.radioContainer.parentNode.parentNode&&this.radioContainer.parentNode.parentNode.removeChild(this.radioContainer.parentNode),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}getNumColumns(){return 2}setValue(t){typeof t!="string"&&(t=String(t));for(let e=0;e<this.radioGroup.length;e++)if(this.radioGroup[e].value===t){this.radioGroup[e].checked=!0,this.value=t,this.onChange();break}}}class Nc extends Gt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.sceditor_instance&&this.sceditor_instance.val(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){if(window.sceditor){const t=this.expandCallbacks("sceditor",$({},{format:this.input_type,emoticonsEnabled:!1,width:"100%",height:300,readOnly:this.schema.readOnly||this.schema.readonly||this.schema.template},this.defaults.options.sceditor||{},this.options.sceditor||{},{element:this.input})),e=window.sceditor.instance(this.input);e===void 0&&window.sceditor.create(this.input,t),this.sceditor_instance=e||window.sceditor.instance(this.input),this.sceditor_instance.blur(()=>{this.value=this.sceditor_instance.val(),this.sceditor_instance.updateOriginal(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)}else super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.sceditor_instance&&this.sceditor_instance.readOnly(!1),super.enable()}disable(t){this.sceditor_instance&&this.sceditor_instance.readOnly(!0),super.disable(t)}destroy(){this.sceditor_instance&&(this.sceditor_instance.destroy(),this.sceditor_instance=null),super.destroy()}}class Mc extends xi{setValue(t,e){if(this.select2_instance){e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0);const i=this.updateValue(t);this.input.value=i,this.select2v4?this.select2_instance.val(i).trigger("change"):this.select2_instance.select2("val",i),this.onChange(!0)}else super.setValue(t,e)}afterInputReady(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2&&!this.select2_instance){const t=this.expandCallbacks("select2",$({},this.defaults.options.select2||{},this.options.select2||{}));this.newEnumAllowed=t.tags=!!t.tags&&this.schema.type==="string",this.select2_instance=window.jQuery(this.input).select2(t),this.select2v4=Wt(this.select2_instance.select2,"amd"),this.selectChangeHandler=()=>{const e=this.select2v4?this.select2_instance.val():this.select2_instance.select2("val");this.updateValue(e),this.onChange(!0)},this.select2_instance.on("change",this.selectChangeHandler),this.select2_instance.on("select2-blur",this.selectChangeHandler)}super.afterInputReady()}updateValue(t){let e=this.enum_values[0];return t=this.typecast(t||""),this.enum_values.includes(t)?e=t:this.newEnumAllowed&&(e=this.addNewOption(t)?t:e),this.value=e,e}addNewOption(t){const e=this.typecast(t);let i=!1,s;return!this.enum_values.includes(e)&&e!==""&&(this.enum_options.push(`${e}`),this.enum_display.push(`${e}`),this.enum_values.push(e),this.schema.enum.push(e),s=this.input.querySelector(`option[value="${e}"]`),s?s.removeAttribute("data-select2-tag"):this.input.appendChild(new Option(e,e,!1,!1)).trigger("change"),i=!0),i}enable(){this.always_disabled||this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!1):this.select2_instance.select2("enable",!0)),super.enable()}disable(t){this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!0):this.select2_instance.select2("enable",!1)),super.disable(t)}destroy(){this.select2_instance&&(this.select2_instance.select2("destroy"),this.select2_instance=null),super.destroy()}}class Hc extends xi{setValue(t,e){if(this.selectize_instance){e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0);const i=this.updateValue(t);this.input.value=i,this.selectize_instance.clear(!0),this.selectize_instance.setValue(i),this.onChange(!0)}else super.setValue(t,e)}afterInputReady(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.selectize&&!this.selectize_instance){const t=this.expandCallbacks("selectize",$({},this.defaults.options.selectize||{},this.options.selectize||{}));this.newEnumAllowed=t.create=!!t.create&&this.schema.type==="string",this.selectize_instance=window.jQuery(this.input).selectize(t)[0].selectize,this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=e=>{this.updateValue(e),this.onChange(!0)},this.selectize_instance.on("change",this.multiselectChangeHandler)}super.afterInputReady()}updateValue(t){let e=this.enum_values[0];return t=this.typecast(t||""),this.enum_values.includes(t)?e=t:this.newEnumAllowed&&(e=this.addNewOption(t)?t:e),this.value=e,e}addNewOption(t){const e=this.typecast(t);let i=!1;return!this.enum_values.includes(e)&&e!==""&&(this.enum_options.push(`${e}`),this.enum_display.push(`${e}`),this.enum_values.push(e),this.schema.enum.push(e),this.selectize_instance.addItem(e),this.selectize_instance.refreshOptions(!1),i=!0),i}onWatchedFieldChange(){super.onWatchedFieldChange(),this.selectize_instance&&(this.selectize_instance.clear(!0),this.selectize_instance.clearOptions(!0),this.enum_options.forEach((t,e)=>{this.selectize_instance.addOption({value:t,text:this.enum_display[e]})}),this.selectize_instance.addItem(`${this.value}`,!0))}enable(){!this.always_disabled&&this.selectize_instance&&this.selectize_instance.unlock(),super.enable()}disable(t){this.selectize_instance&&this.selectize_instance.lock(),super.disable(t)}destroy(){this.selectize_instance&&(this.selectize_instance.destroy(),this.selectize_instance=null),super.destroy()}}class Rc extends Gt{build(){this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description)));const t=this.formname.replace(/\W/g,"");if(typeof SignaturePad=="function"){this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input);const e=document.createElement("div");e.classList.add("signature-container");const i=document.createElement("canvas");this.jsoneditor.options.use_name_attributes&&i.setAttribute("name",t),i.classList.add("signature"),e.appendChild(i),this.signaturePad=new window.SignaturePad(i),this.signaturePad.onEnd=()=>{this.signaturePad.isEmpty()?this.input.value="":this.input.value=this.signaturePad.toDataURL(),this.is_dirty=!0,this.refreshValue(),this.watch_listener(),this.jsoneditor.notifyWatchers(this.path),this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange()};const s=document.createElement("div"),o=document.createElement("button");o.classList.add("tiny","button"),o.innerHTML="Clear signature",s.appendChild(o),e.appendChild(s),this.options.compact&&this.container.setAttribute("class",`${this.container.getAttribute("class")} compact`),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),Array.from(this.inputs).forEach(n=>{i.setAttribute("readOnly","readOnly"),n.disabled=!0})),o.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.signaturePad.clear(),this.signaturePad.strokeEnd()}),this.control=this.theme.getFormControl(this.label,e,this.description),this.container.appendChild(this.control),this.refreshValue(),i.width=e.offsetWidth,this.options&&this.options.canvas_height?i.height=this.options.canvas_height:i.height="300"}else{const e=document.createElement("p");e.innerHTML="Signature pad is not available, please include SignaturePad from https://github.com/szimek/signature_pad",this.container.appendChild(e)}}setValue(t){if(typeof SignaturePad=="function"){const e=this.sanitize(t);return this.value===e?void 0:(this.value=e,this.input.value=this.value,this.signaturePad.clear(),t&&t!==""&&this.signaturePad.fromDataURL(t),this.watch_listener(),this.jsoneditor.notifyWatchers(this.path),!1)}}destroy(){this.signaturePad.off(),delete this.signaturePad}}class Dc extends Gt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.simplemde_instance&&this.simplemde_instance.value(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;window.SimpleMDE?(t=this.expandCallbacks("simplemde",$({},{height:300},this.defaults.options.simplemde||{},this.options.simplemde||{},{element:this.input,forceSync:!0})),this.simplemde_instance=new window.SimpleMDE(t),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.simplemde_instance.codemirror.options.readOnly=!0),this.simplemde_instance.codemirror.on("change",()=>{this.value=this.simplemde_instance.value(),this.is_dirty=!0,this.onChange(!0)}),t.autorefresh&&this.startListening(this.simplemde_instance.codemirror,this.simplemde_instance.codemirror.state.autoRefresh={delay:250}),this.theme.afterInputReady(this.input)):super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.simplemde_instance&&(this.simplemde_instance.codemirror.options.readOnly=!1),super.enable()}disable(t){this.simplemde_instance&&(this.simplemde_instance.codemirror.options.readOnly=!0),super.disable(t)}destroy(){this.simplemde_instance&&(this.simplemde_instance.toTextArea(),this.simplemde_instance=null),super.destroy()}startListening(t,e){function i(){t.display.wrapper.offsetHeight?(this.stopListening(t,e),t.display.lastWrapHeight!==t.display.wrapper.clientHeight&&t.refresh()):e.timeout=window.setTimeout(i,e.delay)}e.timeout=window.setTimeout(i,e.delay),e.hurry=()=>{window.clearTimeout(e.timeout),e.timeout=window.setTimeout(i,50)},t.on(window,"mouseup",e.hurry),t.on(window,"keyup",e.hurry)}stopListening(t,e){window.clearTimeout(e.timeout),t.off(window,"mouseup",e.hurry),t.off(window,"keyup",e.hurry)}}const Vc={".starrating":"direction:rtl;display:inline-block;white-space:nowrap",".starrating > input":"display:none",".starrating > label:before":"content:'%5C2606';margin:1px;font-size:18px;font-style:normal;font-weight:400;line-height:1;font-family:'Arial';display:inline-block",".starrating > label":"color:%23888;cursor:pointer;margin:8px%200%202px%200",".starrating > label.starrating-display-enabled":"margin:1px%200%200%200",".starrating > input:checked ~ label":"color:%23ffca08",".starrating:not(.readonly) > input:hover ~ label":"color:%23ffca08",".starrating > input:checked ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating:not(.readonly) > input:hover ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating .starrating-display":"position:relative;direction:rtl;text-align:center;font-size:10px;line-height:0px"};class Jn extends Gt{build(){if(this.options.compact||(this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.ratingContainer=document.createElement("div"),this.ratingContainer.classList.add("starrating"),this.schema.enum===void 0){let i=this.schema.maximum?this.schema.maximum:5;this.schema.exclusiveMaximum&&i--,this.enum_values=[];for(let s=0;s<i;s++)this.enum_values.push(s+1)}else this.enum_values=this.schema.enum;this.radioGroup=[];const t=i=>{i.preventDefault(),i.stopPropagation(),this.setValue(i.currentTarget.value),this.onChange(!0)};for(let i=this.enum_values.length-1;i>-1;i--){const s=this.formname+(i+1),o=this.theme.getFormInputField("radio");o.name=`${this.formname}[starrating]`,o.value=this.enum_values[i],o.id=s,o.addEventListener("change",t,!1),this.radioGroup.push(o);const n=document.createElement("label");n.htmlFor=s,n.title=this.enum_values[i],this.options.displayValue&&n.classList.add("starrating-display-enabled");const a=this.theme.getHiddenText("label");a.textContent=i,n.appendChild(a),this.ratingContainer.appendChild(o),this.ratingContainer.appendChild(n)}if(this.options.displayValue&&(this.displayRating=document.createElement("div"),this.displayRating.classList.add("starrating-display"),this.displayRating.innerText=this.enum_values[0],this.ratingContainer.appendChild(this.displayRating)),this.schema.readOnly||this.schema.readonly){this.disable(!0);for(let i=0;i<this.radioGroup.length;i++)this.radioGroup[i].disabled=!0;this.ratingContainer.classList.add("readonly")}const e=this.theme.getContainer();e.appendChild(this.ratingContainer),this.input=e,this.control=this.theme.getFormControl(this.label,e,this.description,this.infoButton),this.container.appendChild(this.control),this.refreshValue()}enable(){if(!this.always_disabled){for(let t=0;t<this.radioGroup.length;t++)this.radioGroup[t].disabled=!1;this.ratingContainer.classList.remove("readonly"),this.disabled=!1}}disable(t){t&&(this.always_disabled=!0);for(let e=0;e<this.radioGroup.length;e++)this.radioGroup[e].disabled=!0;this.ratingContainer.classList.add("readonly"),this.disabled=!0}destroy(){this.ratingContainer.parentNode&&this.ratingContainer.parentNode.parentNode&&this.ratingContainer.parentNode.parentNode.removeChild(this.ratingContainer.parentNode),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)return this.schema.type==="integer"?this.value===""?void 0:this.value*1:this.value}setValue(t){for(let e=0;e<this.radioGroup.length;e++)if(this.radioGroup[e].value===`${t}`){this.radioGroup[e].checked=!0,this.value=t,this.options.displayValue&&(this.displayRating.innerHTML=this.value),this.onChange(!0);break}}}Jn.rules=Vc;class Fc extends Wn{build(){super.build(),this.input.setAttribute("type","number"),this.input.getAttribute("step")||this.input.setAttribute("step","1");const t=this.theme.getStepperButtons(this.input);this.control.appendChild(t),this.stepperDown=this.control.querySelector(".stepper-down"),this.stepperUp=this.control.querySelector(".stepper-up")}enable(){super.enable(),this.stepperDown.removeAttribute("disabled"),this.stepperUp.removeAttribute("disabled")}disable(){super.disable(),this.stepperDown.setAttribute("disabled",!0),this.stepperUp.setAttribute("disabled",!0)}}class zc extends Zr{register(){if(super.register(),this.rows)for(let t=0;t<this.rows.length;t++)this.rows[t].register()}unregister(){if(super.unregister(),this.rows)for(let t=0;t<this.rows.length;t++)this.rows[t].unregister()}getNumColumns(){return Math.max(Math.min(12,this.width),3)}preBuild(){const t=this.jsoneditor.expandRefs(this.schema.items||{});this.item_title=t.title||"row",this.item_default=t.default||null,this.item_has_child_editors=t.properties||t.items,this.width=12,this.array_controls_top=this.options.array_controls_top||this.jsoneditor.options.array_controls_top,super.preBuild()}build(){this.tableContainer=this.theme.getTableContainer(),this.table=this.theme.getTable(),this.tableContainer.appendChild(this.table),this.container.appendChild(this.tableContainer),this.thead=this.theme.getTableHead(),this.table.appendChild(this.thead),this.header_row=this.theme.getTableRow(),this.thead.appendChild(this.header_row),this.row_holder=this.theme.getTableBody(),this.table.appendChild(this.row_holder);const t=this.getElementEditor(0,!0);if(this.item_default=t.getDefault(),this.width=t.getNumColumns()+2,this.options.compact?(this.panel=document.createElement("div"),this.container.appendChild(this.panel)):(this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.container.appendChild(this.title),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText)),this.container.appendChild(this.infoButton)),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.error_holder=document.createElement("div"),this.panel.appendChild(this.error_holder)),this.panel.appendChild(this.tableContainer),this.controls=this.theme.getButtonHolder(),this.array_controls_top?this.title.appendChild(this.controls):this.panel.appendChild(this.controls),this.item_has_child_editors){const e=t.getChildEditors(),i=t.property_order||Object.keys(e);for(let s=0;s<i.length;s++){const o=this.theme.getTableHeaderCell(e[i[s]].getTitle());e[i[s]].options.hidden&&(o.style.display="none"),this.header_row.appendChild(o)}}else this.header_row.appendChild(this.theme.getTableHeaderCell(this.item_title));t.destroy(),this.row_holder.innerHTML="",this.controls_header_cell=this.theme.getTableHeaderCell(this.translate("table_controls")),this.controls_header_cell.setAttribute("aria-hidden","true"),this.controls_header_cell.style.visibility="hidden",this.header_row.appendChild(this.controls_header_cell),this.addControls()}onChildEditorChange(t){this.refreshValue(),super.onChildEditorChange()}getItemDefault(){return $({},{default:this.item_default}).default}getItemTitle(){return this.item_title}getElementEditor(t,e){const i=$({},this.schema.items),s=this.jsoneditor.getEditorClass(i,this.jsoneditor),o=this.row_holder.appendChild(this.theme.getTableRow());let n=o;this.item_has_child_editors||(n=this.theme.getTableCell(),o.appendChild(n));const a=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:n,path:`${this.path}.${t}`,parent:this,compact:!0,table_row:!0});return a.preBuild(),e||(a.build(),a.postBuild(),a.controls_cell=o.appendChild(this.theme.getTableCell()),a.row=o,a.table_controls=this.theme.getButtonHolder(),a.controls_cell.appendChild(a.table_controls),a.table_controls.style.margin=0,a.table_controls.style.padding=0),a}destroy(){this.innerHTML="",this.checkParent(this.title)&&this.title.parentNode.removeChild(this.title),this.checkParent(this.description)&&this.description.parentNode.removeChild(this.description),this.checkParent(this.row_holder)&&this.row_holder.parentNode.removeChild(this.row_holder),this.checkParent(this.table)&&this.table.parentNode.removeChild(this.table),this.checkParent(this.panel)&&this.panel.parentNode.removeChild(this.panel),this.rows=this.title=this.description=this.row_holder=this.table=this.panel=null,super.destroy()}ensureArraySize(t){if(Array.isArray(t)||(t=[t]),this.schema.minItems)for(;t.length<this.schema.minItems;)t.push(this.getItemDefault());return this.schema.maxItems&&t.length>this.schema.maxItems&&(t=t.slice(0,this.schema.maxItems)),t}setValue(t=[],e){if(t=this.ensureArraySize(t),JSON.stringify(t)===this.serialized)return;let i=!1;t.forEach((s,o)=>{this.rows[o]?this.rows[o].setValue(s):(this.addRow(s),i=!0)});for(let s=t.length;s<this.rows.length;s++){const o=this.rows[s].container;this.item_has_child_editors||this.rows[s].row.parentNode.removeChild(this.rows[s].row),this.rows[s].destroy(),o.parentNode&&o.parentNode.removeChild(o),this.rows[s]=null,i=!0}this.rows=this.rows.slice(0,t.length),this.refreshValue(),(i||e)&&this.refreshRowButtons(),this.onChange()}refreshRowButtons(){const t=this.schema.minItems&&this.schema.minItems>=this.rows.length,e=this.schema.maxItems&&this.schema.maxItems<=this.rows.length,i=[];this.rows.forEach((h,c)=>{if(h.delete_button){const p=!t;this.setButtonState(h.delete_button,p),i.push(p)}if(h.copy_button){const p=!e;this.setButtonState(h.copy_button,p),i.push(p)}if(h.moveup_button){const p=c!==0;this.setButtonState(h.moveup_button,p),i.push(p)}if(h.movedown_button){const p=c!==this.rows.length-1;this.setButtonState(h.movedown_button,p),i.push(p)}});const s=i.some(h=>h);this.rows.forEach(h=>this.setButtonState(h.controls_cell,s)),this.setButtonState(this.controls_header_cell,s),this.setButtonState(this.table,this.value.length);const o=!(e||this.hide_add_button);this.setButtonState(this.add_row_button,o);const n=!(!this.value.length||t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,n);const a=!(this.value.length<=1||t||this.hide_delete_all_rows_buttons);this.setButtonState(this.remove_all_rows_button,a);const l=o||n||a;this.setButtonState(this.controls,l)}refreshValue(){this.value=[],this.rows.forEach((t,e)=>{this.value[e]=t.getValue()}),this.serialized=JSON.stringify(this.value)}addRow(t){const e=this.rows.length;this.rows[e]=this.getElementEditor(e);const i=this.rows[e].table_controls;return this.hide_delete_buttons||(this.rows[e].delete_button=this._createDeleteButton(e,i)),this.show_copy_button&&(this.rows[e].copy_button=this._createCopyButton(e,i)),this.hide_move_buttons||(this.rows[e].moveup_button=this._createMoveUpButton(e,i)),this.hide_move_buttons||(this.rows[e].movedown_button=this._createMoveDownButton(e,i)),typeof t<"u"&&this.rows[e].setValue(t),this.rows[e]}_createDeleteButton(t,e){const i=this.getButton("","delete","button_delete_row_title_short");return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{if(s.preventDefault(),s.stopPropagation(),!this.askConfirmation())return!1;const o=s.currentTarget.getAttribute("data-i")*1,n=this.getValue(),a=this.getValue()[o];n.splice(o,1),this.setValue(n),this.onChange(!0),this.jsoneditor.trigger("deleteRow",a)}),e.appendChild(i),i}_createCopyButton(t,e){const i=this.getButton("","copy","button_copy_row_title_short"),s=this.schema;return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation();const n=o.currentTarget.getAttribute("data-i")*1,a=this.getValue();let l=a[n];s.items.type==="string"&&s.items.format==="uuid"?l=yi():s.items.type==="object"&&s.items.properties&&a.forEach((h,c)=>{if(n===c)for(const p of Object.keys(h))s.items.properties&&s.items.properties[p]&&s.items.properties[p].format==="uuid"&&(l=Object.assign({},a[n]),l[p]=yi())}),a.splice(n+1,0,l),this.setValue(a),this.onChange(!0),this.jsoneditor.trigger("copyRow",this.rows[n+1])}),e.appendChild(i),i}_createMoveUpButton(t,e){const i=this.getButton("","moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const o=s.currentTarget.getAttribute("data-i")*1,n=this.getValue();n.splice(o-1,0,n.splice(o,1)[0]),this.setValue(n),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[o-1])}),e.appendChild(i),i}_createMoveDownButton(t,e){const i=this.getButton("","movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const o=s.currentTarget.getAttribute("data-i")*1,n=this.getValue();n.splice(o+1,0,n.splice(o,1)[0]),this.setValue(n),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[o+1])}),e.appendChild(i),i}addControls(){this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.title_controls&&(this.title.insertBefore(this.toggle_button,this.title.childNodes[0]),this.toggle_button.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.setButtonState(this.panel,this.collapsed),this.collapsed?(this.collapsed=!1,this.setButtonText(t.currentTarget,"","collapse","button_collapse")):(this.collapsed=!0,this.setButtonText(t.currentTarget,"","expand","button_expand"))}),this.options.collapsed&&se(this.toggle_button,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none")),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton()}_createToggleButton(){const t=this.getButton("","collapse","button_collapse");return t.classList.add("json-editor-btntype-toggle"),t}_createAddRowButton(){const t=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-add"),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const i=this.addRow();this.refreshValue(),this.refreshRowButtons(),this.onChange(!0),this.jsoneditor.trigger("addRow",i)}),this.controls.appendChild(t),t}_createDeleteLastRowButton(){const t=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-deletelast"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue(),s=i.pop();this.setValue(i),this.onChange(!0),this.jsoneditor.trigger("deleteRow",s)}),this.controls.appendChild(t),t}_createRemoveAllRowsButton(){const t=this.getButton("button_delete_all","delete","button_delete_all_title");return t.classList.add("json-editor-btntype-deleteall"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();this.setValue([]),this.onChange(!0),this.jsoneditor.trigger("deleteAllRows",i)}),this.controls.appendChild(t),t}}class qc extends Bt{getNumColumns(){return 4}build(){if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.hidden&&(this.container.style.display="none"),this.options=this.expandCallbacks("upload",$({},{title:"Browse",icon:"",auto_upload:!1,hide_input:!1,enable_drag_drop:!1,drop_zone_text:"Drag & Drop file here",drop_zone_top:!1,alt_drop_zone:"",mime_type:"",max_upload_size:0,upload_handler:(i,s,o,n)=>{window.alert(`No upload_handler defined for "${i.path}". You must create your own handler to enable upload to server`)}},this.defaults.options.upload||{},this.options.upload||{})),this.options.mime_type=this.options.mime_type?[].concat(this.options.mime_type):[],this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(typeof this.options.upload_handler!="function")throw new Error("Upload handler required for upload editor");if(this.uploader=this.theme.getFormInputField("file"),this.uploader.style.display="none",this.options.mime_type.length&&this.uploader.setAttribute("accept",this.options.mime_type),this.options.enable_drag_drop===!0&&this.options.hide_input===!0||(this.clickHandler=i=>{this.uploader.dispatchEvent(new window.MouseEvent("click",{view:window,bubbles:!0,cancelable:!1}))},this.browseButton=this.getButton(this.options.title,this.options.icon,this.options.title),this.browseButton.addEventListener("click",this.clickHandler),this.fileDisplay=this.theme.getFormInputField("input"),this.fileDisplay.setAttribute("readonly",!0),this.fileDisplay.value="No file selected.",this.fileDisplay.addEventListener("dblclick",this.clickHandler),this.fileUploadGroup=this.theme.getInputGroup(this.fileDisplay,[this.browseButton]),this.fileUploadGroup||(this.fileUploadGroup=document.createElement("div"),this.fileUploadGroup.appendChild(this.fileDisplay),this.fileUploadGroup.appendChild(this.browseButton))),this.options.enable_drag_drop===!0){if(this.options.alt_drop_zone!=="")if(this.altDropZone=document.querySelector(this.options.alt_drop_zone),this.altDropZone)this.dropZone=this.altDropZone;else throw new Error(`Error: alt_drop_zone selector "${this.options.alt_drop_zone}" not found!`);else this.dropZone=this.theme.getDropZone(this.options.drop_zone_text);this.dropZone&&(this.dropZone.classList.add("upload-dropzone"),this.dropZone.addEventListener("dblclick",this.clickHandler))}this.uploadHandler=i=>{i.preventDefault(),i.stopPropagation();const s=i.target.files||i.dataTransfer.files;if(s&&s.length)if(this.options.max_upload_size!==0&&s[0].size>this.options.max_upload_size)this.theme.addInputError(this.uploader,`${this.translate("upload_max_size")} ${this.options.max_upload_size}`);else if(this.options.mime_type.length!==0&&!this.isValidMimeType(s[0].type,this.options.mime_type))this.theme.addInputError(this.uploader,`${this.translate("upload_wrong_file_format")} ${this.options.mime_type.toString()}`);else{this.fileDisplay&&(this.fileDisplay.value=s[0].name);let o=new window.FileReader;o.onload=n=>{this.preview_value=n.target.result,this.refreshPreview(s),this.onChange(!0),o=null},o.readAsDataURL(s[0])}},this.uploader.addEventListener("change",this.uploadHandler),this.dragHandler=i=>{const s=i.dataTransfer.items||i.dataTransfer.files,o=s&&s.length&&(this.options.mime_type.length===0||this.isValidMimeType(s[0].type,this.options.mime_type)),n=i.currentTarget.classList&&i.currentTarget.classList.contains("upload-dropzone")&&o;switch((i.currentTarget===window?"w_":"e_")+i.type){case"w_drop":case"w_dragover":n||(i.dataTransfer.dropEffect="none");break;case"e_dragenter":{n?(this.dropZone.classList.add("valid-dropzone"),i.dataTransfer.dropEffect="copy"):this.dropZone.classList.add("invalid-dropzone");break}case"e_dragover":{n&&(i.dataTransfer.dropEffect="copy");break}case"e_dragleave":this.dropZone.classList.remove("valid-dropzone","invalid-dropzone");break;case"e_drop":{this.dropZone.classList.remove("valid-dropzone","invalid-dropzone"),n&&this.uploadHandler(i);break}}n||i.preventDefault()},this.options.enable_drag_drop===!0&&(["dragover","drop"].forEach(i=>{window.addEventListener(i,this.dragHandler,!0)}),["dragenter","dragover","dragleave","drop"].forEach(i=>{this.dropZone.addEventListener(i,this.dragHandler,!0)}))}this.preview=document.createElement("div"),this.control=this.input.controlgroup=this.theme.getFormControl(this.label,this.uploader||this.input,this.description,this.infoButton),this.uploader&&(this.uploader.controlgroup=this.control);const t=this.uploader||this.input,e=document.createElement("div");this.dropZone&&!this.altDropZone&&this.options.drop_zone_top===!0&&e.appendChild(this.dropZone),this.fileUploadGroup&&e.appendChild(this.fileUploadGroup),this.dropZone&&!this.altDropZone&&this.options.drop_zone_top!==!0&&e.appendChild(this.dropZone),e.appendChild(this.preview),t.parentNode.insertBefore(e,t.nextSibling),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{this.afterInputReady()})}afterInputReady(){if(this.value){const t=document.createElement("img");t.style.maxWidth="100%",t.style.maxHeight="100px",t.onload=e=>{this.preview.appendChild(t)},t.onerror=e=>{console.error("upload error",e,e.currentTarget)},t.src=this.container.querySelector("a").href}this.theme.afterInputReady(this.input)}refreshPreview(t){if(this.last_preview===this.preview_value||(this.last_preview=this.preview_value,this.preview.innerHTML="",!this.preview_value))return;const e=t[0],i=this.preview_value.match(/^data:([^;,]+)[;,]/);if(e.mimeType=i?i[1]:"unknown",e.size>0){const o=Math.floor(Math.log(e.size)/Math.log(1024));e.formattedSize=`${parseFloat((e.size/1024**o).toFixed(2))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}`}else e.formattedSize="0 Bytes";const s=this.getButton("button_upload","upload","button_upload");s.addEventListener("click",o=>{o.preventDefault(),s.setAttribute("disabled","disabled"),this.theme.removeInputError(this.uploader),this.theme.getProgressBar&&(this.progressBar=this.theme.getProgressBar(),this.preview.appendChild(this.progressBar)),this.options.upload_handler(this.path,e,{success:n=>{this.setValue(n),this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange(),this.progressBar&&this.preview.removeChild(this.progressBar),s.removeAttribute("disabled")},failure:n=>{this.theme.addInputError(this.uploader,n),this.progressBar&&this.preview.removeChild(this.progressBar),s.removeAttribute("disabled")},updateProgress:n=>{this.progressBar&&(n?this.theme.updateProgressBar(this.progressBar,n):this.theme.updateProgressBarUnknown(this.progressBar))}})}),this.preview.appendChild(this.theme.getUploadPreview(e,s,this.preview_value)),this.options.auto_upload&&(s.dispatchEvent(new window.MouseEvent("click")),s.parentNode.removeChild(s))}enable(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),super.disable()}setValue(t){this.value!==t&&(this.value=t,this.input.value=this.value,this.onChange())}destroy(){this.options.enable_drag_drop===!0&&(["dragover","drop"].forEach(t=>{window.removeEventListener(t,this.dragHandler,!0)}),["dragenter","dragover","dragleave","drop"].forEach(t=>{this.dropZone.removeEventListener(t,this.dragHandler,!0)}),this.dropZone.removeEventListener("dblclick",this.clickHandler),this.dropZone&&this.dropZone.parentNode&&this.dropZone.parentNode.removeChild(this.dropZone)),this.uploader&&this.uploader.parentNode&&(this.uploader.removeEventListener("change",this.uploadHandler),this.uploader.parentNode.removeChild(this.uploader)),this.browseButton&&this.browseButton.parentNode&&(this.browseButton.removeEventListener("click",this.clickHandler),this.browseButton.parentNode.removeChild(this.browseButton)),this.fileDisplay&&this.fileDisplay.parentNode&&(this.fileDisplay.removeEventListener("dblclick",this.clickHandler),this.fileDisplay.parentNode.removeChild(this.fileDisplay)),this.fileUploadGroup&&this.fileUploadGroup.parentNode&&this.fileUploadGroup.parentNode.removeChild(this.fileUploadGroup),this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.header&&this.header.parentNode&&this.header.parentNode.removeChild(this.header),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}isValidMimeType(t,e){return e.reduce((i,s)=>i||new RegExp(s.replace(/\*/g,".*"),"gi").test(t),!1)}}class Uc extends Gt{preBuild(){super.preBuild(),this.schema.default=this.uuid=this.getUuid(),this.schema.options||(this.schema.options={}),this.schema.options.cleave||(this.schema.options.cleave={delimiters:["-"],blocks:[8,4,4,4,12]})}build(){super.build(),this.disable(!0),this.input.setAttribute("readonly","true")}sanitize(t){return this.testUuid(t)||(t=this.uuid),t}setValue(t,e,i){this.testUuid(t)||(t=this.uuid),this.uuid=t,super.setValue(t,e,i)}getUuid(){return yi()}testUuid(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}}class Wc extends Gt{postBuild(){window.Picker&&(this.input.type="text"),this.input.style.padding="3px"}setValue(t,e,i){const s=super.setValue(t,e,i);return this.picker_instance&&this.picker_instance.domElement&&s&&s.changed&&this.picker_instance.setColor(s.value,!0),s}getNumColumns(){return 2}afterInputReady(){super.afterInputReady(),this.createPicker(!0)}disable(){if(super.disable(),this.picker_instance&&this.picker_instance.domElement){this.picker_instance.domElement.style.pointerEvents="none";const t=this.picker_instance.domElement.querySelectorAll("button");for(let e=0;e<t.length;e++)t[e].disabled=!0}}enable(){if(super.enable(),this.picker_instance&&this.picker_instance.domElement){this.picker_instance.domElement.style.pointerEvents="auto";const t=this.picker_instance.domElement.querySelectorAll("button");for(let e=0;e<t.length;e++)t[e].disabled=!1}}destroy(){this.createPicker(!1),super.destroy()}createPicker(t){if(t){if(window.Picker&&!this.picker_instance){const e=this.expandCallbacks("colorpicker",$({},{editor:!1,alpha:!1,color:this.value,popup:"bottom"},this.defaults.options.colorpicker||{},this.options.colorpicker||{},{parent:this.container})),i=s=>{const o=this.picker_instance.settings.editorFormat,n=this.picker_instance.settings.alpha;this.setValue(o==="hex"?n?s.hex:s.hex.slice(0,7):s[`${o+(n?"a":"")}String`])};!e.popup&&typeof e.onChange!="function"?e.onChange=i:e.popup&&typeof e.onDone!="function"&&(e.onDone=i),this.picker_instance=new window.Picker(e),e.popup||(this.input.style.display="none",this.theme.afterInputReady(this.picker_instance.domElement))}}else this.picker_instance&&(this.picker_instance.destroy(),this.picker_instance=null,this.input.style.display="")}}const hs={ace:pc,array:Zr,arrayChoices:mc,arraySelect2:gc,arraySelectize:bc,autocomplete:fc,base64:yc,button:zn,checkbox:vc,choices:qn,datetime:wc,describedBy:xc,enum:Cc,hidden:Ec,info:kc,integer:Wn,ip:Lc,jodit:Ac,multiple:Oc,multiselect:us,null:Pc,number:Un,object:Zn,radio:Ic,sceditor:Nc,select:xi,select2:Mc,selectize:Hc,signature:Rc,simplemde:Dc,starrating:Jn,stepper:Fc,string:Gt,table:zc,upload:qc,uuid:Uc,colorpicker:Wc},Gc="html",Zc="default",Jc={},Yc={},Xc={},Qc={},Yn={},Kc=[],Jr="en",tp=Jr;Yn.en={error_notset:"Property must be set",error_notempty:"Value required",error_enum:"Value must be one of the enumerated values",error_const:"Value must be the constant value",error_anyOf:"Value must validate against at least one of the provided schemas",error_oneOf:"Value must validate against exactly one of the provided schemas. It currently validates against {{0}} of the schemas.",error_not:"Value must not validate against the provided schema",error_type_union:"Value must be one of the provided types",error_type:"Value must be of type {{0}}",error_disallow_union:"Value must not be one of the provided disallowed types",error_disallow:"Value must not be of type {{0}}",error_multipleOf:"Value must be a multiple of {{0}}",error_maximum_excl:"Value must be less than {{0}}",error_maximum_incl:"Value must be at most {{0}}",error_minimum_excl:"Value must be greater than {{0}}",error_minimum_incl:"Value must be at least {{0}}",error_maxLength:"Value must be at most {{0}} characters long",error_contains:"No items match contains",error_minContains:"Contains match count {{0}} is less than minimum contains count of {{1}}",error_maxContains:"Contains match count {{0}} exceeds maximum contains count of {{1}}",error_minLength:"Value must be at least {{0}} characters long",error_pattern:"Value must match the pattern {{0}}",error_additionalItems:"No additional items allowed in this array",error_maxItems:"Value must have at most {{0}} items",error_minItems:"Value must have at least {{0}} items",error_uniqueItems:"Array must have unique items",error_maxProperties:"Object must have at most {{0}} properties",error_minProperties:"Object must have at least {{0}} properties",error_required:"Object is missing the required property '{{0}}'",error_additional_properties:"No additional properties allowed, but property {{0}} is set",error_property_names_exceeds_maxlength:"Property name {{0}} exceeds maxLength",error_property_names_enum_mismatch:"Property name {{0}} does not match any enum values",error_property_names_const_mismatch:"Property name {{0}} does not match the const value",error_property_names_pattern_mismatch:"Property name {{0}} does not match pattern",error_property_names_false:"Property name {{0}} fails when propertyName is false",error_property_names_maxlength:"Property name {{0}} cannot match invalid maxLength",error_property_names_enum:"Property name {{0}} cannot match invalid enum",error_property_names_pattern:"Property name {{0}} cannot match invalid pattern",error_property_names_unsupported:"Unsupported propertyName {{0}}",error_dependency:"Must have property {{0}}",error_date:"Date must be in the format {{0}}",error_time:"Time must be in the format {{0}}",error_datetime_local:"Datetime must be in the format {{0}}",error_invalid_epoch:"Date must be greater than 1 January 1970",error_ipv4:"Value must be a valid IPv4 address in the form of 4 numbers between 0 and 255, separated by dots",error_ipv6:"Value must be a valid IPv6 address",error_hostname:"The hostname has the wrong format",upload_max_size:"Filesize too large. Max size is ",upload_wrong_file_format:"Wrong file format. Allowed format(s): ",button_save:"Save",button_copy:"Copy",button_cancel:"Cancel",button_add:"Add",button_delete_all:"All",button_delete_all_title:"Delete All",button_delete_last:"Last {{0}}",button_delete_last_title:"Delete Last {{0}}",button_add_row_title:"Add {{0}}",button_move_down_title:"Move down",button_move_up_title:"Move up",button_properties:"Properties",button_object_properties:"Object Properties",button_copy_row_title:"Copy {{0}}",button_delete_row_title:"Delete {{0}}",button_delete_row_title_short:"Delete",button_copy_row_title_short:"Copy",button_collapse:"Collapse",button_expand:"Expand",button_edit_json:"Edit JSON",button_upload:"Upload",flatpickr_toggle_button:"Toggle",flatpickr_clear_button:"Clear",choices_placeholder_text:"Start typing to add value",default_array_item_title:"item",button_delete_node_warning:"Are you sure you want to remove this item?",table_controls:"Controls"};Object.entries(hs).forEach(([r,t])=>{hs[r].options=t.options||{}});function ep(r,t,e){console.log("Upload handler required for upload editor")}function ip(r,t,e){let i={};e&&e.options&&e.options.error_messages&&e.options.error_messages[Se.language]&&(i=e.options.error_messages[Se.language]);const s=Se.languages[Se.language];if(!s)throw new Error(`Unknown language ${Se.language}`);let o=i[r]||s[r]||Se.languages[Jr][r]||r;if(t)for(let n=0;n<t.length;n++)o=o.replace(new RegExp(`\\{\\{${n}}}`,"g"),t[n]);return o}function sp(r,t){return r}const rp={upload:ep,use_name_attributes:!0,prompt_before_delete:!0,use_default_values:!0,max_depth:0,button_state_mode:1,case_sensitive_property_search:!0,show_errors:"interaction"},Se={options:rp,theme:Gc,template:Zc,themes:Yc,callbacks:Jc,templates:Xc,iconlibs:Qc,editors:hs,languages:Yn,resolvers:nc,custom_validators:Kc,default_language:Jr,language:tp,translate:ip,translateProperty:sp};class op{constructor(t){this.options=t||{},this.schema={},this.refs=this.options.refs||{},this.refs_with_info={},this.refs_prefix="#/counter/",this.refs_counter=1,this._subSchema1={type(e){typeof e.type=="object"&&(e.type=this._expandSubSchema(e.type))},disallow(e){typeof e.disallow=="object"&&(e.disallow=this._expandSubSchema(e.disallow))},anyOf(e){Object.entries(e.anyOf).forEach(([i,s])=>{e.anyOf[i]=this.expandSchema(s)})},dependencies(e){Object.entries(e.dependencies).forEach(([i,s])=>{typeof s=="object"&&!Array.isArray(s)&&(e.dependencies[i]=this.expandSchema(s))})},not(e){e.not=this.expandSchema(e.not)}},this._subSchema2={allOf(e,i){let s=$({},i);return Object.entries(e.allOf).forEach(([o,n])=>{e.allOf[o]=this.expandRefs(n,!0),s=this.extendSchemas(s,this.expandSchema(n))}),delete s.allOf,s},extends(e,i){let s;return Array.isArray(e.extends)?s=e.extends.reduce((o,n,a)=>this.extendSchemas(o,this.expandSchema(n)),i):s=this.extendSchemas(i,this.expandSchema(e.extends)),delete s.extends,s},oneOf(e,i){const s=$({},i);return delete s.oneOf,e.oneOf.reduce((o,n,a)=>(o.oneOf[a]=this.extendSchemas(this.expandSchema(n),s),o),i),i}}}async load(t,e,i){return this.schema=t,await this._asyncloadExternalRefs(t,e,this._getFileBase(i),!0),this.expandRefs(t)}expandRefs(t,e){const i=$({},t);if(!i.$ref)return i;const s=i.$ref.split("#");if(s.length===2&&!this.refs_with_info[i.$ref]){const l=this.expandRecursivePointer(this.schema,s[1]),h=this.extendSchemas(i,this.expandSchema(l));return delete h.$ref,h}const o=s.length>2?this.refs_with_info["#"+s[1]]:this.refs_with_info[i.$ref];delete i.$ref;const n=o.$ref.startsWith("#")?o.fetchUrl:"",a=this._getRef(n,o);if(!this.refs[a])console.warn(`reference:'${a}' not found!`);else if(e&&Wt(this.refs[a],"allOf")){const l=this.refs[a].allOf;Object.keys(l).forEach(h=>{l[h]=this.expandRefs(l[h],!0)})}return s.length>2?this.extendSchemas(i,this.expandSchema(this.expandRecursivePointer(this.refs[a],s[2]))):this.extendSchemas(i,this.expandSchema(this.refs[a]))}expandRecursivePointer(t,e){let i=t;return e.split("/").slice(1).forEach(s=>{i[s]&&(i=i[s])}),i.$refs&&i.$refs.startsWith("#")?this.expandRecursivePointer(t,i.$refs):i}expandSchema(t){Object.entries(this._subSchema1).forEach(([i,s])=>{t[i]&&s.call(this,t)});let e=$({},t);return Object.entries(this._subSchema2).forEach(([i,s])=>{t[i]&&(e=s.call(this,t,e))}),this.expandRefs(e)}_getRef(t,e){const i=t+e;return this.refs[i]?i:t+decodeURIComponent(e.$ref)}_expandSubSchema(t){return Array.isArray(t)?t.map(e=>typeof e=="object"?this.expandSchema(e):e):this.expandSchema(t)}_manageRecursivePointer(t,e){Object.keys(t).forEach(i=>{t[i].$ref&&t[i].$ref.indexOf("#")===0&&(t[i].$ref=e+t[i].$ref)})}_getExternalRefs(t,e,i=!1){i||this._manageRecursivePointer(t,e);const s={},o=n=>Object.keys(n).forEach(a=>{s[a]=!0});if(t.$ref&&typeof t.$ref!="object"&&!(t.$ref.indexOf("#")===0&&i)){let n=t.$ref,a="";n.indexOf("#")>0&&(n=n.substr(0,n.indexOf("#"))),n!==t.$ref&&(a=t.$ref.substr(t.$ref.indexOf("#")));const l=this.refs_prefix+this.refs_counter++,h=l+a;t.$ref.substr(0,1)!=="#"&&!this.refs[t.$ref]&&(s[n]=!0),this.refs_with_info[l]={fetchUrl:e,$ref:n},t.$ref=h}return Object.values(t).forEach(n=>{!n||typeof n!="object"||(Array.isArray(n)?Object.values(n).forEach(a=>{a&&typeof a=="object"&&o(this._getExternalRefs(a,e,i))}):(!n.$ref||!(typeof n.$ref=="string"&&n.$ref.startsWith("#")))&&o(this._getExternalRefs(n,e,i)))}),t.id&&typeof t.id=="string"&&t.id.substr(0,4)==="urn:"?this.refs[t.id]=t:t.$id&&typeof t.$id=="string"&&t.$id.substr(0,4)==="urn:"&&(this.refs[t.$id]=t),s}_getFileBase(t){if(!t)return"/";const{ajaxBase:e}=this.options;return typeof e>"u"?this._getFileBaseFromFileLocation(t):e}_getFileBaseFromFileLocation(t){const e=t.split("/");return e.pop(),`${e.join("/")}/`}_joinUrl(t,e){var i=t;return t.substr(0,7)!=="http://"&&t.substr(0,8)!=="https://"&&t.substr(0,5)!=="blob:"&&t.substr(0,5)!=="data:"&&t.substr(0,1)!=="#"&&t.substr(0,1)!=="/"&&(i=e+t),i.indexOf("#")>0&&(i=i.substr(0,i.indexOf("#"))),i}_isUniformResourceName(t){return t.substr(0,4)==="urn:"}async _asyncloadExternalRefs(t,e,i,s=!1){const o=this._getExternalRefs(t,e,s);let n=0;for(const a of Object.keys(o)){if(typeof a>"u"||this.refs[a])continue;if(this._isUniformResourceName(a)){this.refs[a]="loading",n++;const p=this.options.urn_resolver;let b=a;if(typeof p!="function")throw console.log(`No "urn_resolver" callback defined to resolve "${b}"`),new Error(`Must set urn_resolver option to a callback to resolve ${b}`);b.indexOf("#")>0&&(b=b.substr(0,b.indexOf("#")));let g;try{let y;g=await p(b);try{y=JSON.parse(g)}catch(w){throw console.log(w),new Error(`Failed to parse external ref ${b}`)}if(!(typeof y=="boolean"||typeof y=="object")||y===null||Array.isArray(y))throw new Error(`External ref does not contain a valid schema - ${b}`);this.refs[a]=y,await this._asyncloadExternalRefs(y,a,i)}catch(y){throw console.log(y),new Error(`Failed to parse external ref ${b}`)}if(typeof g=="boolean")throw new Error(`External ref does not contain a valid schema - ${b}`);continue}if(!this.options.ajax)throw new Error(`Must set ajax option to true to load external ref ${a}`);n++;let l=this._joinUrl(a,i),h;if(this.options.ajax_cache_responses){const p=this.cacheGet(l);p&&(h=p)}if(!h){const p=await new Promise(b=>{const g=new XMLHttpRequest;this.options.ajaxCredentials&&(g.withCredentials=this.options.ajaxCredentials),g.overrideMimeType("application/json"),g.open("GET",l,!0),g.onload=()=>{b(g)},g.onerror=y=>{b(void 0)},g.send()});if(typeof p>"u")throw new Error(`Failed to fetch ref via ajax - ${a}`);try{h=JSON.parse(p.responseText),this.onSchemaLoaded({schema:h,schemaUrl:l}),this.options.ajax_cache_responses&&this.cacheSet(l,h)}catch(b){throw console.log(b),new Error(`Failed to parse external ref ${l}`)}}if(!(typeof h=="boolean"||typeof h=="object")||h===null||Array.isArray(h))throw new Error(`External ref does not contain a valid schema - ${l}`);this.refs[a]=h;const c=this._getFileBaseFromFileLocation(l);if(l!==a){const p=l.split("/");l=(a.substr(0,1)==="/"?"/":"")+p.pop()}await this._asyncloadExternalRefs(h,l,c)}if(!n)return!0;this.onAllSchemasLoaded()}onSchemaLoaded(t){}onAllSchemasLoaded(){}extendSchemas(t,e){t=$({},t),e=$({},e);const i={},s=(a,l)=>(a==="required"||a==="defaultProperties")&&typeof l=="object"&&Array.isArray(l),o=(a,l)=>{s(a,l)?i[a]=l.concat(e[a]).reduce((h,c)=>(h.includes(c)||h.push(c),h),[]):a==="type"&&(typeof l=="string"||Array.isArray(l))?n(l):typeof l=="object"&&!Array.isArray(l)&&l!==null?i[a]=this.extendSchemas(l,e[a]):i[a]=l},n=a=>{typeof a=="string"&&(a=[a]),typeof e.type=="string"&&(e.type=[e.type]),!e.type||!e.type.length?i.type=a:i.type=a.filter(l=>e.type.includes(l)),i.type.length===1&&typeof i.type[0]=="string"?i.type=i.type[0]:i.type.length===0&&delete i.type};return Object.entries(t).forEach(([a,l])=>{typeof e[a]<"u"?o(a,l):i[a]=l}),Object.entries(e).forEach(([a,l])=>{typeof t[a]>"u"&&(i[a]=l)}),i}getCacheKey(t){return["je-cache",t].join("::")}getCacheBuster(){return this.options.ajax_cache_buster||new Date().toISOString().slice(0,10)}cacheSet(t,e){try{window.localStorage.setItem(this.getCacheKey(t),JSON.stringify({cacheBuster:this.getCacheBuster(),schema:e}))}catch(i){console.error(i)}}cacheGet(t){try{const e=window.localStorage.getItem(this.getCacheKey(t));if(e){const i=JSON.parse(e);if(i.cacheBuster&&i.schema&&i.cacheBuster===this.getCacheBuster())return i.schema;this.cacheDelete(t)}}catch(e){console.error(e)}}cacheDelete(t){window.localStorage.removeItem(this.getCacheKey(t))}}const np=()=>({compile(r){const t=r.match(/{{\s*([a-zA-Z0-9\-_ .]+)\s*}}/g),e=t&&t.length;if(!e)return()=>r;const i=[],s=n=>{let a=t[n].replace(/[{}]+/g,"").trim().split(".");const l=a.length;let h;if(l>1){let c;h=p=>{for(c=p,n=0;n<l&&(c=c[a[n]],!!c);n++);return c}}else a=a[0],h=c=>c[a];i.push({s:t[n],r:h})};for(var o=0;o<e;o++)s(o);return n=>{let a=`${r}`,l;for(o=0;o<e;o++)l=i[o],a=a.replace(l.s,l.r(n));return a}}}),ap=()=>window.EJS?{compile(r){const t=new window.EJS({text:r});return e=>t.render(e)}}:!1,lp=()=>window.Handlebars,hp=()=>window.Hogan?{compile(r){const t=window.Hogan.compile(r);return e=>t.render(e)}}:!1,dp=()=>window._?{compile(r){return t=>window._.template(r)(t)}}:!1,cp=()=>!window.Mark||!window.Mark.up?!1:{compile(r){return t=>window.Mark.up(r,t)}},pp=()=>window.Mustache?{compile(r){return t=>window.Mustache.render(r,t)}}:!1,up=()=>window.swig,mp=()=>window._?{compile(r){return t=>window._.template(r)(t)}}:!1,gp={default:np,ejs:ap,handlebars:lp,hogan:hp,lodash:dp,markup:cp,mustache:pp,swig:up,underscore:mp},bp={collapse:"",expand:"",delete:"",edit:"",add:"",cancel:"",save:"",moveup:"",movedown:""};class me{constructor(t="",e=bp){this.mapping=e,this.icon_prefix=t}getIconClass(t){return this.mapping[t]?this.icon_prefix+this.mapping[t]:this.icon_prefix+t}getIcon(t){const e=this.getIconClass(t);if(!e)return null;const i=document.createElement("i");return i.classList.add(...e.split(" ")),i}}const fp="glyphicon glyphicon-",yp={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"floppy-remove",save:"floppy-saved",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};class vp extends me{constructor(){super(fp,yp)}}const _p="icon-",wp={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban-circle",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};class xp extends me{constructor(){super(_p,wp)}}const Cp="fa fa-",Ep={collapse:"caret-square-o-down",expand:"caret-square-o-right",delete:"times",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"files-o",clear:"times-circle-o",time:"clock-o",calendar:"calendar",edit_properties:"list"};class kp extends me{constructor(){super(Cp,Ep)}}const Lp="fas fa-",Ap={collapse:"caret-down",expand:"caret-right",delete:"trash",edit:"pen",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"times-circle",time:"clock",calendar:"calendar",edit_properties:"list"};class jp extends me{constructor(){super(Lp,Ap)}}const Sp="ui-icon ui-icon-",Tp={collapse:"triangle-1-s",expand:"triangle-1-e",delete:"trash",edit:"pencil",add:"plusthick",subtract:"minusthick",cancel:"closethick",save:"disk",moveup:"arrowthick-1-n",moveright:"arrowthick-1-e",movedown:"arrowthick-1-s",moveleft:"arrowthick-1-w",copy:"copy",clear:"circle-close",time:"time",calendar:"calendar",edit_properties:"note"};class $p extends me{constructor(){super(Sp,Tp)}}const Op="oi oi-",Pp={collapse:"collapse-down",expand:"expand-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"file",moveup:"arrow-thick-top",moveright:"arrow-thick-right",movedown:"arrow-thick-bottom",moveleft:"arrow-thick-left",copy:"clipboard",clear:"circle-x",time:"clock",calendar:"calendar",edit_properties:"list"};class Bp extends me{constructor(){super(Op,Pp)}}const Ip="icon icon-",Np={collapse:"arrow-down",expand:"arrow-right",delete:"delete",edit:"edit",add:"plus",subtract:"minus",cancel:"cross",save:"check",moveup:"upward",moveright:"forward",movedown:"downward",moveleft:"back",copy:"copy",clear:"close",time:"time",calendar:"bookmark",edit_properties:"menu"};class Mp extends me{constructor(){super(Ip,Np)}}const Hp="bi bi-",Rp={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"dash",cancel:"x-circle",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"clipboard",clear:"x-circle",time:"clock",calendar:"calendar",edit_properties:"list-ul"};class Dp extends me{constructor(){super(Hp,Rp)}}const Vp={bootstrap:Dp,bootstrap3:vp,fontawesome3:xp,fontawesome4:kp,fontawesome5:jp,jqueryui:$p,openiconic:Bp,spectre:Mp},Jo=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].find(r=>r in document.documentElement);class ge{constructor(t,e={disable_theme_rules:!1}){this.jsoneditor=t,Object.keys(e).forEach(i=>{typeof t.options[i]<"u"&&(e[i]=t.options[i])}),this.options=e}getContainer(){return document.createElement("div")}getFloatRightLinkHolder(){const t=document.createElement("div");return t.classList.add("je-float-right-linkholder"),t}getModal(){const t=document.createElement("div");return t.style.display="none",t.classList.add("je-modal"),t}getGridContainer(){return document.createElement("div")}getGridRow(){const t=document.createElement("div");return t.classList.add("row"),t}getGridColumn(){return document.createElement("div")}setGridColumnSize(t,e){}getLink(t){const e=document.createElement("a");return e.setAttribute("href","#"),e.appendChild(document.createTextNode(t)),e}disableHeader(t){t.style.color="#ccc"}disableLabel(t){t.style.color="#ccc"}enableHeader(t){t.style.color=""}enableLabel(t){t.style.color=""}getInfoButton(t){const e=document.createElement("span");e.innerText="ⓘ",e.classList.add("je-infobutton-icon");const i=document.createElement("span");return i.classList.add("je-infobutton-tooltip"),i.innerText=t,e.onmouseover=()=>{i.style.visibility="visible"},e.onmouseleave=()=>{i.style.visibility="hidden"},e.appendChild(i),e}getFormInputLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(t)),e&&i.classList.add("required"),i}getLabelLike(t,e){const i=document.createElement("b");return i.appendChild(document.createTextNode(t)),e&&i.classList.add("required"),i}getHeader(t,e){const i=document.createElement("span");return typeof t=="string"?i.textContent=t:i.appendChild(t),i.classList.add("je-header"),i}getCheckbox(){const t=this.getFormInputField("checkbox");return t.classList.add("je-checkbox"),t}getCheckboxLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(` ${t}`)),e&&i.classList.add("required"),i}getMultiCheckboxHolder(t,e,i,s){const o=document.createElement("div");return o.classList.add("control-group"),e&&(e.style.display="block",o.appendChild(e),s&&e.appendChild(s)),Object.values(t).forEach(n=>{n.style.display="inline-block",n.style.marginRight="20px",o.appendChild(n)}),i&&o.appendChild(i),o}getFormCheckboxControl(t,e,i){const s=document.createElement("div");return s.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),i&&s.classList.add("je-checkbox-control--compact"),s}getFormRadio(t){const e=this.getFormInputField("radio");return Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),e.classList.add("je-radio"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(` ${t}`)),e&&i.classList.add("required"),i}getFormRadioControl(t,e,i,s){const o=document.createElement("div");return o.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),i&&o.classList.add("je-radio-control--compact"),e.tagName.toLowerCase()!=="div"&&s&&t&&e&&(e.setAttribute("id",s),e.setAttribute("aria-labelledby",s),t.setAttribute("for",s)),o}getSelectInput(t,e){const i=document.createElement("select");return t&&this.setSelectOptions(i,t),i}getSwitcher(t){const e=this.getSelectInput(t,!1);return e.classList.add("je-switcher"),e}getSwitcherOptions(t){return t.getElementsByTagName("option")}setSwitcherOptions(t,e,i){this.setSelectOptions(t,e,i)}setSelectOptions(t,e,i=[]){t.innerHTML="";for(let s=0;s<e.length;s++){const o=document.createElement("option");o.setAttribute("value",e[s]),o.textContent=i[s]||e[s],t.appendChild(o)}}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("je-textarea"),t}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;"),e}visuallyHidden(t){t&&t.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;"),e}getRangeInput(t,e,i,s,o){const n=this.getFormInputField("range");return n.setAttribute("min",t),n.setAttribute("max",e),n.setAttribute("step",i),s&&(s.setAttribute("id",o+"-description"),n.setAttribute("aria-describedby",o+"-description")),n}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("button");i.setAttribute("type","button"),i.classList.add("stepper-down");const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("stepper-up"),t.getAttribute("readonly")&&(i.setAttribute("disabled",!0),s.setAttribute("disabled",!0)),i.textContent="-",s.textContent="+";const o=(l,h)=>{h?l.value=Number(h):l.value=Number(l.value),l.setAttribute("initialized","1")},n=t.getAttribute("min"),a=t.getAttribute("max");return i.addEventListener("click",()=>{t.getAttribute("initialized")?n?Number(t.value)>Number(n)&&t.stepDown():t.stepDown():o(t,n),se(t,"change")}),s.addEventListener("click",()=>{t.getAttribute("initialized")?a?Number(t.value)<Number(a)&&t.stepUp():t.stepUp():o(t,n),se(t,"change")}),e.appendChild(i),e.appendChild(s),e}getRangeOutput(t){const e=document.createElement("output"),i=s=>{e.value=s.currentTarget.value};return t.addEventListener("change",i,!1),t.addEventListener("input",i,!1),e}getRangeControl(t,e){const i=document.createElement("div");return i.classList.add("je-range-control"),e&&i.appendChild(e),i.appendChild(t),i}getFormInputField(t){const e=document.createElement("input");return e.setAttribute("type",t),e}afterInputReady(t){}getFormControl(t,e,i,s,o){const n=document.createElement("div");return n.classList.add("form-control"),t&&(n.appendChild(t),o&&t.setAttribute("for",o)),(e.type==="checkbox"||e.type==="radio")&&t?(e.style.width="auto",t.insertBefore(e,t.firstChild),s&&t.appendChild(s)):(s&&t&&t.appendChild(s),n.appendChild(e)),e.tagName.toLowerCase()!=="div"&&e&&t&&o&&(t.setAttribute("for",o),e.setAttribute("id",o)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",o+"-description"),e.setAttribute("aria-describedby",o+"-description")),i&&n.appendChild(i),n}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-indented-panel"),t}getTopIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-indented-panel--top"),t}getChildEditorHolder(){return document.createElement("div")}getDescription(t){const e=document.createElement("p");return window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getCheckboxDescription(t){return this.getDescription(t)}getFormInputDescription(t){return this.getDescription(t)}getButtonHolder(){return document.createElement("span")}getHeaderButtonHolder(){return this.getButtonHolder()}getFormButtonHolder(t){return this.getButtonHolder()}getButton(t,e,i){const s=document.createElement("button");return s.type="button",this.setButtonText(s,t,e,i),s}getFormButton(t,e,i){return this.getButton(t,e,i)}setButtonText(t,e,i,s){for(;t.firstChild;)t.removeChild(t.firstChild);if(i&&(t.appendChild(i),e=` ${e}`),!this.jsoneditor.options.iconlib||!this.jsoneditor.options.remove_button_labels||!i){const o=document.createElement("span");o.appendChild(document.createTextNode(e)),t.appendChild(o)}s&&t.setAttribute("title",s)}getTableContainer(){return document.createElement("div")}getTable(){return document.createElement("table")}getTableRow(){return document.createElement("tr")}getTableHead(){return document.createElement("thead")}getTableBody(){return document.createElement("tbody")}getTableHeaderCell(t){const e=document.createElement("th");return e.textContent=t,e}getTableCell(){return document.createElement("td")}getErrorMessage(t){const e=document.createElement("p");return e.style=e.style||{},e.style.color="red",e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.errmsg.setAttribute("role","alert")}removeInputError(t){}addTableRowError(t){}removeTableRowError(t){}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<div class='je-tabholder tabs'></div><div class='content' id='${e}'></div><div class='je-tabholder--clear'></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<div class='tabs je-tabholder--top'></div><div class='je-tabholder--clear'></div><div class='content' id='${e}'></div>`,i}applyStyles(t,e){Object.keys(e).forEach(i=>t.style[i]=e[i])}closest(t,e){for(;t&&t!==document;)if(t[Jo]){if(t[Jo](e))return t;t=t.parentNode}else return!1;return!1}insertBasicTopTab(t,e){e.firstChild.insertBefore(t,e.firstChild.firstChild)}getTab(t,e){const i=document.createElement("div");return i.appendChild(t),i.id=e,i.classList.add("je-tab"),i}getTopTab(t,e){const i=document.createElement("div");return i.appendChild(t),i.id=e,i.classList.add("je-tab--top"),i}getTabContentHolder(t){return t.children[1]}getTopTabContentHolder(t){return t.children[1]}getTabContent(){return this.getIndentedPanel()}getTopTabContent(){return this.getTopIndentedPanel()}markTabActive(t){this.applyStyles(t.tab,{opacity:1,background:"white"}),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){this.applyStyles(t.tab,{opacity:.5,background:""}),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}addTab(t,e){t.children[0].appendChild(e)}addTopTab(t,e){t.children[0].appendChild(e)}getBlockLink(){const t=document.createElement("a");return t.classList.add("je-block-link"),t}getBlockLinkHolder(){return document.createElement("div")}getLinksHolder(){return document.createElement("div")}createMediaLink(t,e,i){t.appendChild(e),i.classList.add("je-media"),t.appendChild(i)}createImageLink(t,e,i){t.appendChild(e),e.appendChild(i)}getFirstTab(t){return t.firstChild.firstChild}getInputGroup(t,e){}cleanText(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText}getDropZone(t){const e=document.createElement("div");return e.setAttribute("data-text",t),e.classList.add("je-dropzone"),e}getUploadPreview(t,e,i){const s=document.createElement("div");if(s.classList.add("je-upload-preview"),t.mimeType.substr(0,5)==="image"){const a=document.createElement("img");a.src=i,s.appendChild(a)}const o=document.createElement("div");o.innerHTML+=`<strong>Name:</strong> ${t.name}<br><strong>Type:</strong> ${t.type}<br><strong>Size:</strong> ${t.formattedSize}`,s.appendChild(o),s.appendChild(e);const n=document.createElement("div");return n.style.clear="left",s.appendChild(n),s}getProgressBar(){const t=document.createElement("progress");return t.setAttribute("max",100),t.setAttribute("value",0),t}updateProgressBar(t,e){t&&t.setAttribute("value",e)}updateProgressBarUnknown(t){t&&t.removeAttribute("value")}}const Fp={".je-form-input-label":"display:block;margin-bottom:3px;font-weight:bold",".je-form-input-description":"display:inline-block;margin:0;font-size:0.8em;font-style:italic",".je-indented-panel":"padding:5px;margin:10px;border-radius:3px;border:1px%20solid%20%23ddd",".je-child-editor-holder":"margin-bottom:8px",".je-header-button-holder":"display:inline-block;margin-left:10px;font-size:0.8em;vertical-align:middle",".je-table":"margin-bottom:5px;border-bottom:1px%20solid%20%23ccc",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"};class Xn extends ge{getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return i.classList.add("je-form-input-label"),i}getFormInputDescription(t){const e=super.getFormInputDescription(t);return e.classList.add("je-form-input-label"),e}getIndentedPanel(){const t=super.getIndentedPanel();return t.classList.add("je-indented-panel"),t}getTopIndentedPanel(){return this.getIndentedPanel()}getChildEditorHolder(){const t=super.getChildEditorHolder();return t.classList.add("je-child-editor-holder"),t}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.classList.add("je-header-button-holder"),t}getTable(){const t=super.getTable();return t.classList.add("je-table"),t}addInputError(t,e){const i=this.closest(t,".form-control")||t.controlgroup;t.errmsg?t.errmsg.style.display="block":(t.errmsg=document.createElement("div"),t.errmsg.setAttribute("class","errmsg"),t.errmsg.style=t.errmsg.style||{},t.errmsg.style.color="red",i.appendChild(t.errmsg)),t.errmsg.innerHTML="",t.errmsg.appendChild(document.createTextNode(e)),t.errmsg.setAttribute("role","alert")}removeInputError(t){t.style&&(t.style.borderColor=""),t.errmsg&&(t.errmsg.style.display="none")}}Xn.rules=Fp;const zp={};class Qn extends ge{getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),i}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`col-md-offset-${i}`)}afterInputReady(t){t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),t}getRangeInput(t,e,i,s,o){return super.getRangeInput(t,e,i,s,o)}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&e.classList.add("form-control"),e}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("sr-only"),e}visuallyHidden(t){t&&t.classList.add("sr-only")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getFormControl(t,e,i,s,o){const n=document.createElement("div");return t&&(e.type==="checkbox"||e.type==="radio")?(n.classList.add(e.type),s&&t.appendChild(s),t.insertBefore(e,t.firstChild),n.appendChild(t)):(n.classList.add("form-group"),t&&(t.classList.add("control-label"),n.appendChild(t),s&&t.appendChild(s)),n.appendChild(e)),i&&n.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&o&&(t.setAttribute("for",o),e.setAttribute("id",o)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",o+"-description"),e.setAttribute("aria-describedby",o+"-description")),n}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("well","well-sm"),t.style.paddingBottom=0,t}getInfoButton(t){const e=document.createElement("span");e.classList.add("glyphicon","glyphicon-info-sign","pull-right"),e.style.padding=".25rem",e.style.position="relative",e.style.display="inline-block";const i=document.createElement("span");return i.style["font-family"]="sans-serif",i.style.visibility="hidden",i.style["background-color"]="rgba(50, 50, 50, .75)",i.style.margin="0 .25rem",i.style.color="#FAFAFA",i.style.padding=".5rem 1rem",i.style["border-radius"]=".25rem",i.style.width="25rem",i.style.position="absolute",i.innerText=t,e.onmouseover=()=>{i.style.visibility="visible"},e.onmouseleave=()=>{i.style.visibility="hidden"},e.appendChild(i),e}getFormInputDescription(t){const e=document.createElement("p");return e.classList.add("help-block"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),typeof t=="string"?i.textContent=t:i.appendChild(t),i}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.style.marginLeft="10px",t}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-default"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-bordered"),t.style.width="auto",t.style.maxWidth="none",t}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("p"),t.errmsg.classList.add("help-block","errormsg"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("has-error"))}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='col-md-2 nav nav-pills nav-stacked' id='${e}' role='tablist'></ul><div class='col-md-10 tab-content active well well-small' id='${e}'></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='nav nav-tabs' id='${e}' role='tablist'></ul><div class='tab-content active well well-small' id='${e}'></div>`,i}getTab(t,e){const i=document.createElement("li");i.setAttribute("role","presentation");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),s.setAttribute("aria-controls",e),s.setAttribute("role","tab"),s.setAttribute("data-toggle","tab"),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.setAttribute("role","presentation");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),s.setAttribute("aria-controls",e),s.setAttribute("role","tab"),s.setAttribute("data-toggle","tab"),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}getProgressBar(){const t=document.createElement("div");t.classList.add("progress");const e=document.createElement("div");return e.classList.add("progress-bar"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="0%",t.appendChild(e),t}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);const s=document.createElement("div");s.classList.add("input-group-btn"),i.appendChild(s);for(let o=0;o<e.length;o++)s.appendChild(e[o]);return i}}Qn.rules=zp;const qp={".jsoneditor-twbs4-text-button":"background:none;padding:0;border:0;color:currentColor","td > .form-group":"margin-bottom:0",".json-editor-btn-upload":"margin-top:1rem",".je-noindent .card":"padding:0;border:0",".je-tooltip:hover::before":"display:block;position:absolute;font-size:0.8em;color:%23fff;border-radius:0.2em;content:attr(title);background-color:%23000;margin-top:-2.5em;padding:0.3em",".je-tooltip:hover::after":"display:block;position:absolute;font-size:0.8em;color:%23fff",".select2-container--default .select2-selection--single":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__arrow":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__rendered":"line-height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".selectize-control.form-control":"padding:0",".selectize-dropdown.form-control":"padding:0;height:auto",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},Up={disable_theme_rules:!1,input_size:"normal",custom_forms:!1,object_indent:!0,object_background:"bg-light",object_text:"",table_border:!1,table_zebrastyle:!1,tooltip:"bootstrap"};class Kn extends ge{constructor(t){super(t,Up)}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),this.options.custom_forms===!1?(this.options.input_size==="small"&&i.classList.add("form-control-sm"),this.options.input_size==="large"&&i.classList.add("form-control-lg")):(i.classList.remove("form-control"),i.classList.add("custom-select"),this.options.input_size==="small"&&i.classList.add("custom-select-sm"),this.options.input_size==="large"&&i.classList.add("custom-select-lg")),i}getContainer(){const t=document.createElement("div");return this.options.object_indent||t.classList.add("je-noindent"),t}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`offset-md-${i}`)}afterInputReady(t){if(t.controlgroup)return;const e=t.name;t.id=e;const i=t.parentNode.parentNode.getElementsByTagName("label")[0];i&&(i.htmlFor=e),t.controlgroup=this.closest(t,".form-group")}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),this.options.input_size==="small"&&t.classList.add("form-control-sm"),this.options.input_size==="large"&&t.classList.add("form-control-lg"),t}getRangeInput(t,e,i,s,o){const n=super.getRangeInput(t,e,i,s,o);return this.options.custom_forms===!0&&(n.classList.remove("form-control"),n.classList.add("custom-range")),n}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),o=document.createElement("button");o.setAttribute("type","button");const n=document.createElement("button");n.setAttribute("type","button"),e.appendChild(i),e.appendChild(t),e.appendChild(s),i.appendChild(o),s.appendChild(n),e.classList.add("input-group"),i.classList.add("input-group-prepend"),s.classList.add("input-group-append"),o.classList.add("btn"),o.classList.add("btn-secondary"),o.classList.add("stepper-down"),n.classList.add("btn"),n.classList.add("btn-secondary"),n.classList.add("stepper-up"),t.getAttribute("readonly")&&(o.setAttribute("disabled",!0),n.setAttribute("disabled",!0)),o.textContent="-",n.textContent="+";const a=(c,p)=>{p?c.value=Number(p):c.value=Number(c.value),c.setAttribute("initialized","1")},l=t.getAttribute("min"),h=t.getAttribute("max");return t.addEventListener("change",()=>{t.getAttribute("initialized")||t.setAttribute("initialized","1")}),o.addEventListener("click",()=>{t.getAttribute("initialized")?l?Number(t.value)>Number(l)&&t.stepDown():t.stepDown():a(t,l),se(t,"change")}),n.addEventListener("click",()=>{t.getAttribute("initialized")?h?Number(t.value)<Number(h)&&t.stepUp():t.stepUp():a(t,l),se(t,"change")}),e}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&t!=="file"&&(e.classList.add("form-control"),this.options.input_size==="small"&&e.classList.add("form-control-sm"),this.options.input_size==="large"&&e.classList.add("form-control-lg")),t==="file"&&e.classList.add("form-control-file"),e}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("sr-only"),e}visuallyHidden(t){t&&t.classList.add("sr-only")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getFormControl(t,e,i,s,o){const n=document.createElement("div");if(n.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")){const a=document.createElement("div");this.options.custom_forms===!1?(a.classList.add("form-check"),e.classList.add("form-check-input"),t.classList.add("form-check-label")):(a.classList.add("custom-control"),e.classList.add("custom-control-input"),t.classList.add("custom-control-label"),e.type==="checkbox"?a.classList.add("custom-checkbox"):a.classList.add("custom-radio")),a.appendChild(e),a.appendChild(t),s&&a.appendChild(s),n.appendChild(a)}else t&&(n.appendChild(t),s&&n.appendChild(s)),n.appendChild(e);return i&&n.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&o&&(t.setAttribute("for",o),e.setAttribute("id",o)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",o+"-description"),e.setAttribute("aria-describedby",o+"-description")),n}getInfoButton(t){const e=document.createElement("button");e.type="button",e.classList.add("ml-3","jsoneditor-twbs4-text-button"),e.setAttribute("data-toggle","tooltip"),e.setAttribute("data-placement","auto"),e.title=t;const i=document.createTextNode("ⓘ");return e.appendChild(i),this.options.tooltip==="bootstrap"?window.jQuery&&window.jQuery().tooltip?window.jQuery(e).tooltip():console.warn("Could not find popper jQuery plugin of Bootstrap."):this.options.tooltip==="css"&&e.classList.add("je-tooltip"),e}getCheckbox(){return this.getFormInputField("checkbox")}getMultiCheckboxHolder(t,e,i,s){const o=document.createElement("div");o.classList.add("form-group"),e&&(o.appendChild(e),s&&e.appendChild(s));const n=document.createElement("div");return Object.values(t).forEach(a=>{const l=a.firstChild;n.appendChild(l)}),o.appendChild(n),i&&o.appendChild(i),o}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return this.options.custom_forms===!1?e.classList.add("form-check-input"):e.classList.add("custom-control-input"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return this.options.custom_forms===!1?i.classList.add("form-check-label"):i.classList.add("custom-control-label"),i.appendChild(document.createTextNode(t)),i}getFormRadioControl(t,e,i){const s=document.createElement("div");return this.options.custom_forms===!1?s.classList.add("form-check"):s.classList.add("custom-control","custom-radio"),s.appendChild(e),s.appendChild(t),i&&(this.options.custom_forms===!1?s.classList.add("form-check-inline"):s.classList.add("custom-control-inline")),s}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("card","card-body","mb-3"),this.options.object_background&&t.classList.add(this.options.object_background),this.options.object_text&&t.classList.add(this.options.object_text),t}getFormInputDescription(t){const e=document.createElement("small");return e.classList.add("form-text"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),i.classList.add("card-title"),i.classList.add("level-"+e),typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=this.getButtonHolder();return e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"&&e.classList.add("text-right"),e}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-secondary","btn-sm"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-sm"),this.options.table_border&&t.classList.add("table-bordered"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getErrorMessage(t){const e=document.createElement("div");return e.classList.add("alert","alert-danger"),e.setAttribute("role","alert"),e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("is-invalid"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("invalid-feedback"),t.controlgroup.appendChild(t.errmsg),t.errmsg.style.display="block"),t.errmsg.style.display="block",t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("is-invalid"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='col-md-2' id='${i}'><ul class='nav flex-column nav-pills'></ul></div><div class='col-md-10'><div class='tab-content' id='${i}'></div></div>`,e.classList.add("row"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTabContentHolder(t){return t.children[1].children[0]}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("card"),i.innerHTML=`<div class='card-header'><ul class='nav nav-tabs card-header-tabs' id='${e}'></ul></div><div class='card-body'><div class='tab-content' id='${e}'></div></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.firstChild.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}insertBasicTopTab(t,e){e.children[0].children[0].insertBefore(t,e.children[0].children[0].firstChild)}addTopTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabContentHolder(t){return t.children[1].children[0]}getFirstTab(t){return t.firstChild.firstChild.firstChild}getProgressBar(){const t=document.createElement("div");t.classList.add("progress");const e=document.createElement("div");return e.classList.add("progress-bar"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="0%",t.appendChild(e),t}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getBlockLink(){const t=document.createElement("a");return t.classList.add("mb-3","d-inline-block"),t}getLinksHolder(){return document.createElement("div")}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);const s=document.createElement("div");s.classList.add("input-group-append"),i.appendChild(s);for(let o=0;o<e.length;o++)e[o].classList.remove("mr-2","btn-secondary"),e[o].classList.add("btn-outline-secondary"),s.appendChild(e[o]);return i}}Kn.rules=qp;const Wp={".form-group":"margin-bottom:1rem",".form-text":"display:block",".jsoneditor-twbs5-text-button":"background:none;padding:0;border:0;color:currentColor","td > .form-group":"margin-bottom:0",".json-editor-btn-upload":"margin-top:1rem",".je-noindent .card":"padding:0;border:0",".je-tooltip:hover::before":"display:block;position:absolute;font-size:0.8em;color:%23fff;border-radius:0.2em;content:attr(title);background-color:%23000;margin-top:-2.5em;padding:0.3em",".je-tooltip:hover::after":"display:block;position:absolute;font-size:0.8em;color:%23fff",".select2-container--default .select2-selection--single":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__arrow":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__rendered":"line-height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".selectize-control.form-control":"padding:0",".selectize-dropdown.form-control":"padding:0;height:auto",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},Gp={disable_theme_rules:!1,input_size:"normal",object_indent:!0,object_background:"bg-light",object_text:"",table_border:!1,table_zebrastyle:!1,tooltip:"bootstrap"};class ta extends ge{constructor(t){super(t,Gp)}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),i.classList.add("form-select"),this.options.input_size==="small"&&i.classList.add("form-control-sm"),this.options.input_size==="large"&&i.classList.add("form-control-lg"),i}getContainer(){const t=document.createElement("div");return this.options.object_indent||t.classList.add("je-noindent"),t}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`offset-md-${i}`)}afterInputReady(t){if(t.controlgroup)return;const e=t.name;t.id=e;const i=t.parentNode.parentNode.getElementsByTagName("label")[0];i&&(i.classList.add("form-label"),i.htmlFor=e),t.controlgroup=this.closest(t,".form-group")}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),this.options.input_size==="small"&&t.classList.add("form-control-sm"),this.options.input_size==="large"&&t.classList.add("form-control-lg"),t}getRangeInput(t,e,i,s,o){const n=super.getRangeInput(t,e,i,s,o);return n.classList.remove("form-control"),n.classList.add("form-range"),n}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("button");i.setAttribute("type","button");const s=document.createElement("button");s.setAttribute("type","button"),e.appendChild(i),e.appendChild(t),e.appendChild(s),e.classList.add("input-group"),i.classList.add("btn"),i.classList.add("btn-secondary"),i.classList.add("stepper-down"),s.classList.add("btn"),s.classList.add("btn-secondary"),s.classList.add("stepper-up"),t.getAttribute("readonly")&&(i.setAttribute("disabled",!0),s.setAttribute("disabled",!0)),i.textContent="-",s.textContent="+";const o=(l,h)=>{h?l.value=Number(h):l.value=Number(l.value),l.setAttribute("initialized","1")},n=t.getAttribute("min"),a=t.getAttribute("max");return t.addEventListener("change",()=>{t.getAttribute("initialized")||t.setAttribute("initialized","1")}),i.addEventListener("click",()=>{t.getAttribute("initialized")?n?Number(t.value)>Number(n)&&t.stepDown():t.stepDown():o(t,n),se(t,"change")}),s.addEventListener("click",()=>{t.getAttribute("initialized")?a?Number(t.value)<Number(a)&&t.stepUp():t.stepUp():o(t,n),se(t,"change")}),e}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&(e.classList.add("form-control"),this.options.input_size==="small"&&e.classList.add("form-control-sm"),this.options.input_size==="large"&&e.classList.add("form-control-lg")),e}getFormControl(t,e,i,s,o){const n=document.createElement("div");if(n.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")){const a=document.createElement("div");a.classList.add("form-check"),e.classList.add("form-check-input"),t.classList.add("form-check-label"),e.tagName.toLowerCase()!=="div"&&e&&t&&o&&(t.setAttribute("for",o),e.setAttribute("id",o)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",o+"-description"),e.setAttribute("aria-describedby",o+"-description")),a.appendChild(e),a.appendChild(t),s&&a.appendChild(s),n.appendChild(a)}else t&&(t.classList.add("form-label"),n.appendChild(t),s&&n.appendChild(s)),n.appendChild(e);return i&&n.appendChild(i),n}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("visually-hidden"),e}visuallyHidden(t){t&&t.classList.add("visually-hidden")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getInfoButton(t){const e=document.createElement("button");e.type="button",e.classList.add("ms-3","jsoneditor-twbs5-text-button"),e.setAttribute("data-toggle","tooltip"),e.setAttribute("data-placement","auto"),e.title=t;const i=document.createTextNode("ⓘ");return e.appendChild(i),this.options.tooltip==="bootstrap"?window.jQuery&&window.jQuery().tooltip?window.jQuery(e).tooltip():console.warn("Could not find popper jQuery plugin of Bootstrap."):this.options.tooltip==="css"&&e.classList.add("je-tooltip"),e}getCheckbox(){return this.getFormInputField("checkbox")}getMultiCheckboxHolder(t,e,i,s){const o=document.createElement("div");o.classList.add("form-group"),e&&(o.appendChild(e),s&&e.appendChild(s));const n=document.createElement("div");return Object.values(t).forEach(a=>{const l=a.firstChild;n.appendChild(l)}),o.appendChild(n),i&&o.appendChild(i),o}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return e.classList.add("form-check-input"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return i.classList.add("form-check-label"),i.appendChild(document.createTextNode(t)),i}getFormRadioControl(t,e,i){const s=document.createElement("div");return s.classList.add("form-check"),s.appendChild(e),s.appendChild(t),i&&s.classList.add("form-check-inline"),s}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("card","card-body","my-3"),this.options.object_background&&t.classList.add(this.options.object_background),this.options.object_text&&t.classList.add(this.options.object_text),t}getFormInputDescription(t){const e=document.createElement("small");return e.classList.add("form-text"),e.classList.add("d-block"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),i.classList.add("card-title"),i.classList.add("level-"+e),typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=this.getButtonHolder();return e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"&&e.classList.add("text-end"),e}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-secondary","btn-sm"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-sm"),this.options.table_border&&t.classList.add("table-bordered"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getErrorMessage(t){const e=document.createElement("div");return e.classList.add("alert","alert-danger"),e.setAttribute("role","alert"),e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("is-invalid"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("invalid-feedback"),t.controlgroup.appendChild(t.errmsg),t.errmsg.style.display="block"),t.errmsg.style.display="block",t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("is-invalid"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='col-md-2' id='${i}'><ul class='nav flex-column nav-pills'></ul></div><div class='col-md-10'><div class='tab-content' id='${i}'></div></div>`,e.classList.add("row"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTabContentHolder(t){return t.children[1].children[0]}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("card"),i.innerHTML=`<div class='card-header'><ul class='nav nav-tabs card-header-tabs' id='${e}'></ul></div><div class='card-body'><div class='tab-content' id='${e}'></div></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.firstChild.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}insertBasicTopTab(t,e){e.children[0].children[0].insertBefore(t,e.children[0].children[0].firstChild)}addTopTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabContentHolder(t){return t.children[1].children[0]}getFirstTab(t){return t.firstChild.firstChild.firstChild}getProgressBar(){const t=document.createElement("div");t.classList.add("progress");const e=document.createElement("div");return e.classList.add("progress-bar"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="0%",t.appendChild(e),t}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getBlockLink(){const t=document.createElement("a");return t.classList.add("mb-3","d-inline-block"),t}getLinksHolder(){return document.createElement("div")}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);for(let s=0;s<e.length;s++)e[s].classList.remove("me-2","btn-secondary"),e[s].classList.add("btn-outline-secondary"),i.appendChild(e[s]);return i}}ta.rules=Wp;class ea extends ge{getTable(){const t=super.getTable();return t.setAttribute("cellpadding",5),t.setAttribute("cellspacing",0),t}getTableHeaderCell(t){const e=super.getTableHeaderCell(t);return e.classList.add("ui-state-active"),e.style.fontWeight="bold",e}getTableCell(){const t=super.getTableCell();return t.classList.add("ui-widget-content"),t}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.style.marginLeft="10px",t.style.fontSize=".6em",t.style.display="inline-block",t}getFormInputDescription(t){const e=this.getDescription(t);return e.style.marginLeft="10px",e.style.display="inline-block",e}getFormControl(t,e,i,s){const o=super.getFormControl(t,e,i,s);return e.type==="checkbox"?(o.style.lineHeight="25px",o.style.padding="3px 0"):o.style.padding="4px 0 8px 0",o}getDescription(t){const e=document.createElement("span");return e.style.fontSize=".8em",e.style.fontStyle="italic",window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getButtonHolder(){const t=document.createElement("div");return t.classList.add("ui-buttonset"),t.style.fontSize=".7em",t}getFormInputLabel(t,e){const i=document.createElement("label");return i.style.fontWeight="bold",i.style.display="block",i.textContent=t,e&&i.classList.add("required"),i}getButton(t,e,i){const s=document.createElement("button");s.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),e&&!t?(s.classList.add("ui-button-icon-only"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),s.appendChild(e)):e?(s.classList.add("ui-button-text-icon-primary"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),s.appendChild(e)):s.classList.add("ui-button-text-only");const o=document.createElement("span");return o.classList.add("ui-button-text"),o.textContent=t||i||".",s.appendChild(o),s.setAttribute("title",i),s}setButtonText(t,e,i,s){t.innerHTML="",t.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),i&&!e?(t.classList.add("ui-button-icon-only"),i.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(i)):i?(t.classList.add("ui-button-text-icon-primary"),i.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(i)):t.classList.add("ui-button-text-only");const o=document.createElement("span");o.classList.add("ui-button-text"),o.textContent=e||s||".",t.appendChild(o),t.setAttribute("title",s)}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("ui-widget-content","ui-corner-all"),t.style.padding="1em 1.4em",t.style.marginBottom="20px",t}afterInputReady(t){if(!t.controls&&(t.controls=this.closest(t,".form-control"),this.queuedInputErrorText)){const e=this.queuedInputErrorText;delete this.queuedInputErrorText,this.addInputError(t,e)}}addInputError(t,e){if(!t.controls){this.queuedInputErrorText=e;return}t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("div"),t.errmsg.classList.add("ui-state-error"),t.controls.appendChild(t.errmsg)),t.errmsg.textContent=e}removeInputError(t){t.controls||delete this.queuedInputErrorText,t.errmsg&&(t.errmsg.style.display="none")}markTabActive(t){t.tab.classList.remove("ui-widget-header"),t.tab.classList.add("ui-state-active"),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){t.tab.classList.add("ui-widget-header"),t.tab.classList.remove("ui-state-active"),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}}ea.rules={'div[data-schemaid="root"]:after':'position:relative;color:red;margin:10px 0;font-weight:600;display:block;width:100%;text-align:center;content:"This is an old JSON-Editor 1.x Theme and might not display elements correctly when used with the 2.x version"'};const Zp={".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"};class ia extends ge{addInputError(t,e){if(t.errmsg)t.errmsg.style.display="block";else{const i=this.closest(t,".form-control");t.errmsg=document.createElement("div"),t.errmsg.setAttribute("class","errmsg"),i.nodeName&&i.appendChild(t.errmsg)}t.errmsg.innerHTML="",t.errmsg.appendChild(document.createTextNode(e)),t.errmsg.setAttribute("role","alert")}removeInputError(t){t.style&&(t.style.borderColor=""),t.errmsg&&(t.errmsg.style.display="none")}}ia.rules=Zp;const Jp={"*":"--primary-color:%235755d9;--gray-color:%23bcc3ce;--light-color:%23fff",".slider:focus":"box-shadow:none","h4 > label + .btn-group":"margin-left:1rem",".text-right > button":"margin-right:0%20!important",".text-left > button":"margin-left:0%20!important",".property-selector":"font-size:0.7rem;font-weight:normal;max-height:260px%20!important;width:395px%20!important",".property-selector .form-checkbox":"margin:0",textarea:"width:100%25;min-height:2rem;resize:vertical",table:"border-collapse:collapse",".table td":"padding:0.4rem%200.4rem",".mr-5":"margin-right:1rem%20!important","div[data-schematype]:not([data-schematype='object'])":"transition:0.5s","div[data-schematype]:not([data-schematype='object']):hover":"background-color:%23eee",".je-table-border td":"border:0.05rem%20solid%20%23dadee4%20!important",".btn-info":"font-size:0.5rem;font-weight:bold;height:0.8rem;padding:0.15rem%200;line-height:0.8;margin:0.3rem%200%200.3rem%200.1rem",".je-label + select":"min-width:5rem",".je-label":"font-weight:600",".btn-action.btn-info":"width:0.8rem",".je-border":"border:0.05rem%20solid%20%23dadee4",".je-panel":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-panel-top":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".required:after":"content:%22%20*%22;color:red;font:inherit",".je-align-bottom":"margin-top:auto",".je-desc":"font-size:smaller;margin:0.2rem%200",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem;border:3px%20solid%20white;box-shadow:0px%200px%208px%20rgba(0%2C%200%2C%200%2C%200.3);box-sizing:border-box",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red",".columns .container.je-noindent":"padding-left:0;padding-right:0",".selectize-control.multi .item":"background:var(--primary-color)%20!important",".select2-container--default .select2-selection--single .select2-selection__arrow":"display:none",".select2-container--default .select2-selection--single":"border:none",".select2-container .select2-selection--single .select2-selection__rendered":"padding:0",".select2-container .select2-search--inline .select2-search__field":"margin-top:0",".select2-container--default.select2-container--focus .select2-selection--multiple":"border:0.05rem%20solid%20var(--gray-color)",".select2-container--default .select2-selection--multiple .select2-selection__choice":"margin:0.4rem%200.2rem%200.2rem%200;padding:2px%205px;background-color:var(--primary-color);color:var(--light-color)",".select2-container--default .select2-search--inline .select2-search__field":"line-height:normal",".choices":"margin-bottom:auto",".choices__list--multiple .choices__item":"border:none;background-color:var(--primary-color);color:var(--light-color)",".choices[data-type*='select-multiple'] .choices__button":"border-left:0.05rem%20solid%20%232826a6",".choices__inner":"font-size:inherit;min-height:20px;padding:4px%207.5px%204px%203.75px",".choices[data-type*='select-one'] .choices__inner":"padding-bottom:4px",".choices__list--dropdown .choices__item":"font-size:inherit"},Yp={disable_theme_rules:!1,label_bold:!0,align_bottom:!1,object_indent:!1,object_border:!1,table_border:!1,table_zebrastyle:!1,input_size:"normal"};class sa extends ge{constructor(t){super(t,Yp)}setGridColumnSize(t,e,i){t.classList.add(`col-${e}`),i&&t.classList.add("col-mx-auto")}getGridContainer(){const t=document.createElement("div");return t.classList.add("container"),this.options.object_indent||t.classList.add("je-noindent"),t}getGridRow(){const t=document.createElement("div");return t.classList.add("columns"),t}getGridColumn(){const t=document.createElement("div");return t.classList.add("column"),this.options.align_bottom&&t.classList.add("je-align-bottom"),t}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-panel"),this.options.object_border&&t.classList.add("je-border"),t}getTopIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-panel-top"),this.options.object_border&&t.classList.add("je-border"),t}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=super.getButtonHolder();return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=super.getFormButtonHolder();return e.classList.remove("btn-group"),e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"?e.classList.add("text-right"):e.classList.add("text-left"),e}getFormButton(t,e,i){const s=super.getFormButton(t,e,i);return s.classList.add("btn","btn-primary","mx-2","my-1"),this.options.input_size!=="small"&&s.classList.remove("btn-sm"),this.options.input_size==="large"&&s.classList.add("btn-lg"),s}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-sm","btn-primary","mr-2","my-1"),s}getHeader(t,e){const i=document.createElement("span");return typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getFormInputDescription(t){const e=super.getFormInputDescription(t);return e.classList.add("je-desc","hide-sm"),e}getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return this.options.label_bold&&i.classList.add("je-label"),i}getCheckbox(){return this.getFormInputField("checkbox")}getCheckboxLabel(t,e){const i=super.getCheckboxLabel(t,e),s=document.createElement("i");return s.classList.add("form-icon"),i.classList.add("form-checkbox","pr-0"),i.insertBefore(s,i.firstChild),i}getFormCheckboxControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-inline"),t}getMultiCheckboxHolder(t,e,i,s){return super.getMultiCheckboxHolder(t,e,i,s)}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return e}getFormRadioLabel(t,e){const i=super.getFormRadioLabel(t,e),s=document.createElement("i");return s.classList.add("form-icon"),i.classList.add("form-radio"),i.insertBefore(s,i.firstChild),i}getFormRadioControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-inline"),t}getFormInputField(t){const e=super.getFormInputField(t);return["checkbox","radio"].includes(t)||e.classList.add("form-input"),e}getRangeInput(t,e,i,s,o){const n=super.getRangeInput(t,e,i,s,o);return n.classList.add("slider"),n.classList.remove("form-input"),n.setAttribute("oninput",'this.setAttribute("value", this.value)'),n}getRangeControl(t,e){const i=super.getRangeControl(t,e);return i.classList.add("text-center"),i}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-select"),i}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-input"),t}getFormControl(t,e,i,s,o){const n=document.createElement("div");return n.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")?(n.classList.add(e.type),s&&t.appendChild(s),t.insertBefore(e,t.firstChild),n.appendChild(t)):(t&&(t.classList.add("form-label"),n.appendChild(t),s&&t.appendChild(s)),n.appendChild(e)),this.options.input_size==="small"?e.classList.add("input-sm","select-sm"):this.options.input_size==="large"&&e.classList.add("input-lg","select-lg"),e.type!=="checkbox"&&n.appendChild(e),i&&n.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&o&&(t.setAttribute("for",o),e.setAttribute("id",o)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",o+"-description"),e.setAttribute("aria-describedby",o+"-description")),n}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);for(let s=0;s<e.length;s++)e[s].classList.add("input-group-btn"),e[s].classList.remove("btn-sm","mr-2","my-1"),i.appendChild(e[s]);return i}getInfoButton(t){const e=document.createElement("div");e.classList.add("popover","popover-left","float-right");const i=document.createElement("button");i.classList.add("btn","btn-secondary","btn-info","btn-action","s-circle"),i.setAttribute("tabindex","-1"),e.appendChild(i);const s=document.createTextNode("I");i.appendChild(s);const o=document.createElement("div");o.classList.add("popover-container"),e.appendChild(o);const n=document.createElement("div");n.classList.add("card"),o.appendChild(n);const a=document.createElement("div");return a.classList.add("card-body"),a.innerHTML=t,n.appendChild(a),e}getTable(){const t=super.getTable();return t.classList.add("table","table-scroll"),this.options.table_border&&t.classList.add("je-table-border"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getProgressBar(){const t=super.getProgressBar();return t.classList.add("progress"),t}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("columns"),i.innerHTML=`<div class="column col-2"></div><div class="column col-10 content" id="${e}"></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class="tab"></ul><div class="content" id="${e}"></div>`,i}getTab(t,e){const i=document.createElement("a");return i.classList.add("btn","btn-secondary","btn-block"),i.setAttribute("href",`#${e}`),i.appendChild(t),i}getTopTab(t,e){const i=document.createElement("li");i.id=e,i.classList.add("tab-item");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),i.appendChild(s),i}markTabActive(t){t.tab.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){t.tab.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}afterInputReady(t){if(t.localName==="select"){if(t.classList.contains("selectized")){const e=t.nextSibling;e&&(e.classList.remove("form-select"),Array.from(e.querySelectorAll(".form-select")).forEach(i=>{i.classList.remove("form-select")}))}else if(t.classList.contains("select2-hidden-accessible")){const e=t.nextSibling;e&&e.querySelector(".select2-selection--single")&&e.classList.add("form-select")}}t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("form-input-hint"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.classList.remove("d-hide"),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.classList.add("d-hide"),t.controlgroup.classList.remove("has-error"))}}sa.rules=Jp;const Xp={".slider":"-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;display:block;border:none;height:1.2rem;width:100%25",".slider:focus":"box-shadow:0%200%200%200%20rgba(87%2C%2085%2C%20217%2C%200.2);outline:none",".slider.tooltip:not([data-tooltip])::after":"content:attr(value)",".slider::-webkit-slider-thumb":"-webkit-appearance:none;background:%23f17405;border-radius:100%25;height:0.6rem;margin-top:-0.25rem;transition:transform%200.2s;width:0.6rem",".slider:active::-webkit-slider-thumb":"transform:scale(1.25);outline:none",".slider::-webkit-slider-runnable-track":"background:%23b2b4b6;border-radius:0.1rem;height:0.1rem;width:100%25","a.tooltips":"position:relative;display:inline","a.tooltips span":"position:absolute;white-space:nowrap;width:auto;padding-left:1rem;padding-right:1rem;color:%23ffffff;background:rgba(56%2C%2056%2C%2056%2C%200.85);height:1.5rem;line-height:1.5rem;text-align:center;visibility:hidden;border-radius:3px","a.tooltips span:after":"content:%22%22;position:absolute;top:50%25;left:100%25;margin-top:-5px;width:0;height:0;border-left:5px%20solid%20rgba(56%2C%2056%2C%2056%2C%200.85);border-top:5px%20solid%20transparent;border-bottom:5px%20solid%20transparent","a:hover.tooltips span":"visibility:visible;opacity:0.9;font-size:0.8rem;right:100%25;top:50%25;margin-top:-12px;margin-right:10px;z-index:999",".json-editor-btntype-properties + div":"font-size:0.8rem;font-weight:normal",textarea:"width:100%25;min-height:2rem;resize:vertical",table:"width:100%25;border-collapse:collapse",".table td":"padding:0rem%200rem","div[data-schematype]:not([data-schematype='object'])":"transition:0.5s","div[data-schematype]:not([data-schematype='object']):hover":"background-color:%23e6f4fe","div[data-schemaid='root']":"position:relative;width:inherit;display:inherit;overflow-x:hidden;z-index:10","select[multiple]":"height:auto","select[multiple].from-select":"height:auto",".je-table-zebra:nth-child(even)":"background-color:%23f2f2f2",".je-table-border":"border:0.5px%20solid%20black",".je-table-hdiv":"border-bottom:1px%20solid%20black",".je-border":"border:0.05rem%20solid%20%233182ce",".je-panel":"width:inherit;padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-panel-top":"width:100%25;padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".required:after":"content:%22%20*%22;color:red;font:inherit;font-weight:bold",".je-desc":"font-size:smaller;margin:0.2rem%200",".container-xl.je-noindent":"padding-left:0;padding-right:0",".json-editor-btntype-add":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%234299e1;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-deletelast":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%23e53e3e;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-deleteall":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%23000000;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btn-save":"float:right;color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%232b6cb0;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btn-back":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%232b6cb0;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-delete":"color:%23e53e3e;background-color:rgba(218%2C%20222%2C%20228%2C%200.1);margin:0.03rem;padding:0.1rem",".json-editor-btntype-move":"color:%23000000;background-color:rgba(218%2C%20222%2C%20228%2C%200.1);margin:0.03rem;padding:0.1rem",".json-editor-btn-collapse":"padding:0em%200.8rem;font-size:1.3rem;color:%23e53e3e;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},Qp={disable_theme_rules:!1,label_bold:!1,object_panel_default:!0,object_indent:!0,object_border:!1,table_border:!1,table_hdiv:!1,table_zebrastyle:!1,input_size:"small",enable_compact:!1};class ra extends ge{constructor(t){super(t,Qp)}getGridContainer(){const t=document.createElement("div");return t.classList.add("flex","flex-col","w-full"),this.options.object_indent||t.classList.add("je-noindent"),t}getGridRow(){const t=document.createElement("div");return t.classList.add("flex","flex-wrap","w-full"),t}getGridColumn(){const t=document.createElement("div");return t.classList.add("flex","flex-col"),t}setGridColumnSize(t,e,i){e>0&&e<12?t.classList.add(`w-${e}/12`,"px-1"):t.classList.add("w-full","px-1"),i&&(t.style.marginLeft=`${100/12*i}%`)}getIndentedPanel(){const t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","p-1"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}getTopIndentedPanel(){const t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","m-2"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}getTitle(){return this.translateProperty(this.schema.title)}getSelectInput(t,e){const i=super.getSelectInput(t);return e?i.classList.add("form-multiselect","block","py-0","h-auto","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"):i.classList.add("form-select","block","py-0","h-6","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&i.classList.add("compact"),i}afterInputReady(t){t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}getTextareaInput(){const t=super.getTextareaInput();return t.classList.add("block","w-full","px-1","text-sm","leading-normal","bg-white","text-black","border","border-grey","rounded"),this.options.enable_compact&&t.classList.add("compact"),t.style.height=0,t}getRangeInput(t,e,i){const s=this.getFormInputField("range");return s.classList.add("slider"),this.options.enable_compact&&s.classList.add("compact"),s.setAttribute("oninput",'this.setAttribute("value", this.value)'),s.setAttribute("min",t),s.setAttribute("max",e),s.setAttribute("step",i),s}getRangeControl(t,e){const i=super.getRangeControl(t,e);return i.classList.add("text-center","text-black"),i}getCheckbox(){const t=this.getFormInputField("checkbox");return t.classList.add("form-checkbox","text-red-600"),t}getCheckboxLabel(t,e){const i=super.getCheckboxLabel(t,e);return i.classList.add("inline-flex","items-center"),i}getFormCheckboxControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("inline-flex flex-row"),t}getMultiCheckboxHolder(t,e,i,s){const o=super.getMultiCheckboxHolder(t,e,i,s);return o.classList.add("inline-flex","flex-col"),o}getFormRadio(t){const e=this.getFormInputField("radio");e.classList.add("form-radio","text-red-600");for(const i in t)e.setAttribute(i,t[i]);return e}getFormRadioLabel(t,e){const i=super.getFormRadioLabel(t,e);return i.classList.add("inline-flex","items-center","mr-2"),i}getFormRadioControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-radio"),t}getRadioHolder(t,e,i,s,o){const n=super.getRadioHolder(e,i,s,o);return t.options.layout==="h"?n.classList.add("inline-flex","flex-row"):n.classList.add("inline-flex","flex-col"),n}getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return this.options.label_bold?i.classList.add("font-bold"):i.classList.add("required"),i}getFormInputField(t){const e=super.getFormInputField(t);return["checkbox","radio"].includes(t)||e.classList.add("block","w-full","px-1","text-black","text-sm","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&e.classList.add("compact"),e}getFormInputDescription(t){const e=document.createElement("p");return e.classList.add("block","mt-1","text-xs"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getFormControl(t,e,i,s){const o=document.createElement("div");return o.classList.add("form-group","mb-1","w-full"),t&&(t.classList.add("text-xs"),e.type==="checkbox"&&(e.classList.add("form-checkbox","text-xs","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormCheckboxControl(t,e,!1,s)),e.type==="radio"&&(e.classList.add("form-radio","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormRadioControl(t,e,!1,s)),o.appendChild(t),!["checkbox","radio"].includes(e.type)&&s&&o.appendChild(s)),["checkbox","radio"].includes(e.type)||(this.options.input_size==="small"?e.classList.add("text-xs"):this.options.input_size==="normal"?e.classList.add("text-base"):this.options.input_size==="large"&&e.classList.add("text-xl"),o.appendChild(e)),i&&o.appendChild(i),o}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.classList.add("text-sm"),t}getButtonHolder(){const t=document.createElement("div");return t.classList.add("flex","relative","inline-flex","align-middle"),t}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("inline-block","align-middle","text-center","text-sm","bg-blue-700","text-white","py-1","pr-1","m-2","shadow","select-none","whitespace-no-wrap","rounded"),s}getInfoButton(t){const e=document.createElement("a");e.classList.add("tooltips","float-right"),e.innerHTML="ⓘ";const i=document.createElement("span");return i.innerHTML=t,e.appendChild(i),e}getTable(){const t=super.getTable();return this.options.table_border?t.classList.add("je-table-border"):t.classList.add("table","border","p-0"),t}getTableRow(){const t=super.getTableRow();return this.options.table_border&&t.classList.add("je-table-border"),this.options.table_zebrastyle&&t.classList.add("je-table-zebra"),t}getTableHeaderCell(t){const e=super.getTableHeaderCell(t);return this.options.table_border?e.classList.add("je-table-border"):this.options.table_hdiv?e.classList.add("je-table-hdiv"):e.classList.add("text-xs","border","p-0","m-0"),e}getTableCell(){const t=super.getTableCell();return this.options.table_border?t.classList.add("je-table-border"):this.options.table_hdiv?t.classList.add("je-table-hdiv"):t.classList.add("border-0","p-0","m-0"),t}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.controlgroup.classList.add("text-red-600"),t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("p"),t.errmsg.classList.add("block","mt-1","text-xs","text-red"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.textContent=e)}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("text-red-600"),t.controlgroup.classList.remove("has-error"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='w-2/12' id='${i}'><ul class='list-reset pl-0 mb-0'></ul></div><div class='w-10/12' id='${i}'></div>`,e.classList.add("flex"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='nav-tabs flex list-reset pl-0 mb-0 border-b border-grey-light' id='${e}'></ul><div class='p-6 block' id='${e}'></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item","flex-col","text-center","text-white","bg-blue-500","shadow-md","border","p-2","mb-2","mr-2","hover:bg-blue-400","rounded");const s=document.createElement("a");return s.classList.add("nav-link","text-center"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item","flex","border-l","border-t","border-r");const s=document.createElement("a");return s.classList.add("nav-link","-mb-px","flex-row","text-center","bg-white","p-2","hover:bg-blue-400","rounded-t"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("block"),t.tab.firstChild.classList.contains("border-b")===!0?(t.tab.firstChild.classList.add("border-b-0"),t.tab.firstChild.classList.remove("border-b")):t.tab.firstChild.classList.add("border-b-0"),t.container.classList.contains("hidden")===!0&&t.container.classList.remove("hidden"),t.container.classList.add("block")}markTabInactive(t){t.tab.firstChild.classList.contains("border-b-0")===!0?(t.tab.firstChild.classList.add("border-b"),t.tab.firstChild.classList.remove("border-b-0")):t.tab.firstChild.classList.add("border-b"),t.container.classList.contains("block")===!0&&(t.container.classList.remove("block"),t.container.classList.add("hidden"))}getProgressBar(){const t=document.createElement("div");t.classList.add("progress");const e=document.createElement("div");return e.classList.add("bg-blue","leading-none","py-1","text-xs","text-center","text-white"),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuenow",0),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuenax",100),e.innerHTML="0%",t.appendChild(e),t}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","bg-blue","leading-none","py-1","text-xs","text-center","text-white","block"),e.removeAttribute("aria-valuenow"),e.classList.add("w-full"),e.innerHTML=""}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("relative","items-stretch","w-full"),i.appendChild(t);const s=document.createElement("div");s.classList.add("-mr-1"),i.appendChild(s);for(let o=0;o<e.length;o++)s.appendChild(e[o]);return i}}ra.rules=Xp;const Kp={html:Xn,bootstrap3:Qn,bootstrap4:Kn,bootstrap5:ta,jqueryui:ea,barebones:ia,spectre:sa,tailwind:ra},tu={".je-float-right-linkholder":"float:right;margin-left:10px",".je-modal":"background-color:white;border:1px%20solid%20black;box-shadow:3px%203px%20black;position:absolute;z-index:10",".je-infobutton-icon":"font-size:16px;font-weight:bold;padding:0.25rem;position:relative;display:inline-block",".je-infobutton-tooltip":"font-size:12px;font-weight:normal;font-family:sans-serif;visibility:hidden;background-color:rgba(50%2C%2050%2C%2050%2C%200.75);margin:0%200.25rem;color:%23fafafa;padding:0.5rem%201rem;border-radius:0.25rem;width:20rem;position:absolute",".je-not-loaded":"pointer-events:none",".je-header":"display:inline-block",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-checkbox":"display:inline-block;width:auto",".je-checkbox-control--compact":"display:inline-block;margin-right:1rem",".je-radio":"display:inline-block;width:auto",".je-radio-control--compact":"display:inline-block;margin-right:1rem",".je-switcher":"background-color:transparent;display:inline-block;font-style:italic;font-weight:normal;height:auto;width:auto;margin-bottom:0;margin-left:5px;padding:0%200%200%203px",".je-textarea":"width:100%25;height:300px;box-sizing:border-box",".je-range-control":"text-align:center",".je-indented-panel":"padding-left:10px;margin-left:10px;border-left:1px%20solid%20%23ccc",".je-indented-panel--top":"padding-left:10px;margin-left:10px",".je-tabholder":"float:left;width:130px",".je-tabholder .content":"margin-left:120px",".je-tabholder--top":"margin-left:10px",".je-tabholder--clear":"clear:both",".je-tab":"border:1px%20solid%20%23ccc;border-width:1px%200%201px%201px;text-align:center;line-height:30px;border-radius:5px;border-bottom-right-radius:0;border-top-right-radius:0;font-weight:bold;cursor:pointer",".je-tab--top":"float:left;border:1px%20solid%20%23ccc;border-width:1px%201px%200px%201px;text-align:center;line-height:30px;border-radius:5px;padding-left:5px;padding-right:5px;border-bottom-right-radius:0;border-bottom-left-radius:0;font-weight:bold;cursor:pointer",".je-block-link":"display:block",".je-media":"width:100%25"};class K{constructor(t,e={}){if(!(t instanceof Element))throw new Error("element should be an instance of Element");this.element=t,this.options=$({},K.defaults.options,e),this.ready=!1,this.copyClipboard=null,this.schema=this.options.schema,this.template=this.options.template,this.translate=this.options.translate||K.defaults.translate,this.translateProperty=this.options.translateProperty||K.defaults.translateProperty,this.uuid=0,this.__data={};const i=this.options.theme||K.defaults.theme,s=K.defaults.themes[i];if(!s)throw new Error(`Unknown theme ${i}`);this.element.setAttribute("data-theme",i),this.element.classList.add("je-not-loaded"),this.element.classList.remove("je-ready"),this.theme=new s(this);const o=$(tu,this.getEditorsRules()),n=(l,h,c)=>c?this.addNewStyleRulesToShadowRoot(l,h,c):this.addNewStyleRules(l,h);if(!this.theme.options.disable_theme_rules){const l=Fn(this.element);n("default",o,l),typeof s.rules<"u"&&n(i,s.rules,l)}const a=K.defaults.iconlibs[this.options.iconlib||K.defaults.iconlib];a&&(this.iconlib=new a),this.root_container=this.theme.getContainer(),this.element.appendChild(this.root_container),this.promise=this.load()}async load(){const t=document.location.origin+document.location.pathname.toString(),e=new op(this.options);e.onSchemaLoaded=a=>{this.trigger("schemaLoaded",a)},e.onAllSchemasLoaded=()=>{this.trigger("allSchemasLoaded")},this.expandSchema=a=>e.expandSchema(a),this.expandRefs=(a,l)=>e.expandRefs(a,l);const i=document.location.toString(),s=await e.load(this.schema,t,i),o=this.options.custom_validators?{custom_validators:this.options.custom_validators}:{};this.validator=new Gn(this,null,o,K.defaults);const n=this.getEditorClass(s);this.root=this.createEditor(n,{jsoneditor:this,schema:s,required:!0,container:this.root_container}),this.root.preBuild(),this.root.build(),this.root.postBuild(),Wt(this.options,"startval")&&this.root.setValue(this.options.startval),this.validation_results=this.validator.validate(this.root.getValue()),this.root.showValidationErrors(this.validation_results),this.ready=!0,this.element.classList.remove("je-not-loaded"),this.element.classList.add("je-ready"),window.requestAnimationFrame(()=>{this.ready&&(this.validation_results=this.validator.validate(this.root.getValue()),this.root.showValidationErrors(this.validation_results),this.trigger("ready"),this.trigger("change"))})}getValue(){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return this.root.getValue()}setValue(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return this.root.setValue(t),this}validate(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return arguments.length===1?this.validator.validate(t):this.validation_results}destroy(){this.destroyed||this.ready&&(this.schema=null,this.options=null,this.root.destroy(),this.root=null,this.root_container=null,this.validator=null,this.validation_results=null,this.theme=null,this.iconlib=null,this.template=null,this.__data=null,this.ready=!1,this.element.innerHTML="",this.element.removeAttribute("data-theme"),this.destroyed=!0)}on(t,e){return this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[],this.callbacks[t].push(e),this}off(t,e){if(t&&e){this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[];const i=[];for(let s=0;s<this.callbacks[t].length;s++)this.callbacks[t][s]!==e&&i.push(this.callbacks[t][s]);this.callbacks[t]=i}else t?(this.callbacks=this.callbacks||{},this.callbacks[t]=[]):this.callbacks={};return this}trigger(t,e){if(this.callbacks&&this.callbacks[t]&&this.callbacks[t].length)for(let i=0;i<this.callbacks[t].length;i++)this.callbacks[t][i].apply(this,[e]);return this}setOption(t,e){if(t==="show_errors")this.options.show_errors=e,this.onChange();else throw new Error(`Option ${t} must be set during instantiation and cannot be changed later`);return this}getEditorsRules(){const t=(e,i)=>i.rules?$(e,i.rules):e;return Object.values(K.defaults.editors).reduce(t,{})}getEditorClass(t){let e;if(t=this.expandSchema(t),K.defaults.resolvers.find(i=>(e=i(t,this),e&&K.defaults.editors[e])),!e)throw new Error(`Unknown editor for schema ${JSON.stringify(t)}`);if(!K.defaults.editors[e])throw new Error(`Unknown editor ${e}`);return K.defaults.editors[e]}createEditor(t,e,i=1){return e=$({},t.options||{},e),new t(e,K.defaults,i)}onChange(){if(this.ready&&!this.firing_change)return this.firing_change=!0,window.requestAnimationFrame(()=>{this.firing_change=!1,this.ready&&(this.validation_results=this.validator.validate(this.root.getValue()),this.options.show_errors!=="never"?this.root.showValidationErrors(this.validation_results):this.root.showValidationErrors([]),this.trigger("change"))}),this}compileTemplate(t,e=K.defaults.template){let i;if(typeof e=="string"){if(!K.defaults.templates[e])throw new Error(`Unknown template engine ${e}`);if(i=K.defaults.templates[e](),!i)throw new Error(`Template engine ${e} missing required library.`)}else i=e;if(!i)throw new Error("No template engine set");if(!i.compile)throw new Error("Invalid template engine set");return i.compile(t)}_data(t,e,i){if(arguments.length===3){let s;t.hasAttribute(`data-jsoneditor-${e}`)?s=t.getAttribute(`data-jsoneditor-${e}`):(s=this.uuid++,t.setAttribute(`data-jsoneditor-${e}`,s)),this.__data[s]=i}else return t.hasAttribute(`data-jsoneditor-${e}`)?this.__data[t.getAttribute(`data-jsoneditor-${e}`)]:null}registerEditor(t){return this.editors=this.editors||{},this.editors[t.path]=t,this}unregisterEditor(t){return this.editors=this.editors||{},this.editors[t.path]=null,this}getEditor(t){if(this.editors)return this.editors[t]}watch(t,e){return this.watchlist=this.watchlist||{},this.watchlist[t]=this.watchlist[t]||[],this.watchlist[t].push(e),this}unwatch(t,e){if(!this.watchlist||!this.watchlist[t])return this;if(!e)return this.watchlist[t]=null,this;const i=[];for(let s=0;s<this.watchlist[t].length;s++)this.watchlist[t][s]!==e&&i.push(this.watchlist[t][s]);return this.watchlist[t]=i.length?i:null,this}notifyWatchers(t){if(!this.watchlist||!this.watchlist[t])return this;for(let e=0;e<this.watchlist[t].length;e++)this.watchlist[t][e]()}isEnabled(){return!this.root||this.root.isEnabled()}enable(){this.root.enable()}disable(){this.root.disable()}setCopyClipboardContents(t){this.copyClipboard=t}getCopyClipboardContents(){return this.copyClipboard}addNewStyleRules(t,e){let i=document.querySelector(`#theme-${t}`);i||(i=document.createElement("style"),i.setAttribute("id",`theme-${t}`),i.appendChild(document.createTextNode("")),document.head.appendChild(i));const s=i.sheet?i.sheet:i.styleSheet,o=this.element.nodeName.toLowerCase();for(;s.cssRules.length>0;)s.deleteRule(0);Object.keys(e).forEach(n=>{const a=t==="default"?n:`${o}[data-theme="${t}"] ${n}`;s.insertRule?s.insertRule(a+" {"+decodeURIComponent(e[n])+"}",0):s.addRule&&s.addRule(a,decodeURIComponent(e[n]),0)})}addNewStyleRulesToShadowRoot(t,e,i){const s=this.element.nodeName.toLowerCase();let o="";Object.keys(e).forEach(a=>{const l=t==="default"?a:`${s}[data-theme="${t}"] ${a}`;o+=l+" {"+decodeURIComponent(e[a])+`}
71
+ `});const n=new CSSStyleSheet;n.replaceSync(o),i.adoptedStyleSheets=[...i.adoptedStyleSheets,n]}}K.defaults=Se;K.AbstractEditor=Bt;K.AbstractTheme=ge;K.AbstractIconLib=me;Object.assign(K.defaults.themes,Kp);Object.assign(K.defaults.editors,hs);Object.assign(K.defaults.templates,gp);Object.assign(K.defaults.iconlibs,Vp);const eu=`
72
+ * {
73
+ font-family: Roboto, sans-serif;
74
+ }
75
+ `,Yr=`
76
+ input[type=checkbox] {
77
+ appearance: none;
78
+ -webkit-appearance: none;
79
+ margin: 0;
80
+ cursor: pointer;
81
+ display: flex;
82
+ flex-direction: row;
83
+ align-items: center;
84
+ width: 24px;
85
+ height: 24px;
86
+ }
87
+ input[type=checkbox]:after {
88
+ display: block;
89
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-blank-outline%3C/title%3E%3Cpath d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z' /%3E%3C/svg%3E");
90
+ width: 20px;
91
+ height: 20px;
92
+ margin-right: 4px;
93
+ }
94
+ input[type=checkbox]:checked:after {
95
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-marked%3C/title%3E%3Cpath d='M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z' /%3E%3C/svg%3E");
96
+
97
+ }
98
+ `,oa=`
99
+ input[type=radio] {
100
+ appearance: none;
101
+ -webkit-appearance: none;
102
+ margin: 0;
103
+ cursor: pointer;
104
+ display: flex;
105
+ flex-direction: row;
106
+ align-items: center;
107
+ width: 24px;
108
+ height: 24px;
109
+ }
110
+
111
+ label span {
112
+ font-size: small;
113
+ }
114
+
115
+ input[type=radio]:after {
116
+ display: block;
117
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E");
118
+ width: 20px;
119
+ height: 20px;
120
+ margin-right: 4px;
121
+ }
122
+ input[type=radio]:checked:after {
123
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-marked%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z' /%3E%3C/svg%3E");
124
+
125
+ }
126
+ `,na=`
127
+ input[type="range"] {
128
+ -webkit-appearance: none;
129
+ width: 90%;
130
+ margin-left: 5%;
131
+ height: 6px;
132
+ border-radius: 5px;
133
+ background: #d7dcdf;
134
+ outline: none;
135
+ padding: 0;
136
+ }
137
+ input[type="range"]::-webkit-slider-thumb {
138
+ appearance: none;
139
+ width: 15px;
140
+ height: 15px;
141
+ border-radius: 50%;
142
+ background: #2c3e50;
143
+ cursor: pointer;
144
+ transition: background 0.15s ease-in-out;
145
+ }
146
+ .range-slider {
147
+ margin: 60px 0 0 0;
148
+ }
149
+ .range-slider {
150
+ width: 100%;
151
+ }
152
+ input[type="range"]::-webkit-slider-thumb:hover {
153
+ background: #00416F;
154
+ }
155
+ input[type="range"]:active::-webkit-slider-thumb {
156
+ background: #00416F;
157
+ }
158
+ input[type="range"]::-moz-range-thumb {
159
+ width: 15px;
160
+ height: 15px;
161
+ border: 0;
162
+ border-radius: 50%;
163
+ background: #2c3e50;
164
+ cursor: pointer;
165
+ transition: background 0.15s ease-in-out;
166
+ }
167
+ input[type="range"]::-moz-range-thumb:hover {
168
+ background: #00416F;
169
+ }
170
+ input[type="range"]:active::-moz-range-thumb {
171
+ background: #00416F;
172
+ }
173
+ input[type="range"]:focus::-webkit-slider-thumb {
174
+ box-shadow: 0 0 0 3px #fff0, 0 0 0 6px #00416F00;
175
+ }
176
+ .range-slider__value {
177
+ display: inline-block;
178
+ position: relative;
179
+ width: 60px;
180
+ color: #fff;
181
+ line-height: 20px;
182
+ text-align: center;
183
+ border-radius: 3px;
184
+ background: #2c3e50;
185
+ padding: 5px 10px;
186
+ margin-left: 8px;
187
+ }
188
+ .range-slider__value:after {
189
+ position: absolute;
190
+ top: 8px;
191
+ left: -7px;
192
+ width: 0;
193
+ height: 0;
194
+ border-top: 7px solid transparent;
195
+ border-right: 7px solid #2c3e50;
196
+ border-bottom: 7px solid transparent;
197
+ content: '';
198
+ }
199
+
200
+ input::-moz-focus-inner, input::-moz-focus-outer {
201
+ border: 0;
202
+ }
203
+ `,iu=`
204
+ ${Yr}
205
+ ${oa}
206
+ ${na}
207
+
208
+ [data-schemaid=root] > .je-header {
209
+ display: none;
210
+ }
211
+ input[type="text"], select {
212
+ box-sizing: border-box !important;
213
+ width: 100% !important;
214
+ margin: 0.5rem 0rem !important;
215
+ padding: 5px 7px !important;
216
+ border-radius: 4px !important;
217
+ border: 1px solid #0004 !important;
218
+ }
219
+ .je-range-control {
220
+ padding: 0.5rem 0;
221
+ }
222
+ .errmsg {
223
+ font-size: x-small;
224
+ }
225
+ tc-range-slider{
226
+ display: block;
227
+ margin: 0.5rem 0;
228
+ }
229
+ `;(()=>{var r=o=>o==null?!1:typeof o=="boolean"?o:o.trim().toLowerCase()==="true";window.tcRangeSliderPlugins=window.tcRangeSliderPlugins||[];var t="min-label",e="max-label",i="#1E293B",s=()=>{let o=null,n=null,a=null,l,h=!1,c=i,p="",b,g=null,y=null,w=null,A=[],G=()=>{var j;let R=(j=o==null?void 0:o.shadowRoot)==null?void 0:j.querySelector(".range-slider-box");g=document.createElement("div"),g.classList.add("labels-row"),R.prepend(g)},it=j=>{let R=document.createElement("label");return R.className=j,R.setAttribute("for","range-slider"),R},nt=()=>{y=it(t),y.textContent=rt(a==null?void 0:a.getTextMin(),p),w=it(e),w.textContent=rt(a==null?void 0:a.getTextMax(),p),n==null||n.before(y),n==null||n.after(w);let j=a==null?void 0:a.getValues();if(j)for(let R=0;R<j.length;R++){let lt=it(`value${R+1}-label generated-label`);lt.textContent=rt(j[R],p),A.push(lt),g==null||g.append(lt)}},It=()=>{for(let j of A)!j||j.remove();y==null||y.remove(),w==null||w.remove(),g==null||g.remove(),A=[]},ct=j=>{h=j,h?(G(),nt()):It()},q=j=>{c=j;for(let R of A)!R||(R.style.color=c??i);y&&(y.style.color=c??i),w&&(w.style.color=c??i)},gt=j=>{p=j,l&&l()},kt=()=>{!a||!g||g.classList.toggle("is-reversed",a.isRightToLeft()||a.isBottomToTop())},rt=(j,R)=>{let lt=`${(j??"").toString()}${R}`;return b&&typeof b=="function"?b(j):lt};return{get name(){return"Generated Labels"},init:(j,R,lt,Tt)=>{var wt,$t,Zt;o=j,a=Tt,n=(wt=j.shadowRoot)==null?void 0:wt.getElementById("range-slider"),l=R,c=($t=o.getAttribute("generate-labels-text-color"))!=null?$t:i,p=(Zt=o.getAttribute("generate-labels-units"))!=null?Zt:"",ct(r(o.getAttribute("generate-labels"))),kt(),q(c)},update:j=>{if(!(!h||!j.values)){kt();for(let R=0;R<j.values.length;R++){let lt=j.values[R],Tt=A[R];if(lt===void 0&&Tt){Tt.remove(),A[R]=void 0;continue}if(lt!==void 0&&!Tt){let wt=it(`value${R+1}-label generated-label`);if(wt.textContent=rt(lt,p),A[R]=wt,j.values.length<=0)g==null||g.append(wt);else if(R===0)g==null||g.append(wt);else{let $t=A[R-1];$t==null||$t.after(wt)}continue}!Tt||(Tt.textContent=rt(lt,p))}y&&(y.textContent=rt(j.textMin,p)),w&&(w.textContent=rt(j.textMax,p)),q(c)}},onAttrChange:(j,R)=>{j==="generate-labels"&&ct(r(R)),j==="generate-labels-text-color"&&q(R),j==="generate-labels-units"&&gt(R)},gettersAndSetters:[{name:"generateLabels",attributes:{get(){return h??!1},set:j=>{ct(r(j))}}},{name:"textColor",attributes:{get(){return c??""},set:j=>{q(j)}}},{name:"generateLabelsTextColor",attributes:{get(){return c??""},set:j=>{q(j)}}},{name:"units",attributes:{get(){return p??""},set:j=>{gt(j)}}},{name:"generateLabelsUnits",attributes:{get(){return p??""},set:j=>{gt(j)}}},{name:"generateLabelsFormat",attributes:{get(){return b},set:j=>{b=j,l&&l()}}}],css:`
230
+ .labels-row{
231
+ text-align: center;
232
+ display: flex;
233
+ justify-content: center;
234
+ }
235
+
236
+ .is-reversed,
237
+ .is-reversed + .row{
238
+ flex-direction: row-reverse;
239
+ }
240
+
241
+ .type-vertical{
242
+ position: relative;
243
+ }
244
+
245
+ .type-vertical .labels-row{
246
+ flex-direction: column;
247
+ position: absolute;
248
+ top: 50%;
249
+ right: -100%;
250
+ transform: translateY(-50%);
251
+ }
252
+
253
+ .type-vertical .is-reversed,
254
+ .type-vertical .is-reversed + .row{
255
+ flex-direction: column-reverse;
256
+ }
257
+
258
+ .max-label,
259
+ .min-label{
260
+ margin: 0 1rem;
261
+ width: 2rem;
262
+ text-align: center;
263
+ white-space: nowrap;
264
+ }
265
+
266
+ .generated-label{
267
+ text-align: center;
268
+ margin: 0 0.5rem;
269
+ white-space: nowrap;
270
+ }
271
+ `,destroy:It}};window.tcRangeSliderPlugins.push(s)})();(()=>{var r=Object.defineProperty,t=Math.pow,e=(d,m,v)=>m in d?r(d,m,{enumerable:!0,configurable:!0,writable:!0,value:v}):d[m]=v,i=(d,m,v)=>(e(d,typeof m!="symbol"?m+"":m,v),v),s=(d,m)=>` ${m&&m.length>0?m.map(v=>`<link rel="stylesheet" href="${v}" />`).join(""):""} <style> ${d} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`,o=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",n="pointers-overlap",a="pointers-min-distance",l="pointers-max-distance",h="range-dragging",c="data",p="min",b="max",g="step",y="round",w="type",A="theme",G="rtl",it="btt",nt="disabled",It="keyboard-disabled",ct="mousewheel-disabled",q="slider-width",gt="slider-height",kt="slider-radius",rt="slider-bg",j="slider-bg-hover",R="slider-bg-fill",lt="pointer-width",Tt="pointer-height",wt="pointer-radius",$t="pointer-bg",Zt="pointer-bg-hover",we="pointer-bg-focus",ms="pointer-shadow",Ci="pointer-shadow-hover",gs="pointer-shadow-focus",Aa="pointer-border",ja="pointer-border-hover",Sa="pointer-border-focus",Xr="animate-onclick",Ta="css-links",Qt="vertical",Be="horizontal",bs=(d,m,v,f,C)=>{let B=m-d;return B===0?v:(f-v)*(C-d)/B+v},ae=d=>!isNaN(parseFloat(d))&&isFinite(d),bt=(d,m)=>ae(d)?Number(d):m,Qr=(d,m)=>m===0?0:Math.round(d/m)*m,$a=(d,m=1/0)=>{if(m===1/0)return d;let v=t(10,m);return Math.round(d*v)/v},Lt=d=>d==null?!1:typeof d=="boolean"?d:d.trim().toLowerCase()==="true",Oa=(d,m)=>{d.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:m}}))},Pa=(d,m)=>{d.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:m}}))},Ba=(d,m)=>{d.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:m}}))},Ia=(d,m)=>{d.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:m}}))},Na=(d,m)=>{if(!m||m.length<=0)return;let v=m.map(C=>ae(C)?bt(C,C):C),f={values:v||[]};f.value=v[0],f.value0=v[0],f.value1=v[0];for(let C=1;C<v.length;C++)f[`value${C+1}`]=v[C];d.dispatchEvent(new CustomEvent("change",{detail:f}))},fs=(d,m,v)=>{let f=0,C,B,H,E,k=!1,D=(N,ot,xt,vt,pt,ut)=>{let Mt=f;xt!==void 0&&N>xt&&(N=xt),ot!==void 0&&N<ot&&(N=ot),f=N;let Ht=f;return(vt===Qt&&ut||vt===Be&&pt)&&(Ht=100-Ht),vt===Qt?m.style.top=`${Ht}%`:m.style.left=`${Ht}%`,Mt!==f},U=N=>N===m||m.contains(N),T=(N,ot,xt,vt)=>{C=N,B=ot,H=xt,E=vt},Q=N=>{k=N,m.classList.toggle("disabled",k),k?m.setAttribute("aria-disabled","true"):m.hasAttribute("aria-disabled")&&m.removeAttribute("aria-disabled")},Jt=(N,ot)=>{ot==null?m.removeAttribute(N):m.setAttribute(N,ot)},Ot=N=>m.getAttribute(N),I=N=>{if(!k){switch(N.key){case"ArrowLeft":{N.preventDefault(),typeof C=="function"&&C(v);break}case"ArrowRight":{N.preventDefault(),typeof B=="function"&&B(v);break}case"ArrowUp":{N.preventDefault(),typeof H=="function"&&H(v);break}case"ArrowDown":{N.preventDefault(),typeof E=="function"&&E(v);break}}Ia(d,N)}},F=()=>{k||Oa(d,m)};return m.className=`pointer pointer-${v}`,m.addEventListener("keydown",I),m.addEventListener("click",F),{$pointer:m,get percent(){return f},get disabled(){return k},set disabled(N){Q(N)},updatePosition:D,isClicked:U,setCallbacks:T,setAttr:Jt,getAttr:Ot,destroy:()=>{m.removeEventListener("keydown",I),m.removeEventListener("click",F),m.remove()}}},Ma=d=>{if(d==null)return;if(Array.isArray(d))return d;if(d.trim()==="")return;let m=d.split(","),v=[],f=!0;for(let C=0;C<m.length;C++){let B=m[C].trim();B!==""&&(v.push(B),ae(B)||(f=!1))}return f?v.map(C=>Number(C)):v},Ha=(d,m)=>m?m.findIndex(v=>v===d||v.toString().trim()===d.toString().trim()):-1,Ra=d=>({updatePosition:(m,v,f,C)=>{if(v.length<=0)return;let B=v.length===1,H=v[0],E=v[v.length-1];m===Qt?(d.style.removeProperty("width"),d.style.removeProperty("right"),d.style.removeProperty("left"),B?d.style.height=`${H}%`:d.style.height=`${Math.abs(H-E)}%`,C?(d.style.bottom="0%",B?d.style.top="auto":d.style.top=`${Math.min(100-E,100-H)}%`):(d.style.bottom="auto",B?d.style.top="0%":d.style.top=`${Math.min(H,E)}%`)):(d.style.removeProperty("height"),d.style.removeProperty("top"),d.style.removeProperty("bottom"),B?d.style.width=`${H}%`:d.style.width=`${Math.abs(H-E)}%`,f?(d.style.right="0%",B?d.style.left="auto":d.style.left=`${Math.min(100-E,100-H)}%`):(d.style.right="auto",B?d.style.left="0%":d.style.left=`${Math.min(H,E)}%`))}}),Kr="--animate-onclick",Da="--width",Va="--height",Fa="--panel-bg-border-radius",za="--panel-bg",qa="--panel-bg-hover",Ua="--panel-bg-fill",Wa="--pointer-width",Ga="--pointer-height",Za="--pointer-border-radius",Ja="--pointer-bg",Ya="--pointer-bg-hover",Xa="--pointer-bg-focus",Qa="--pointer-shadow",Ka="--pointer-shadow-hover",tl="--pointer-shadow-focus",el="--pointer-border",il="--pointer-border-hover",sl="--pointer-border-focus",Ei=(d,m,v)=>{let f=new Map;for(let C of d.attributes){let B=C.nodeName.trim().toLowerCase();if(!m.test(B))continue;let H=B.replace(/\D/g,"").trim(),E=H===""||H==="0"||H==="1"?0:bt(H,0)-1,k=v&&typeof v=="function"?v(C.value):C.value;f.set(E,k)}return f},rl=d=>{if(!d)return null;let m=d.getAttribute(Ta);if(!m)return null;let v=m.split(";"),f=[];for(let C of v)C.trim()!==""&&f.push(C.trim());return f},to=[[Da,q,"sliderWidth",null],[Va,gt,"sliderHeight",null],[Fa,kt,"sliderRadius",null],[za,rt,"sliderBg",null],[qa,j,"sliderBgHover",null],[Ua,R,"sliderBgFill",null],[Wa,lt,"pointer#Width",/^pointer([0-9]*)-width$/],[Ga,Tt,"pointer#Height",/^pointer([0-9]*)-height$/],[Za,wt,"pointer#Radius",/^pointer([0-9]*)-radius$/],[Ja,$t,"pointer#Bg",/^pointer([0-9]*)-bg$/],[Ya,Zt,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[Xa,we,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[Qa,ms,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[Ka,Ci,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[tl,gs,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[el,Aa,"pointer#Border",/^pointer([0-9]*)-border$/],[il,ja,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[sl,Sa,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],ol=(d,m,v)=>{let f=null,C=[],B=new Map,H=(I,F=m)=>{let N=[...F.classList];for(let ot of N)ot.startsWith(I)&&m.classList.remove(ot)},E=()=>{H("shape");let I=m.querySelectorAll(".pointer");for(let F of I)H("shape",F)},k=I=>{f=I,H("theme-"),typeof I=="string"&&m.classList.add(`theme-${I}`)},D=()=>{if(E(),!(C.length<=0)){m.classList.add("shape",`shape-${C[0]}`);for(let I=1;I<C.length;I++){let F=C[I];if(!F)continue;let N=m.querySelector(`.pointer-${I}`);!N||N.classList.add("shape",`shape-${F}`)}}},U=(I,F)=>{C[I]=F,D()},T=()=>{E();let I=Ei(d,/^pointer([0-9]*)-shape$/);if(!(I.size<=0)){for(let F of I){let N=F[0];C[N]=F[1]}D()}},Q=(I,F)=>`${I}-${F}`,Jt=(I,F,N)=>{let ot=v[N];if(!ot)return;let xt=N===0?m:ot.$pointer;if(F==null){B.has(Q(I,N))&&B.delete(Q(I,N)),xt.style.removeProperty(I);return}B.set(Q(I,N),F),xt.style.setProperty(I,F)},Ot=(I,F)=>B.get(Q(I,F));return(()=>{for(let I of to){let[F,N,ot,xt]=I;if(xt){let pt=Ei(d,xt);for(let ut of pt){let Mt=ut[0],Ht=ut[1];Jt(F,Ht,Mt)}}else{let pt=d.getAttribute(N);Jt(F,pt,0)}let vt=[];if(ot.indexOf("#")===-1)vt.push([ot,0]);else{vt.push([ot.replace("#",""),0]),vt.push([ot.replace("#","0"),0]),vt.push([ot.replace("#","1"),0]);for(let pt=1;pt<v.length;pt++)vt.push([ot.replace("#",(pt+1).toString()),pt])}for(let pt of vt)try{let ut=pt[0],Mt=pt[1];Object.prototype.hasOwnProperty.call(d,ut)||Object.defineProperty(d,ut,{get(){return Ot(F,Mt)},set:Ht=>{Jt(F,Ht,Mt)}})}catch(ut){console.error(ut)}}k(d.getAttribute(A)),T()})(),{setStyle:Jt,getStyle:Ot,get theme(){return f},set theme(I){k(I)},get pointerShapes(){return C},setPointerShape:U}},Ie="animate-on-click",eo="range-dragging",nl=(d,m,v,f)=>{let C=[],B=U=>{for(let T of C)T.update&&typeof T.update=="function"&&T.update(U)},H=()=>{for(let U of C)U.destroy&&typeof U.destroy=="function"&&U.destroy()},E=(U,T)=>{for(let Q of C)Q.onAttrChange&&typeof Q.onAttrChange=="function"&&Q.onAttrChange(U,T)},k=U=>{if(U.gettersAndSetters){for(let T of U.gettersAndSetters)if(!(!T.name||!T.attributes))try{Object.prototype.hasOwnProperty.call(d,T.name)||Object.defineProperty(d,T.name,T.attributes)}catch(Q){console.error("defineSettersGetters error:",Q)}}},D=U=>{var T;if(!U.css)return;let Q=(T=d.shadowRoot)==null?void 0:T.querySelector("style");!Q||(Q.innerHTML+=U.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let U of window.tcRangeSliderPlugins){let T=U();C.push(T),T.init&&typeof T.init=="function"&&(T.init(d,m,v,f),k(T),D(T))}},update:B,onAttrChange:E,destroy:H}},al=10,io=20,ll=(d,m)=>{let v=new Map,f=/^value([0-9]*)$/;for(let E of d.attributes){let k=E.nodeName.trim().toLowerCase();if(!f.test(k))continue;let D=k.replace("value","").trim(),U=D===""||D==="0"||D==="1"?0:bt(D,0)-1,T=ae(E.value)?bt(E.value,0):E.value;v.set(U,T)}let C=Math.max(...Array.from(v.keys())),B=[];B.push([fs(d,m,0),v.get(0)]);let H=m;for(let E=1;E<=C;E++){let k=m.cloneNode(!0);H.after(k),H=k,B.push([fs(d,k,E),v.get(E)])}return B},so=(d,m,v,f,C,B,H)=>{try{Object.defineProperty(d,f,{configurable:!0,get(){if(!m)return;let E=m.pointers[v];if(!E)return;let k=m.getTextValue(E.percent);return ae(k)?bt(k,k):k},set:E=>{m.pointers[v]?m==null||m.setValue(E,v):m==null||m.addPointer(E)}}),Object.defineProperty(d,C,{configurable:!0,get(){var E,k;return(k=(E=m==null?void 0:m.pointers[v])==null?void 0:E.getAttr("aria-label"))!=null?k:void 0},set:E=>{!m||m.setAriaLabel(v,E)}}),Object.defineProperty(d,B,{configurable:!0,get(){var E,k;return(k=(E=m==null?void 0:m.styles)==null?void 0:E.pointerShapes[v])!=null?k:null},set:E=>{!m||!m.styles||m.styles.setPointerShape(v,E)}}),Object.defineProperty(d,H,{configurable:!0,get(){var E;return(E=m==null?void 0:m.pointers[v].disabled)!=null?E:!1},set:E=>{if(!m)return;let k=m==null?void 0:m.pointers[v];!k||(k.disabled=E)}})}catch(E){console.error(E)}},hl=(d,m)=>{let v=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let f=2;f<al;f++)v.push([`value${f}`,`ariaLabel${f}`,`pointer${f}Shape`,`pointer${f}Disabled`,f-1]);for(let f of v)so(d,m,f[4],f[0],f[1],f[2],f[3])},ro=(d,m,v)=>{var f;let C=(f=v.shadowRoot)==null?void 0:f.querySelector(".container");if(C)for(let B of d)m?C.prepend(B.$pointer):C.append(B.$pointer)},dl=(d,m)=>{if(!(!m||d.length<=1)){for(let v of d)v.$pointer.style.zIndex=io.toString();m.$pointer.style.zIndex=(io*2).toString()}},ys=0,Ye=100,Ne=2,oo="0.3s",cl=(d,m,v)=>{let f=v.map(u=>u[0]),C=null,B=null,H=null,E=null,k=ys,D=Ye,U,T,Q=Be,Jt=Ne,Ot=!1,I=!1,F=!1,N=0,ot=1/0,xt=!1,vt,pt,ut=!1,Mt=!1,Ht=!1,be=oo,no=[],ao=u=>{ut||(u.preventDefault&&u.preventDefault(),xe(u),window.addEventListener("mousemove",xe),window.addEventListener("mouseup",ki),Pa(d,u))},ki=u=>{ut||(vt=void 0,pt=void 0,window.removeEventListener("mousemove",xe),window.removeEventListener("mouseup",ki),be&&m.classList.add(Ie),Ba(d,u))},ml=(u,_)=>{if(f.length<=0)return;if(f.length===1)return f[0].isClicked(u)&&be&&m.classList.remove(Ie),f[0];let S=bl(u);if(xt){let Y=_,Kt=Ai(Y);Kt!==void 0&&(Y=Qr(Y,Kt)),S?(vt=Y,pt=0,be&&m.classList.remove(Ie)):vt!==void 0&&(pt=Y-vt,vt=Y)}if(!gl(u)&&!S){for(let Y of f)if(!(!Y.isClicked(u)||Y.disabled))return be&&m.classList.remove(Ie),Y;for(let Y of f)if(C===Y)return Y}let et=1/0,mt=null;for(let Y of f){if(Y.disabled)continue;let Kt=Math.abs(_-Y.percent);Kt<et&&(et=Kt,mt=Y)}return mt},lo=()=>f.findIndex(u=>C===u&&!u.disabled),xe=u=>{let _;if(Q===Qt){let{height:et,top:mt}=m.getBoundingClientRect(),Y=u.type.indexOf("mouse")!==-1?u.clientY:u.touches[0].clientY;_=Math.min(Math.max(0,Y-mt),et)*100/et}else{let{width:et,left:mt}=m.getBoundingClientRect(),Y=u.type.indexOf("mouse")!==-1?u.clientX:u.touches[0].clientX;_=Math.min(Math.max(0,Y-mt),et)*100/et}if((Ot||I)&&(_=100-_),C=ml(u.target,_),C&&dl(f,C),xt&&f.length>1&&pt!==void 0){let et=f[0],mt=f[f.length-1],Y=et.percent+pt<0,Kt=mt.percent+pt>100;if(Y||Kt)return;for(let Ii=0;Ii<f.length;Ii++)Rt(Ii,f[Ii].percent+pt);return}let S=lo();S!==-1&&(Rt(S,_),C==null||C.$pointer.focus())},Li=u=>{if(ut||document.activeElement!==d||C!=null&&C.disabled)return;u.stopPropagation(),u.preventDefault();let _=u.deltaY<0,S=Ot||I,et=_?!S:S,mt=lo();mt!==-1&&(et?Xe(mt,f[mt].percent):Qe(mt,f[mt].percent))},ho=u=>{ut||Mt||(Q===Qt?I?Rt(u,100):Rt(u,0):Ot?Qe(u,f[u].percent):Xe(u,f[u].percent))},co=u=>{ut||Mt||(Q===Qt?I?Rt(u,0):Rt(u,100):Ot?Xe(u,f[u].percent):Qe(u,f[u].percent))},po=u=>{ut||Mt||(Q===Qt?I?Qe(u,f[u].percent):Xe(u,f[u].percent):Ot?Rt(u,100):Rt(u,0))},uo=u=>{ut||Mt||(Q===Qt?I?Xe(u,f[u].percent):Qe(u,f[u].percent):Ot?Rt(u,0):Rt(u,100))},gl=u=>u.classList.contains("panel"),bl=u=>u.classList.contains("panel-fill"),Xe=(u,_)=>{if(_===void 0)return;let S=Ai(_);S==null&&(S=1),_-=S,_<0&&(_=0),Rt(u,_)},Qe=(u,_)=>{if(_===void 0)return;let S=Ai(_);S==null&&(S=1),_+=S,_>100&&(_=100),Rt(u,_)},Ce=()=>{!E||E.update({percents:mo(),values:go(),$pointers:bo(),min:fo(),max:yo(),data:ws(),step:_s(),round:Cs(),type:xs(),textMin:ji(),textMax:Si(),rightToLeft:Ls(),bottomToTop:As(),pointersOverlap:$s(),pointersMinDistance:Es(),pointersMaxDistance:ks(),rangeDragging:Os(),disabled:js(),keyboardDisabled:Ss(),mousewheelDisabled:Ts()})},fl=()=>{Ce()},yl=u=>{if(!(F||f.length<=1||D===k))if(u===0){let _=ot*100/(D-k);return Math.max(0,f[u+1].percent-_)}else{let _=N*100/(D-k);return Math.min(f[u-1].percent+_,100)}},vl=u=>{if(!(F||f.length<=1||D===k))if(u===f.length-1){let _=ot*100/(D-k);return Math.min(f[u-1].percent+_,100)}else{let _=N*100/(D-k);return Math.max(0,f[u+1].percent-_)}},Ai=u=>{let _;if(typeof U=="function"){let S=bs(0,100,k,D,u);_=U(S,u)}else _=U;if(ae(_)){let S=D-k;return _=S===0?0:_*100/S,_}},Me=u=>{if(u===void 0)return;let _=bs(0,100,k,D,u);return T!==void 0?T[Math.round(_)]:$a(_,Jt)},ji=()=>T!==void 0?T[k]:k,Si=()=>T!==void 0?T[D]:D,_s=()=>U,_l=u=>{var _;return u<=0||F?ji():(_=Me(f[u-1].percent))!=null?_:""},wl=u=>{var _;return f.length<=1||u>=f.length-1||F?Si():(_=Me(f[u+1].percent))!=null?_:""},mo=()=>f.map(u=>u.percent),go=()=>f.map(u=>Me(u.percent)),bo=()=>f.map(u=>u.$pointer),fo=()=>k,yo=()=>D,ws=()=>T,xs=()=>Q,Cs=()=>Jt,Es=()=>N,ks=()=>ot,xl=u=>no[u],Ls=()=>Ot,As=()=>I,js=()=>ut,Ss=()=>Mt,Ts=()=>Ht,$s=()=>F,Os=()=>xt,Rt=(u,_)=>{if(_===void 0)return;let S=Ai(_);S!==void 0&&(_=Qr(_,S));let et=f[u];if(!et)return;let mt=et.updatePosition(_,yl(u),vl(u),Q,Ot,I);B==null||B.updatePosition(Q,f.map(Y=>Y.percent),Ot,I),Ce();for(let Y of f){let Kt=Me(Y.percent);Kt!==void 0&&(Y.setAttr("aria-valuenow",Kt.toString()),Y.setAttr("aria-valuetext",Kt.toString()))}El(),mt&&Na(d,f.map(Y=>Me(Y.percent)))},re=()=>{for(let u=0;u<f.length;u++)Rt(u,f[u].percent)},Cl=(u,_)=>{k=T!==void 0?0:bt(u,ys),D=T!==void 0?T.length-1:bt(_,Ye),Ti(k),$i(D)},El=()=>{var u,_;for(let S=0;S<f.length;S++){let et=f[S];et.setAttr("aria-valuemin",((u=_l(S))!=null?u:"").toString()),et.setAttr("aria-valuemax",((_=wl(S))!=null?_:"").toString())}},Ti=u=>{k=bt(u,ys),k>D&&(D=k+Ye),re()},$i=u=>{D=bt(u,Ye),D<k&&(D=k+Ye),re()},vo=u=>{F=!0;for(let _=0;_<u.length;_++)Oi(u[_],_);F=!1;for(let _=0;_<u.length;_++)Oi(u[_],_)},Oi=(u,_)=>{let S;T!==void 0?(S=u==null?0:Ha(u,T),S===-1&&(S=0)):(S=bt(u,k),S<k&&(S=k),S>D&&(S=D));let et=bs(k,D,0,100,S);Rt(_,et)},Pi=u=>{if(u==null){U=void 0;return}if(typeof u=="function"){U=u,re();return}if(ae(u)){U=bt(u,1);let _=Math.abs(D-k);U>_&&(U=void 0),re();return}U=void 0},Ps=u=>{F=u,re()},Bs=u=>{(!ae(u)||u<0)&&(u=0),N=u},Is=u=>{(!ae(u)||u<0)&&(u=1/0),ot=u},Ns=u=>{ut=u,m.classList.toggle("disabled",ut),ut?m.setAttribute("aria-disabled","true"):m.hasAttribute("aria-disabled")&&m.removeAttribute("aria-disabled")},_o=u=>{Mt=u},wo=u=>{Ht=u,Ht?document.removeEventListener("wheel",Li):document.addEventListener("wheel",Li,{passive:!1})},Ms=u=>{if(u==null){T=void 0;return}if(T=Ma(u),T===void 0||T.length<=0){T=void 0;return}Ti(0),$i(T.length-1),U===void 0&&Pi(1)},Hs=u=>{var _;typeof u=="string"?Q=u.trim().toLowerCase()===Qt?Qt:Be:Q=Be;let S=(_=d.shadowRoot)==null?void 0:_.querySelector(".range-slider-box");if(!S)return;S.className=`range-slider-box type-${Q}`,re();let et=Q===Qt?"vertical":"horizontal";for(let mt of f)mt.setAttr("aria-orientation",et)},Rs=u=>{Ot=u,f.length>1&&ro(f,Ot,d),re(),Ce()},Ds=u=>{I=u,f.length>1&&ro(f,I,d),re(),Ce()},Vs=u=>{Jt=bt(u,Ne),Jt<0&&(Jt=Ne),Ce()},xo=u=>{u==null||u.toString().trim().toLowerCase()==="false"?(be=void 0,m.style.removeProperty(Kr),m.classList.remove(Ie)):(be=u.toString(),m.style.setProperty(Kr,be),m.classList.add(Ie))},Co=(u,_)=>{let S=f[u];!S||(S.setAttr("aria-label",_),no[u]=_)},Bi=u=>{if(vt=void 0,f.length<=1){xt=!1,m.classList.remove(eo);return}xt=u,m.classList.toggle(eo,xt)},kl=()=>{Ns(Lt(d.getAttribute(nt))),Mt=Lt(d.getAttribute(It)),Ht=Lt(d.getAttribute(ct));let u=Ei(d,/^pointer([0-9]*)-disabled$/,_=>Lt(_));for(let _ of u){let S=_[0];!f[S]||(f[S].disabled=_[1])}},Ll=()=>{let u=Ei(d,/^aria-label([0-9]*)$/);for(let _ of u){let S=_[0];Co(S,_[1])}},Al=u=>{let _=f.length,S=f[_-1].$pointer,et=S.cloneNode(!0);S.after(et);let mt=fs(d,et,_);return mt.setCallbacks(ho,co,po,uo),f.push(mt),Oi(u,_),re(),Ce(),_},jl=()=>{let u=f.length,_=f[u-1];return _?(_.destroy(),f.pop(),f.length<=1&&Bi(!1),re(),Ce(),u-1):-1};return(()=>{var u,_;for(let et of f)et.setCallbacks(ho,co,po,uo);let S=(u=d.shadowRoot)==null?void 0:u.querySelector(".panel-fill");S&&(B=Ra(S)),Hs(d.getAttribute(w)),Rs(Lt(d.getAttribute(G))),Ds(Lt(d.getAttribute(it))),Cl(d.getAttribute(p),d.getAttribute(b)),Pi(d.getAttribute(g)),Ms(d.getAttribute(c)),vo(v.map(et=>et[1])),Ps(Lt(d.getAttribute(n))),Bs(bt(d.getAttribute(a),0)),Is(bt(d.getAttribute(l),1/0)),Bi(Lt(d.getAttribute(h))),Vs(bt(d.getAttribute(y),Ne)),kl(),Ll(),H=ol(d,m,f),xo((_=d.getAttribute(Xr))!=null?_:oo),m.addEventListener("mousedown",ao),m.addEventListener("mouseup",ki),m.addEventListener("touchmove",xe),m.addEventListener("touchstart",xe),Ht||document.addEventListener("wheel",Li,{passive:!1}),E=nl(d,fl,{setValues:vo,setMin:Ti,setMax:$i,setStep:Pi,setPointersOverlap:Ps,setPointersMinDistance:Bs,setPointersMaxDistance:Is,setDisabled:Ns,setType:Hs,setRightToLeft:Rs,setBottomToTop:Ds,setRound:Vs,setKeyboardDisabled:_o,setMousewheelDisabled:wo,setRangeDragging:Bi,setData:Ms},{getPercents:mo,getValues:go,getPointerElements:bo,getMin:fo,getMax:yo,getStep:_s,getData:ws,getType:xs,getRound:Cs,getTextMin:ji,getTextMax:Si,isRightToLeft:Ls,isBottomToTop:As,isDisabled:js,isKeyboardDisabled:Ss,isMousewheelDisabled:Ts,isPointersOverlap:$s,isRangeDraggingEnabled:Os,getPointersMinDistance:Es,getPointersMaxDistance:ks}),E.init()})(),{get pointers(){return f},get styles(){return H},get pluginsManager(){return E},get min(){return ji()},get max(){return Si()},get step(){return _s()},get pointersOverlap(){return $s()},set pointersOverlap(u){Ps(u)},get pointersMinDistance(){return Es()},set pointersMinDistance(u){Bs(u)},get pointersMaxDistance(){return ks()},set pointersMaxDistance(u){Is(u)},get disabled(){return js()},set disabled(u){Ns(u)},get data(){return ws()},get type(){return xs()},set type(u){Hs(u)},get rightToLeft(){return Ls()},set rightToLeft(u){Rs(u)},get bottomToTop(){return As()},set bottomToTop(u){Ds(u)},get round(){return Cs()},set round(u){Vs(u)},get animateOnClick(){return be},set animateOnClick(u){xo(u)},get keyboardDisabled(){return Ss()},set keyboardDisabled(u){_o(u)},get mousewheelDisabled(){return Ts()},set mousewheelDisabled(u){wo(u)},get rangeDragging(){return Os()},set rangeDragging(u){Bi(u)},setMin:Ti,setMax:$i,setValue:Oi,setStep:Pi,setData:Ms,getTextValue:Me,setAriaLabel:Co,getAriaLabel:xl,addPointer:Al,removePointer:jl,destroy:()=>{m.removeEventListener("mousedown",ao),m.removeEventListener("mouseup",ki),m.removeEventListener("touchmove",xe),m.removeEventListener("touchstart",xe),document.removeEventListener("wheel",Li);for(let u of f)u.destroy();E==null||E.destroy()}}},pl=(d,m,v)=>{let f=to.find(([E,k,D,U])=>k.replace("#","")===m.replace(/\d+/g,""));if(f&&d.styles){let[E,k,D,U]=f,T=m.replace(/\D/g,"").trim(),Q=T===""||T==="0"||T==="1"?0:bt(T,0)-1;d.styles.setStyle(E,v,Q);return}switch(d&&d.pluginsManager&&d.pluginsManager.onAttrChange(m,v),m){case p:{d.setMin(v);break}case b:{d.setMax(v);break}case g:{d.setStep(v);break}case n:{d.pointersOverlap=Lt(v);break}case a:{d.pointersMinDistance=bt(v,0);break}case h:{d.rangeDragging=Lt(v);break}case l:{d.pointersMaxDistance=bt(v,1/0);break}case nt:{d.disabled=Lt(v);break}case It:{d.keyboardDisabled=Lt(v);break}case ct:{d.mousewheelDisabled=Lt(v);break}case c:{d.setData(v);break}case w:{d.type=v;break}case G:{d.rightToLeft=Lt(v);break}case it:{d.bottomToTop=Lt(v);break}case y:{d.round=bt(v,Ne);break}case A:{d.styles&&(d.styles.theme=v);break}case Xr:{d.animateOnClick=v;break}}let C=null;if(/^value([0-9]*)$/.test(m)&&(C="value"),/^pointer([0-9]*)-disabled$/.test(m)&&(C="pointer-disabled"),/^aria-label([0-9]*)$/.test(m)&&(C="aria-label"),/^pointer([0-9]*)-shape$/.test(m)&&(C="pointer-shape"),!C)return;let B=m.replace(/\D/g,"").trim(),H=B===""||B==="0"||B==="1"?0:bt(B,0)-1;switch(C){case"value":{d.setValue(v,H);break}case"pointer-disabled":{let E=d==null?void 0:d.pointers[H];if(!E)return;E.disabled=Lt(v);break}case"aria-label":{d.setAriaLabel(H,v);break}case"pointer-shape":{d.styles&&d.styles.setPointerShape(H,v);break}}},ul=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(d){this.slider&&this.slider.setStep(d)}get step(){var d;return(d=this.slider)==null?void 0:d.step}set disabled(d){this.slider&&(this.slider.disabled=d)}get disabled(){var d,m;return(m=(d=this.slider)==null?void 0:d.disabled)!=null?m:!1}set data(d){var m;(m=this.slider)==null||m.setData(d)}get data(){var d;return(d=this.slider)==null?void 0:d.data}set min(d){var m;(m=this.slider)==null||m.setMin(d)}get min(){var d;return(d=this.slider)==null?void 0:d.min}set max(d){var m;(m=this.slider)==null||m.setMax(d)}get max(){var d;return(d=this.slider)==null?void 0:d.max}set round(d){!this.slider||(this.slider.round=d)}get round(){var d,m;return(m=(d=this.slider)==null?void 0:d.round)!=null?m:Ne}set type(d){!this.slider||(this.slider.type=d??Be)}get type(){var d;return((d=this.slider)==null?void 0:d.type)||Be}set pointersOverlap(d){!this.slider||(this.slider.pointersOverlap=d)}get pointersOverlap(){var d,m;return(m=(d=this.slider)==null?void 0:d.pointersOverlap)!=null?m:!1}set pointersMinDistance(d){!this.slider||(this.slider.pointersMinDistance=d)}get pointersMinDistance(){var d,m;return(m=(d=this.slider)==null?void 0:d.pointersMinDistance)!=null?m:0}set pointersMaxDistance(d){!this.slider||(this.slider.pointersMaxDistance=d)}get pointersMaxDistance(){var d,m;return(m=(d=this.slider)==null?void 0:d.pointersMaxDistance)!=null?m:1/0}set theme(d){!this.slider||!this.slider.styles||(this.slider.styles.theme=d)}get theme(){var d,m,v;return(v=(m=(d=this.slider)==null?void 0:d.styles)==null?void 0:m.theme)!=null?v:null}set rtl(d){!this.slider||(this.slider.rightToLeft=d)}get rtl(){var d,m;return(m=(d=this.slider)==null?void 0:d.rightToLeft)!=null?m:!1}set btt(d){!this.slider||(this.slider.bottomToTop=d)}get btt(){var d,m;return(m=(d=this.slider)==null?void 0:d.bottomToTop)!=null?m:!1}set keyboardDisabled(d){!this.slider||(this.slider.keyboardDisabled=d)}get keyboardDisabled(){var d,m;return(m=(d=this.slider)==null?void 0:d.keyboardDisabled)!=null?m:!1}set mousewheelDisabled(d){!this.slider||(this.slider.mousewheelDisabled=d)}get mousewheelDisabled(){var d,m;return(m=(d=this.slider)==null?void 0:d.mousewheelDisabled)!=null?m:!1}set animateOnClick(d){!this.slider||(this.slider.animateOnClick=d)}get animateOnClick(){var d;return(d=this.slider)==null?void 0:d.animateOnClick}get rangeDragging(){var d,m;return(m=(d=this.slider)==null?void 0:d.rangeDragging)!=null?m:!1}set rangeDragging(d){this.slider&&(this.slider.rangeDragging=Lt(d))}get externalCSSList(){return this._externalCSSList}addPointer(d){var m,v;if(!this.slider)return;let f=(v=(m=this.slider)==null?void 0:m.addPointer(d))!=null?v:0;so(this,this.slider,f,`value${f+1}`,`ariaLabel${f+1}`,`pointerShape${f+1}`,`pointer${f+1}Disabled`)}removePointer(){var d;!this.slider||(d=this.slider)==null||d.removePointer()}addCSS(d){if(!this.shadowRoot)return;let m=document.createElement("style");m.textContent=d,this.shadowRoot.appendChild(m)}connectedCallback(){var d,m;if(!this.shadowRoot)return;this._externalCSSList=rl(this),this.shadowRoot.innerHTML=s(o,this._externalCSSList);let v=(d=this.shadowRoot)==null?void 0:d.querySelector(".pointer");if(!v)return;let f=(m=this.shadowRoot)==null?void 0:m.getElementById("range-slider");if(!f)return;let C=ll(this,v);this.slider=cl(this,f,C),hl(this,this.slider),this._observer=new MutationObserver(B=>{B.forEach(H=>{var E;if(!this.slider||H.type!=="attributes")return;let k=H.attributeName;!k||pl(this.slider,k,(E=this.getAttribute(k))!=null?E:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},vs=ul;window.tcRangeSlider=vs,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",vs),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends vs{})})();function su(r,t){Object.keys(t).forEach(e=>{r.setAttribute(e,t[e])})}class ru extends Bt{register(){super.register()}unregister(){super.unregister()}build(){const t=this.schema.properties,e=this.options,i=this.schema.description,s=this.theme,o=this.defaults.startVals[this.key];e.compact||(this.header=this.label=s.getFormInputLabel(this.getTitle(),this.isRequired())),i&&(this.description=s.getFormInputDescription(this.translateProperty(i))),e.infoText&&(this.infoButton=s.getInfoButton(this.translateProperty(e.infoText)));const n=document.createElement("tc-range-slider"),a=Object.keys(t).find(c=>c.includes("min")),l=Object.keys(t).find(c=>c.includes("max")),h={min:t[a].minimum,max:t[l].maximum,value1:(o==null?void 0:o[a])||t[a].default,value2:(o==null?void 0:o[l])||t[l].default,"slider-bg-fill":"#004170","generate-labels":"true","slider-width":"100%","range-dragging":"false"};su(n,h),this.input=n,this.input.id=this.formname,this.control=s.getFormControl(this.label,this.input,this.description,this.infoButton),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.input.addEventListener("change",c=>{c.preventDefault(),c.stopPropagation(),this.value={[a]:c.detail.value1,[l]:c.detail.value2},this.onChange(!0)}),this.container.appendChild(this.control)}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}}const ou=[{type:"object",format:"minmax",func:ru}],nu=r=>{ou.map(({type:t,format:e,func:i})=>{K.defaults.startVals=r,K.defaults.editors[e]=i,K.defaults.resolvers.unshift(s=>{if(s.type===t&&s.format===e)return e})})};var ui,Ue,hr,Yo,dr,aa;class la extends Ft{constructor(){super(),W(this,hr),W(this,dr),W(this,ui,{}),W(this,Ue,null),this.schema,this.startVals,this.options={show_opt_in:!1,disable_collapse:!0,disable_edit_json:!0,disable_properties:!0,disable_array_delete_all_rows:!0,disable_array_delete_last_row:!0,array_controls_top:!0},this.unstyled=!1}getSchema(){return this.schema}setSchema(t){this.schema=t}getDefaultValues(){return this.startVals}setDefaultValues(t){this.startVals=t}getValues(){return st(this,ui)}firstUpdated(){if(!st(this,Ue)){nu(this.startVals||{});const t=this.renderRoot.querySelector("form");We(this,Ue,new K(t,{schema:this.schema,...this.startVals?{startval:this.startVals}:{},theme:"html",ajax:!0,...this.options})),Ct(this,dr,aa).call(this)}}render(){return z`
272
+ <style>
273
+ ${eu}
274
+ ${!this.unstyled&&iu}
275
+ </style>
276
+ <form></form>
277
+ `}}ui=new WeakMap,Ue=new WeakMap,hr=new WeakSet,Yo=function(){this.dispatchEvent(new CustomEvent("change",{detail:st(this,ui),bubbles:!0,composed:!0})),this.requestUpdate()},dr=new WeakSet,aa=function(){["ready","change"].map(r=>{st(this,Ue).on(r,()=>{We(this,ui,st(this,Ue).getValue()),Ct(this,hr,Yo).call(this)})})},_t(la,"properties",{schema:{attribute:!1,type:Object},startVals:{attribute:!1,type:Object},options:{attribute:!1,type:Object},unstyled:{type:Boolean}});customElements.define("eox-jsonform",la);const au=(r,t,e)=>{let i=t;return e.layer.getSource().getTileUrlFunction()&&(i||(i=e.layer.getSource().getTileUrlFunction()),e.layer.getSource().setTileUrlFunction((...s)=>qh(i(...s),r)),e.layer.getSource().setKey(new Date)),i};var Di=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var hu="Expected a function",Xo=NaN,du="[object Symbol]",cu=/^\s+|\s+$/g,pu=/^[-+]0x[0-9a-f]+$/i,uu=/^0b[01]+$/i,mu=/^0o[0-7]+$/i,gu=parseInt,bu=typeof Di=="object"&&Di&&Di.Object===Object&&Di,fu=typeof self=="object"&&self&&self.Object===Object&&self,yu=bu||fu||Function("return this")(),vu=Object.prototype,_u=vu.toString,wu=Math.max,xu=Math.min,ir=function(){return yu.Date.now()};function Cu(r,t,e){var i,s,o,n,a,l,h=0,c=!1,p=!1,b=!0;if(typeof r!="function")throw new TypeError(hu);t=Qo(t)||0,cr(e)&&(c=!!e.leading,p="maxWait"in e,o=p?wu(Qo(e.maxWait)||0,t):o,b="trailing"in e?!!e.trailing:b);function g(q){var gt=i,kt=s;return i=s=void 0,h=q,n=r.apply(kt,gt),n}function y(q){return h=q,a=setTimeout(G,t),c?g(q):n}function w(q){var gt=q-l,kt=q-h,rt=t-gt;return p?xu(rt,o-kt):rt}function A(q){var gt=q-l,kt=q-h;return l===void 0||gt>=t||gt<0||p&&kt>=o}function G(){var q=ir();if(A(q))return it(q);a=setTimeout(G,w(q))}function it(q){return a=void 0,b&&i?g(q):(i=s=void 0,n)}function nt(){a!==void 0&&clearTimeout(a),h=0,i=l=s=a=void 0}function It(){return a===void 0?n:it(ir())}function ct(){var q=ir(),gt=A(q);if(i=arguments,s=this,l=q,gt){if(a===void 0)return y(l);if(p)return a=setTimeout(G,t),g(l)}return a===void 0&&(a=setTimeout(G,t)),n}return ct.cancel=nt,ct.flush=It,ct}function cr(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function Eu(r){return!!r&&typeof r=="object"}function ku(r){return typeof r=="symbol"||Eu(r)&&_u.call(r)==du}function Qo(r){if(typeof r=="number")return r;if(ku(r))return Xo;if(cr(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=cr(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(cu,"");var e=uu.test(r);return e||mu.test(r)?gu(r.slice(2),e?2:8):pu.test(r)?Xo:+r}var Lu=Cu;const ha=lu(Lu);var Zi,Ji,Yi,pr,da,ur,mr;class ca extends Ft{constructor(){super(),W(this,pr),W(this,Zi,{}),W(this,Ji,null),W(this,Yi,void 0),W(this,ur,""),W(this,mr,""),this.layer=null,this.unstyled=!1,this.noShadow=!1,this.layerConfig=null,this.debouncedDataChange=ha(Ct(this,pr,da),1e3,{leading:!0})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){We(this,Ji,Cd(this.layer,this.layerConfig));const t={disable_edit_json:!0,disable_collapse:!0,disable_properties:!0};return z`
278
+ <style>
279
+ ${st(this,ur)}
280
+ ${!this.unstyled&&st(this,mr)}
281
+ </style>
282
+ ${ie(this.layerConfig,()=>z`
283
+ <!-- Render a JSON form for layer configuration -->
284
+ <eox-jsonform
285
+ .schema=${this.layerConfig.schema}
286
+ .startVals=${st(this,Ji)}
287
+ .options=${t}
288
+ @change=${this.debouncedDataChange}
289
+ ></eox-jsonform>
290
+ `)}
291
+ `}}Zi=new WeakMap,Ji=new WeakMap,Yi=new WeakMap,pr=new WeakSet,da=function(r){We(this,Zi,r.detail),We(this,Yi,au(st(this,Zi),st(this,Yi),this)),this.requestUpdate()},ur=new WeakMap,mr=new WeakMap,_t(ca,"properties",{layer:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},layerConfig:{attribute:!1}});customElements.define("eox-layercontrol-layerconfig",ca);var Xi,gr,br;class pa extends Ft{constructor(){super(),W(this,Xi,t=>this.selectedTab===t&&"highlighted"),W(this,gr,`
292
+ .tabbed figure {
293
+ margin: 0;
294
+ }
295
+ .tabbed nav {
296
+ display: flex;
297
+ justify-content: space-between;
298
+ }
299
+ .tabbed nav div {
300
+ display: flex;
301
+ }
302
+ .tabbed .tab {
303
+ display: none;
304
+ }
305
+ .tabbed .tab.highlighted {
306
+ display: block;
307
+ }
308
+ .tabbed label.highlighted {
309
+ background: lightgrey;
310
+ }
311
+ `),W(this,br,`
312
+ .tabbed {
313
+ font-size: small;
314
+ }
315
+ .tabbed label.highlighted {
316
+ background: #00417011;
317
+ pointer-events: none;
318
+ }
319
+ nav div label,
320
+ nav div span {
321
+ width: 20px;
322
+ height: 20px;
323
+ display: flex;
324
+ align-items: center;
325
+ justify-content: center;
326
+ cursor: pointer;
327
+ }
328
+ figure {
329
+ background: #00417011;
330
+ border-top: 1px solid #0041701a;
331
+ }
332
+ `),this.actions=[],this.selectedTab=0,this.tabs=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const t=this.tabs,e=this.actions,i=e.length+t.length>1;return z`
333
+ <style>
334
+ ${st(this,gr)}
335
+ ${!this.unstyled&&st(this,br)}
336
+ </style>
337
+ <div class="tabbed">
338
+ <!-- Navigation for tabs and actions -->
339
+ ${ie(i,()=>z`
340
+ <nav>
341
+ <div>
342
+ <!-- Labels for tabs -->
343
+ ${Gi(t,(s,o)=>z`
344
+ <label
345
+ class=${st(this,Xi).call(this,o)}
346
+ @click=${()=>this.selectedTab=o}
347
+ >
348
+ <!-- Customizable icon for each tab -->
349
+ <slot name=${`${s}-icon`}>${s}</slot>
350
+ </label>
351
+ `)}
352
+ </div>
353
+ <div>
354
+ <!-- Icons for actions -->
355
+ ${Gi(e,s=>z`
356
+ <span>
357
+ <!-- Customizable icon for each action -->
358
+ <slot name=${`${s}-icon`}>${s}</slot>
359
+ </span>
360
+ `)}
361
+ </div>
362
+ </nav>
363
+ `)}
364
+ <figure>
365
+ <!-- Content for each tab -->
366
+ ${Gi(t,(s,o)=>z`
367
+ <div class="tab ${st(this,Xi).call(this,o)}">
368
+ <!-- Content slot for each tab -->
369
+ <slot name=${`${s}-content`}>${s}</slot>
370
+ </div>
371
+ `)}
372
+ </figure>
373
+ </div>
374
+ `}}Xi=new WeakMap,gr=new WeakMap,br=new WeakMap,_t(pa,"properties",{actions:{attribute:!1},selectedTab:{state:!0},tabs:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-tabs",pa);const Au=`
375
+ button,
376
+ .button {
377
+ /* TODO: why does this only work here and not from :root? */
378
+ --primary-color: #004170;
379
+ --primary-color-hover: #004170CC;
380
+ --error-color: #FF5252;
381
+
382
+ display: inline-flex;
383
+ position: relative;
384
+ align-items: center;
385
+ color: #fff;
386
+ border-width: 0;
387
+ outline: none;
388
+ border-radius: 4px;
389
+ padding: 16px;
390
+ height: 36px;
391
+ cursor: pointer;
392
+ font-family: inherit;
393
+ font-size: 0.875rem;
394
+ text-transform: uppercase;
395
+ letter-spacing: 1.25px;
396
+ font-weight: 500;
397
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
398
+ transition-property: box-shadow, transform, opacity, background;
399
+ transition-duration: 0.28s;
400
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
401
+ }
402
+
403
+ button:hover:not([disabled]):not(.icon),
404
+ .button:hover:not([disabled]):not(.icon) {
405
+ box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
406
+ background: var(--primary-color-hover);
407
+ }
408
+
409
+ button, button:active,
410
+ .button, .button:active {
411
+ background: var(--primary-color);
412
+ }
413
+
414
+ button[disabled],
415
+ .button[disabled] {
416
+ opacity: 0.5;
417
+ cursor: not-allowed;
418
+ }
419
+
420
+ button.outline,
421
+ .button.outline {
422
+ background: transparent;
423
+ box-shadow: none;
424
+ color: var(--primary-color);
425
+ outline: 1px solid var(--primary-color);
426
+ }
427
+
428
+ button.outline:hover,
429
+ .button.outline:hover {
430
+ background: transparent;
431
+ }
432
+
433
+ button.icon,
434
+ .button.icon {
435
+ background: transparent;
436
+ border: none;
437
+ box-shadow: none;
438
+ padding: 0;
439
+ border-radius: 50%;
440
+ width: 24px;
441
+ height: 24px;
442
+ text-indent: -9999px;
443
+ }
444
+
445
+ button.icon-text,
446
+ .button.icon-text {
447
+ text-indent: 26px;
448
+ }
449
+
450
+ button.icon:before, button.icon-text:before,
451
+ .button.icon:before, .button.icon-text:before {
452
+ position: absolute;
453
+ text-indent: 0;
454
+ line-height: initial;
455
+ }
456
+
457
+ button.icon:before,
458
+ .button.icon:before {
459
+ width: 24px;
460
+ height: 24px;
461
+ margin-right: 0;
462
+ }
463
+
464
+ button.icon-text:before,
465
+ .button.icon-text:before {
466
+ width: 18px;
467
+ height: 18px;
468
+ }
469
+
470
+ button.small,
471
+ .button.small {
472
+ height: 28px;
473
+ padding: 12.4px;
474
+ font-size: .75rem;
475
+ }
476
+
477
+ button.smallest.icon,
478
+ button.smallest.icon::before {
479
+ height: 16px;
480
+ width: 16px;
481
+ padding: 0px;
482
+ }
483
+ `;var fr,yr;class ua extends Ft{constructor(){super(),_t(this,"_removeButton",()=>Ad(this)),_t(this,"_sortButton",()=>jd(this.unstyled)),_t(this,"_button",t=>Ld(t,this.unstyled)),W(this,fr,""),W(this,yr,`
484
+ ${Au}
485
+ ${oa}
486
+ ${Yr}
487
+ ${na}
488
+ .drag-handle {
489
+ cursor: n-resize;
490
+ }
491
+ .single-action-container,
492
+ details.tools {
493
+ position: relative;
494
+ }
495
+ eox-layercontrol-layer details summary::before {
496
+ content: "";
497
+ }
498
+ details.tools[open] {
499
+ /*border-top: 1px solid #0041703a;*/
500
+ }
501
+ .single-action {
502
+ position: relative;
503
+ }
504
+ details.tools summary .icon {
505
+ pointer-events: none;
506
+ }
507
+ .single-action,
508
+ details.tools summary {
509
+ position: absolute;
510
+ right: 0;
511
+ top: -24px;
512
+ display: flex;
513
+ border-radius: 4px;
514
+ cursor: pointer;
515
+ }
516
+ .single-action .icon::before,
517
+ details.tools summary .icon::before {
518
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Edots-vertical%3C/title%3E%3Cpath d='M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z' /%3E%3C/svg%3E");
519
+ }
520
+ .single-action,
521
+ details.tools summary,
522
+ eox-layercontrol-tabs button.icon {
523
+ transition: opacity .2s;
524
+ }
525
+ .single-action,
526
+ details.tools summary {
527
+ opacity: .5;
528
+ }
529
+ eox-layercontrol-tabs button.icon {
530
+ opacity: .7;
531
+ }
532
+ .single-action:hover,
533
+ details.tools summary:hover,
534
+ eox-layercontrol-tabs button.icon:hover {
535
+ opacity: 1;
536
+ }
537
+ .tools-placeholder,
538
+ .single-action .icon,
539
+ .single-action .icon::before,
540
+ details.tools summary .icon,
541
+ details.tools summary .icon::before {
542
+ height: 16px;
543
+ width: 16px;
544
+ }
545
+ eox-layercontrol-tabs button.icon,
546
+ eox-layercontrol-tabs .button.icon {
547
+ display: flex;
548
+ justify-content: center;
549
+ }
550
+ eox-layercontrol-tabs button.icon::before,
551
+ eox-layercontrol-tabs .button.icon::before {
552
+ width: 16px;
553
+ height: 16px;
554
+ }
555
+ details.tools summary .info-icon,
556
+ button.icon[slot=info-icon]::before {
557
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Einformation-outline%3C/title%3E%3Cpath d='M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z' /%3E%3C/svg%3E");
558
+ }
559
+ details.tools summary .opacity-icon,
560
+ button.icon[slot=opacity-icon]::before {
561
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eopacity%3C/title%3E%3Cpath d='M17.66,8L12,2.35L6.34,8C4.78,9.56 4,11.64 4,13.64C4,15.64 4.78,17.75 6.34,19.31C7.9,20.87 9.95,21.66 12,21.66C14.05,21.66 16.1,20.87 17.66,19.31C19.22,17.75 20,15.64 20,13.64C20,11.64 19.22,9.56 17.66,8M6,14C6,12 6.62,10.73 7.76,9.6L12,5.27L16.24,9.65C17.38,10.77 18,12 18,14H6Z' /%3E%3C/svg%3E");
562
+ }
563
+ details.tools summary .config-icon,
564
+ button.icon[slot=config-icon]::before {
565
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Etune%3C/title%3E%3Cpath d='M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z' /%3E%3C/svg%3E");
566
+ }
567
+ .single-action .remove-icon::before,
568
+ [slot=remove-icon] button.icon::before {
569
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ff0000' viewBox='0 0 24 24'%3E%3Ctitle%3Edelete-outline%3C/title%3E%3Cpath d='M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z' /%3E%3C/svg%3E");
570
+ }
571
+ .single-action .sort-icon::before,
572
+ [slot=sort-icon] .button.icon::before {
573
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Edrag-horizontal-variant%3C/title%3E%3Cpath d='M21 11H3V9H21V11M21 13H3V15H21V13Z' /%3E%3C/svg%3E");
574
+ }
575
+ [slot=info-content],
576
+ [slot=opacity-content] {
577
+ padding: 12px 6px;
578
+ }
579
+ `),this.layer=null,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var t;const e=Ed(this.tools,this.layer),i=kd(this.tools,this.layer),s=this[`_${e==null?void 0:e[0]}Button`]?this[`_${e==null?void 0:e[0]}Button`]():tt,o=((t=this.tools)==null?void 0:t.length)===1?`${this.tools[0]}-icon`:"",n=e==null?void 0:e.length,a=i==null?void 0:i.length;return z`
580
+ <style>
581
+ ${st(this,fr)}
582
+ ${!this.unstyled&&st(this,yr)}
583
+ </style>
584
+ ${ie(n+a>0,()=>z`
585
+ ${ie(n===1&&a===0,()=>z`
586
+ <div class="single-action-container">
587
+ <div class="single-action">${s}</div>
588
+ </div>
589
+ `,()=>{var l;return z`
590
+ <details
591
+ class="tools"
592
+ open=${this.layer.get("layerControlToolsExpand")||tt}
593
+ >
594
+ <summary>
595
+ <button class="icon ${o}">Tools</button>
596
+ </summary>
597
+ <eox-layercontrol-tabs
598
+ .noShadow=${!1}
599
+ .actions=${e}
600
+ .tabs=${i}
601
+ .unstyled=${this.unstyled}
602
+ >
603
+ <!-- Rendering tabs and content -->
604
+ ${Gi(i,h=>this._button(h))}
605
+
606
+ <div slot="info-content">
607
+ ${Sd(this.layer.get("description"))}
608
+ </div>
609
+ <div slot="opacity-content">
610
+ <!-- Input for opacity -->
611
+ <input
612
+ type="range"
613
+ min="0"
614
+ max="1"
615
+ step="0.01"
616
+ value=${Rn((l=this.layer)==null?void 0:l.getOpacity())}
617
+ @input=${h=>this.layer.setOpacity(parseFloat(h.target.value))}
618
+ />
619
+ </div>
620
+ <div slot="config-content">
621
+ <!-- Layer configuration -->
622
+ <eox-layercontrol-layerconfig
623
+ slot="config-content"
624
+ .layer=${this.layer}
625
+ .noShadow=${!0}
626
+ .layerConfig=${this.layer.get("layerConfig")}
627
+ .unstyled=${this.unstyled}
628
+ @changed=${()=>this.requestUpdate()}
629
+ ></eox-layercontrol-layerconfig>
630
+ </div>
631
+ <div slot="remove-icon">${this._removeButton()}</div>
632
+ <div slot="sort-icon">${this._sortButton()}</div>
633
+ </eox-layercontrol-tabs>
634
+ </details>
635
+ `})}
636
+ `)}
637
+ `}}fr=new WeakMap,yr=new WeakMap,_t(ua,"properties",{layer:{attribute:!1},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-layer-tools",ua);const ju=r=>{const t=()=>{const e=wd(r.layer,r.map,r.showLayerZoomState);let i=!1;!e&&r.currLayerVisibilityBasedOnZoom?(r.currLayerVisibilityBasedOnZoom=!1,i=!0):e&&!r.currLayerVisibilityBasedOnZoom&&(r.currLayerVisibilityBasedOnZoom=!0,i=!0),i&&(r.requestUpdate(),r.dispatchEvent(new CustomEvent("change:resolution",{bubbles:!0})))};Nn(r.layer,r.showLayerZoomState)&&(t(),r.map.getView().on("change:resolution",()=>t()))},Su=(r,t)=>{const e=t.layer;e.setVisible(r.target.checked),r.target.checked&&e.get("layerControlExclusive")&&t.parentNode.parentNode.querySelectorAll("li > eox-layercontrol-layer").forEach(i=>{var s;i.layer!==e&&(s=i.layer)!=null&&s.get("layerControlExclusive")&&(i.layer.setVisible(!1),i.requestUpdate())}),t.dispatchEvent(new CustomEvent("changed",{bubbles:!0})),t.requestUpdate()};var ri,Qi,vr,ma,_r,wr;class ga extends Ft{constructor(){super(),W(this,ri),W(this,vr),_t(this,"currLayerVisibilityBasedOnZoom",!0),W(this,_r,""),W(this,wr,`
638
+ ${Yr}
639
+ eox-layercontrol-layer {
640
+ width: 100%;
641
+ }
642
+ .layer.zoom-state-invisible {
643
+ background: #d2e2ee;
644
+ opacity: 0.3;
645
+ }
646
+ .layer {
647
+ width: 100%;
648
+ align-items: center;
649
+ justify-content: space-between;
650
+ padding: 4px 0;
651
+ }
652
+ label, span {
653
+ display: flex;
654
+ align-items: center;
655
+ cursor: pointer;
656
+ }
657
+ [data-type] .title::before {
658
+ width: 20px;
659
+ min-width: 20px;
660
+ height: 20px;
661
+ margin-right: 6px;
662
+ }
663
+ [data-type=group] .title::before {
664
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Efolder-outline%3C/title%3E%3Cpath d='M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z' /%3E%3C/svg%3E");
665
+ }
666
+ [data-type=group] > eox-layercontrol-layer-group > details[open] > summary > eox-layercontrol-layer > .layer > label > .title::before {
667
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Efolder-open-outline%3C/title%3E%3Cpath d='M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z' /%3E%3C/svg%3E");
668
+ }
669
+ [data-type=raster] .title::before {
670
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckerboard%3C/title%3E%3Cpath d='M2 2V22H22V2H2M20 12H16V16H20V20H16V16H12V20H8V16H4V12H8V8H4V4H8V8H12V4H16V8H20V12M16 8V12H12V8H16M12 12V16H8V12H12Z' /%3E%3C/svg%3E");
671
+ }
672
+ [data-type=vector] .title::before {
673
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-outline%3C/title%3E%3Cpath d='M11,13.5V21.5H3V13.5H11M9,15.5H5V19.5H9V15.5M12,2L17.5,11H6.5L12,2M12,5.86L10.08,9H13.92L12,5.86M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13M17.5,15A2.5,2.5 0 0,0 15,17.5A2.5,2.5 0 0,0 17.5,20A2.5,2.5 0 0,0 20,17.5A2.5,2.5 0 0,0 17.5,15Z' /%3E%3C/svg%3E");
674
+ }
675
+ [data-type=draw] .title::before {
676
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Evector-square-edit%3C/title%3E%3Cpath d='M22.7 14.4L21.7 15.4L19.6 13.3L20.6 12.3C20.8 12.1 21.2 12.1 21.4 12.3L22.7 13.6C22.9 13.8 22.9 14.1 22.7 14.4M13 19.9L19.1 13.8L21.2 15.9L15.1 22H13V19.9M11 19.9V19.1L11.6 18.5L12.1 18H8V16H6V8H8V6H16V8H18V12.1L19.1 11L19.3 10.8C19.5 10.6 19.8 10.4 20.1 10.3V8H22.1V2H16.1V4H8V2H2V8H4V16H2V22H8V20L11 19.9M18 4H20V6H18V4M4 4H6V6H4V4M6 20H4V18H6V20Z' /%3E%3C/svg%3E");
677
+ }
678
+ `),this.layer=null,this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){ju(this)}render(){var t;const e=this.layer.getVisible(),i=e?"visible":"",s=this.currLayerVisibilityBasedOnZoom?"":"zoom-state-invisible",o=Ct(this,ri,Qi).call(this,"layerControlDisable")?"disabled":"",n=Ct(this,ri,Qi).call(this,"layerControlExclusive")?"radio":"checkbox",a=((t=this.tools)==null?void 0:t.length)>0;return z`
679
+ <style>
680
+ ${st(this,_r)}
681
+ ${!this.unstyled&&st(this,wr)}
682
+ </style>
683
+ ${ie(this.layer,()=>z`
684
+ <!-- Render the layer -->
685
+ <div class="layer ${i} ${s}">
686
+ <label class="drag-handle ${o}">
687
+ <!-- Input element for layer visibility -->
688
+ <input
689
+ type=${n}
690
+ .checked=${Rn(e)}
691
+ @click=${Ct(this,vr,ma)}
692
+ />
693
+
694
+ <!-- Layer title -->
695
+ <span class="title">${Ct(this,ri,Qi).call(this,this.titleProperty)}</span>
696
+ ${ie(a,()=>z`<span class="tools-placeholder"></span>`)}
697
+ </label>
698
+ </div>
699
+
700
+ <!-- Render layer tools -->
701
+ <eox-layercontrol-layer-tools
702
+ .noShadow=${!0}
703
+ .layer=${this.layer}
704
+ .tools=${this.tools}
705
+ .unstyled=${this.unstyled}
706
+ ></eox-layercontrol-layer-tools>
707
+ `)}
708
+ `}}ri=new WeakSet,Qi=function(r){var t;return(t=this.layer)==null?void 0:t.get(r)},vr=new WeakSet,ma=function(r){Su(r,this)},_r=new WeakMap,wr=new WeakMap,_t(ga,"properties",{layer:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-layer",ga);var xr,Cr;class ba extends Ft{constructor(){super(),W(this,xr,""),W(this,Cr,`
709
+ details summary {
710
+ cursor: pointer;
711
+ display: flex;
712
+ }
713
+ details summary { list-style-type: none; } /* Firefox */
714
+ details summary::-webkit-details-marker { display: none; } /* Chrome */
715
+ details summary::marker { display: none; }
716
+ details summary::before {
717
+ display: block;
718
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echevron-right%3C/title%3E%3Cpath d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z' /%3E%3C/svg%3E");
719
+ font-size: 13px;
720
+ width: 24px;
721
+ height: 24px;
722
+ margin: 4px 0;
723
+ transform-origin: center;
724
+ transition: transform 0.1s ease-in-out;
725
+ }
726
+ details[open] > summary:before {
727
+ transform: rotate(90deg);
728
+ }
729
+ details[data-children-length="0"] summary::before {
730
+ display: none;
731
+ }
732
+ `),this.group=null,this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var t,e;const i=!!((t=this.group)!=null&&t.get("layerControlExpand")),s=(e=Hn(this.group.getLayers()))==null?void 0:e.length;return z`
733
+ <style>
734
+ ${st(this,xr)}
735
+ ${!this.unstyled&&st(this,Cr)}
736
+ </style>
737
+ ${ie(this.group,()=>z`
738
+ <!-- Render the details element with the layer control -->
739
+ <details
740
+ open=${i||tt}
741
+ data-children-length=${s}
742
+ >
743
+ <summary>
744
+ <!-- Render the layer control within the summary -->
745
+ <eox-layercontrol-layer
746
+ .noShadow=${!0}
747
+ .layer=${this.group}
748
+ .map=${this.map}
749
+ .titleProperty=${this.titleProperty}
750
+ .showLayerZoomState=${this.showLayerZoomState}
751
+ .tools=${this.tools}
752
+ .unstyled=${this.unstyled}
753
+ @changed=${()=>this.requestUpdate()}
754
+ ></eox-layercontrol-layer>
755
+ </summary>
756
+
757
+ <!-- Render the list of layers within the details -->
758
+ <eox-layercontrol-layer-list
759
+ .noShadow=${!0}
760
+ .idProperty=${this.idProperty}
761
+ .layers=${this.group.getLayers()}
762
+ .map=${this.map}
763
+ .titleProperty=${this.titleProperty}
764
+ .showLayerZoomState=${this.showLayerZoomState}
765
+ .tools=${this.tools}
766
+ .unstyled=${this.unstyled}
767
+ @changed=${()=>this.requestUpdate()}
768
+ ></eox-layercontrol-layer-list>
769
+ </details>
770
+ `)}
771
+ `}}xr=new WeakMap,Cr=new WeakMap,_t(ba,"properties",{group:{attribute:!1},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-layer-group",ba);const Tu=r=>{const{layers:t,idProperty:e,titleProperty:i,renderRoot:s}=r;if(t){const o=s.querySelector("ul");_d(t,e,i,r),vd(o,t,e,r)}},$u=r=>{const{layers:t}=r,e=ha(()=>{r.requestUpdate(),r.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))},50),i=()=>e();t&&(t.hasListener("change:length")&&(t==null||t.un("change:length",i)),t.on("change:length",i))};var Er,kr;class fa extends Ft{constructor(){super(),W(this,Er,""),W(this,kr,`
772
+ ul {
773
+ padding: 0;
774
+ margin: 0;
775
+ }
776
+ ul ul {
777
+ padding-left: 48px;
778
+ }
779
+ li {
780
+ list-style: none;
781
+ }
782
+ li {
783
+ border-bottom: 1px solid #0041703a;
784
+ }
785
+ li:first-child {
786
+ border-top: 1px solid #0041703a;
787
+ }
788
+ li:last-child {
789
+ border: none;
790
+ }
791
+ li.sortable-chosen {
792
+ background: #eeea;
793
+ }
794
+ li.sortable-drag {
795
+ opacity: 0;
796
+ }
797
+ li.sortable-ghost {
798
+ }
799
+ `),this.idProperty="id",this.layers=null,this.map=null,this.tools=void 0,this.titleProperty="title",this.showLayerZoomState=!1,this.unstyled=!1,this.noShadow=!1}firstUpdated(){Tu(this)}updated(){$u(this)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const t=Hn(this.layers).reverse();return z`
800
+ <style>
801
+ ${st(this,Er)}
802
+ ${!this.unstyled&&st(this,kr)}
803
+ </style>
804
+ <ul>
805
+ ${ie(this.layers,()=>z`
806
+ ${Jl(t,e=>e,e=>z`
807
+ <li
808
+ data-layer="${e.get(this.idProperty)}"
809
+ data-type="${xd(e,this.map)}"
810
+ >
811
+ ${e.getLayers?z`
812
+ <eox-layercontrol-layer-group
813
+ .noShadow=${!0}
814
+ .group=${e}
815
+ .idProperty=${this.idProperty}
816
+ .map=${this.map}
817
+ .titleProperty=${this.titleProperty}
818
+ .showLayerZoomState=${this.showLayerZoomState}
819
+ .tools=${this.tools}
820
+ .unstyled=${this.unstyled}
821
+ @changed=${()=>this.requestUpdate()}
822
+ >
823
+ </eox-layercontrol-layer-group>
824
+ `:z`
825
+ <eox-layercontrol-layer
826
+ .noShadow=${!0}
827
+ .layer=${e}
828
+ .map=${this.map}
829
+ .titleProperty=${this.titleProperty}
830
+ .showLayerZoomState=${this.showLayerZoomState}
831
+ .tools=${this.tools}
832
+ .unstyled=${this.unstyled}
833
+ @changed=${()=>this.requestUpdate()}
834
+ ></eox-layercontrol-layer>
835
+ `}
836
+ </li>
837
+ `)}
838
+ `)}
839
+ </ul>
840
+ `}}Er=new WeakMap,kr=new WeakMap,_t(fa,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-layer-list",fa);const Ou=r=>{const t=r.querySelector("select[name=optional]"),e=t?t.value:null,i=Gr(r.layers.getArray(),"layerControlOptional",!0).find(s=>(s.get(r.idProperty)||s.ol_uid)===e);i==null||i.set("layerControlOptional",!1),i==null||i.setVisible(!0),r.dispatchEvent(new CustomEvent("changed",{bubbles:!0})),r.renderRoot.parentNode.querySelectorAll("eox-layercontrol-layer-list").forEach(s=>s.requestUpdate()),r.requestUpdate()};var Lr,ya;class va extends Ft{constructor(){super(),W(this,Lr),this.idProperty="id",this.layers=null,this.titleProperty="title",this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const t=Gr(this.layers.getArray(),"layerControlOptional",!0);return z`
841
+ <!-- Label for the dropdown -->
842
+ <label for="optional">Optional layers</label>
843
+
844
+ <!-- Dropdown select element -->
845
+ <select name="optional" data-cy="optionalLayers">
846
+ <!-- Default placeholder option -->
847
+ <option disabled selected value>
848
+ -- select an optional layer to add --
849
+ </option>
850
+
851
+ <!-- Mapping through filtered layers list to generate dropdown options -->
852
+ ${t.map(e=>{const i=e.get(this.idProperty)||e.ol_uid,s=e.get(this.titleProperty),o=`layer ${e.get(this.idProperty)}`;return z` <option value="${i}">${s||o}</option> `})}
853
+ </select>
854
+
855
+ <!-- Button to handle adding layers -->
856
+ <button @click="${Ct(this,Lr,ya)}">add</button>
857
+ `}}Lr=new WeakSet,ya=function(){Ou(this)},_t(va,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},titleProperty:{attribute:"title-property",type:String},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-optional-list",va);const Pu=(r,t)=>{t.jsonInput=r.target.value,t.requestUpdate()},Ko=r=>{const t=JSON.parse(`{"data":${wn(r.jsonInput)}}`);Array.isArray(t.data)?t.data.forEach(e=>{r.eoxMap.addOrUpdateLayer(e)}):r.eoxMap.addOrUpdateLayer(t.data),r.jsonInput=null,r.requestUpdate()},Bu=(r,t)=>{t.urlInput=r.target.value,t.requestUpdate()};async function Iu(r){const t=r.urlInput;if(r.wmsCapabilities=null,r.searchLoad=!0,r.requestUpdate(),!t)return!1;if(zr(t)==="XYZ")return{Name:t};try{const e=await Vh(t);r.wmsCapabilities=e}catch{}finally{r.searchLoad=!1,r.requestUpdate()}return!1}const Nu=(r,t)=>{const{Name:e}=r,i=zr(t.urlInput)||"XYZ",s={type:"Tile",properties:{id:e,title:e},source:{type:i,url:t.urlInput,params:{LAYERS:e}}};t.jsonInput=JSON.stringify(s)},Mu=(r,t)=>{t.open=r||null,t.urlInput=null,t.jsonInput=null,t.wmsCapabilities=null,t.requestUpdate()};var Ar,_a,jr,wa,ds,Sr,Tr,xa,$r,Ca,oi,Ki,Or,Pr;class Ea extends Ft{constructor(){super(),W(this,Ar),W(this,jr),W(this,ds),W(this,Tr),W(this,$r),W(this,oi),_t(this,"urlInput",null),_t(this,"jsonInput",null),_t(this,"open",null),_t(this,"searchLoad",!1),_t(this,"wmsCapabilities",null),W(this,Or,`
858
+ .eox-add-layer-main .open {
859
+ position: relative;
860
+ }
861
+ .eox-add-layer-main .close {
862
+ display: none;
863
+ }
864
+ `),W(this,Pr,`
865
+ .eox-add {
866
+ background: #f0f2f5;
867
+ border-top: 1px solid #0041701a;
868
+ padding: 0.5rem;
869
+ font-size: small;
870
+ }
871
+ .eox-add-layer-col, .eox-add-layer-tab {
872
+ display: flex;
873
+ width: 100%;
874
+ }
875
+ .eox-add-layer-main .close {
876
+ display: none;
877
+ }
878
+ .eox-add-layer-main .open {
879
+ position: relative;
880
+ }
881
+ button.icon.add-icon {
882
+ flex-grow: 1;
883
+ }
884
+ .eox-add-layer-tab li {
885
+ border: 0 !important;
886
+ font-size: smaller;
887
+ padding: 0.2rem 0.7rem;
888
+ background: #f0f2f5;
889
+ border-radius: 4px 4px 0px 0px;
890
+ font-size: 0.8rem;
891
+ font-weight: 500;
892
+ cursor: pointer;
893
+ }
894
+ .eox-add-layer-tab li.active {
895
+ background: #204270;
896
+ color: white;
897
+ font-weight: 700;
898
+ }
899
+ .relative {
900
+ position: relative
901
+ }
902
+ .eox-add-layer-col.justify-end {
903
+ justify-content: end;
904
+ }
905
+ .eox-add ul {
906
+ max-height: 120px;
907
+ overflow: scroll;
908
+ }
909
+ .eox-add ul li {
910
+ display: flex;
911
+ align-items: center;
912
+ justify-content: space-between;
913
+ padding: 0.1rem 0.2rem;
914
+ }
915
+ button.icon {
916
+ justify-content: end;
917
+ transition: opacity .2s;
918
+ opacity: .7;
919
+ }
920
+ button.icon:hover {
921
+ opacity: 1;
922
+ }
923
+ button.icon.add-layer-icon::before {
924
+ width: 16px;
925
+ min-width: 16px;
926
+ height: 16px;
927
+ }
928
+ button.icon.add-icon::before {
929
+ width: 18px;
930
+ min-width: 18px;
931
+ height: 18px;
932
+ }
933
+ .add-icon.icon::before {
934
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath xmlns='http://www.w3.org/2000/svg' d='M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z' fill='%23004270'/%3E%3C/svg%3E");
935
+ }
936
+ .add-layer-icon::before {
937
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eplus-thick%3C/title%3E%3Cpath fill='%23004270' d='M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z' /%3E%3C/svg%3E");
938
+ }
939
+ .json-add-layer {
940
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eplus-thick%3C/title%3E%3Cpath fill='white' d='M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z' /%3E%3C/svg%3E");
941
+ }
942
+ .search-icon::after {
943
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Emagnify%3C/title%3E%3Cpath d='M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z' fill='white' /%3E%3C/svg%3E");
944
+ }
945
+ .search-icon::after, .json-add-layer::before {
946
+ width: 14px;
947
+ min-width: 14px;
948
+ height: 14px;
949
+ display:flex
950
+ margin-right: 6px;
951
+ color: white;
952
+ }
953
+ .search-icon, .json-add-layer {
954
+ padding: 4px 6px;
955
+ height: 28px;
956
+ border-radius: 0px 4px 4px 0px;
957
+ box-shadow: none;
958
+ }
959
+ .json-add-layer {
960
+ position: absolute;
961
+ bottom: 16px;
962
+ right: 14px;
963
+ border-radius: 4px;
964
+ height: 24px;
965
+ padding: 4px;
966
+ }
967
+ input.add-url, textarea.add-layer-input {
968
+ box-sizing: border-box !important;
969
+ width: 100%;
970
+ height: 28px;
971
+ padding: 5px 7px !important;
972
+ border: 1px solid #0004 !important;
973
+ font-size: smaller;
974
+ border-radius: 4px 0px 0px 4px;
975
+ }
976
+ textarea.add-layer-input {
977
+ height: 90px;
978
+ resize: none;
979
+ border-radius: 4px;
980
+ }
981
+ .divider {
982
+ margin: 1rem 0px;
983
+ height: 1px;
984
+ border-top: 1.5px solid #00417059;
985
+ text-align: center;
986
+ position: relative;
987
+ }
988
+ .divider span {
989
+ position: relative;
990
+ top: -.6em;
991
+ padding: 0px 0.5rem;
992
+ background: #f0f2f5;
993
+ color: #00417059;
994
+ font-weight: bold;
995
+ display: inline-block;
996
+ }
997
+ `),this.eoxMap=null,this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const t=this.open?"open":"close",e=this.open==="url",i=this.open==="json",s=!Fh(this.urlInput)||this.searchLoad?!0:tt;return z`
998
+ <style>
999
+ ${st(this,Or)}
1000
+ ${!this.unstyled&&st(this,Pr)}
1001
+ </style>
1002
+ <div class="eox-add-layer-main">
1003
+ <div class="eox-add-layer-col">
1004
+ <!-- Tabbed interface for URL and JSON -->
1005
+ <ul class="eox-add-layer-tab ${t}">
1006
+ <li
1007
+ @click=${()=>Ct(this,oi,Ki).call(this,"url")}
1008
+ class="${e?"active":""}"
1009
+ >
1010
+ URL
1011
+ </li>
1012
+ <li
1013
+ @click=${()=>Ct(this,oi,Ki).call(this,"json")}
1014
+ class="${i?"active":""}"
1015
+ >
1016
+ JSON
1017
+ </li>
1018
+ </ul>
1019
+
1020
+ <!-- Button to toggle tabs -->
1021
+ <button
1022
+ class="add-icon icon"
1023
+ @click=${()=>Ct(this,oi,Ki).call(this,this.open?null:"url")}
1024
+ >
1025
+ ${this.unstyled?"Add Layer":""}
1026
+ </button>
1027
+ </div>
1028
+ <div class="eox-add ${t}">
1029
+ ${e?z`
1030
+ <!-- Input field for URL -->
1031
+ <div class="eox-add-layer-col">
1032
+ <input
1033
+ type="text"
1034
+ class="add-url"
1035
+ placeholder="Add URL (WMS/XYZ)"
1036
+ .value="${this.urlInput}"
1037
+ @input=${Ct(this,Ar,_a)}
1038
+ >
1039
+ </input>
1040
+ <!-- Search button for URL -->
1041
+ <button
1042
+ class="search-icon"
1043
+ disabled=${s}
1044
+ @click=${Ct(this,jr,wa)}
1045
+ >
1046
+ ${this.unstyled?"Search":""}
1047
+ </button>
1048
+ </div>
1049
+
1050
+ <!-- Display layers for WMS capabilities -->
1051
+ ${this.wmsCapabilities?z`<ul class="search-lists">
1052
+ ${this.wmsCapabilities.Capability.Layer.Layer.map(o=>{const n=o.Name;return z`
1053
+ <li class="search-list">
1054
+ ${n}
1055
+ <!-- Button to add layer -->
1056
+ <button
1057
+ class="add-layer-icon icon"
1058
+ @click=${()=>Ct(this,ds,Sr).call(this,o)}
1059
+ >
1060
+ ${this.unstyled?"+":""}
1061
+ </button>
1062
+ </li>
1063
+ `})}
1064
+ </ul>`:tt}
1065
+ `:z`
1066
+ <!-- Textarea for JSON input -->
1067
+ <textarea
1068
+ class="add-layer-input"
1069
+ placeholder="Please put a valid eox-map layer JSON."
1070
+ @input=${Ct(this,$r,Ca)}
1071
+ .value=${this.jsonInput}
1072
+ ></textarea>
1073
+
1074
+ <!-- Button to add JSON layer -->
1075
+ <button
1076
+ class="add-layer-icon json-add-layer"
1077
+ disabled=${zh(this.jsonInput)?tt:!0}
1078
+ @click=${Ct(this,Tr,xa)}
1079
+ >
1080
+ ${this.unstyled?"Add JSON":""}
1081
+ </button>
1082
+ `}
1083
+ </div>
1084
+ </div>
1085
+ `}}Ar=new WeakSet,_a=function(r){Bu(r,this)},jr=new WeakSet,wa=async function(){const r=await Iu(this);r&&Ct(this,ds,Sr).call(this,r)},ds=new WeakSet,Sr=function(r){Nu(r,this),Ko(this)},Tr=new WeakSet,xa=function(){Ko(this)},$r=new WeakSet,Ca=function(r){Pu(r,this)},oi=new WeakSet,Ki=function(r){Mu(r,this)},Or=new WeakMap,Pr=new WeakMap,_t(Ea,"properties",{eoxMap:{attribute:!1,state:!0},unstyled:{type:Boolean},noShadow:{type:Boolean}});customElements.define("eox-layercontrol-add-layers",Ea);const Hu=(r,t)=>{if(t.requestUpdate(),r.target.tagName==="EOX-LAYERCONTROL-LAYER-TOOLS"){const e=t.renderRoot.querySelector("eox-layercontrol-optional-list");e==null||e.requestUpdate()}},Ru=r=>{const t=r.for;return document.querySelector(t)},Du=r=>{const t=document.querySelector(r.for);t&&t.map!==r.map&&(r.map=t.map)};var ni,Br,ka,Ir;class La extends Ft{constructor(){super(),W(this,Br),W(this,ni,void 0),W(this,Ir,"* { font-family: Roboto, sans-serif; }"),this.for="eox-map",this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=["info","opacity","config","remove","sort"],this.addExternalLayers=!1,this.unstyled=!1,this.styleOverride=""}updated(){Du(this)}firstUpdated(){We(this,ni,Ru(this))}render(){var t,e,i;const s=(t=this.map)==null?void 0:t.getLayers().getArray(),o=s&&((e=Gr(s,"layerControlOptional",!0))==null?void 0:e.length)>0;return z`
1086
+ <style>
1087
+ ${!this.unstyled&&st(this,Ir)}
1088
+ ${this.styleOverride}
1089
+ </style>
1090
+
1091
+ <!-- Conditional rendering of add layers component -->
1092
+ ${ie(this.addExternalLayers&&((i=st(this,ni))==null?void 0:i.addOrUpdateLayer),()=>z`
1093
+ <eox-layercontrol-add-layers
1094
+ .noShadow=${!0}
1095
+ .eoxMap=${st(this,ni)}
1096
+ .unstyled=${this.unstyled}
1097
+ ></eox-layercontrol-add-layers>
1098
+ `)}
1099
+
1100
+ <!-- Conditional rendering of layer list component -->
1101
+ ${ie(this.map,()=>z`
1102
+ <eox-layercontrol-layer-list
1103
+ .noShadow=${!0}
1104
+ class="layers"
1105
+ .idProperty=${this.idProperty}
1106
+ .layers=${this.map.getLayers()}
1107
+ .map=${this.map}
1108
+ .titleProperty=${this.titleProperty}
1109
+ .showLayerZoomState=${this.showLayerZoomState}
1110
+ .tools=${this.tools}
1111
+ .unstyled=${this.unstyled}
1112
+ @changed=${Ct(this,Br,ka)}
1113
+ ></eox-layercontrol-layer-list>
1114
+ `)}
1115
+
1116
+ <!-- Conditional rendering of optional list component -->
1117
+ ${ie(o,()=>z`
1118
+ <eox-layercontrol-optional-list
1119
+ .noShadow=${!0}
1120
+ .idProperty=${this.idProperty}
1121
+ .layers=${this.map.getLayers()}
1122
+ .titleProperty=${this.titleProperty}
1123
+ @changed=${()=>this.requestUpdate()}
1124
+ ></eox-layercontrol-optional-list>
1125
+ `)}
1126
+ `}}ni=new WeakMap,Br=new WeakSet,ka=function(r){Hu(r,this)},Ir=new WeakMap,_t(La,"properties",{for:{type:String},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},addExternalLayers:{attribute:!1},unstyled:{type:Boolean},styleOverride:{type:String}});customElements.define("eox-layercontrol",La);export{La as EOxLayerControl};