inline-style-editor 1.0.4 → 1.1.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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # inline-style-editor
2
- Lightweight (~55KB, ~22KB gzipped) tool to graphically change style and CSS (on classes or inline) using a graphical interface.
2
+ Lightweight (~42KB, ~16KB gzipped) tool to graphically change style and CSS (on classes or inline) using a graphical interface.
3
3
 
4
4
  See [demo](https://qpincon.github.io/inline-style-editor/).
5
5
 
@@ -10,19 +10,10 @@ npm install inline-style-editor
10
10
 
11
11
  Then, to use it:
12
12
 
13
- ### In a Svelte project
14
- ```svelte
15
- <script>
16
- import InlineStyleEditor from "inline-style-editor";
17
- </script>
18
-
19
- <InlineStyleEditor />
20
- ```
21
-
22
13
  ### As a JS module
23
14
  ```js
24
15
  import InlineStyleEditor from "node_modules/inline-style-editor/dist/inline-style-editor.mjs";
25
- new InlineStyleEditor();
16
+ const editor = new InlineStyleEditor();
26
17
  ```
27
18
  Also don't forget to import the css in: `node_modules/inline-style-editor/dist/inline-style-editor.css`.
28
19
 
@@ -55,6 +46,39 @@ new InlineStyleEditor({
55
46
  | listenOnClick | Boolean | Default to false. If true, click events will be listened on the `<body>` element, and the editor opened where clicked |
56
47
  | getAdditionalElems | Function | A function called everytime the editor is opened. Should return a *list* of HTMLElement, that will be editable as well |
57
48
  | onStyleChanged | Function | A function called everytime a style is modified. The first argument is the current target element, the second the edited CSS rule, or 'inline' if inline, the third the CSS prop name, the fourth the prop value |
49
+ | customProps | Object | An object defining custom properties to edit. See below. |
50
+
51
+ #### customProps
52
+
53
+ `customProps` is an object on the form of `propName` (as displayed in the editor) -> `definition`.
54
+
55
+ `definition` is an object defining the property to edit and the used widget:
56
+ - `type`: One of `slider`, `select` or `color`.
57
+ - If `slider`, `min`, `max` and `step` must be defined (floats).
58
+ - If `select`, `choices` must be defined. It is a function returning a list to select from
59
+ - `getter`: A function to get the property value. Takes the edited HTMLElement as first argument. If `null` is returned, the widget will not be awailable for the current element.
60
+ - `setter`: A function to set the property value. Takes the edited HTMLElement as first argument, and the new value as second argument.
61
+
62
+ _Example, to edit the pathLength of an SVG element using a slider_:
63
+ ```js
64
+ new InlineStyleEditor({
65
+ customProps: {
66
+ 'pathLength': {
67
+ type: 'slider', min: 1, max: 500, step: 1,
68
+ getter: (el) => {
69
+ // disable when elem is not a SVG geometry
70
+ if (!el.getTotalLength) return null;
71
+ const pathLength = el.getAttribute('pathLength');
72
+ if (!pathLength) return Math.round(el.getTotalLength());
73
+ return parseInt(pathLength);
74
+ },
75
+ setter: (el, val) => {
76
+ el.setAttribute('pathLength', val);
77
+ }
78
+ },
79
+ }
80
+ });
81
+ ```
58
82
 
59
83
  ### Suported css properties
60
84
 
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).InlineStyleEditor=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function s(t){t.parentNode.removeChild(t)}function c(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function u(t){return document.createElement(t)}function f(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function h(t){return document.createTextNode(t)}function d(){return h(" ")}function p(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e,n){t.classList[n?"add":"remove"](e)}let y;function b(t){y=t}function w(){if(!y)throw new Error("Function called outside component initialization");return y}function _(t){w().$$.on_mount.push(t)}function k(t){w().$$.on_destroy.push(t)}const $=[],S=[],x=[],C=[],M=Promise.resolve();let E=!1;function L(t){x.push(t)}const T=new Set;let A=0;function O(){const t=y;do{for(;A<$.length;){const t=$[A];A++,b(t),N(t.$$)}for(b(null),$.length=0,A=0;S.length;)S.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];T.has(e)||(T.add(e),e())}x.length=0}while($.length);for(;C.length;)C.pop()();E=!1,T.clear(),b(t)}function N(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(L)}}const H=new Set;let j;function D(){j={r:0,c:[],p:j}}function I(){j.r||r(j.c),j=j.p}function P(t,e){t&&t.i&&(H.delete(t),t.i(e))}function R(t,e,n,r){if(t&&t.o){if(H.has(t))return;H.add(t),j.c.push((()=>{H.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function B(t,n,i,l){const{fragment:a,on_mount:s,on_destroy:c,after_update:u}=t.$$;a&&a.m(n,i),l||L((()=>{const n=s.map(e).filter(o);c?c.push(...n):r(n),t.$$.on_mount=[]})),u.forEach(L)}function F(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(t,e){-1===t.$$.dirty[0]&&($.push(t),E||(E=!0,M.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function q(e,o,i,l,a,c,u,f=[-1]){const h=y;b(e);const d=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:a,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(h?h.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:o.target||h.$$.root};u&&u(d.root);let p=!1;if(d.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return d.ctx&&a(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),p&&G(e,t)),n})):[],d.update(),p=!0,r(d.before_update),d.fragment=!!l&&l(d.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);d.fragment&&d.fragment.l(t),t.forEach(s)}else d.fragment&&d.fragment.c();o.intro&&P(e.$$.fragment),B(e,o.target,o.anchor,o.customElement),O()}b(h)}class U{$destroy(){F(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=9007199254740991,Y="[object Arguments]",X="[object Function]",V="[object GeneratorFunction]",J="[object Symbol]",Z="object"==typeof z&&z&&z.Object===Object&&z,K="object"==typeof self&&self&&self.Object===Object&&self,Q=Z||K||Function("return this")();function tt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function et(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var nt=Object.prototype,rt=nt.hasOwnProperty,ot=nt.toString,it=Q.Symbol,lt=nt.propertyIsEnumerable,at=it?it.isConcatSpreadable:void 0,st=Math.max;function ct(t,e,n,r,o){var i=-1,l=t.length;for(n||(n=ut),o||(o=[]);++i<l;){var a=t[i];e>0&&n(a)?e>1?ct(a,e-1,n,r,o):et(o,a):r||(o[o.length]=a)}return o}function ut(t){return ht(t)||function(t){return function(t){return dt(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=W}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?ot.call(t):"";return e==X||e==V}(t)}(t)}(t)&&rt.call(t,"callee")&&(!lt.call(t,"callee")||ot.call(t)==Y)}(t)||!!(at&&t&&t[at])}function ft(t){if("string"==typeof t||function(t){return"symbol"==typeof t||dt(t)&&ot.call(t)==J}(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}var ht=Array.isArray;function dt(t){return!!t&&"object"==typeof t}var pt,gt,mt=(pt=function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var l=e[r],a=t[l];n(a,l)&&(i[l]=a)}return i}(t=Object(t),e,(function(e,n){return n in t}))}(t,function(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}(ct(e,1),ft))},gt=st(void 0===gt?pt.length-1:gt,0),function(){for(var t=arguments,e=-1,n=st(t.length-gt,0),r=Array(n);++e<n;)r[e]=t[gt+e];e=-1;for(var o=Array(gt+1);++e<gt;)o[e]=t[e];return o[gt]=r,tt(pt,this,o)}),vt=mt,yt=/^\s+|\s+$/g,bt=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,_t=/^0o[0-7]+$/i,kt=parseInt,$t="object"==typeof z&&z&&z.Object===Object&&z,St="object"==typeof self&&self&&self.Object===Object&&self,xt=$t||St||Function("return this")(),Ct=Object.prototype.toString,Mt=Math.max,Et=Math.min,Lt=function(){return xt.Date.now()};function Tt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Ct.call(t)}(t))return NaN;if(Tt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Tt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(yt,"");var n=wt.test(t);return n||_t.test(t)?kt(t.slice(2),n?2:8):bt.test(t)?NaN:+t}var Ot=function(t,e,n){var r,o,i,l,a,s,c=0,u=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=r,i=o;return r=o=void 0,c=e,l=t.apply(i,n)}function p(t){return c=t,a=setTimeout(m,e),u?d(t):l}function g(t){var n=t-s;return void 0===s||n>=e||n<0||f&&t-c>=i}function m(){var t=Lt();if(g(t))return v(t);a=setTimeout(m,function(t){var n=e-(t-s);return f?Et(n,i-(t-c)):n}(t))}function v(t){return a=void 0,h&&r?d(t):(r=o=void 0,l)}function y(){var t=Lt(),n=g(t);if(r=arguments,o=this,s=t,n){if(void 0===a)return p(s);if(f)return a=setTimeout(m,e),d(s)}return void 0===a&&(a=setTimeout(m,e)),l}return e=At(e)||0,Tt(n)&&(u=!!n.leading,i=(f="maxWait"in n)?Mt(At(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=s=o=a=void 0},y.flush=function(){return void 0===a?l:v(Lt())},y};function Nt(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Nt,n=(e,n)=>Nt(t(e),n),r=(e,n)=>t(e)-n):(e=t===Nt||t===Ht?t:Dt,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const l=o(t,e,n,i-1);return l>n&&r(t[l-1],e)>-r(t[l],e)?l-1:l},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function Dt(){return 0}jt(Nt),jt((function(t){return null===t?NaN:+t})).center;var It=Math.sqrt(50),Pt=Math.sqrt(10),Rt=Math.sqrt(2);function Bt(t,e,n){var r,o,i,l,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(o=t,t=e,e=o),0===(l=function(t,e,n){var r=(e-t)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=It?10:i>=Pt?5:i>=Rt?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=It?10:i>=Pt?5:i>=Rt?2:1)}(t,e,n))||!isFinite(l))return[];if(l>0){let n=Math.round(t/l),r=Math.round(e/l);for(n*l<t&&++n,r*l>e&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)*l}else{l=-l;let n=Math.round(t*l),r=Math.round(e*l);for(n/l<t&&++n,r/l>e&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)/l}return r&&i.reverse(),i}function Ft(t){return Math.ceil(Math.log(function(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&++n}return n}(t))/Math.LN2)+1}var Gt=Array.prototype.slice;function qt(t,e){return t-e}var Ut=t=>()=>t;function zt(t,e){for(var n,r=-1,o=e.length;++r<o;)if(n=Wt(t,e[r]))return n;return 0}function Wt(t,e){for(var n=e[0],r=e[1],o=-1,i=0,l=t.length,a=l-1;i<l;a=i++){var s=t[i],c=s[0],u=s[1],f=t[a],h=f[0],d=f[1];if(Yt(s,f,e))return 0;u>r!=d>r&&n<(h-c)*(r-u)/(d-u)+c&&(o=-o)}return o}function Yt(t,e,n){var r,o,i,l;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(o=t[r=+(t[0]===e[0])],i=n[r],l=e[r],o<=i&&i<=l||l<=i&&i<=o)}function Xt(){}var Vt=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Jt(){var t=1,e=1,n=Ft,r=a;function o(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(qt);else{const n=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}(t),r=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=It?o*=10:i>=Pt?o*=5:i>=Rt&&(o*=2),e<t?-o:o}(n[0],n[1],e);e=Bt(Math.floor(n[0]/r)*r,Math.floor(n[1]/r-1)*r,e)}return e.map((e=>i(t,e)))}function i(n,o){var i=[],a=[];return function(n,r,o){var i,a,s,c,u,f,h=new Array,d=new Array;i=a=-1,c=n[0]>=r,Vt[c<<1].forEach(p);for(;++i<t-1;)s=c,c=n[i+1]>=r,Vt[s|c<<1].forEach(p);Vt[c<<0].forEach(p);for(;++a<e-1;){for(i=-1,c=n[a*t+t]>=r,u=n[a*t]>=r,Vt[c<<1|u<<2].forEach(p);++i<t-1;)s=c,c=n[a*t+t+i+1]>=r,f=u,u=n[a*t+i+1]>=r,Vt[s|c<<1|u<<2|f<<3].forEach(p);Vt[c|u<<3].forEach(p)}i=-1,u=n[a*t]>=r,Vt[u<<2].forEach(p);for(;++i<t-1;)f=u,u=n[a*t+i+1]>=r,Vt[u<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+i,t[0][1]+a],s=[t[1][0]+i,t[1][1]+a],c=l(r),u=l(s);(e=d[c])?(n=h[u])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),o(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=u]=e):(e=h[u])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),o(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[u]={start:c,end:u,ring:[r,s]}}Vt[u<<3].forEach(p)}(n,o,(function(t){r(t,n,o),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?i.push([t]):a.push(t)})),a.forEach((function(t){for(var e,n=0,r=i.length;n<r;++n)if(-1!==zt((e=i[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:o,coordinates:i}}function l(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,o){n.forEach((function(n){var i,l=n[0],a=n[1],s=0|l,c=0|a,u=r[c*t+s];l>0&&l<t&&s===l&&(i=r[c*t+s-1],n[0]=l+(o-i)/(u-i)-.5),a>0&&a<e&&c===a&&(i=r[(c-1)*t+s],n[1]=a+(o-i)/(u-i)-.5)}))}return o.contour=i,o.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),i=Math.floor(n[1]);if(!(r>=0&&i>=0))throw new Error("invalid size");return t=r,e=i,o},o.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Ut(Gt.call(t)):Ut(t),o):n},o.smooth=function(t){return arguments.length?(r=t?a:Xt,o):r===a},o}function Zt(t,e){return!(t.x<e.left||t.x>e.right||t.y>e.bottom||t.y<e.top)}function Kt(t,e){for(const n of e)if(Zt(t,n))return!0;return!1}function Qt({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} h${t} v${e} h-${t}z`}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).InlineStyleEditor=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function a(t){t.parentNode.removeChild(t)}function c(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function u(t){return document.createElement(t)}function f(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function h(t){return document.createTextNode(t)}function d(){return h(" ")}function p(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e,n){t.classList[n?"add":"remove"](e)}let y;function b(t){y=t}function w(){if(!y)throw new Error("Function called outside component initialization");return y}function _(t){w().$$.on_mount.push(t)}function k(t){w().$$.on_destroy.push(t)}const $=[],S=[],x=[],C=[],M=Promise.resolve();let E=!1;function L(){E||(E=!0,M.then(H))}function T(t){x.push(t)}const A=new Set;let N=0;function H(){const t=y;do{for(;N<$.length;){const t=$[N];N++,b(t),O(t.$$)}for(b(null),$.length=0,N=0;S.length;)S.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];A.has(e)||(A.add(e),e())}x.length=0}while($.length);for(;C.length;)C.pop()();E=!1,A.clear(),b(t)}function O(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const D=new Set;let P;function R(){P={r:0,c:[],p:P}}function B(){P.r||r(P.c),P=P.p}function I(t,e){t&&t.i&&(D.delete(t),t.i(e))}function F(t,e,n,r){if(t&&t.o){if(D.has(t))return;D.add(t),P.c.push((()=>{D.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function G(t,n,i,l){const{fragment:s,on_mount:a,on_destroy:c,after_update:u}=t.$$;s&&s.m(n,i),l||T((()=>{const n=a.map(e).filter(o);c?c.push(...n):r(n),t.$$.on_mount=[]})),u.forEach(T)}function j(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function q(e,o,i,l,s,c,u,f=[-1]){const h=y;b(e);const d=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(h?h.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:o.target||h.$$.root};u&&u(d.root);let p=!1;if(d.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return d.ctx&&s(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),p&&function(t,e){-1===t.$$.dirty[0]&&($.push(t),L(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(e,t)),n})):[],d.update(),p=!0,r(d.before_update),d.fragment=!!l&&l(d.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);d.fragment&&d.fragment.l(t),t.forEach(a)}else d.fragment&&d.fragment.c();o.intro&&I(e.$$.fragment),G(e,o.target,o.anchor,o.customElement),H()}b(h)}class U{$destroy(){j(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function z(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function W(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Y(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=z,n=(e,n)=>z(t(e),n),r=(e,n)=>t(e)-n):(e=t===z||t===W?t:X,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const l=o(t,e,n,i-1);return l>n&&r(t[l-1],e)>-r(t[l],e)?l-1:l},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function X(){return 0}Y(z),Y((function(t){return null===t?NaN:+t})).center;var V=Math.sqrt(50),J=Math.sqrt(10),Z=Math.sqrt(2);function K(t,e,n){var r,o,i,l,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(o=t,t=e,e=o),0===(l=function(t,e,n){var r=(e-t)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=V?10:i>=J?5:i>=Z?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=V?10:i>=J?5:i>=Z?2:1)}(t,e,n))||!isFinite(l))return[];if(l>0){let n=Math.round(t/l),r=Math.round(e/l);for(n*l<t&&++n,r*l>e&&--r,i=new Array(o=r-n+1);++s<o;)i[s]=(n+s)*l}else{l=-l;let n=Math.round(t*l),r=Math.round(e*l);for(n/l<t&&++n,r/l>e&&--r,i=new Array(o=r-n+1);++s<o;)i[s]=(n+s)/l}return r&&i.reverse(),i}function Q(t){return Math.ceil(Math.log(function(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&++n}return n}(t))/Math.LN2)+1}var tt=Array.prototype.slice;function et(t,e){return t-e}var nt=t=>()=>t;function rt(t,e){for(var n,r=-1,o=e.length;++r<o;)if(n=ot(t,e[r]))return n;return 0}function ot(t,e){for(var n=e[0],r=e[1],o=-1,i=0,l=t.length,s=l-1;i<l;s=i++){var a=t[i],c=a[0],u=a[1],f=t[s],h=f[0],d=f[1];if(it(a,f,e))return 0;u>r!=d>r&&n<(h-c)*(r-u)/(d-u)+c&&(o=-o)}return o}function it(t,e,n){var r,o,i,l;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(o=t[r=+(t[0]===e[0])],i=n[r],l=e[r],o<=i&&i<=l||l<=i&&i<=o)}function lt(){}var st=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function at(){var t=1,e=1,n=Q,r=s;function o(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(et);else{const n=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}(t),r=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=V?o*=10:i>=J?o*=5:i>=Z&&(o*=2),e<t?-o:o}(n[0],n[1],e);e=K(Math.floor(n[0]/r)*r,Math.floor(n[1]/r-1)*r,e)}return e.map((e=>i(t,e)))}function i(n,o){var i=[],s=[];return function(n,r,o){var i,s,a,c,u,f,h=new Array,d=new Array;i=s=-1,c=n[0]>=r,st[c<<1].forEach(p);for(;++i<t-1;)a=c,c=n[i+1]>=r,st[a|c<<1].forEach(p);st[c<<0].forEach(p);for(;++s<e-1;){for(i=-1,c=n[s*t+t]>=r,u=n[s*t]>=r,st[c<<1|u<<2].forEach(p);++i<t-1;)a=c,c=n[s*t+t+i+1]>=r,f=u,u=n[s*t+i+1]>=r,st[a|c<<1|u<<2|f<<3].forEach(p);st[c|u<<3].forEach(p)}i=-1,u=n[s*t]>=r,st[u<<2].forEach(p);for(;++i<t-1;)f=u,u=n[s*t+i+1]>=r,st[u<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+i,t[0][1]+s],a=[t[1][0]+i,t[1][1]+s],c=l(r),u=l(a);(e=d[c])?(n=h[u])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(a),o(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(a),d[e.end=u]=e):(e=h[u])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(a),o(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[u]={start:c,end:u,ring:[r,a]}}st[u<<3].forEach(p)}(n,o,(function(t){r(t,n,o),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?i.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=i.length;n<r;++n)if(-1!==rt((e=i[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:o,coordinates:i}}function l(e){return 2*e[0]+e[1]*(t+1)*4}function s(n,r,o){n.forEach((function(n){var i,l=n[0],s=n[1],a=0|l,c=0|s,u=r[c*t+a];l>0&&l<t&&a===l&&(i=r[c*t+a-1],n[0]=l+(o-i)/(u-i)-.5),s>0&&s<e&&c===s&&(i=r[(c-1)*t+a],n[1]=s+(o-i)/(u-i)-.5)}))}return o.contour=i,o.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),i=Math.floor(n[1]);if(!(r>=0&&i>=0))throw new Error("invalid size");return t=r,e=i,o},o.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?nt(tt.call(t)):nt(t),o):n},o.smooth=function(t){return arguments.length?(r=t?s:lt,o):r===s},o}function ct(t,e){return!(t.x<e.left||t.x>e.right||t.y>e.bottom||t.y<e.top)}function ut(t,e){for(const n of e)if(ct(t,n))return!0;return!1}function ft({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} h${t} v${e} h-${t}z`}
2
2
  /*!
3
3
  * vanilla-picker v2.12.1
4
4
  * https://vanilla-picker.js.org
@@ -6,4 +6,4 @@
6
6
  * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
7
7
  * Released under the ISC license.
8
8
  */
