@eox/layercontrol 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-layercontrol.js +2150 -0
- package/dist/eox-layercontrol.umd.cjs +188 -0
- package/package.json +1 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
(function(v,x){typeof exports=="object"&&typeof module<"u"?x(exports):typeof define=="function"&&define.amd?define(["exports"],x):(v=typeof globalThis<"u"?globalThis:v||self,x(v["eox-layercontrol"]={}))})(this,function(v){"use strict";var mi=Object.defineProperty;var vi=(v,x,F)=>x in v?mi(v,x,{enumerable:!0,configurable:!0,writable:!0,value:F}):v[x]=F;var A=(v,x,F)=>(vi(v,typeof x!="symbol"?x+"":x,F),F);/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const x=window,F=x.ShadowRoot&&(x.ShadyCSS===void 0||x.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),$t=new WeakMap;let yn=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Dt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(F&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=$t.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&$t.set(t,e))}return e}toString(){return this.cssText}};const En=i=>new yn(typeof i=="string"?i:i+"",void 0,Dt),_n=(i,e)=>{F?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const n=document.createElement("style"),o=x.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,i.appendChild(n)})},At=F?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return En(t)})(i):i;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/var tt;const je=window,Tt=je.trustedTypes,bn=Tt?Tt.emptyScript:"",Mt=je.reactiveElementPolyfillSupport,nt={toAttribute(i,e){switch(e){case Boolean:i=i?bn:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Ot=(i,e)=>e!==i&&(e==e||i==i),it={attribute:!0,type:String,converter:nt,reflect:!1,hasChanged:Ot},ot="finalized";let de=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const o=this._$Ep(n,t);o!==void 0&&(this._$Ev.set(o,n),e.push(o))}),e}static createProperty(e,t=it){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,n,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(o){const a=this[e];this[t]=o,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||it}static finalize(){if(this.hasOwnProperty(ot))return!1;this[ot]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const o of n)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const o of n)t.unshift(At(o))}else e!==void 0&&t.push(At(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return _n(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=it){var o;const a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){const r=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:nt).toAttribute(t,n.type);this._$El=e,r==null?this.removeAttribute(a):this.setAttribute(a,r),this._$El=null}}_$AK(e,t){var n;const o=this.constructor,a=o._$Ev.get(e);if(a!==void 0&&this._$El!==a){const r=o.getPropertyOptions(a),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?r.converter:nt;this._$El=a,this[a]=l.fromAttribute(t,r.type),this._$El=null}}requestUpdate(e,t,n){let o=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ot)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,a)=>this[a]=o),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var a;return(a=o.hostUpdate)===null||a===void 0?void 0:a.call(o)}),this.update(n)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(n=>{var o;return(o=n.hostUpdated)===null||o===void 0?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};de[ot]=!0,de.elementProperties=new Map,de.elementStyles=[],de.shadowRootOptions={mode:"open"},Mt==null||Mt({ReactiveElement:de}),((tt=je.reactiveElementVersions)!==null&&tt!==void 0?tt:je.reactiveElementVersions=[]).push("1.6.2");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/var rt;const ze=window,ue=ze.trustedTypes,xt=ue?ue.createPolicy("lit-html",{createHTML:i=>i}):void 0,at="$lit$",Z=`lit$${(Math.random()+"").slice(9)}$`,Nt="?"+Z,wn=`<${Nt}>`,te=document,we=()=>te.createComment(""),Ce=i=>i===null||typeof i!="object"&&typeof i!="function",Lt=Array.isArray,Cn=i=>Lt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",st=`[
|
|
14
|
+
\f\r]`,Se=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,It=/-->/g,Pt=/>/g,ne=RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),jt=/'/g,zt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Sn=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Sn(1),he=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),Ht=new WeakMap,ie=te.createTreeWalker(te,129,null,!1),Dn=(i,e)=>{const t=i.length-1,n=[];let o,a=e===2?"<svg>":"",r=Se;for(let s=0;s<t;s++){const d=i[s];let c,h,f=-1,_=0;for(;_<d.length&&(r.lastIndex=_,h=r.exec(d),h!==null);)_=r.lastIndex,r===Se?h[1]==="!--"?r=It:h[1]!==void 0?r=Pt:h[2]!==void 0?(Ut.test(h[2])&&(o=RegExp("</"+h[2],"g")),r=ne):h[3]!==void 0&&(r=ne):r===ne?h[0]===">"?(r=o??Se,f=-1):h[1]===void 0?f=-2:(f=r.lastIndex-h[2].length,c=h[1],r=h[3]===void 0?ne:h[3]==='"'?zt:jt):r===zt||r===jt?r=ne:r===It||r===Pt?r=Se:(r=ne,o=void 0);const E=r===ne&&i[s+1].startsWith("/>")?" ":"";a+=r===Se?d+wn:f>=0?(n.push(c),d.slice(0,f)+at+d.slice(f)+Z+E):d+Z+(f===-2?(n.push(void 0),s):E)}const l=a+(i[t]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return[xt!==void 0?xt.createHTML(l):l,n]};class De{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let a=0,r=0;const l=e.length-1,s=this.parts,[d,c]=Dn(e,t);if(this.el=De.createElement(d,n),ie.currentNode=this.el.content,t===2){const h=this.el.content,f=h.firstChild;f.remove(),h.append(...f.childNodes)}for(;(o=ie.nextNode())!==null&&s.length<l;){if(o.nodeType===1){if(o.hasAttributes()){const h=[];for(const f of o.getAttributeNames())if(f.endsWith(at)||f.startsWith(Z)){const _=c[r++];if(h.push(f),_!==void 0){const E=o.getAttribute(_.toLowerCase()+at).split(Z),y=/([.?@])?(.*)/.exec(_);s.push({type:1,index:a,name:y[2],strings:E,ctor:y[1]==="."?An:y[1]==="?"?Mn:y[1]==="@"?On:Ue})}else s.push({type:6,index:a})}for(const f of h)o.removeAttribute(f)}if(Ut.test(o.tagName)){const h=o.textContent.split(Z),f=h.length-1;if(f>0){o.textContent=ue?ue.emptyScript:"";for(let _=0;_<f;_++)o.append(h[_],we()),ie.nextNode(),s.push({type:2,index:++a});o.append(h[f],we())}}}else if(o.nodeType===8)if(o.data===Nt)s.push({type:2,index:a});else{let h=-1;for(;(h=o.data.indexOf(Z,h+1))!==-1;)s.push({type:7,index:a}),h+=Z.length-1}a++}}static createElement(e,t){const n=te.createElement("template");return n.innerHTML=e,n}}function ce(i,e,t=i,n){var o,a,r,l;if(e===he)return e;let s=n!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[n]:t._$Cl;const d=Ce(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==d&&((a=s==null?void 0:s._$AO)===null||a===void 0||a.call(s,!1),d===void 0?s=void 0:(s=new d(i),s._$AT(i,t,n)),n!==void 0?((r=(l=t)._$Co)!==null&&r!==void 0?r:l._$Co=[])[n]=s:t._$Cl=s),s!==void 0&&(e=ce(i,s._$AS(i,e.values),s,n)),e}class $n{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:o}=this._$AD,a=((t=e==null?void 0:e.creationScope)!==null&&t!==void 0?t:te).importNode(n,!0);ie.currentNode=a;let r=ie.nextNode(),l=0,s=0,d=o[0];for(;d!==void 0;){if(l===d.index){let c;d.type===2?c=new $e(r,r.nextSibling,this,e):d.type===1?c=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(c=new xn(r,this,e)),this._$AV.push(c),d=o[++s]}l!==(d==null?void 0:d.index)&&(r=ie.nextNode(),l++)}return ie.currentNode=te,a}v(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class $e{constructor(e,t,n,o){var a;this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=o,this._$Cp=(a=o==null?void 0:o.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ce(this,e,t),Ce(e)?e===C||e==null||e===""?(this._$AH!==C&&this._$AR(),this._$AH=C):e!==this._$AH&&e!==he&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):Cn(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==C&&Ce(this._$AH)?this._$AA.nextSibling.data=e:this.$(te.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:o}=e,a=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=De.createElement(o.h,this.options)),o);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(n);else{const r=new $n(a,this),l=r.u(this.options);r.v(n),this.$(l),this._$AH=r}}_$AC(e){let t=Ht.get(e.strings);return t===void 0&&Ht.set(e.strings,t=new De(e)),t}T(e){Lt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,o=0;for(const a of e)o===t.length?t.push(n=new $e(this.k(we()),this.k(we()),this,this.options)):n=t[o],n._$AI(a),o++;o<t.length&&(this._$AR(n&&n._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){const o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}}class Ue{constructor(e,t,n,o,a){this.type=1,this._$AH=C,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,o){const a=this.strings;let r=!1;if(a===void 0)e=ce(this,e,t,0),r=!Ce(e)||e!==this._$AH&&e!==he,r&&(this._$AH=e);else{const l=e;let s,d;for(e=a[0],s=0;s<a.length-1;s++)d=ce(this,l[n+s],t,s),d===he&&(d=this._$AH[s]),r||(r=!Ce(d)||d!==this._$AH[s]),d===C?e=C:e!==C&&(e+=(d??"")+a[s+1]),this._$AH[s]=d}r&&!o&&this.j(e)}j(e){e===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class An extends Ue{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===C?void 0:e}}const Tn=ue?ue.emptyScript:"";class Mn extends Ue{constructor(){super(...arguments),this.type=4}j(e){e&&e!==C?this.element.setAttribute(this.name,Tn):this.element.removeAttribute(this.name)}}class On extends Ue{constructor(e,t,n,o,a){super(e,t,n,o,a),this.type=5}_$AI(e,t=this){var n;if((e=(n=ce(this,e,t,0))!==null&&n!==void 0?n:C)===he)return;const o=this._$AH,a=e===C&&o!==C||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,r=e!==C&&(o===C||a);a&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}}class xn{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ce(this,e)}}const kt=ze.litHtmlPolyfillSupport;kt==null||kt(De,$e),((rt=ze.litHtmlVersions)!==null&&rt!==void 0?rt:ze.litHtmlVersions=[]).push("2.7.4");const Nn=(i,e,t)=>{var n,o;const a=(n=t==null?void 0:t.renderBefore)!==null&&n!==void 0?n:e;let r=a._$litPart$;if(r===void 0){const l=(o=t==null?void 0:t.renderBefore)!==null&&o!==void 0?o:null;a._$litPart$=r=new $e(e.insertBefore(we(),l),l,void 0,t??{})}return r._$AI(i),r};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/var lt,dt;class fe extends de{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Nn(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return he}}fe.finalized=!0,fe._$litElement$=!0,(lt=globalThis.litElementHydrateSupport)===null||lt===void 0||lt.call(globalThis,{LitElement:fe});const Rt=globalThis.litElementPolyfillSupport;Rt==null||Rt({LitElement:fe}),((dt=globalThis.litElementVersions)!==null&&dt!==void 0?dt:globalThis.litElementVersions=[]).push("3.3.2");/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/const Bt=i=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(i,e):((t,n)=>{const{kind:o,elements:a}=n;return{kind:o,elements:a,finisher(r){customElements.define(t,r)}}})(i,e);/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/const Ln=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},In=(i,e,t)=>{e.constructor.createProperty(t,i)};function H(i){return(e,t)=>t!==void 0?In(i,e,t):Ln(i,e)}/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/function pe(i){return H({...i,state:!0})}/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2021 Google LLC
|
|
34
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
+
*/var ut;((ut=window.HTMLSlotElement)===null||ut===void 0?void 0:ut.prototype.assignedElements)!=null;/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2021 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*/function*ht(i,e){if(i!==void 0){let t=0;for(const n of i)yield e(n,t++)}}/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2021 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/function ct(i,e,t){return i?e():t==null?void 0:t()}/**!
|
|
44
|
+
* Sortable 1.15.0
|
|
45
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
46
|
+
* @author owenm <owen23355@gmail.com>
|
|
47
|
+
* @license MIT
|
|
48
|
+
*/function Yt(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Y(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yt(Object(t),!0).forEach(function(n){Pn(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Yt(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function He(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?He=function(e){return typeof e}:He=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(i)}function Pn(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Q(){return Q=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Q.apply(this,arguments)}function jn(i,e){if(i==null)return{};var t={},n=Object.keys(i),o,a;for(a=0;a<n.length;a++)o=n[a],!(e.indexOf(o)>=0)&&(t[o]=i[o]);return t}function zn(i,e){if(i==null)return{};var t=jn(i,e),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);for(o=0;o<a.length;o++)n=a[o],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var Un="1.15.0";function V(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var q=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ke=V(/Edge/i),Wt=V(/firefox/i),Re=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),Ft=V(/iP(ad|od|hone)/i),Vt=V(/chrome/i)&&V(/android/i),Xt={capture:!1,passive:!1};function w(i,e,t){i.addEventListener(e,t,!q&&Xt)}function b(i,e,t){i.removeEventListener(e,t,!q&&Xt)}function Be(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function Hn(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function W(i,e,t,n){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&Be(i,e):Be(i,e))||n&&i===t)return i;if(i===t)break}while(i=Hn(i))}return null}var Gt=/\s+/g;function j(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var n=(" "+i.className+" ").replace(Gt," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(Gt," ")}}function p(i,e,t){var n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function ge(i,e){var t="";if(typeof i=="string")t=i;else do{var n=p(i,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(i=i.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(t)}function Zt(i,e,t){if(i){var n=i.getElementsByTagName(e),o=0,a=n.length;if(t)for(;o<a;o++)t(n[o],o);return n}return[]}function J(){var i=document.scrollingElement;return i||document.documentElement}function M(i,e,t,n,o){if(!(!i.getBoundingClientRect&&i!==window)){var a,r,l,s,d,c,h;if(i!==window&&i.parentNode&&i!==J()?(a=i.getBoundingClientRect(),r=a.top,l=a.left,s=a.bottom,d=a.right,c=a.height,h=a.width):(r=0,l=0,s=window.innerHeight,d=window.innerWidth,c=window.innerHeight,h=window.innerWidth),(e||t)&&i!==window&&(o=o||i.parentNode,!q))do if(o&&o.getBoundingClientRect&&(p(o,"transform")!=="none"||t&&p(o,"position")!=="static")){var f=o.getBoundingClientRect();r-=f.top+parseInt(p(o,"border-top-width")),l-=f.left+parseInt(p(o,"border-left-width")),s=r+a.height,d=l+a.width;break}while(o=o.parentNode);if(n&&i!==window){var _=ge(o||i),E=_&&_.a,y=_&&_.d;_&&(r/=y,l/=E,h/=E,c/=y,s=r+c,d=l+h)}return{top:r,left:l,bottom:s,right:d,width:h,height:c}}}function Qt(i,e,t){for(var n=Jt(i,!0),o=M(i)[e];n;){var a=M(n)[t],r=void 0;if(t==="top"||t==="left"?r=o>=a:r=o<=a,!r)return n;if(n===J())break;n=Jt(n,!1)}return!1}function me(i,e,t,n){for(var o=0,a=0,r=i.children;a<r.length;){if(r[a].style.display!=="none"&&r[a]!==g.ghost&&(n||r[a]!==g.dragged)&&W(r[a],t.draggable,i,!1)){if(o===e)return r[a];o++}a++}return null}function ft(i,e){for(var t=i.lastElementChild;t&&(t===g.ghost||p(t,"display")==="none"||e&&!Be(t,e));)t=t.previousElementSibling;return t||null}function k(i,e){var t=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==g.clone&&(!e||Be(i,e))&&t++;return t}function qt(i){var e=0,t=0,n=J();if(i)do{var o=ge(i),a=o.a,r=o.d;e+=i.scrollLeft*a,t+=i.scrollTop*r}while(i!==n&&(i=i.parentNode));return[e,t]}function kn(i,e){for(var t in i)if(i.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===i[t][n])return Number(t)}return-1}function Jt(i,e){if(!i||!i.getBoundingClientRect)return J();var t=i,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var o=p(t);if(t.clientWidth<t.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return J();if(n||e)return t;n=!0}}while(t=t.parentNode);return J()}function Rn(i,e){if(i&&e)for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function pt(i,e){return Math.round(i.top)===Math.round(e.top)&&Math.round(i.left)===Math.round(e.left)&&Math.round(i.height)===Math.round(e.height)&&Math.round(i.width)===Math.round(e.width)}var gt;function Bn(i,e){return function(){if(!gt){var t=arguments,n=this;t.length===1?i.call(n,t[0]):i.apply(n,t),gt=setTimeout(function(){gt=void 0},e)}}}function Yn(i,e,t){i.scrollLeft+=e,i.scrollTop+=t}function Kt(i){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(i).cloneNode(!0):t?t(i).clone(!0)[0]:i.cloneNode(!0)}var R="Sortable"+new Date().getTime();function Wn(){var i=[],e;return{captureAnimationState:function(){if(i=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(o){if(!(p(o,"display")==="none"||o===g.ghost)){i.push({target:o,rect:M(o)});var a=Y({},i[i.length-1].rect);if(o.thisAnimationDuration){var r=ge(o,!0);r&&(a.top-=r.f,a.left-=r.e)}o.fromRect=a}})}},addAnimationState:function(n){i.push(n)},removeAnimationState:function(n){i.splice(kn(i,{target:n}),1)},animateAll:function(n){var o=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var a=!1,r=0;i.forEach(function(l){var s=0,d=l.target,c=d.fromRect,h=M(d),f=d.prevFromRect,_=d.prevToRect,E=l.rect,y=ge(d,!0);y&&(h.top-=y.f,h.left-=y.e),d.toRect=h,d.thisAnimationDuration&&pt(f,h)&&!pt(c,h)&&(E.top-h.top)/(E.left-h.left)===(c.top-h.top)/(c.left-h.left)&&(s=Vn(E,f,_,o.options)),pt(h,c)||(d.prevFromRect=c,d.prevToRect=h,s||(s=o.options.animation),o.animate(d,E,h,s)),s&&(a=!0,r=Math.max(r,s),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},s),d.thisAnimationDuration=s)}),clearTimeout(e),a?e=setTimeout(function(){typeof n=="function"&&n()},r):typeof n=="function"&&n(),i=[]},animate:function(n,o,a,r){if(r){p(n,"transition",""),p(n,"transform","");var l=ge(this.el),s=l&&l.a,d=l&&l.d,c=(o.left-a.left)/(s||1),h=(o.top-a.top)/(d||1);n.animatingX=!!c,n.animatingY=!!h,p(n,"transform","translate3d("+c+"px,"+h+"px,0)"),this.forRepaintDummy=Fn(n),p(n,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),p(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){p(n,"transition",""),p(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},r)}}}}function Fn(i){return i.offsetWidth}function Vn(i,e,t,n){return Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var ve=[],mt={initializeByDefault:!0},Ae={mount:function(e){for(var t in mt)mt.hasOwnProperty(t)&&!(t in e)&&(e[t]=mt[t]);ve.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ve.push(e)},pluginEvent:function(e,t,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var a=e+"Global";ve.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][a]&&t[r.pluginName][a](Y({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](Y({sortable:t},n)))})},initializePlugins:function(e,t,n,o){ve.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var d=new l(e,t,e.options);d.sortable=e,d.options=e.options,e[s]=d,Q(n,d.defaults)}});for(var a in e.options)if(e.options.hasOwnProperty(a)){var r=this.modifyOption(e,a,e.options[a]);typeof r<"u"&&(e.options[a]=r)}},getEventProperties:function(e,t){var n={};return ve.forEach(function(o){typeof o.eventProperties=="function"&&Q(n,o.eventProperties.call(t[o.pluginName],e))}),n},modifyOption:function(e,t,n){var o;return ve.forEach(function(a){e[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[t]=="function"&&(o=a.optionListeners[t].call(e[a.pluginName],n))}),o}};function Xn(i){var e=i.sortable,t=i.rootEl,n=i.name,o=i.targetEl,a=i.cloneEl,r=i.toEl,l=i.fromEl,s=i.oldIndex,d=i.newIndex,c=i.oldDraggableIndex,h=i.newDraggableIndex,f=i.originalEvent,_=i.putSortable,E=i.extraEventProperties;if(e=e||t&&t[R],!!e){var y,X=e.options,se="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!q&&!ke?y=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(n,!0,!0)),y.to=r||t,y.from=l||t,y.item=o||t,y.clone=a,y.oldIndex=s,y.newIndex=d,y.oldDraggableIndex=c,y.newDraggableIndex=h,y.originalEvent=f,y.pullMode=_?_.lastPutMode:void 0;var U=Y(Y({},E),Ae.getEventProperties(n,e));for(var le in U)y[le]=U[le];t&&t.dispatchEvent(y),X[se]&&X[se].call(e,y)}}var Gn=["evt"],P=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=n.evt,a=zn(n,Gn);Ae.pluginEvent.bind(g)(e,t,Y({dragEl:u,parentEl:$,ghostEl:m,rootEl:S,nextEl:oe,lastDownEl:Ye,cloneEl:D,cloneHidden:K,dragStarted:Me,putSortable:O,activeSortable:g.active,originalEvent:o,oldIndex:ye,oldDraggableIndex:Te,newIndex:z,newDraggableIndex:ee,hideGhostForTarget:sn,unhideGhostForTarget:ln,cloneNowHidden:function(){K=!0},cloneNowShown:function(){K=!1},dispatchSortableEvent:function(l){I({sortable:t,name:l,originalEvent:o})}},a))};function I(i){Xn(Y({putSortable:O,cloneEl:D,targetEl:u,rootEl:S,oldIndex:ye,oldDraggableIndex:Te,newIndex:z,newDraggableIndex:ee},i))}var u,$,m,S,oe,Ye,D,K,ye,z,Te,ee,We,O,Ee=!1,Fe=!1,Ve=[],re,B,vt,yt,en,tn,Me,_e,Oe,xe=!1,Xe=!1,Ge,N,Et=[],_t=!1,Ze=[],Qe=typeof document<"u",qe=Ft,nn=ke||q?"cssFloat":"float",Zn=Qe&&!Vt&&!Ft&&"draggable"in document.createElement("div"),on=function(){if(Qe){if(q)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),rn=function(e,t){var n=p(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=me(e,0,t),r=me(e,1,t),l=a&&p(a),s=r&&p(r),d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+M(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+M(r).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&l.float&&l.float!=="none"){var h=l.float==="left"?"left":"right";return r&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||d>=o&&n[nn]==="none"||r&&n[nn]==="none"&&d+c>o)?"vertical":"horizontal"},Qn=function(e,t,n){var o=n?e.left:e.top,a=n?e.right:e.bottom,r=n?e.width:e.height,l=n?t.left:t.top,s=n?t.right:t.bottom,d=n?t.width:t.height;return o===l||a===s||o+r/2===l+d/2},qn=function(e,t){var n;return Ve.some(function(o){var a=o[R].options.emptyInsertThreshold;if(!(!a||ft(o))){var r=M(o),l=e>=r.left-a&&e<=r.right+a,s=t>=r.top-a&&t<=r.bottom+a;if(l&&s)return n=o}}),n},an=function(e){function t(a,r){return function(l,s,d,c){var h=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(a==null&&(r||h))return!0;if(a==null||a===!1)return!1;if(r&&a==="clone")return a;if(typeof a=="function")return t(a(l,s,d,c),r)(l,s,d,c);var f=(r?l:s).options.group.name;return a===!0||typeof a=="string"&&a===f||a.join&&a.indexOf(f)>-1}}var n={},o=e.group;(!o||He(o)!="object")&&(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},sn=function(){!on&&m&&p(m,"display","none")},ln=function(){!on&&m&&p(m,"display","")};Qe&&!Vt&&document.addEventListener("click",function(i){if(Fe)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Fe=!1,!1},!0);var ae=function(e){if(u){e=e.touches?e.touches[0]:e;var t=qn(e.clientX,e.clientY);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[R]._onDragOver(n)}}},Jn=function(e){u&&u.parentNode[R]._isOutsideThisEl(e.target)};function g(i,e){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=e=Q({},e),i[R]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return rn(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,l){r.setData("Text",l.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:g.supportPointer!==!1&&"PointerEvent"in window&&!Re,emptyInsertThreshold:5};Ae.initializePlugins(this,i,t);for(var n in t)!(n in e)&&(e[n]=t[n]);an(e);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=e.forceFallback?!1:Zn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?w(i,"pointerdown",this._onTapStart):(w(i,"mousedown",this._onTapStart),w(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(i,"dragover",this),w(i,"dragenter",this)),Ve.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Q(this,Wn())}g.prototype={constructor:g,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(_e=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,u):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,o=this.options,a=o.preventOnFilter,r=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,d=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=o.filter;if(ai(n),!u&&!(/mousedown|pointerdown/.test(r)&&e.button!==0||o.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Re&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=W(s,o.draggable,n,!1),!(s&&s.animated)&&Ye!==s)){if(ye=k(s),Te=k(s,o.draggable),typeof c=="function"){if(c.call(this,e,s,this)){I({sortable:t,rootEl:d,name:"filter",targetEl:s,toEl:n,fromEl:n}),P("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=W(d,h.trim(),n,!1),h)return I({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),P("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}o.handle&&!W(d,o.handle,n,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,t,n){var o=this,a=o.el,r=o.options,l=a.ownerDocument,s;if(n&&!u&&n.parentNode===a){var d=M(n);if(S=a,u=n,$=u.parentNode,oe=u.nextSibling,Ye=n,We=r.group,g.dragged=u,re={target:u,clientX:(t||e).clientX,clientY:(t||e).clientY},en=re.clientX-d.left,tn=re.clientY-d.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,u.style["will-change"]="all",s=function(){if(P("delayEnded",o,{evt:e}),g.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Wt&&o.nativeDraggable&&(u.draggable=!0),o._triggerDragStart(e,t),I({sortable:o,name:"choose",originalEvent:e}),j(u,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){Zt(u,c.trim(),bt)}),w(l,"dragover",ae),w(l,"mousemove",ae),w(l,"touchmove",ae),w(l,"mouseup",o._onDrop),w(l,"touchend",o._onDrop),w(l,"touchcancel",o._onDrop),Wt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,u.draggable=!0),P("delayStart",this,{evt:e}),r.delay&&(!r.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(ke||q))){if(g.eventCanceled){this._onDrop();return}w(l,"mouseup",o._disableDelayedDrag),w(l,"touchend",o._disableDelayedDrag),w(l,"touchcancel",o._disableDelayedDrag),w(l,"mousemove",o._delayedDragTouchMoveHandler),w(l,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&w(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,r.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;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(){u&&bt(u),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):t?w(document,"touchmove",this._onTouchMove):w(document,"mousemove",this._onTouchMove):(w(u,"dragend",this),w(S,"dragstart",this._onDragStart));try{document.selection?Ke(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Ee=!1,S&&u){P("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",Jn);var n=this.options;!e&&j(u,n.dragClass,!1),j(u,n.ghostClass,!0),g.active=this,e&&this._appendGhost(),I({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(B){this._lastX=B.clientX,this._lastY=B.clientY,sn();for(var e=document.elementFromPoint(B.clientX,B.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(B.clientX,B.clientY),e!==t);)t=e;if(u.parentNode[R]._isOutsideThisEl(e),t)do{if(t[R]){var n=void 0;if(n=t[R]._onDragOver({clientX:B.clientX,clientY:B.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ln()}},_onTouchMove:function(e){if(re){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,a=e.touches?e.touches[0]:e,r=m&&ge(m,!0),l=m&&r&&r.a,s=m&&r&&r.d,d=qe&&N&&qt(N),c=(a.clientX-re.clientX+o.x)/(l||1)+(d?d[0]-Et[0]:0)/(l||1),h=(a.clientY-re.clientY+o.y)/(s||1)+(d?d[1]-Et[1]:0)/(s||1);if(!g.active&&!Ee){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(m){r?(r.e+=c-(vt||0),r.f+=h-(yt||0)):r={a:1,b:0,c:0,d:1,e:c,f:h};var f="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");p(m,"webkitTransform",f),p(m,"mozTransform",f),p(m,"msTransform",f),p(m,"transform",f),vt=c,yt=h,B=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!m){var e=this.options.fallbackOnBody?document.body:S,t=M(u,!0,qe,!0,e),n=this.options;if(qe){for(N=e;p(N,"position")==="static"&&p(N,"transform")==="none"&&N!==document;)N=N.parentNode;N!==document.body&&N!==document.documentElement?(N===document&&(N=J()),t.top+=N.scrollTop,t.left+=N.scrollLeft):N=J(),Et=qt(N)}m=u.cloneNode(!0),j(m,n.ghostClass,!1),j(m,n.fallbackClass,!0),j(m,n.dragClass,!0),p(m,"transition",""),p(m,"transform",""),p(m,"box-sizing","border-box"),p(m,"margin",0),p(m,"top",t.top),p(m,"left",t.left),p(m,"width",t.width),p(m,"height",t.height),p(m,"opacity","0.8"),p(m,"position",qe?"absolute":"fixed"),p(m,"zIndex","100000"),p(m,"pointerEvents","none"),g.ghost=m,e.appendChild(m),p(m,"transform-origin",en/parseInt(m.style.width)*100+"% "+tn/parseInt(m.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,o=e.dataTransfer,a=n.options;if(P("dragStart",this,{evt:e}),g.eventCanceled){this._onDrop();return}P("setupClone",this),g.eventCanceled||(D=Kt(u),D.removeAttribute("id"),D.draggable=!1,D.style["will-change"]="",this._hideClone(),j(D,this.options.chosenClass,!1),g.clone=D),n.cloneId=Ke(function(){P("clone",n),!g.eventCanceled&&(n.options.removeCloneOnHide||S.insertBefore(D,u),n._hideClone(),I({sortable:n,name:"clone"}))}),!t&&j(u,a.dragClass,!0),t?(Fe=!0,n._loopId=setInterval(n._emulateDragOver,50)):(b(document,"mouseup",n._onDrop),b(document,"touchend",n._onDrop),b(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",a.setData&&a.setData.call(n,o,u)),w(document,"drop",n),p(u,"transform","translateZ(0)")),Ee=!0,n._dragStartId=Ke(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),Me=!0,Re&&p(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,o,a,r,l=this.options,s=l.group,d=g.active,c=We===s,h=l.sort,f=O||d,_,E=this,y=!1;if(_t)return;function X(Pe,pi){P(Pe,E,Y({evt:e,isOwner:c,axis:_?"vertical":"horizontal",revert:r,dragRect:o,targetRect:a,canSort:h,fromSortable:f,target:n,completed:U,onMove:function(vn,gi){return Je(S,t,u,o,vn,M(vn),e,gi)},changed:le},pi))}function se(){X("dragOverAnimationCapture"),E.captureAnimationState(),E!==f&&f.captureAnimationState()}function U(Pe){return X("dragOverCompleted",{insertion:Pe}),Pe&&(c?d._hideClone():d._showClone(E),E!==f&&(j(u,O?O.options.ghostClass:d.options.ghostClass,!1),j(u,l.ghostClass,!0)),O!==E&&E!==g.active?O=E:E===g.active&&O&&(O=null),f===E&&(E._ignoreWhileAnimating=n),E.animateAll(function(){X("dragOverAnimationComplete"),E._ignoreWhileAnimating=null}),E!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(n===u&&!u.animated||n===t&&!n.animated)&&(_e=null),!l.dragoverBubble&&!e.rootEl&&n!==document&&(u.parentNode[R]._isOutsideThisEl(e.target),!Pe&&ae(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),y=!0}function le(){z=k(u),ee=k(u,l.draggable),I({sortable:E,name:"change",toEl:t,newIndex:z,newDraggableIndex:ee,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=W(n,l.draggable,t,!0),X("dragOver"),g.eventCanceled)return y;if(u.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||E._ignoreWhileAnimating===n)return U(!1);if(Fe=!1,d&&!l.disabled&&(c?h||(r=$!==S):O===this||(this.lastPutMode=We.checkPull(this,d,u,e))&&s.checkPut(this,d,u,e))){if(_=this._getDirection(e,n)==="vertical",o=M(u),X("dragOverValid"),g.eventCanceled)return y;if(r)return $=S,se(),this._hideClone(),X("revert"),g.eventCanceled||(oe?S.insertBefore(u,oe):S.appendChild(u)),U(!0);var G=ft(t,l.draggable);if(!G||ni(e,_,this)&&!G.animated){if(G===u)return U(!1);if(G&&t===e.target&&(n=G),n&&(a=M(n)),Je(S,t,u,o,n,a,e,!!n)!==!1)return se(),G&&G.nextSibling?t.insertBefore(u,G.nextSibling):t.appendChild(u),$=t,le(),U(!0)}else if(G&&ti(e,_,this)){var Ct=me(t,0,l,!0);if(Ct===u)return U(!1);if(n=Ct,a=M(n),Je(S,t,u,o,n,a,e,!1)!==!1)return se(),t.insertBefore(u,Ct),$=t,le(),U(!0)}else if(n.parentNode===t){a=M(n);var be=0,St,ci=u.parentNode!==t,fn=!Qn(u.animated&&u.toRect||o,n.animated&&n.toRect||a,_),pn=_?"top":"left",Ne=Qt(n,"top","top")||Qt(u,"top","top"),fi=Ne?Ne.scrollTop:void 0;_e!==n&&(St=a[pn],xe=!1,Xe=!fn&&l.invertSwap||ci),be=ii(e,n,a,_,fn?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Xe,_e===n);var Le;if(be!==0){var gn=k(u);do gn-=be,Le=$.children[gn];while(Le&&(p(Le,"display")==="none"||Le===m))}if(be===0||Le===n)return U(!1);_e=n,Oe=be;var mn=n.nextElementSibling,Ie=!1;Ie=be===1;var et=Je(S,t,u,o,n,a,e,Ie);if(et!==!1)return(et===1||et===-1)&&(Ie=et===1),_t=!0,setTimeout(ei,30),se(),Ie&&!mn?t.appendChild(u):n.parentNode.insertBefore(u,Ie?mn:n),Ne&&Yn(Ne,0,fi-Ne.scrollTop),$=u.parentNode,St!==void 0&&!Xe&&(Ge=Math.abs(St-M(n)[pn])),le(),U(!0)}if(t.contains(u))return U(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",ae),b(document,"mousemove",ae),b(document,"touchmove",ae)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(z=k(u),ee=k(u,n.draggable),P("drop",this,{evt:e}),$=u&&u.parentNode,z=k(u),ee=k(u,n.draggable),g.eventCanceled){this._nulling();return}Ee=!1,Xe=!1,xe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wt(this.cloneId),wt(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Re&&p(document.body,"user-select",""),p(u,"transform",""),e&&(Me&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),m&&m.parentNode&&m.parentNode.removeChild(m),(S===$||O&&O.lastPutMode!=="clone")&&D&&D.parentNode&&D.parentNode.removeChild(D),u&&(this.nativeDraggable&&b(u,"dragend",this),bt(u),u.style["will-change"]="",Me&&!Ee&&j(u,O?O.options.ghostClass:this.options.ghostClass,!1),j(u,this.options.chosenClass,!1),I({sortable:this,name:"unchoose",toEl:$,newIndex:null,newDraggableIndex:null,originalEvent:e}),S!==$?(z>=0&&(I({rootEl:$,name:"add",toEl:$,fromEl:S,originalEvent:e}),I({sortable:this,name:"remove",toEl:$,originalEvent:e}),I({rootEl:$,name:"sort",toEl:$,fromEl:S,originalEvent:e}),I({sortable:this,name:"sort",toEl:$,originalEvent:e})),O&&O.save()):z!==ye&&z>=0&&(I({sortable:this,name:"update",toEl:$,originalEvent:e}),I({sortable:this,name:"sort",toEl:$,originalEvent:e})),g.active&&((z==null||z===-1)&&(z=ye,ee=Te),I({sortable:this,name:"end",toEl:$,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){P("nulling",this),S=u=$=m=oe=D=Ye=K=re=B=Me=z=ee=ye=Te=_e=Oe=O=We=g.dragged=g.ghost=g.clone=g.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=vt=yt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":u&&(this._onDragOver(e),Kn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,o=0,a=n.length,r=this.options;o<a;o++)t=n[o],W(t,r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||ri(t));return e},sort:function(e,t){var n={},o=this.el;this.toArray().forEach(function(a,r){var l=o.children[r];W(l,this.options.draggable,o,!1)&&(n[a]=l)},this),t&&this.captureAnimationState(),e.forEach(function(a){n[a]&&(o.removeChild(n[a]),o.appendChild(n[a]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return W(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var o=Ae.modifyOption(this,e,t);typeof o<"u"?n[e]=o:n[e]=t,e==="group"&&an(n)},destroy:function(){P("destroy",this);var e=this.el;e[R]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ve.splice(Ve.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!K){if(P("hideClone",this),g.eventCanceled)return;p(D,"display","none"),this.options.removeCloneOnHide&&D.parentNode&&D.parentNode.removeChild(D),K=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(K){if(P("showClone",this),g.eventCanceled)return;u.parentNode==S&&!this.options.group.revertClone?S.insertBefore(D,u):oe?S.insertBefore(D,oe):S.appendChild(D),this.options.group.revertClone&&this.animate(u,D),p(D,"display",""),K=!1}}};function Kn(i){i.dataTransfer&&(i.dataTransfer.dropEffect="move"),i.cancelable&&i.preventDefault()}function Je(i,e,t,n,o,a,r,l){var s,d=i[R],c=d.options.onMove,h;return window.CustomEvent&&!q&&!ke?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=i,s.dragged=t,s.draggedRect=n,s.related=o||e,s.relatedRect=a||M(e),s.willInsertAfter=l,s.originalEvent=r,i.dispatchEvent(s),c&&(h=c.call(d,s,r)),h}function bt(i){i.draggable=!1}function ei(){_t=!1}function ti(i,e,t){var n=M(me(t.el,0,t.options,!0)),o=10;return e?i.clientX<n.left-o||i.clientY<n.top&&i.clientX<n.right:i.clientY<n.top-o||i.clientY<n.bottom&&i.clientX<n.left}function ni(i,e,t){var n=M(ft(t.el,t.options.draggable)),o=10;return e?i.clientX>n.right+o||i.clientX<=n.right&&i.clientY>n.bottom&&i.clientX>=n.left:i.clientX>n.right&&i.clientY>n.top||i.clientX<=n.right&&i.clientY>n.bottom+o}function ii(i,e,t,n,o,a,r,l){var s=n?i.clientY:i.clientX,d=n?t.height:t.width,c=n?t.top:t.left,h=n?t.bottom:t.right,f=!1;if(!r){if(l&&Ge<d*o){if(!xe&&(Oe===1?s>c+d*a/2:s<h-d*a/2)&&(xe=!0),xe)f=!0;else if(Oe===1?s<c+Ge:s>h-Ge)return-Oe}else if(s>c+d*(1-o)/2&&s<h-d*(1-o)/2)return oi(e)}return f=f||r,f&&(s<c+d*a/2||s>h-d*a/2)?s>c+d/2?1:-1:0}function oi(i){return k(u)<k(i)?1:-1}function ri(i){for(var e=i.tagName+i.className+i.src+i.href+i.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function ai(i){Ze.length=0;for(var e=i.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Ze.push(n)}}function Ke(i){return setTimeout(i,0)}function wt(i){return clearTimeout(i)}Qe&&w(document,"touchmove",function(i){(g.active||Ee)&&i.cancelable&&i.preventDefault()}),g.utils={on:w,off:b,css:p,find:Zt,is:function(e,t){return!!W(e,t,e,!1)},extend:Rn,throttle:Bn,closest:W,toggleClass:j,clone:Kt,index:k,nextTick:Ke,cancelNextTick:wt,detectDirection:rn,getChild:me},g.get=function(i){return i[R]},g.mount=function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(g.utils=Y(Y({},g.utils),n.utils)),Ae.mount(n)})},g.create=function(i,e){return new g(i,e)},g.version=Un;var dn=function(e){var t=e.originalEvent,n=e.putSortable,o=e.dragEl,a=e.activeSortable,r=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var d=n||a;l();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,h=document.elementFromPoint(c.clientX,c.clientY);s(),d&&!d.el.contains(h)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function un(){}un.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=me(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:dn},Q(un,{pluginName:"revertOnSpill"});function hn(){}hn.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,o=n||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:dn},Q(hn,{pluginName:"removeOnSpill"});const cn=`
|
|
49
|
+
:host {
|
|
50
|
+
display: block;
|
|
51
|
+
}
|
|
52
|
+
ul {
|
|
53
|
+
padding: 0;
|
|
54
|
+
}
|
|
55
|
+
li {
|
|
56
|
+
list-style: none;
|
|
57
|
+
}
|
|
58
|
+
li > .layer {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
}
|
|
62
|
+
li > .layer > label {
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
li label > img {
|
|
68
|
+
margin-right: 4px;
|
|
69
|
+
}
|
|
70
|
+
.dragHandle {
|
|
71
|
+
cursor: ns-resize;
|
|
72
|
+
}
|
|
73
|
+
`,si="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHRpdGxlPmV5ZTwvdGl0bGU+PHBhdGggZmlsbD0iIzAwNDE3MCIgZD0iTTEyLDlBMywzIDAgMCwwIDksMTJBMywzIDAgMCwwIDEyLDE1QTMsMyAwIDAsMCAxNSwxMkEzLDMgMCAwLDAgMTIsOU0xMiwxN0E1LDUgMCAwLDEgNywxMkE1LDUgMCAwLDEgMTIsN0E1LDUgMCAwLDEgMTcsMTJBNSw1IDAgMCwxIDEyLDE3TTEyLDQuNUM3LDQuNSAyLjczLDcuNjEgMSwxMkMyLjczLDE2LjM5IDcsMTkuNSAxMiwxOS41QzE3LDE5LjUgMjEuMjcsMTYuMzkgMjMsMTJDMjEuMjcsNy42MSAxNyw0LjUgMTIsNC41WiIgLz48L3N2Zz4=",li="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHRpdGxlPmV5ZS1vZmYtb3V0bGluZTwvdGl0bGU+PHBhdGggZmlsbD0iIzAwNDE3MCIgZD0iTTIsNS4yN0wzLjI4LDRMMjAsMjAuNzJMMTguNzMsMjJMMTUuNjUsMTguOTJDMTQuNSwxOS4zIDEzLjI4LDE5LjUgMTIsMTkuNUM3LDE5LjUgMi43MywxNi4zOSAxLDEyQzEuNjksMTAuMjQgMi43OSw4LjY5IDQuMTksNy40NkwyLDUuMjdNMTIsOUEzLDMgMCAwLDEgMTUsMTJDMTUsMTIuMzUgMTQuOTQsMTIuNjkgMTQuODMsMTNMMTEsOS4xN0MxMS4zMSw5LjA2IDExLjY1LDkgMTIsOU0xMiw0LjVDMTcsNC41IDIxLjI3LDcuNjEgMjMsMTJDMjIuMTgsMTQuMDggMjAuNzksMTUuODggMTksMTcuMTlMMTcuNTgsMTUuNzZDMTguOTQsMTQuODIgMjAuMDYsMTMuNTQgMjAuODIsMTJDMTkuMTcsOC42NCAxNS43Niw2LjUgMTIsNi41QzEwLjkxLDYuNSA5Ljg0LDYuNjggOC44NCw3TDcuMyw1LjQ3QzguNzQsNC44NSAxMC4zMyw0LjUgMTIsNC41TTMuMTgsMTJDNC44MywxNS4zNiA4LjI0LDE3LjUgMTIsMTcuNUMxMi42OSwxNy41IDEzLjM3LDE3LjQzIDE0LDE3LjI5TDExLjcyLDE1QzEwLjI5LDE0Ljg1IDkuMTUsMTMuNzEgOSwxMi4yOEw1LjYsOC44N0M0LjYxLDkuNzIgMy43OCwxMC43OCAzLjE4LDEyWiIgLz48L3N2Zz4=",di="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHRpdGxlPmRyYWc8L3RpdGxlPjxwYXRoIGZpbGw9IiMwMDQxNzBhYSIgZD0iTTcsMTlWMTdIOVYxOUg3TTExLDE5VjE3SDEzVjE5SDExTTE1LDE5VjE3SDE3VjE5SDE1TTcsMTVWMTNIOVYxNUg3TTExLDE1VjEzSDEzVjE1SDExTTE1LDE1VjEzSDE3VjE1SDE1TTcsMTFWOUg5VjExSDdNMTEsMTFWOUgxM1YxMUgxMU0xNSwxMVY5SDE3VjExSDE1TTcsN1Y1SDlWN0g3TTExLDdWNUgxM1Y3SDExTTE1LDdWNUgxN1Y3SDE1WiIgLz48L3N2Zz4=";var ui=Object.defineProperty,hi=Object.getOwnPropertyDescriptor,T=(i,e,t,n)=>{for(var o=n>1?void 0:n?hi(e,t):e,a=i.length-1,r;a>=0;a--)(r=i[a])&&(o=(n?r(e,t,o):r(o))||o);return n&&o&&ui(e,t,o),o};v.EOxLayerControl=class extends fe{constructor(){super(...arguments);A(this,"_currentlySorting");A(this,"olMap");A(this,"layerCollection");A(this,"layerArray");A(this,"optionalLayerArray");A(this,"for");A(this,"layerIdentifier","ol_uid");A(this,"layerTitle","title");A(this,"sortBy","layerOrder");A(this,"layerConfig",["opacity"]);A(this,"externalLayerConfig");A(this,"hideConfigs",!1)}_updateControl(t){this.layerCollection=t;const n=[...t.getArray()].filter(r=>r.get("layerControlHide")!==!0&&r.get("layerControlOptional")!==!0),o=[...t.getArray()].filter(r=>r.get("layerControlOptional")===!0);this.getAttribute("sortBy")==="zIndex"?n.sort((r,l)=>r.get("zIndex")?r.get("zIndex")<l.get("zIndex")?1:-1:1):n.reverse(),this.layerArray=n,this.optionalLayerArray=o,this.requestUpdate()}_emitLayerconfig(t){const n={detail:{layer:t},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("layerconfig",n))}changeOpacity(t,n){t.setOpacity(n)}changeStyleProperty(t,n,o){t.updateStyleVariables({...t.style_,[n]:o})}resetLayerConfig(){this.hideConfigs=!0,setTimeout(()=>{this.hideConfigs=!1,this.requestUpdate()},0)}render(){var a;const t=document.querySelector(this.for),o=(t.map||t).getLayers();return this._updateControl(o),o.on("change:length",()=>{this._currentlySorting||this._updateControl(o)}),L`
|
|
74
|
+
<style>
|
|
75
|
+
${cn}
|
|
76
|
+
</style>
|
|
77
|
+
<div>
|
|
78
|
+
<slot></slot>
|
|
79
|
+
<ul>
|
|
80
|
+
${ht(this.layerArray,r=>L`
|
|
81
|
+
<li
|
|
82
|
+
layerid="${r.get(this.layerIdentifier)}"
|
|
83
|
+
>
|
|
84
|
+
<div class="layer">
|
|
85
|
+
<label>
|
|
86
|
+
${ct(r.getVisible(),()=>L`<img
|
|
87
|
+
src="${si}"
|
|
88
|
+
width="24"
|
|
89
|
+
height="24"
|
|
90
|
+
/>`,()=>L`<img
|
|
91
|
+
src="${li}"
|
|
92
|
+
width="24"
|
|
93
|
+
height="24"
|
|
94
|
+
/>`)}
|
|
95
|
+
<input
|
|
96
|
+
type="checkbox"
|
|
97
|
+
checked="${r.getVisible()||C}"
|
|
98
|
+
style="display: none"
|
|
99
|
+
@click=${()=>{r.setVisible(!r.getVisible()),this.requestUpdate()}}
|
|
100
|
+
/>
|
|
101
|
+
<span class="title"
|
|
102
|
+
>${r.get(this.layerTitle)||`layer ${r.get(this.layerIdentifier)}`}</span
|
|
103
|
+
>
|
|
104
|
+
</label>
|
|
105
|
+
${this.sortBy==="layerOrder"?L`<img
|
|
106
|
+
class="dragHandle"
|
|
107
|
+
src="${di}"
|
|
108
|
+
width="24"
|
|
109
|
+
height="24"
|
|
110
|
+
/>`:C}
|
|
111
|
+
</div>
|
|
112
|
+
${this.layerConfig&&!this.hideConfigs?L`
|
|
113
|
+
<eox-layerconfig
|
|
114
|
+
.layerConfig="${this.layerConfig}"
|
|
115
|
+
.layerControl="${this}"
|
|
116
|
+
.layer=${r}
|
|
117
|
+
.external=${this.externalLayerConfig}
|
|
118
|
+
></eox-layerconfig>
|
|
119
|
+
`:C}
|
|
120
|
+
${this.externalLayerConfig&&r.style_?L`
|
|
121
|
+
<button @click=${()=>this._emitLayerconfig(r)}>
|
|
122
|
+
configure
|
|
123
|
+
</button>
|
|
124
|
+
`:C}
|
|
125
|
+
</li>
|
|
126
|
+
`)}
|
|
127
|
+
</ul>
|
|
128
|
+
${ct(((a=this.optionalLayerArray)==null?void 0:a.length)>0,()=>L`
|
|
129
|
+
<label for="optional">Optional layers</label>
|
|
130
|
+
|
|
131
|
+
<select name="optional">
|
|
132
|
+
<option disabled selected value>
|
|
133
|
+
-- select an optional layer to add --
|
|
134
|
+
</option>
|
|
135
|
+
${this.optionalLayerArray.map(r=>L`
|
|
136
|
+
<option
|
|
137
|
+
value="${r.get(this.layerIdentifier)}"
|
|
138
|
+
>
|
|
139
|
+
${r.get(this.layerTitle)||`layer ${r.get(this.layerIdentifier)}`}
|
|
140
|
+
</option>
|
|
141
|
+
`)}
|
|
142
|
+
</select>
|
|
143
|
+
<button
|
|
144
|
+
@click="${()=>{const r=this.optionalLayerArray.find(l=>l.get(this.layerIdentifier)===this.shadowRoot.querySelector("select[name=optional]").value);this.layerCollection.remove(r),this.layerCollection.insertAt(this.layerCollection.getLength(),r),r.set("layerControlOptional",!1),r.setVisible(!0),this.resetLayerConfig()}}"
|
|
145
|
+
>
|
|
146
|
+
add
|
|
147
|
+
</button>
|
|
148
|
+
`)}
|
|
149
|
+
</div>
|
|
150
|
+
`}updated(){this.sortBy=="layerOrder"&&g.create(this.renderRoot.querySelector("ul"),{handle:".dragHandle",dataIdAttr:"layerId",store:{get:()=>this.layerCollection.getArray().map(t=>t.get(this.layerIdentifier)).reverse(),set:t=>{var n=t.toArray().reverse();n.forEach((o,a)=>{const r=this.layerCollection.getArray().find(l=>l.get(this.layerIdentifier)===o);this.layerCollection.remove(r),this.layerCollection.insertAt(a,r)})}},onSort:()=>{this.resetLayerConfig()}})}},T([pe()],v.EOxLayerControl.prototype,"olMap",2),T([pe()],v.EOxLayerControl.prototype,"layerCollection",2),T([pe()],v.EOxLayerControl.prototype,"layerArray",2),T([pe()],v.EOxLayerControl.prototype,"optionalLayerArray",2),T([H()],v.EOxLayerControl.prototype,"for",2),T([H()],v.EOxLayerControl.prototype,"layerIdentifier",2),T([H()],v.EOxLayerControl.prototype,"layerTitle",2),T([H()],v.EOxLayerControl.prototype,"sortBy",2),T([H({type:Array})],v.EOxLayerControl.prototype,"layerConfig",2),T([H({type:Boolean})],v.EOxLayerControl.prototype,"externalLayerConfig",2),v.EOxLayerControl=T([Bt("eox-layercontrol")],v.EOxLayerControl),v.EOxLayerConfig=class extends fe{constructor(){super(...arguments);A(this,"for");A(this,"layerConfig");A(this,"layerControl");A(this,"layer");A(this,"external");A(this,"_layerControlElement");A(this,"_currentLayer");A(this,"_configList",{})}_handleInput(t,n){n==="opacity"?this._layerControlElement.changeOpacity(this._currentLayer,parseFloat(t.target.value)):this._layerControlElement.changeStyleProperty(this._currentLayer,n,parseFloat(t.target.value))}_parseConfigs(t){if(!t)return;const n=t.style_;n&&n.color&&n.color[0]==="array"&&(this._configList=n.variables)}connectedCallback(){super.connectedCallback(),!this.layerConfig&&!this.layerControl?(this._layerControlElement=document.querySelector(this.for),this.layerConfig=this._layerControlElement.layerConfig,this._layerControlElement&&this._layerControlElement.addEventListener("layerconfig",t=>{this._currentLayer=t.detail.layer,this._parseConfigs(this._currentLayer),this.requestUpdate()})):(this._layerControlElement=this.layerControl,this._currentLayer=this.layer,this._parseConfigs(this._currentLayer))}render(){return L`
|
|
151
|
+
<style>
|
|
152
|
+
${cn}
|
|
153
|
+
</style>
|
|
154
|
+
${ct(this._currentLayer,()=>L`
|
|
155
|
+
<div>
|
|
156
|
+
<slot></slot>
|
|
157
|
+
${this.for?L`layer: ${this._currentLayer.get("name")}`:C}
|
|
158
|
+
${ht(this.layerConfig.filter(t=>this.for?t!=="opacity":!0),t=>L`
|
|
159
|
+
<div>${t}</div>
|
|
160
|
+
<input
|
|
161
|
+
type="range"
|
|
162
|
+
min="0"
|
|
163
|
+
max="1"
|
|
164
|
+
step="0.01"
|
|
165
|
+
value="${this._currentLayer.getOpacity()}"
|
|
166
|
+
@input=${n=>this._handleInput(n,t)}
|
|
167
|
+
/>
|
|
168
|
+
`)}
|
|
169
|
+
${Object.keys(this._configList).length>0&&!this.external?L`
|
|
170
|
+
<details open="${this.for?!0:C}">
|
|
171
|
+
<summary>Layer config</summary>
|
|
172
|
+
<ul>
|
|
173
|
+
${ht(Object.keys(this._configList),t=>L` <li>
|
|
174
|
+
<div>${t}</div>
|
|
175
|
+
<input
|
|
176
|
+
type="range"
|
|
177
|
+
min="${["red","green","blue"].includes(t)?1:2e3}"
|
|
178
|
+
max="${["red","green","blue"].includes(t)?4:5e3}"
|
|
179
|
+
value="${this._configList[t]}"
|
|
180
|
+
@input=${n=>this._handleInput(n,t)}
|
|
181
|
+
/>
|
|
182
|
+
</li>`)}
|
|
183
|
+
</ul>
|
|
184
|
+
</details>
|
|
185
|
+
`:C}
|
|
186
|
+
</div>
|
|
187
|
+
`)}
|
|
188
|
+
`}},T([H()],v.EOxLayerConfig.prototype,"for",2),T([H({type:Array})],v.EOxLayerConfig.prototype,"layerConfig",2),T([H({type:Object,attribute:!1})],v.EOxLayerConfig.prototype,"layerControl",2),T([H({type:Object,attribute:!1})],v.EOxLayerConfig.prototype,"layer",2),T([H({type:Boolean})],v.EOxLayerConfig.prototype,"external",2),T([pe()],v.EOxLayerConfig.prototype,"_currentLayer",2),T([pe()],v.EOxLayerConfig.prototype,"_configList",2),v.EOxLayerConfig=T([Bt("eox-layerconfig")],v.EOxLayerConfig),Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|