9
- var te=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},ee=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ne=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var re={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function oe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var ie=function(){function t(e,n,r,o){te(this,t);var i=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===r){var l=e&&""+e;l&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),r=ne(n,4),o=r[0],l=r[1],a=r[2],s=r[3];void 0===s&&(s=1),o/=360,l/=100,a/=100,i.hsla=[o,l,a,s]}else if(e.startsWith("rgb")){var c=e.match(/([\-\d\.e]+)/g).map(Number),u=ne(c,4),f=u[0],h=u[1],d=u[2],p=u[3];void 0===p&&(p=1),i.rgba=[f,h,d,p]}else e.startsWith("#")?i.rgba=t.hexToRgb(e):i.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(l.toLowerCase())}else this.rgba=[e,n,r,void 0===o?1:o]}return ee(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return oe(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],r=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,r){return oe(t*e[r],3===r?3:1)+n[r]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=re[n];return void 0===r?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=ne(t,4),n=e[0],r=e[1],o=e[2],i=e[3];n/=255,r/=255,o/=255;var l=Math.max(n,r,o),a=Math.min(n,r,o),s=void 0,c=void 0,u=(l+a)/2;if(l===a)s=c=0;else{var f=l-a;switch(c=u>.5?f/(2-l-a):f/(l+a),l){case n:s=(r-o)/f+(r<o?6:0);break;case r:s=(o-n)/f+2;break;case o:s=(n-r)/f+4}s/=6}return[s,c,u,i]}},{key:"hslToRgb",value:function(t){var e=ne(t,4),n=e[0],r=e[1],o=e[2],i=e[3],l=void 0,a=void 0,s=void 0;if(0===r)l=a=s=o;else{var c=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},u=o<.5?o*(1+r):o+r-o*r,f=2*o-u;l=c(f,u,n+1/3),a=c(f,u,n),s=c(f,u,n-1/3)}var h=[255*l,255*a,255*s].map(Math.round);return h[3]=i,h}}]),t}(),le=function(){function t(){te(this,t),this._events=[]}return ee(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,r){this._events=this._events.filter((function(o){var i=!0;return e&&e!==o.target&&(i=!1),n&&n!==o.type&&(i=!1),r&&r!==o.handler&&(i=!1),i&&t._doRemove(o.target,o.type,o.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function ae(t,e,n){var r=!1;function o(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,i,l){if(l&&(r=!0),r){t.preventDefault();var a=e.getBoundingClientRect(),s=a.width,c=a.height,u=i.clientX,f=i.clientY,h=o(u-a.left,0,s),d=o(f-a.top,0,c);n(h/s,d/c)}}function l(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):r=!1}function a(t,e){1===t.touches.length?i(t,t.touches[0],e):r=!1}t.add(e,"mousedown",(function(t){l(t,!0)})),t.add(e,"touchstart",(function(t){a(t,!0)})),t.add(window,"mousemove",l),t.add(e,"touchmove",a),t.add(window,"mouseup",(function(t){r=!1})),t.add(e,"touchend",(function(t){r=!1})),t.add(e,"touchcancel",(function(t){r=!1}))}var se="keydown",ce="mousedown",ue="focusin";function fe(t,e){return(e||document).querySelector(t)}function he(t){t.preventDefault(),t.stopPropagation()}function de(t,e,n,r,o){t.add(e,se,(function(t){n.indexOf(t.key)>=0&&(o&&he(t),r(t))}))}var pe=function(){function t(e){te(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new le,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return ee(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var r in t)n&&n.indexOf(r)>=0||(e[r]=t[r])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var r=t.color||t.colour;r&&this._setColor(r)}var o=n.parent;if(o&&n.popup&&!this._popupInited){var i=function(t){return e.openHandler(t)};this._events.add(o,"click",i),de(this._events,o,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===se?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===ce||e===ue){var r=(this.__containedEvent||0)+100;t.timeStamp>r&&(n=!0)}else he(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==ce&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new ie(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var r=n.hsla;r[3]=1,n.hsla=r}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=(e=r,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=o,this._domH=fe(".picker_hue",o),this._domSL=fe(".picker_sl",o),this._domA=fe(".picker_alpha",o),this._domEdit=fe(".picker_editor input",o),this._domSample=fe(".picker_sample",o),this._domOkay=fe(".picker_done button",o),this._domCancel=fe(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup((function(){return o.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,r=this._events;function o(t,e,n){r.add(t,e,n)}o(n,"click",(function(t){return t.preventDefault()})),ae(r,this._domH,(function(t,n){return e._setHSLA(t)})),ae(r,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&ae(r,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var i=this._domEdit;o(i,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(i,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};o(window,ce,e),o(window,ue,e),de(r,n,["Esc","Escape"],e);var i=function(e){t.__containedEvent=e.timeStamp};o(n,ce,i),o(n,ue,i),o(t._domCancel,"click",e)}));var l=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};o(this._domOkay,"click",l),de(r,n,["Enter"],l)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var r=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===r?e.classList.add(t):e.classList.remove(t)})),e.classList.add(r)}))}},{key:"_setHSLA",value:function(t,e,n,r,o){o=o||{};var i=this.colour,l=i.hsla;[t,e,n,r].forEach((function(t,e){(t||0===t)&&(l[e]=t)})),i.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,r="hsl("+360*n[0]+", 100%, 50%)",o=e.hslString,i=e.hslaString,l=this._domH,a=this._domSL,s=this._domA,c=fe(".picker_selector",l),u=fe(".picker_selector",a),f=fe(".picker_selector",s);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,y(0,u,n[1]),b(0,u,1-n[2]),a.style.color=o,b(0,f,1-n[3]);var h=o,d=h.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[h,d]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=e.printRGB(m);break;case"hsl":v=e.printHSL(m);break;default:v=e.printHex(m)}this._domEdit.value=v}this._domSample.style.color=i}function y(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",r=e.style.display!==n;return r&&(e.style.display=n),r}}]),t}();function ge(e){let n;return{c(){n=u("div")},m(t,r){a(t,n,r),e[6](n)},p:t,i:t,o:t,d(t){t&&s(n),e[6](null)}}}function me(t,e,n){let r,o,{value:i="#AAAAAAFF"}=e,{options:l={}}=e,{onChange:a=(()=>{})}=e;function s(t){var e;(e=t.rgbaString)!==i&&(a(e,i),n(1,i=e))}return _((()=>{!function(t){if(!r)return;o&&o.destroy();t.onChange=s,n(5,o=new pe({parent:r,color:i,popup:!1,...t})),o.show(),o.openHandler()}(l)})),k((()=>{o.destroy()})),t.$$set=t=>{"value"in t&&n(1,i=t.value),"options"in t&&n(2,l=t.options),"onChange"in t&&n(3,a=t.onChange)},t.$$.update=()=>{34&t.$$.dirty&&o&&o.setColor(i)},[r,i,l,a,function(t){o.setColor(t)},o,function(t){S[t?"unshift":"push"]((()=>{r=t,n(0,r)}))}]}var ve=class extends U{constructor(t){super(),q(this,t,me,ge,i,{value:1,options:2,onChange:3,setColor:4})}get setColor(){return this.$$.ctx[4]}};const ye=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort());function be(t,e,n){const r=t.slice();r[54]=e[n][0],r[55]=e[n][1],r[57]=e,r[58]=n;const o=r[55].props[r[55].selected];return r[56]=o,r}function we(t,e,n){const r=t.slice();return r[59]=e[n],r}function _e(t,e,n){const r=t.slice();return r[62]=e[n],r[64]=n,r}function ke(t,e,n){const r=t.slice();return r[65]=e[n],r[67]=n,r}function $e(t,e,n){const r=t.slice();return r[68]=e[n],r[70]=n,r}function Se(t,e,n){const r=t.slice();return r[71]=e[n],r[73]=n,r}function xe(t){let e,n,r,o=t[1],i=[];for(let e=0;e<o.length;e+=1)i[e]=Ce(Se(t,o,e));return{c(){e=u("div"),n=u("b"),n.textContent="Elem",r=d();for(let t=0;t<i.length;t+=1)i[t].c();g(e,"class","select-tab")},m(t,o){a(t,e,o),l(e,n),l(e,r);for(let t=0;t<i.length;t+=1)i[t].m(e,null)},p(t,n){if(50&n[0]){let r;for(o=t[1],r=0;r<o.length;r+=1){const l=Se(t,o,r);i[r]?i[r].p(l,n):(i[r]=Ce(l),i[r].c(),i[r].m(e,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=o.length}},d(t){t&&s(e),c(i,t)}}}function Ce(t){let e,n,r,o,i,c;function f(){return t[28](t[73])}return{c(){e=u("span"),n=h("Elem "),r=h(t[73]),o=d(),v(e,"selected",t[4]===t[73])},m(t,s){a(t,e,s),l(e,n),l(e,r),l(e,o),i||(c=p(e,"click",f),i=!0)},p(n,r){t=n,16&r[0]&&v(e,"selected",t[4]===t[73])},d(t){t&&s(e),i=!1,c()}}}function Me(t){let e,n,r,o,i,c=t[68]+"";function f(){return t[29](t[70])}return{c(){e=u("span"),n=h(c),g(e,"title",r=t[68]),v(e,"selected",t[5]===t[70])},m(t,r){a(t,e,r),l(e,n),o||(i=p(e,"click",f),o=!0)},p(o,i){t=o,20&i[0]&&c!==(c=t[68]+"")&&m(n,c),20&i[0]&&r!==(r=t[68])&&g(e,"title",r),32&i[0]&&v(e,"selected",t[5]===t[70])},d(t){t&&s(e),o=!1,i()}}}function Ee(t){let e,n,r,o,i,c=t[65]+"";function f(){return t[30](t[67])}return{c(){e=u("span"),n=h(c),r=d(),v(e,"selected",t[6]===t[67])},m(t,s){a(t,e,s),l(e,n),l(e,r),o||(i=p(e,"click",f),o=!0)},p(r,o){t=r,24&o[0]&&c!==(c=t[65]+"")&&m(n,c),64&o[0]&&v(e,"selected",t[6]===t[67])},d(t){t&&s(e),o=!1,i()}}}function Le(t){let e,n,r,o=Object.entries(t[13]),i=[];for(let e=0;e<o.length;e+=1)i[e]=Ie(be(t,o,e));const f=t=>R(i[t],1,1,(()=>{i[t]=null}));let h="inline"===t[7]&&null!==t[15][t[4]]&&Pe(t);return{c(){e=u("div");for(let t=0;t<i.length;t+=1)i[t].c();n=d(),h&&h.c(),g(e,"class","editor")},m(t,o){a(t,e,o);for(let t=0;t<i.length;t+=1)i[t].m(e,null);l(e,n),h&&h.m(e,null),r=!0},p(t,r){if(155648&r[0]){let l;for(o=Object.entries(t[13]),l=0;l<o.length;l+=1){const a=be(t,o,l);i[l]?(i[l].p(a,r),P(i[l],1)):(i[l]=Ie(a),i[l].c(),P(i[l],1),i[l].m(e,n))}for(D(),l=o.length;l<i.length;l+=1)f(l);I()}"inline"===t[7]&&null!==t[15][t[4]]?h?h.p(t,r):(h=Pe(t),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(t){if(!r){for(let t=0;t<o.length;t+=1)P(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)R(i[t]);r=!1},d(t){t&&s(e),c(i,t),h&&h.d()}}}function Te(t){let e,n,r=t[56]+"";return{c(){e=u("span"),n=h(r)},m(t,r){a(t,e,r),l(e,n)},p(t,e){8192&e[0]&&r!==(r=t[56]+"")&&m(n,r)},d(t){t&&s(e)}}}function Ae(t){let e,n,r,o,i=t[55].props,f=[];for(let e=0;e<i.length;e+=1)f[e]=Oe(_e(t,i,e));function h(...e){return t[31](t[55],t[57],t[58],...e)}return{c(){e=u("div"),n=u("select");for(let t=0;t<f.length;t+=1)f[t].c()},m(t,i){a(t,e,i),l(e,n);for(let t=0;t<f.length;t+=1)f[t].m(n,null);r||(o=p(n,"change",h),r=!0)},p(e,r){if(t=e,8192&r[0]){let e;for(i=t[55].props,e=0;e<i.length;e+=1){const o=_e(t,i,e);f[e]?f[e].p(o,r):(f[e]=Oe(o),f[e].c(),f[e].m(n,null))}for(;e<f.length;e+=1)f[e].d(1);f.length=i.length}},d(t){t&&s(e),c(f,t),r=!1,o()}}}function Oe(t){let e,n,r,o,i=t[62]+"";return{c(){e=u("option"),n=h(i),r=d(),e.selected=o=t[64]===t[55].selected,e.__value=t[64],e.value=e.__value},m(t,o){a(t,e,o),l(e,n),l(e,r)},p(t,r){8192&r[0]&&i!==(i=t[62]+"")&&m(n,i),8192&r[0]&&o!==(o=t[64]===t[55].selected)&&(e.selected=o)},d(t){t&&s(e)}}}function Ne(t){let e,n;function r(...e){return t[34](t[56],...e)}return e=new ve({props:{value:t[14][t[56]].value,onChange:r}}),{c(){var t;(t=e.$$.fragment)&&t.c()},m(t,r){B(e,t,r),n=!0},p(n,o){t=n;const i={};24576&o[0]&&(i.value=t[14][t[56]].value),8192&o[0]&&(i.onChange=r),e.$set(i)},i(t){n||(P(e.$$.fragment,t),n=!0)},o(t){R(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function He(e){let n,r,o,i=e[14][e[56]].choices(),l=[];for(let t=0;t<i.length;t+=1)l[t]=De(we(e,i,t));function f(...t){return e[33](e[56],...t)}return{c(){n=u("select");for(let t=0;t<l.length;t+=1)l[t].c()},m(t,e){a(t,n,e);for(let t=0;t<l.length;t+=1)l[t].m(n,null);r||(o=p(n,"change",f),r=!0)},p(t,r){if(e=t,24576&r[0]){let t;for(i=e[14][e[56]].choices(),t=0;t<i.length;t+=1){const o=we(e,i,t);l[t]?l[t].p(o,r):(l[t]=De(o),l[t].c(),l[t].m(n,null))}for(;t<l.length;t+=1)l[t].d(1);l.length=i.length}},i:t,o:t,d(t){t&&s(n),c(l,t),r=!1,o()}}}function je(e){let n,r,o,i,c,f,v,y,b,w=e[14][e[56]].displayed+"";function _(...t){return e[32](e[56],...t)}return{c(){n=u("input"),c=d(),f=u("span"),v=h(w),g(n,"type","range"),n.value=r=e[14][e[56]].value,g(n,"min",o=e[14][e[56]].min),g(n,"max",i=e[14][e[56]].max),g(f,"class","current-value")},m(t,e){a(t,n,e),a(t,c,e),a(t,f,e),l(f,v),y||(b=p(n,"change",_),y=!0)},p(t,l){e=t,24576&l[0]&&r!==(r=e[14][e[56]].value)&&(n.value=r),24576&l[0]&&o!==(o=e[14][e[56]].min)&&g(n,"min",o),24576&l[0]&&i!==(i=e[14][e[56]].max)&&g(n,"max",i),24576&l[0]&&w!==(w=e[14][e[56]].displayed+"")&&m(v,w)},i:t,o:t,d(t){t&&s(n),t&&s(c),t&&s(f),y=!1,b()}}}function De(t){let e,n,r,o,i=t[59]+"";return{c(){e=u("option"),n=h(i),e.selected=r=t[59]==t[14][t[56]].value||null,e.__value=o=" "+t[59]+" ",e.value=e.__value},m(t,r){a(t,e,r),l(e,n)},p(t,l){24576&l[0]&&i!==(i=t[59]+"")&&m(n,i),24576&l[0]&&r!==(r=t[59]==t[14][t[56]].value||null)&&(e.selected=r),24576&l[0]&&o!==(o=" "+t[59]+" ")&&(e.__value=o,e.value=e.__value)},d(t){t&&s(e)}}}function Ie(t){let e,n,r,o,i;function c(t,e){return t[55].props.length>1?Ae:Te}let f=c(t),h=f(t);const p=[je,He,Ne],m=[];function v(t,e){return"slider"===t[54]?0:"select"==t[54]?1:"color"==t[54]?2:-1}return~(r=v(t))&&(o=m[r]=p[r](t)),{c(){e=u("div"),h.c(),n=d(),o&&o.c(),g(e,"class","prop-section")},m(t,o){a(t,e,o),h.m(e,null),l(e,n),~r&&m[r].m(e,null),i=!0},p(t,i){f===(f=c(t))&&h?h.p(t,i):(h.d(1),h=f(t),h&&(h.c(),h.m(e,n)));let l=r;r=v(t),r===l?~r&&m[r].p(t,i):(o&&(D(),R(m[l],1,1,(()=>{m[l]=null})),I()),~r?(o=m[r],o?o.p(t,i):(o=m[r]=p[r](t),o.c()),P(o,1),o.m(e,null)):o=null)},i(t){i||(P(o),i=!0)},o(t){R(o),i=!1},d(t){t&&s(e),h.d(),~r&&m[r].d()}}}function Pe(t){let e,n,r;return{c(){e=u("div"),e.textContent="Bring to front",g(e,"class","btn"),v(e,"active",!0===t[15][t[4]])},m(o,i){a(o,e,i),n||(r=p(e,"click",t[18]),n=!0)},p(t,n){32784&n[0]&&v(e,"active",!0===t[15][t[4]])},d(t){t&&s(e),n=!1,r()}}}function Re(t){let e,n,o,i,h,m,v,y,b,w,_,k,$,S,x,C,M,E,L,T,A,O,N,H,j=t[1].length>1&&xe(t),B=Ue(t[2][t[4]]),F=[];for(let e=0;e<B.length;e+=1)F[e]=Me($e(t,B,e));let G=t[3][t[4]]||[],q=[];for(let e=0;e<G.length;e+=1)q[e]=Ee(ke(t,G,e));let U=t[3][t[4]]&&Le(t);return{c(){e=u("div"),n=d(),o=f("svg"),i=f("clipPath"),h=f("path"),m=f("rect"),b=d(),w=u("div"),_=u("div"),_.textContent="x",k=d(),j&&j.c(),$=d(),S=u("div"),x=u("b"),x.textContent="Rule:",C=d();for(let t=0;t<F.length;t+=1)F[t].c();M=d(),E=u("div"),L=u("b"),L.textContent="Property type:",T=d();for(let t=0;t<q.length;t+=1)q[t].c();var r,l,a,s;A=d(),U&&U.c(),r=e,l="position",null===(a="absolute")?r.style.removeProperty(l):r.style.setProperty(l,a,s?"important":""),g(h,"d",t[11]),g(i,"id","overlay-clip"),g(i,"clip-rule","evenodd"),g(m,"y","0"),g(m,"x","0"),g(m,"height","100%"),g(m,"width","100%"),g(m,"class","overlay-over"),g(o,"class","ise-helper-wrapper"),g(o,"version","1.1"),g(o,"xmlns","http://www.w3.org/2000/svg"),g(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),g(o,"width",v=t[12].width),g(o,"height",y=t[12].height),g(_,"class","close-button"),g(S,"class","select-tab"),g(E,"class","select-tab"),g(w,"class","ise")},m(r,s){a(r,e,s),t[26](e),a(r,n,s),a(r,o,s),l(o,i),l(i,h),l(o,m),t[27](o),a(r,b,s),a(r,w,s),l(w,_),l(w,k),j&&j.m(w,null),l(w,$),l(w,S),l(S,x),l(S,C);for(let t=0;t<F.length;t+=1)F[t].m(S,null);l(w,M),l(w,E),l(E,L),l(E,T);for(let t=0;t<q.length;t+=1)q[t].m(E,null);l(w,A),U&&U.m(w,null),t[35](w),O=!0,N||(H=[p(o,"click",t[16]),p(_,"click",t[0])],N=!0)},p(t,e){if((!O||2048&e[0])&&g(h,"d",t[11]),(!O||4096&e[0]&&v!==(v=t[12].width))&&g(o,"width",v),(!O||4096&e[0]&&y!==(y=t[12].height))&&g(o,"height",y),t[1].length>1?j?j.p(t,e):(j=xe(t),j.c(),j.m(w,$)):j&&(j.d(1),j=null),52&e[0]){let n;for(B=Ue(t[2][t[4]]),n=0;n<B.length;n+=1){const r=$e(t,B,n);F[n]?F[n].p(r,e):(F[n]=Me(r),F[n].c(),F[n].m(S,null))}for(;n<F.length;n+=1)F[n].d(1);F.length=B.length}if(88&e[0]){let n;for(G=t[3][t[4]]||[],n=0;n<G.length;n+=1){const r=ke(t,G,n);q[n]?q[n].p(r,e):(q[n]=Ee(r),q[n].c(),q[n].m(E,null))}for(;n<q.length;n+=1)q[n].d(1);q.length=G.length}t[3][t[4]]?U?(U.p(t,e),24&e[0]&&P(U,1)):(U=Le(t),U.c(),P(U,1),U.m(w,null)):U&&(D(),R(U,1,1,(()=>{U=null})),I())},i(t){O||(P(U),O=!0)},o(t){R(U),O=!1},d(i){i&&s(e),t[26](null),i&&s(n),i&&s(o),t[27](null),i&&s(b),i&&s(w),j&&j.d(),c(F,i),c(q,i),U&&U.d(),t[35](null),N=!1,r(H)}}}const Be="text",Fe="border",Ge="stroke",qe="background";function Ue(t){return t?t.map(((t,e)=>{if("inline"===t)return"inline";const n=t.selectorText;return`${t.parentStyleSheet.title||`${e}`}: ${n}`})):[]}function ze(t,e=0){const n=t.getBoundingClientRect();return{left:n.left+window.scrollX-e,top:n.top+window.scrollY-e,width:n.width+2*e,height:n.height+2*e,right:n.left+window.scrollX+n.width+e,bottom:n.top+window.scrollY+n.height+e}}function We(t,e="number"){return"raw"==e?t:"number"==e&&/[0-9]+(px)|(em)|(rem)/.test(t)?parseInt(t):"rgb"!=e||!t.includes("rgb")&&"#"!=t[0]?t:function(t){const e=t.match(/[0-9\.]+/g).map((t=>parseFloat(t)));return 3===e.length&&e.push(1),e.reduce(((t,e,n)=>t+(3===n?Math.round(255*e).toString(16).padStart(2,"0"):e.toString(16).padStart(2,"0"))),"#")}(t)}function Ye(t,e,n){let r,o;const i=["altGlyph","circle","ellipse","line","path","polygon","polyline","rect","text","textPath","tref","tspan"],l={"border-radius":{type:"slider",min:0,max:30,suffix:"px"},"border-width":{type:"slider",min:0,max:30,suffix:"px"},"border-style":{type:"select",choices:()=>["none","dotted","dashed","solid","double","groove","ridge","inset","outset"]},"border-color":{type:"color"},"font-family":{type:"select",choices:function(){return function(){const t=new Set;for(const e of ye.values())document.fonts.check(`12px "${e}"`)&&t.add(e);return[...t.values()]}()}},"font-size":{type:"slider",min:0,max:30,suffix:"px"},"font-weight":{type:"slider",min:0,max:500},color:{type:"color"},"stroke-width":{type:"slider",min:0,max:30,suffix:"px"},stroke:{type:"color"},fill:{type:"color"},"stroke-dasharray":{type:"slider",min:0,max:30,suffix:"px"},"background-color":{type:"color"}},a={[Be]:["font-family","font-size","font-weight","color"],[Fe]:["border-radius","border-width","border-color","border-style"],[Ge]:["stroke-width","stroke","stroke-dasharray","fill"],[qe]:["background-color"]};let s,c,u,f,h,{getAdditionalElems:d=(()=>[])}=e,{listenOnClick:p=!1}=e,{onStyleChanged:g=(()=>{})}=e,m=null,v="",y={width:0,height:0},b=[],w=[],$=[],x=0,C=0,M=0,E={},L=[];_((()=>{N(),n(23,m=c.parentNode),document.body.appendChild(c),document.body.appendChild(u),document.body.appendChild(s),P(),setTimeout((()=>{P()}),1e3),window.addEventListener("resize",P)})),k((()=>{window.removeEventListener("resize",P),p&&m.removeEventListener("click",getTargetsAndRules)}));let T=new Set;function A(t){O(t.target,t.pageX,t.pageY)}function O(t,e,r){if(t.classList.contains("overlay-over"))return H();if(!c.contains(t))if(n(4,x=0),n(5,C=0),n(6,M=0),n(15,L=[]),n(3,$=[]),n(2,w=[]),n(1,b=[t,...d(t)]),n(3,$=b.reduce(((t,e)=>{const n=[];e.firstChild&&3===e.firstChild.nodeType&&n.push(Be);const r=e.tagName.toLowerCase();let o=!1;return i.includes(r)?(n.push(Ge),"g"===e.parentElement.tagName.toLowerCase()&&e.previousElementSibling&&e.previousElementSibling.tagName.toLowerCase()==r&&(o=!0)):(n.push(Fe),n.push(qe)),o?L.push(!0):L.push(null),t.push(n),t}),[])),n(2,w=function(t){const e=document.styleSheets;return t.reduce(((t,n)=>{const r=["inline"];for(let t in e)try{const o=e[t].cssRules;for(let t in o){const e=o[t].selectorText;!e||o[t].selectorText.length>50||e.split(",").some((t=>"*"===t))||n.matches(e)&&r.push(o[t])}}catch(n){T.has(t)||(console.log("Style editor: Not able to access",e[t].ownerNode,"sheet. Try CORS loading the sheet if you want to edit it."),T.add(t))}return t.push(r),t}),[])}(b)),e&&r)j(e,r);else{const e=ze(t,15);j(e.left,e.top)}}function N(){n(9,c.style.display="none",c),n(10,u.style.display="none",u),n(11,v="")}function H(){N()}function j(t,e){t=t+260>y.width?y.width-300:t+10,e=e+410>y.height?y.height-450:e+10,n(9,c.style.left=t+"px",c),n(9,c.style.top=e+"px",c),n(10,u.style.display="block",u),n(9,c.style.display="block",c)}function D(){if(!o)return;let t;if("inline"===o)t=[r];else{const e=o.selectorText.replace(/(:hover)|:focus/g,"");t=Array.from(document.querySelectorAll(e))}const e=t.map((t=>ze(t,10)));n(11,v=function(t,e){let n=function({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} v${e} h${t} v-${e}z`}({width:e.width,height:e.height});if(t.length<10&&!function(t){for(let r=0;r<t.length-1;++r){const o=t[r];for(let i=r+1;i<t.length;++i)if(e=o,n=t[i],e.right>=n.left&&n.right>=e.left&&e.bottom>=n.top&&n.bottom>=e.top)return!0}var e,n;return!1}(t)){for(const e of t)n=`${n} ${Qt(e)}`;return n}const r=Math.min(...t.map((t=>t.left))),o=Math.min(...t.map((t=>t.top))),i=t.map((t=>(t.left=t.left-r,t.right=t.right-r,t.top=t.top-o,t.bottom=t.bottom-o,t)));i.sort(((t,e)=>t.left>e.left?1:t.left<e.left?-1:0));const l=Math.ceil(Math.max(...i.map((t=>t.right)))),a=Math.ceil(Math.max(...i.map((t=>t.bottom)))),s=l*a/2e4,c=Math.ceil(l/s),u=Math.ceil(a/s),f=l/c,h=a/u,d=new Array(c*u);for(let t=0,e=0;t<u;++t)for(let n=0;n<c;++n,++e)d[e]=Kt({x:n*s,y:t*s},i)?1:0;const p=Jt().size([c,u]).thresholds([1])(d)[0];let g="";for(let t of p.coordinates)for(let e of t){for(let t=0;t<e.length;++t){const n=e[t],i=n[0]*f+r,l=n[1]*h+o;g+=t?`L ${i} ${l}`:`M${i} ${l}`}g+="Z"}return`${n} ${g}`}(e,y))}const I=Ot((function(t,e,i){const l=i?e+i:e;if("inline"===o){r.style[t]=l}else o.style.setProperty(t,l);n(14,E[t].value=e,E),n(14,E[t].displayed=l,E),g(r,o,t,l),D()}),100);function P(){const t=getComputedStyle(document.body),e=parseInt(t.marginLeft),r=parseInt(t.marginRight),o=parseInt(t.marginTop),i=parseInt(t.marginBottom);n(12,y={width:document.body.offsetWidth+e+r,height:document.body.offsetHeight+o+i})}function R(t,e,n="number"){let r=o?.style?.[e];if(!r){r=getComputedStyle(t)[e]}return We(r,n)}return t.$$set=t=>{"getAdditionalElems"in t&&n(19,d=t.getAdditionalElems),"listenOnClick"in t&&n(20,p=t.listenOnClick),"onStyleChanged"in t&&n(21,g=t.onStyleChanged)},t.$$.update=()=>{if(8388608&t.$$.dirty[0]&&null!==m&&p&&m.addEventListener("click",A),18&t.$$.dirty[0]&&n(25,r=b[x]),52&t.$$.dirty[0]&&n(7,o=w[x]?.[C]),16777304&t.$$.dirty[0]&&$[x]?.[M]!==h&&n(24,h=$[x]?.[M]),50331776&t.$$.dirty[0]&&h&&o){const t=vt(l,a[h]);Object.keys(t).forEach((e=>{t[e].displayed=R(r,e,"raw");const n=t[e].type;let o="number";"color"===n?o="rgb":"select"===n&&(o="raw"),t[e].value=R(r,e,o)})),n(13,f=Object.entries(t).reduce(((t,[e,n])=>{const r=n.type;return r in t?t[r].props.push(e):t[r]={selected:0,props:[e]},t}),{})),n(14,E=t)}},[N,b,w,$,x,C,M,o,s,c,u,v,y,f,E,L,H,I,function(){n(15,L[x]=!1,L),r.parentNode.appendChild(r)},d,p,g,O,m,h,r,function(t){S[t?"unshift":"push"]((()=>{s=t,n(8,s)}))},function(t){S[t?"unshift":"push"]((()=>{u=t,n(10,u)}))},t=>{n(4,x=t),n(5,C=0)},t=>{n(5,C=t)},t=>{n(6,M=t)},(t,e,r,o)=>n(13,e[r][1].selected=o.target.value,f),(t,e)=>I(t,e.target.value,E[t].suffix,e.target),(t,e)=>I(t,e.target.value),(t,e)=>I(t,e),function(t){S[t?"unshift":"push"]((()=>{c=t,n(9,c)}))}]}var Xe=class extends U{constructor(t){super(),q(this,t,Ye,Re,i,{getAdditionalElems:19,listenOnClick:20,onStyleChanged:21,open:22,close:0},null,[-1,-1,-1])}get open(){return this.$$.ctx[22]}get close(){return this.$$.ctx[0]}};return class{constructor(t){return new Xe({target:document.body,props:t})}}}));
9
+ var ht=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},dt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),pt=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var gt={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function mt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var vt=function(){function t(e,n,r,o){ht(this,t);var i=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===r){var l=e&&""+e;l&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),r=pt(n,4),o=r[0],l=r[1],s=r[2],a=r[3];void 0===a&&(a=1),o/=360,l/=100,s/=100,i.hsla=[o,l,s,a]}else if(e.startsWith("rgb")){var c=e.match(/([\-\d\.e]+)/g).map(Number),u=pt(c,4),f=u[0],h=u[1],d=u[2],p=u[3];void 0===p&&(p=1),i.rgba=[f,h,d,p]}else e.startsWith("#")?i.rgba=t.hexToRgb(e):i.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(l.toLowerCase())}else this.rgba=[e,n,r,void 0===o?1:o]}return dt(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return mt(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],r=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,r){return mt(t*e[r],3===r?3:1)+n[r]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=gt[n];return void 0===r?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=pt(t,4),n=e[0],r=e[1],o=e[2],i=e[3];n/=255,r/=255,o/=255;var l=Math.max(n,r,o),s=Math.min(n,r,o),a=void 0,c=void 0,u=(l+s)/2;if(l===s)a=c=0;else{var f=l-s;switch(c=u>.5?f/(2-l-s):f/(l+s),l){case n:a=(r-o)/f+(r<o?6:0);break;case r:a=(o-n)/f+2;break;case o:a=(n-r)/f+4}a/=6}return[a,c,u,i]}},{key:"hslToRgb",value:function(t){var e=pt(t,4),n=e[0],r=e[1],o=e[2],i=e[3],l=void 0,s=void 0,a=void 0;if(0===r)l=s=a=o;else{var c=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},u=o<.5?o*(1+r):o+r-o*r,f=2*o-u;l=c(f,u,n+1/3),s=c(f,u,n),a=c(f,u,n-1/3)}var h=[255*l,255*s,255*a].map(Math.round);return h[3]=i,h}}]),t}(),yt=function(){function t(){ht(this,t),this._events=[]}return dt(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,r){this._events=this._events.filter((function(o){var i=!0;return e&&e!==o.target&&(i=!1),n&&n!==o.type&&(i=!1),r&&r!==o.handler&&(i=!1),i&&t._doRemove(o.target,o.type,o.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function bt(t,e,n){var r=!1;function o(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,i,l){if(l&&(r=!0),r){t.preventDefault();var s=e.getBoundingClientRect(),a=s.width,c=s.height,u=i.clientX,f=i.clientY,h=o(u-s.left,0,a),d=o(f-s.top,0,c);n(h/a,d/c)}}function l(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):r=!1}function s(t,e){1===t.touches.length?i(t,t.touches[0],e):r=!1}t.add(e,"mousedown",(function(t){l(t,!0)})),t.add(e,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",l),t.add(e,"touchmove",s),t.add(window,"mouseup",(function(t){r=!1})),t.add(e,"touchend",(function(t){r=!1})),t.add(e,"touchcancel",(function(t){r=!1}))}var wt="keydown",_t="mousedown",kt="focusin";function $t(t,e){return(e||document).querySelector(t)}function St(t){t.preventDefault(),t.stopPropagation()}function xt(t,e,n,r,o){t.add(e,wt,(function(t){n.indexOf(t.key)>=0&&(o&&St(t),r(t))}))}var Ct=function(){function t(e){ht(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new yt,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return dt(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var r in t)n&&n.indexOf(r)>=0||(e[r]=t[r])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var r=t.color||t.colour;r&&this._setColor(r)}var o=n.parent;if(o&&n.popup&&!this._popupInited){var i=function(t){return e.openHandler(t)};this._events.add(o,"click",i),xt(this._events,o,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===wt?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===_t||e===kt){var r=(this.__containedEvent||0)+100;t.timeStamp>r&&(n=!0)}else St(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==_t&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new vt(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var r=n.hsla;r[3]=1,n.hsla=r}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=(e=r,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=o,this._domH=$t(".picker_hue",o),this._domSL=$t(".picker_sl",o),this._domA=$t(".picker_alpha",o),this._domEdit=$t(".picker_editor input",o),this._domSample=$t(".picker_sample",o),this._domOkay=$t(".picker_done button",o),this._domCancel=$t(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup((function(){return o.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,r=this._events;function o(t,e,n){r.add(t,e,n)}o(n,"click",(function(t){return t.preventDefault()})),bt(r,this._domH,(function(t,n){return e._setHSLA(t)})),bt(r,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&bt(r,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var i=this._domEdit;o(i,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(i,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};o(window,_t,e),o(window,kt,e),xt(r,n,["Esc","Escape"],e);var i=function(e){t.__containedEvent=e.timeStamp};o(n,_t,i),o(n,kt,i),o(t._domCancel,"click",e)}));var l=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};o(this._domOkay,"click",l),xt(r,n,["Enter"],l)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var r=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===r?e.classList.add(t):e.classList.remove(t)})),e.classList.add(r)}))}},{key:"_setHSLA",value:function(t,e,n,r,o){o=o||{};var i=this.colour,l=i.hsla;[t,e,n,r].forEach((function(t,e){(t||0===t)&&(l[e]=t)})),i.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,r="hsl("+360*n[0]+", 100%, 50%)",o=e.hslString,i=e.hslaString,l=this._domH,s=this._domSL,a=this._domA,c=$t(".picker_selector",l),u=$t(".picker_selector",s),f=$t(".picker_selector",a);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,y(0,u,n[1]),b(0,u,1-n[2]),s.style.color=o,b(0,f,1-n[3]);var h=o,d=h.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[h,d]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=e.printRGB(m);break;case"hsl":v=e.printHSL(m);break;default:v=e.printHex(m)}this._domEdit.value=v}this._domSample.style.color=i}function y(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",r=e.style.display!==n;return r&&(e.style.display=n),r}}]),t}();function Mt(e){let n;return{c(){n=u("div")},m(t,r){s(t,n,r),e[6](n)},p:t,i:t,o:t,d(t){t&&a(n),e[6](null)}}}function Et(t,e,n){let r,o,{value:i="#AAAAAAFF"}=e,{options:l={}}=e,{onChange:s=(()=>{})}=e;function a(t){var e;(e=t.rgbaString)!==i&&(s(e,i),n(1,i=e))}return _((()=>{!function(t){if(!r)return;o&&o.destroy();t.onChange=a,n(5,o=new Ct({parent:r,color:i,popup:!1,...t})),o.show(),o.openHandler()}(l)})),k((()=>{o.destroy()})),t.$$set=t=>{"value"in t&&n(1,i=t.value),"options"in t&&n(2,l=t.options),"onChange"in t&&n(3,s=t.onChange)},t.$$.update=()=>{34&t.$$.dirty&&o&&o.setColor(i)},[r,i,l,s,function(t){o.setColor(t)},o,function(t){S[t?"unshift":"push"]((()=>{r=t,n(0,r)}))}]}var Lt=class extends U{constructor(t){super(),q(this,t,Et,Mt,i,{value:1,options:2,onChange:3,setColor:4})}get setColor(){return this.$$.ctx[4]}};const Tt=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort());function At(t,e,n){const r=t.slice();r[57]=e[n][0],r[58]=e[n][1],r[60]=e,r[61]=n;const o=r[58].props[r[58].selected];return r[59]=o,r}function Nt(t,e,n){const r=t.slice();return r[62]=e[n],r}function Ht(t,e,n){const r=t.slice();return r[65]=e[n],r[67]=n,r}function Ot(t,e,n){const r=t.slice();return r[68]=e[n],r[70]=n,r}function Dt(t,e,n){const r=t.slice();return r[71]=e[n],r[73]=n,r}function Pt(t,e,n){const r=t.slice();return r[74]=e[n],r[76]=n,r}function Rt(t){let e,n,r,o=t[1],i=[];for(let e=0;e<o.length;e+=1)i[e]=Bt(Pt(t,o,e));return{c(){e=u("div"),n=u("b"),n.textContent="Elem",r=d();for(let t=0;t<i.length;t+=1)i[t].c();g(e,"class","select-tab")},m(t,o){s(t,e,o),l(e,n),l(e,r);for(let t=0;t<i.length;t+=1)i[t].m(e,null)},p(t,n){if(50&n[0]){let r;for(o=t[1],r=0;r<o.length;r+=1){const l=Pt(t,o,r);i[r]?i[r].p(l,n):(i[r]=Bt(l),i[r].c(),i[r].m(e,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=o.length}},d(t){t&&a(e),c(i,t)}}}function Bt(t){let e,n,r,o,i,c;function f(){return t[31](t[76])}return{c(){e=u("span"),n=h("Elem "),r=h(t[76]),o=d(),v(e,"selected",t[4]===t[76])},m(t,a){s(t,e,a),l(e,n),l(e,r),l(e,o),i||(c=p(e,"click",f),i=!0)},p(n,r){t=n,16&r[0]&&v(e,"selected",t[4]===t[76])},d(t){t&&a(e),i=!1,c()}}}function It(t){let e,n,r,o,i,c=t[71]+"";function f(){return t[32](t[73])}return{c(){e=u("span"),n=h(c),g(e,"title",r=t[71]),v(e,"selected",t[5]===t[73])},m(t,r){s(t,e,r),l(e,n),o||(i=p(e,"click",f),o=!0)},p(o,i){t=o,20&i[0]&&c!==(c=t[71]+"")&&m(n,c),20&i[0]&&r!==(r=t[71])&&g(e,"title",r),32&i[0]&&v(e,"selected",t[5]===t[73])},d(t){t&&a(e),o=!1,i()}}}function Ft(t){let e,n,r,o,i,c=t[68]+"";function f(){return t[33](t[70])}return{c(){e=u("span"),n=h(c),r=d(),v(e,"selected",t[6]===t[70])},m(t,a){s(t,e,a),l(e,n),l(e,r),o||(i=p(e,"click",f),o=!0)},p(r,o){t=r,24&o[0]&&c!==(c=t[68]+"")&&m(n,c),64&o[0]&&v(e,"selected",t[6]===t[70])},d(t){t&&a(e),o=!1,i()}}}function Gt(t){let e,n=("custom"!==t[68]||"inline"===t[7])&&Ft(t);return{c(){n&&n.c(),e=h("")},m(t,r){n&&n.m(t,r),s(t,e,r)},p(t,r){"custom"!==t[68]||"inline"===t[7]?n?n.p(t,r):(n=Ft(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&a(e)}}}function jt(t){let e,n,r,o=Object.entries(t[13]),i=[];for(let e=0;e<o.length;e+=1)i[e]=Jt(At(t,o,e));const f=t=>F(i[t],1,1,(()=>{i[t]=null}));let h="inline"===t[7]&&null!==t[15][t[4]]&&Zt(t);return{c(){e=u("div");for(let t=0;t<i.length;t+=1)i[t].c();n=d(),h&&h.c(),g(e,"class","editor")},m(t,o){s(t,e,o);for(let t=0;t<i.length;t+=1)i[t].m(e,null);l(e,n),h&&h.m(e,null),r=!0},p(t,r){if(155648&r[0]){let l;for(o=Object.entries(t[13]),l=0;l<o.length;l+=1){const s=At(t,o,l);i[l]?(i[l].p(s,r),I(i[l],1)):(i[l]=Jt(s),i[l].c(),I(i[l],1),i[l].m(e,n))}for(R(),l=o.length;l<i.length;l+=1)f(l);B()}"inline"===t[7]&&null!==t[15][t[4]]?h?h.p(t,r):(h=Zt(t),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(t){if(!r){for(let t=0;t<o.length;t+=1)I(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)F(i[t]);r=!1},d(t){t&&a(e),c(i,t),h&&h.d()}}}function qt(t){let e,n,r=t[59]+"";return{c(){e=u("span"),n=h(r)},m(t,r){s(t,e,r),l(e,n)},p(t,e){8192&e[0]&&r!==(r=t[59]+"")&&m(n,r)},d(t){t&&a(e)}}}function Ut(t){let e,n,r,o,i=t[58].props,f=[];for(let e=0;e<i.length;e+=1)f[e]=zt(Ht(t,i,e));function h(...e){return t[34](t[58],t[60],t[61],...e)}return{c(){e=u("div"),n=u("select");for(let t=0;t<f.length;t+=1)f[t].c()},m(t,i){s(t,e,i),l(e,n);for(let t=0;t<f.length;t+=1)f[t].m(n,null);r||(o=p(n,"change",h),r=!0)},p(e,r){if(t=e,8192&r[0]){let e;for(i=t[58].props,e=0;e<i.length;e+=1){const o=Ht(t,i,e);f[e]?f[e].p(o,r):(f[e]=zt(o),f[e].c(),f[e].m(n,null))}for(;e<f.length;e+=1)f[e].d(1);f.length=i.length}},d(t){t&&a(e),c(f,t),r=!1,o()}}}function zt(t){let e,n,r,o,i=t[65]+"";return{c(){e=u("option"),n=h(i),r=d(),e.selected=o=t[67]===t[58].selected,e.__value=t[67],e.value=e.__value},m(t,o){s(t,e,o),l(e,n),l(e,r)},p(t,r){8192&r[0]&&i!==(i=t[65]+"")&&m(n,i),8192&r[0]&&o!==(o=t[67]===t[58].selected)&&(e.selected=o)},d(t){t&&a(e)}}}function Wt(t){let e,n;function r(...e){return t[37](t[59],...e)}return e=new Lt({props:{value:t[14][t[59]].value,onChange:r}}),{c(){var t;(t=e.$$.fragment)&&t.c()},m(t,r){G(e,t,r),n=!0},p(n,o){t=n;const i={};24576&o[0]&&(i.value=t[14][t[59]].value),8192&o[0]&&(i.onChange=r),e.$set(i)},i(t){n||(I(e.$$.fragment,t),n=!0)},o(t){F(e.$$.fragment,t),n=!1},d(t){j(e,t)}}}function Yt(e){let n,r,o,i=e[14][e[59]].choices(),l=[];for(let t=0;t<i.length;t+=1)l[t]=Vt(Nt(e,i,t));function f(...t){return e[36](e[59],...t)}return{c(){n=u("select");for(let t=0;t<l.length;t+=1)l[t].c()},m(t,e){s(t,n,e);for(let t=0;t<l.length;t+=1)l[t].m(n,null);r||(o=p(n,"change",f),r=!0)},p(t,r){if(e=t,24576&r[0]){let t;for(i=e[14][e[59]].choices(),t=0;t<i.length;t+=1){const o=Nt(e,i,t);l[t]?l[t].p(o,r):(l[t]=Vt(o),l[t].c(),l[t].m(n,null))}for(;t<l.length;t+=1)l[t].d(1);l.length=i.length}},i:t,o:t,d(t){t&&a(n),c(l,t),r=!1,o()}}}function Xt(e){let n,r,o,i,c,f,v,y,b,w,_=e[14][e[59]].displayed+"";function k(...t){return e[35](e[59],...t)}return{c(){n=u("input"),f=d(),v=u("span"),y=h(_),g(n,"type","range"),g(n,"min",r=e[14][e[59]].min),g(n,"max",o=e[14][e[59]].max),g(n,"step",i=e[14][e[59]].step||1),n.value=c=e[14][e[59]].value,g(v,"class","current-value")},m(t,e){s(t,n,e),s(t,f,e),s(t,v,e),l(v,y),b||(w=p(n,"change",k),b=!0)},p(t,l){e=t,24576&l[0]&&r!==(r=e[14][e[59]].min)&&g(n,"min",r),24576&l[0]&&o!==(o=e[14][e[59]].max)&&g(n,"max",o),24576&l[0]&&i!==(i=e[14][e[59]].step||1)&&g(n,"step",i),24576&l[0]&&c!==(c=e[14][e[59]].value)&&(n.value=c),24576&l[0]&&_!==(_=e[14][e[59]].displayed+"")&&m(y,_)},i:t,o:t,d(t){t&&a(n),t&&a(f),t&&a(v),b=!1,w()}}}function Vt(t){let e,n,r,o,i=t[62]+"";return{c(){e=u("option"),n=h(i),e.selected=r=t[62]==t[14][t[59]].value||null,e.__value=o=" "+t[62]+" ",e.value=e.__value},m(t,r){s(t,e,r),l(e,n)},p(t,l){24576&l[0]&&i!==(i=t[62]+"")&&m(n,i),24576&l[0]&&r!==(r=t[62]==t[14][t[59]].value||null)&&(e.selected=r),24576&l[0]&&o!==(o=" "+t[62]+" ")&&(e.__value=o,e.value=e.__value)},d(t){t&&a(e)}}}function Jt(t){let e,n,r,o,i;function c(t,e){return t[58].props.length>1?Ut:qt}let f=c(t),h=f(t);const p=[Xt,Yt,Wt],m=[];function v(t,e){return"slider"===t[57]?0:"select"==t[57]?1:"color"==t[57]?2:-1}return~(r=v(t))&&(o=m[r]=p[r](t)),{c(){e=u("div"),h.c(),n=d(),o&&o.c(),g(e,"class","prop-section")},m(t,o){s(t,e,o),h.m(e,null),l(e,n),~r&&m[r].m(e,null),i=!0},p(t,i){f===(f=c(t))&&h?h.p(t,i):(h.d(1),h=f(t),h&&(h.c(),h.m(e,n)));let l=r;r=v(t),r===l?~r&&m[r].p(t,i):(o&&(R(),F(m[l],1,1,(()=>{m[l]=null})),B()),~r?(o=m[r],o?o.p(t,i):(o=m[r]=p[r](t),o.c()),I(o,1),o.m(e,null)):o=null)},i(t){i||(I(o),i=!0)},o(t){F(o),i=!1},d(t){t&&a(e),h.d(),~r&&m[r].d()}}}function Zt(t){let e,n,r;return{c(){e=u("div"),e.textContent="Bring to front",g(e,"class","btn"),v(e,"active",!0===t[15][t[4]])},m(o,i){s(o,e,i),n||(r=p(e,"click",t[18]),n=!0)},p(t,n){32784&n[0]&&v(e,"active",!0===t[15][t[4]])},d(t){t&&a(e),n=!1,r()}}}function Kt(t){let e,n,o,i,h,m,v,y,b,w,_,k,$,S,x,C,M,E,L,T,A,N,H,O,D=t[1].length>1&&Rt(t),P=oe(t[2][t[4]]),G=[];for(let e=0;e<P.length;e+=1)G[e]=It(Dt(t,P,e));let j=t[3][t[4]]||[],q=[];for(let e=0;e<j.length;e+=1)q[e]=Gt(Ot(t,j,e));let U=t[3][t[4]]&&jt(t);return{c(){e=u("div"),n=d(),o=f("svg"),i=f("clipPath"),h=f("path"),m=f("rect"),b=d(),w=u("div"),_=u("div"),_.textContent="x",k=d(),D&&D.c(),$=d(),S=u("div"),x=u("b"),x.textContent="Rule:",C=d();for(let t=0;t<G.length;t+=1)G[t].c();M=d(),E=u("div"),L=u("b"),L.textContent="Property type:",T=d();for(let t=0;t<q.length;t+=1)q[t].c();var r,l,s,a;A=d(),U&&U.c(),r=e,l="position",null===(s="absolute")?r.style.removeProperty(l):r.style.setProperty(l,s,a?"important":""),g(h,"d",t[11]),g(i,"id","overlay-clip"),g(i,"clip-rule","evenodd"),g(m,"y","0"),g(m,"x","0"),g(m,"height","100%"),g(m,"width","100%"),g(m,"class","overlay-over"),g(o,"class","ise-helper-wrapper"),g(o,"version","1.1"),g(o,"xmlns","http://www.w3.org/2000/svg"),g(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),g(o,"width",v=t[12].width),g(o,"height",y=t[12].height),g(_,"class","close-button"),g(S,"class","select-tab"),g(E,"class","select-tab"),g(w,"class","ise")},m(r,a){s(r,e,a),t[29](e),s(r,n,a),s(r,o,a),l(o,i),l(i,h),l(o,m),t[30](o),s(r,b,a),s(r,w,a),l(w,_),l(w,k),D&&D.m(w,null),l(w,$),l(w,S),l(S,x),l(S,C);for(let t=0;t<G.length;t+=1)G[t].m(S,null);l(w,M),l(w,E),l(E,L),l(E,T);for(let t=0;t<q.length;t+=1)q[t].m(E,null);l(w,A),U&&U.m(w,null),t[38](w),N=!0,H||(O=[p(o,"click",t[16]),p(_,"click",t[0])],H=!0)},p(t,e){if((!N||2048&e[0])&&g(h,"d",t[11]),(!N||4096&e[0]&&v!==(v=t[12].width))&&g(o,"width",v),(!N||4096&e[0]&&y!==(y=t[12].height))&&g(o,"height",y),t[1].length>1?D?D.p(t,e):(D=Rt(t),D.c(),D.m(w,$)):D&&(D.d(1),D=null),524340&e[0]){let n;for(P=oe(t[2][t[4]]),n=0;n<P.length;n+=1){const r=Dt(t,P,n);G[n]?G[n].p(r,e):(G[n]=It(r),G[n].c(),G[n].m(S,null))}for(;n<G.length;n+=1)G[n].d(1);G.length=P.length}if(216&e[0]){let n;for(j=t[3][t[4]]||[],n=0;n<j.length;n+=1){const r=Ot(t,j,n);q[n]?q[n].p(r,e):(q[n]=Gt(r),q[n].c(),q[n].m(E,null))}for(;n<q.length;n+=1)q[n].d(1);q.length=j.length}t[3][t[4]]?U?(U.p(t,e),24&e[0]&&I(U,1)):(U=jt(t),U.c(),I(U,1),U.m(w,null)):U&&(R(),F(U,1,1,(()=>{U=null})),B())},i(t){N||(I(U),N=!0)},o(t){F(U),N=!1},d(i){i&&a(e),t[29](null),i&&a(n),i&&a(o),t[30](null),i&&a(b),i&&a(w),D&&D.d(),c(G,i),c(q,i),U&&U.d(),t[38](null),H=!1,r(O)}}}const Qt="text",te="border",ee="stroke",ne="background",re="custom";function oe(t){return t?t.map(((t,e)=>{if("inline"===t)return"inline";const n=t.selectorText;return`${t.parentStyleSheet.title||`${e}`}: ${n}`})):[]}function ie(t,e=0){const n=t.getBoundingClientRect();return{left:n.left+window.scrollX-e,top:n.top+window.scrollY-e,width:n.width+2*e,height:n.height+2*e,right:n.left+window.scrollX+n.width+e,bottom:n.top+window.scrollY+n.height+e}}function le(t,e="number"){return"raw"==e?t:"number"==e&&/[0-9]+(px)|(em)|(rem)/.test(t)?parseInt(t):"rgb"!=e||!t.includes("rgb")&&"#"!=t[0]?t:function(t){const e=t.match(/[0-9\.]+/g).map((t=>parseFloat(t)));return 3===e.length&&e.push(1),e.reduce(((t,e,n)=>t+(3===n?Math.round(255*e).toString(16).padStart(2,"0"):e.toString(16).padStart(2,"0"))),"#")}(t)}function se(t,e,n){let r,o;const i=["altGlyph","circle","ellipse","line","path","polygon","polyline","rect","text","textPath","tref","tspan"],l={"border-radius":{type:"slider",min:0,max:30,suffix:"px"},"border-width":{type:"slider",min:0,max:30,suffix:"px"},"border-style":{type:"select",choices:()=>["none","dotted","dashed","solid","double","groove","ridge","inset","outset"]},"border-color":{type:"color"},"font-family":{type:"select",choices:function(){return function(){const t=new Set;for(const e of Tt.values())document.fonts.check(`12px "${e}"`)&&t.add(e);return[...t.values()]}()}},"font-size":{type:"slider",min:0,max:30,suffix:"px"},"font-weight":{type:"slider",min:0,max:500},color:{type:"color"},"stroke-width":{type:"slider",min:0,max:30,suffix:"px"},stroke:{type:"color"},fill:{type:"color"},"stroke-dasharray":{type:"slider",min:0,max:30,suffix:"px"},"background-color":{type:"color"}};let{getAdditionalElems:s=(()=>[])}=e,{listenOnClick:a=!1}=e,{onStyleChanged:c=(()=>{})}=e,{customProps:u={}}=e;const f={[Qt]:["font-family","font-size","font-weight","color"],[te]:["border-radius","border-width","border-color","border-style"],[ee]:["stroke-width","stroke","stroke-dasharray","fill"],[ne]:["background-color"],[re]:Object.keys(u)};let h,d,p,g,m,v=null,y="",b={width:0,height:0},w=[],$=[],x=[],C=0,E=0,T=0,A={},N=[];_((()=>{P(),n(26,v=d.parentNode),document.body.appendChild(d),document.body.appendChild(p),document.body.appendChild(h),G(),setTimeout((()=>{G()}),1e3),window.addEventListener("resize",G)})),k((()=>{window.removeEventListener("resize",G),a&&v.removeEventListener("click",getTargetsAndRules)}));let H=new Set;function O(t){D(t.target,t.pageX,t.pageY)}function D(t,e,r){if(t.classList.contains("overlay-over"))return R();if(!d.contains(t))if(n(4,C=0),n(5,E=0),n(6,T=0),n(15,N=[]),n(3,x=[]),n(2,$=[]),n(1,w=[t,...s(t)]),n(3,x=w.reduce(((t,e)=>{const n=[];e.firstChild&&3===e.firstChild.nodeType&&n.push(Qt);const r=e.tagName.toLowerCase();let o=!1;return i.includes(r)?(n.push(ee),"g"===e.parentElement.tagName.toLowerCase()&&e.previousElementSibling&&e.previousElementSibling.tagName.toLowerCase()==r&&(o=!0)):(n.push(te),n.push(ne)),o?N.push(!0):N.push(null),t.push(n),t}),[])),n(2,$=function(t){const e=document.styleSheets;return t.reduce(((t,n)=>{const r=["inline"];for(let t in e)try{const o=e[t].cssRules;for(let t in o){const e=o[t].selectorText;!e||o[t].selectorText.length>50||e.split(",").some((t=>"*"===t))||n.matches(e)&&r.push(o[t])}}catch(n){H.has(t)||(console.log("Style editor: Not able to access",e[t].ownerNode,"sheet. Try CORS loading the sheet if you want to edit it."),H.add(t))}return t.push(r),t}),[])}(w)),Object.keys(u).length&&x[0].push(re),e&&r)B(e,r);else{const e=ie(t,15);B(e.left,e.top)}}function P(){n(9,d.style.display="none",d),n(10,p.style.display="none",p),n(11,y="")}function R(){P()}function B(t,e){t=t+260>b.width?b.width-300:t+10,e=e+410>b.height?b.height-450:e+10,n(9,d.style.left=t+"px",d),n(9,d.style.top=e+"px",d),n(10,p.style.display="block",p),n(9,d.style.display="block",d)}function I(){if(!o)return;let t;if("inline"===o)t=[r];else{const e=o.selectorText.replace(/(:hover)|:focus/g,"");t=Array.from(document.querySelectorAll(e))}const e=t.map((t=>ie(t,10)));n(11,y=function(t,e){let n=function({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} v${e} h${t} v-${e}z`}({width:e.width,height:e.height});if(t.length<10&&!function(t){for(let r=0;r<t.length-1;++r){const o=t[r];for(let i=r+1;i<t.length;++i)if(e=o,n=t[i],e.right>=n.left&&n.right>=e.left&&e.bottom>=n.top&&n.bottom>=e.top)return!0}var e,n;return!1}(t)){for(const e of t)n=`${n} ${ft(e)}`;return n}const r=Math.min(...t.map((t=>t.left))),o=Math.min(...t.map((t=>t.top))),i=t.map((t=>(t.left=t.left-r,t.right=t.right-r,t.top=t.top-o,t.bottom=t.bottom-o,t)));i.sort(((t,e)=>t.left>e.left?1:t.left<e.left?-1:0));const l=Math.ceil(Math.max(...i.map((t=>t.right)))),s=Math.ceil(Math.max(...i.map((t=>t.bottom)))),a=l*s/2e4,c=Math.ceil(l/a),u=Math.ceil(s/a),f=l/c,h=s/u,d=new Array(c*u);for(let t=0,e=0;t<u;++t)for(let n=0;n<c;++n,++e)d[e]=ut({x:n*a,y:t*a},i)?1:0;const p=at().size([c,u]).thresholds([1])(d)[0];let g="";for(let t of p.coordinates)for(let e of t){for(let t=0;t<e.length;++t){const n=e[t],i=n[0]*f+r,l=n[1]*h+o;g+=t?`L ${i} ${l}`:`M${i} ${l}`}g+="Z"}return`${n} ${g}`}(e,b))}const F=function(t,e,n=!1){let r;return function(){const o=this,i=arguments,l=function(){r=null,n||t.apply(o,i)},s=n&&!r;clearTimeout(r),r=setTimeout(l,e),s&&t.apply(o,i)}}((function(t,e,i){const l=i?e+i:e;if("inline"===o)if(A[t].setter)A[t].setter(r,e);else{r.style[t]=l}else o.style.setProperty(t,l);n(14,A[t].value=e,A),n(14,A[t].displayed=l,A),c(r,o,t,l),I()}),100);function G(){const t=getComputedStyle(document.body),e=parseInt(t.marginLeft),r=parseInt(t.marginRight),o=parseInt(t.marginTop),i=parseInt(t.marginBottom);n(12,b={width:document.body.offsetWidth+e+r,height:document.body.offsetHeight+o+i})}function j(t,e,n="number"){let r=o?.style?.[e];if(!r){r=getComputedStyle(t)[e]}return le(r,n)}function q(t){const e=$[C]?.[t];"inline"!==e&&T===x[C].length-1&&n(6,T=0),n(5,E=t)}return t.$$set=t=>{"getAdditionalElems"in t&&n(20,s=t.getAdditionalElems),"listenOnClick"in t&&n(21,a=t.listenOnClick),"onStyleChanged"in t&&n(22,c=t.onStyleChanged),"customProps"in t&&n(23,u=t.customProps)},t.$$.update=()=>{if(67108864&t.$$.dirty[0]&&null!==v&&a&&v.addEventListener("click",O),18&t.$$.dirty[0]&&n(28,r=w[C]),52&t.$$.dirty[0]&&n(7,o=$[C]?.[E]),134217816&t.$$.dirty[0]&&x[C]?.[T]!==m&&n(27,m=x[C]?.[T]),411041920&t.$$.dirty[0]&&m&&o){const t={...l,...u},o=(e=t,f[m].reduce(((t,n)=>(t[n]=e[n],t)),{}));Object.keys(o).forEach((t=>{const e=o[t].type;let n="number";if("color"===e?n="rgb":"select"===e&&(n="raw"),o[t].getter){const e=o[t].getter(r);if(null===e)return void delete o[t];o[t].value=e,o[t].displayed=e}else o[t].displayed=j(r,t,"raw"),o[t].value=j(r,t,n)})),n(13,g=Object.entries(o).reduce(((t,[e,n])=>{const r=n.type;return r in t?t[r].props.push(e):t[r]={selected:0,props:[e]},t}),{})),n(14,A=o)}var e},[P,w,$,x,C,E,T,o,h,d,p,y,b,g,A,N,R,F,function(){n(15,N[C]=!1,N),r.parentNode.appendChild(r)},q,s,a,c,u,D,function(){return"block"===d.style.display},v,m,r,function(t){S[t?"unshift":"push"]((()=>{h=t,n(8,h)}))},function(t){S[t?"unshift":"push"]((()=>{p=t,n(10,p)}))},t=>{n(4,C=t),n(5,E=0)},t=>{q(t)},t=>{n(6,T=t)},async(t,e,r,o)=>{n(13,e[r][1].selected=o.target.value,g),await(L(),M)},(t,e)=>F(t,e.target.value,A[t].suffix,e.target),(t,e)=>F(t,e.target.value),(t,e)=>F(t,e),function(t){S[t?"unshift":"push"]((()=>{d=t,n(9,d)}))}]}var ae=class extends U{constructor(t){super(),q(this,t,se,Kt,i,{getAdditionalElems:20,listenOnClick:21,onStyleChanged:22,customProps:23,open:24,close:0,isOpened:25},null,[-1,-1,-1])}get open(){return this.$$.ctx[24]}get close(){return this.$$.ctx[0]}get isOpened(){return this.$$.ctx[25]}};return class{constructor(t){return new ae({target:document.body,props:t})}}}));