UNPKG

inline-style-editor

Version:

Update CSS rules or add inline style to elements visualy

9 lines 61.2 kB
!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";var t=!1,e=Array.isArray,n=Array.prototype.indexOf,r=Array.from,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,a=Object.prototype,s=Array.prototype,u=Object.getPrototypeOf,c=Object.isExtensible;function f(t){for(var e=0;e<t.length;e++)t[e]()}const d=32,h=64,v=128,p=256,g=512,m=1024,y=2048,b=4096,w=8192,_=16384,x=65536,k=1<<20,S=1<<21,C=Symbol("$state"),M=Symbol("legacy props"),E=Symbol("");function L(t){return t===this.v}function T(t){return e=t,n=this.v,!(e!=e?n==n:e!==n||null!==e&&"object"==typeof e||"function"==typeof e);var e,n}const A=Symbol();function N(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let $=null;function O(t){$=t}function B(t,e=!1,n){var r=$={p:$,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};!function(t){const e=st(8,null,!1);he(e,m),e.teardown=t}((()=>{r.d=!0}))}function D(t){const e=$;if(null!==e){void 0!==t&&(e.x=t);const l=e.e;if(null!==l){var n=It,r=Pt;e.e=null;try{for(var i=0;i<l.length;i++){var o=l[i];jt(o.effect),Rt(o.reaction),ct(o.fn)}}finally{jt(n),Rt(r)}}$=e.p,e.m=!0}return t||{}}function P(t){if("object"!=typeof t||null===t||C in t)return t;const n=u(t);if(n!==a&&n!==s)return t;var r=new Map,i=e(t),l=W(0),c=Pt,f=t=>{var e=Pt;Rt(c);var n=t();return Rt(e),n};return i&&r.set("length",W(t.length)),new Proxy(t,{defineProperty(t,e,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var i=r.get(e);return void 0===i?(i=f((()=>W(n.value))),r.set(e,i)):Y(i,f((()=>P(n.value)))),!0},deleteProperty(t,e){var n=r.get(e);if(void 0===n)e in t&&(r.set(e,f((()=>W(A)))),H(l));else{if(i&&"string"==typeof e){var o=r.get("length"),a=Number(e);Number.isInteger(a)&&a<o.v&&Y(o,a)}Y(n,A),H(l)}return!0},get(e,n,i){if(n===C)return t;var l=r.get(n),a=n in e;if(void 0!==l||a&&!o(e,n)?.writable||(l=f((()=>W(P(a?e[n]:A)))),r.set(n,l)),void 0!==l){var s=ce(l);return s===A?void 0:s}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n&&"value"in n){var i=r.get(e);i&&(n.value=ce(i))}else if(void 0===n){var o=r.get(e),l=o?.v;if(void 0!==o&&l!==A)return{enumerable:!0,configurable:!0,value:l,writable:!0}}return n},has(t,e){if(e===C)return!0;var n=r.get(e),i=void 0!==n&&n.v!==A||Reflect.has(t,e);if((void 0!==n||null!==It&&(!i||o(t,e)?.writable))&&(void 0===n&&(n=f((()=>W(i?P(t[e]):A))),r.set(e,n)),ce(n)===A))return!1;return i},set(t,e,n,a){var s=r.get(e),u=e in t;if(i&&"length"===e)for(var c=n;c<s.v;c+=1){var d=r.get(c+"");void 0!==d?Y(d,A):c in t&&(d=f((()=>W(A))),r.set(c+"",d))}void 0===s?u&&!o(t,e)?.writable||(Y(s=f((()=>W(void 0))),f((()=>P(n)))),r.set(e,s)):(u=s.v!==A,Y(s,f((()=>P(n)))));var h=Reflect.getOwnPropertyDescriptor(t,e);if(h?.set&&h.set.call(a,n),!u){if(i&&"string"==typeof e){var v=r.get("length"),p=Number(e);Number.isInteger(p)&&p>=v.v&&Y(v,p+1)}H(l)}return!0},ownKeys(t){ce(l);var e=Reflect.ownKeys(t).filter((t=>{var e=r.get(t);return void 0===e||e.v!==A}));for(var[n,i]of r)i.v===A||n in t||e.push(n);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function H(t,e=1){Y(t,t.v+e)}function R(t){try{if(null!==t&&"object"==typeof t&&C in t)return t[C]}catch{}return t}function I(t){var e=2050,n=null!==Pt&&2&Pt.f?Pt:null;null===It||null!==n&&0!==(n.f&p)?e|=p:It.f|=k;return{ctx:$,deps:null,effects:null,equals:L,f:e,fn:t,reactions:null,rv:0,v:null,wv:0,parent:n??It}}function j(t){const e=I(t);return qt(e),e}function F(t){var e=t.effects;if(null!==e){t.effects=null;for(var n=0;n<e.length;n+=1)gt(e[n])}}function q(t){var e,n=It;jt(function(t){for(var e=t.parent;null!==e;){if(!(2&e.f))return e;e=e.parent}return null}(t));try{F(t),e=te(t)}finally{jt(n)}return e}function U(t){var e=q(t);(t.equals(e)||(t.v=e,t.wv=Xt()),Ot)||he(t,!Yt&&0===(t.f&p)||null===t.deps?m:b)}const G=new Map;function z(t,e){return{f:0,v:t,reactions:null,equals:L,rv:0,wv:0}}function W(t,e){const n=z(t);return qt(n),n}function V(t,e=!1){const n=z(t);return e||(n.equals=T),n}function Y(t,e,n=!1){return null!==Pt&&!Ht&&18&Pt.f&&!Ft?.includes(t)&&function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),X(t,n?P(e):e)}function X(t,e){if(!t.equals(e)){var n=t.v;Ot?G.set(t,e):G.set(t,n),t.v=e,2&t.f&&(0!==(t.f&y)&&q(t),he(t,0===(t.f&p)?m:b)),t.wv=Xt(),J(t,y),null===It||0===(It.f&m)||96&It.f||(null===zt?function(t){zt=t}([t]):zt.push(t))}return e}function J(t,e){var n=t.reactions;if(null!==n)for(var r=n.length,i=0;i<r;i++){var o=n[i],l=o.f;0===(l&y)&&(he(o,e),1280&l&&(2&l?J(o,b):ae(o)))}}var K,Z,Q,tt;function et(t=""){return document.createTextNode(t)}function nt(t){return Q.call(t)}function rt(t){return tt.call(t)}function it(t,e){return nt(t)}function ot(t,e){var n=nt(t);return n instanceof Comment&&""===n.data?rt(n):n}function lt(t,e=1,n=!1){let r=t;for(;e--;)r=rt(r);return r}function at(t){null===It&&null===Pt&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),null!==Pt&&0!==(Pt.f&p)&&null===It&&function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}(),Ot&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function st(t,e,n,r=!0){var i=It,o={ctx:$,deps:null,nodes_start:null,nodes_end:null,f:t|y,first:null,fn:e,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(n)try{re(o),o.f|=32768}catch(t){throw gt(o),t}else null!==e&&ae(o);if(!(n&&null===o.deps&&null===o.first&&null===o.nodes_start&&null===o.teardown&&!(1048704&o.f))&&r&&(null!==i&&function(t,e){var n=e.last;null===n?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}(o,i),null!==Pt&&2&Pt.f)){var l=Pt;(l.effects??=[]).push(o)}return o}function ut(t){if(at(),!(null!==It&&0!==(It.f&d)&&null!==$&&!$.m))return ct(t);var e=$;(e.e??=[]).push({fn:t,effect:It,reaction:Pt})}function ct(t){return st(4,t,!1)}function ft(t,e=[],n=I){const r=e.map(n);return dt((()=>t(...r.map(ce))))}function dt(t,e=0){return st(24|e,t,!0)}function ht(t,e=!0){return st(40,t,!0,e)}function vt(t){var e=t.teardown;if(null!==e){const t=Ot,n=Pt;Bt(!0),Rt(null);try{e.call(null)}finally{Bt(t),Rt(n)}}}function pt(t,e=!1){var n=t.first;for(t.first=t.last=null;null!==n;){var r=n.next;0!==(n.f&h)?n.parent=null:gt(n,e),n=r}}function gt(t,e=!0){var n=!1;(e||524288&t.f)&&null!==t.nodes_start&&(mt(t.nodes_start,t.nodes_end),n=!0),pt(t,e&&!n),ne(t,0),he(t,_);var r=t.transitions;if(null!==r)for(const t of r)t.stop();vt(t);var i=t.parent;null!==i&&null!==i.first&&yt(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=null}function mt(t,e){for(;null!==t;){var n=t===e?null:rt(t);t.remove(),t=n}}function yt(t){var e=t.parent,n=t.prev,r=t.next;null!==n&&(n.next=r),null!==r&&(r.prev=n),null!==e&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function bt(t,e){var n=[];_t(t,n,!0),wt(n,(()=>{gt(t),e&&e()}))}function wt(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var i of t)i.out(r)}else e()}function _t(t,e,n){if(0===(t.f&w)){if(t.f^=w,null!==t.transitions)for(const r of t.transitions)(r.is_global||n)&&e.push(r);for(var r=t.first;null!==r;){var i=r.next;_t(r,e,!!(0!==(r.f&x)||0!==(r.f&d))&&n),r=i}}}function xt(t){kt(t,!0)}function kt(t,e){if(0!==(t.f&w)){t.f^=w,0===(t.f&m)&&(t.f^=m),Jt(t)&&(he(t,y),ae(t));for(var n=t.first;null!==n;){var r=n.next;kt(n,!!(0!==(n.f&x)||0!==(n.f&d))&&e),n=r}if(null!==t.transitions)for(const n of t.transitions)(n.is_global||e)&&n.in()}}let St=[],Ct=[];function Mt(){var t=St;St=[],f(t)}function Et(t){0===St.length&&queueMicrotask(Mt),St.push(t)}function Lt(){var t;St.length>0&&Mt(),Ct.length>0&&(t=Ct,Ct=[],f(t))}let Tt=!1,At=!1,Nt=null,$t=!1,Ot=!1;function Bt(t){Ot=t}let Dt=[],Pt=null,Ht=!1;function Rt(t){Pt=t}let It=null;function jt(t){It=t}let Ft=null;function qt(t){null!==Pt&&Pt.f&S&&(null===Ft?Ft=[t]:Ft.push(t))}let Ut=null,Gt=0,zt=null;let Wt=1,Vt=0,Yt=!1;function Xt(){return++Wt}function Jt(t){var e=t.f;if(0!==(e&y))return!0;if(0!==(e&b)){var n=t.deps,r=0!==(e&p);if(null!==n){var i,o,l=0!==(e&g),a=r&&null!==It&&!Yt,s=n.length;if(l||a){var u=t,c=u.parent;for(i=0;i<s;i++)o=n[i],!l&&o?.reactions?.includes(u)||(o.reactions??=[]).push(u);l&&(u.f^=g),a&&null!==c&&0===(c.f&p)&&(u.f^=p)}for(i=0;i<s;i++)if(Jt(o=n[i])&&U(o),o.wv>t.wv)return!0}r&&(null===It||Yt)||he(t,m)}return!1}function Kt(t){return 0===(t.f&_)&&(null===t.parent||0===(t.parent.f&v))}function Zt(t,e,n,r){if(Tt){if(null===n&&(Tt=!1),Kt(e))throw t}else if(null!==n&&(Tt=!0),function(t,e){for(var n=e;null!==n;){if(0!==(n.f&v))try{return void n.fn(t)}catch{n.f^=v}n=n.parent}throw Tt=!1,t}(t,e),Kt(e))throw t}function Qt(t,e,n=!0){var r=t.reactions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];Ft?.includes(t)||(2&o.f?Qt(o,e,!1):e===o&&(n?he(o,y):0!==(o.f&m)&&he(o,b),ae(o)))}}function te(t){var e=Ut,n=Gt,r=zt,i=Pt,o=Yt,l=Ft,a=$,s=Ht,u=t.f;Ut=null,Gt=0,zt=null,Yt=0!==(u&p)&&(Ht||!$t||null===Pt),Pt=96&u?null:t,Ft=null,O(t.ctx),Ht=!1,Vt++,t.f|=S;try{var c=(0,t.fn)(),f=t.deps;if(null!==Ut){var d;if(ne(t,Gt),null!==f&&Gt>0)for(f.length=Gt+Ut.length,d=0;d<Ut.length;d++)f[Gt+d]=Ut[d];else t.deps=f=Ut;if(!Yt)for(d=Gt;d<f.length;d++)(f[d].reactions??=[]).push(t)}else null!==f&&Gt<f.length&&(ne(t,Gt),f.length=Gt);if(!(null===zt||Ht||null===f||6146&t.f))for(d=0;d<zt.length;d++)Qt(zt[d],t);return null!==i&&i!==t&&(Vt++,null!==zt&&(null===r?r=zt:r.push(...zt))),c}finally{Ut=e,Gt=n,zt=r,Pt=i,Yt=o,Ft=l,O(a),Ht=s,t.f^=S}}function ee(t,e){let r=e.reactions;if(null!==r){var i=n.call(r,t);if(-1!==i){var o=r.length-1;0===o?r=e.reactions=null:(r[i]=r[o],r.pop())}}null===r&&2&e.f&&(null===Ut||!Ut.includes(e))&&(he(e,b),768&e.f||(e.f^=g),F(e),ne(e,0))}function ne(t,e){var n=t.deps;if(null!==n)for(var r=e;r<n.length;r++)ee(t,n[r])}function re(e){var n=e.f;if(0===(n&_)){he(e,m);var r=It,i=$,o=$t;It=e,$t=!0;try{16&n?function(t){for(var e=t.first;null!==e;){var n=e.next;0===(e.f&d)&&gt(e),e=n}}(e):pt(e),vt(e);var l=te(e);e.teardown="function"==typeof l?l:null,e.wv=Wt;e.deps;t}catch(t){Zt(t,e,r,i||e.ctx)}finally{$t=o,It=r}}}function ie(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){if(null===Nt)throw t;Zt(t,Nt,null)}}function oe(){var t=$t;try{var e=0;for($t=!0;Dt.length>0;){e++>1e3&&ie();var n=Dt,r=n.length;Dt=[];for(var i=0;i<r;i++){le(se(n[i]))}G.clear()}}finally{At=!1,$t=t,Nt=null}}function le(t){var e=t.length;if(0!==e)for(var n=0;n<e;n++){var r=t[n];if(!(24576&r.f))try{Jt(r)&&(re(r),null===r.deps&&null===r.first&&null===r.nodes_start&&(null===r.teardown?yt(r):r.fn=null))}catch(t){Zt(t,r,null,r.ctx)}}}function ae(t){At||(At=!0,queueMicrotask(oe));for(var e=Nt=t;null!==e.parent;){var n=(e=e.parent).f;if(96&n){if(0===(n&m))return;e.f^=m}}Dt.push(e)}function se(t){for(var e=[],n=t;null!==n;){var r=n.f,i=!!(96&r);if(!(i&&0!==(r&m))&&0===(r&w)){if(4&r)e.push(n);else if(i)n.f^=m;else try{Jt(n)&&re(n)}catch(t){Zt(t,n,null,n.ctx)}var o=n.first;if(null!==o){n=o;continue}}var l=n.parent;for(n=n.next;null===n&&null!==l;)n=l.next,l=l.parent}return e}async function ue(){await Promise.resolve(),function(){for(;;){if(Lt(),0===Dt.length)return;At=!0,oe()}}()}function ce(t){var e=!!(2&t.f);if(null===Pt||Ht){if(e&&null===t.deps&&null===t.effects){var n=t,r=n.parent;null!==r&&0===(r.f&p)&&(n.f^=p)}}else if(!Ft?.includes(t)){var i=Pt.deps;t.rv<Vt&&(t.rv=Vt,null===Ut&&null!==i&&i[Gt]===t?Gt++:null===Ut?Ut=[t]:Yt&&Ut.includes(t)||Ut.push(t))}return e&&Jt(n=t)&&U(n),Ot&&G.has(t)?G.get(t):t.v}function fe(t){var e=Ht;try{return Ht=!0,t()}finally{Ht=e}}const de=-7169;function he(t,e){t.f=t.f&de|e}const ve=["touchstart","touchmove"];function pe(t){return ve.includes(t)}const ge=new Set,me=new Set;function ye(t){var n=this,r=n.ownerDocument,o=t.type,l=t.composedPath?.()||[],a=l[0]||t.target,s=0,u=t.__root;if(u){var c=l.indexOf(u);if(-1!==c&&(n===document||n===window))return void(t.__root=n);var f=l.indexOf(n);if(-1===f)return;c<=f&&(s=c)}if((a=l[s]||t.target)!==n){i(t,"currentTarget",{configurable:!0,get:()=>a||r});var d=Pt,h=It;Rt(null),jt(null);try{for(var v,p=[];null!==a;){var g=a.assignedSlot||a.parentNode||a.host||null;try{var m=a["__"+o];if(null!=m&&(!a.disabled||t.target===a))if(e(m)){var[y,...b]=m;y.apply(a,[t,...b])}else m.call(a,t)}catch(t){v?p.push(t):v=t}if(t.cancelBubble||g===n||null===g)break;a=g}if(v){for(let t of p)queueMicrotask((()=>{throw t}));throw v}}finally{t.__root=n,delete t.currentTarget,Rt(d),jt(h)}}}function be(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","\x3c!----\x3e"),e.content}function we(t,e){var n=It;null===n.nodes_start&&(n.nodes_start=t,n.nodes_end=e)}function _e(t,e){var n,r=!!(1&e),i=!!(2&e),o=!t.startsWith("<!>");return()=>{void 0===n&&(n=be(o?t:"<!>"+t),r||(n=nt(n)));var e=i||Z?document.importNode(n,!0):n.cloneNode(!0);r?we(nt(e),e.lastChild):we(e,e);return e}}function xe(){var t=document.createDocumentFragment(),e=document.createComment(""),n=et();return t.append(e,n),we(e,n),t}function ke(t,e){null!==t&&t.before(e)}function Se(t,e){var n=null==e?"":"object"==typeof e?e+"":e;n!==(t.__t??=t.nodeValue)&&(t.__t=n,t.nodeValue=n+"")}function Ce(t,e){return function(t,{target:e,anchor:n,props:i={},events:l,context:a,intro:s=!0}){!function(){if(void 0===K){K=window,Z=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Q=o(e,"firstChild").get,tt=o(e,"nextSibling").get,c(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),c(n)&&(n.__t=void 0)}}();var u=new Set,f=t=>{for(var n=0;n<t.length;n++){var r=t[n];if(!u.has(r)){u.add(r);var i=pe(r);e.addEventListener(r,ye,{passive:i});var o=Me.get(r);void 0===o?(document.addEventListener(r,ye,{passive:i}),Me.set(r,1)):Me.set(r,o+1)}}};f(r(ge)),me.add(f);var d=void 0,v=function(t){const e=st(h,t,!0);return(t={})=>new Promise((n=>{t.outro?bt(e,(()=>{gt(e),n(void 0)})):(gt(e),n(void 0))}))}((()=>{var r=n??e.appendChild(et());return ht((()=>{a&&(B({}),$.c=a);l&&(i.$$events=l),d=t(r,i)||{},a&&D()})),()=>{for(var t of u){e.removeEventListener(t,ye);var i=Me.get(t);0===--i?(document.removeEventListener(t,ye),Me.delete(t)):Me.set(t,i)}me.delete(f),r!==n&&r.parentNode?.removeChild(r)}}));return Ee.set(d,v),d}(t,e)}const Me=new Map;let Ee=new WeakMap;function Le(t,e,[n,r]=[0,0]){var i=t,o=null,l=null,a=A,s=!1;const u=(t,e=!0)=>{s=!0,c(e,t)},c=(t,e)=>{a!==(a=t)&&(a?(o?xt(o):e&&(o=ht((()=>e(i)))),l&&bt(l,(()=>{l=null}))):(l?xt(l):e&&(l=ht((()=>e(i,[n+1,r])))),o&&bt(o,(()=>{o=null}))))};dt((()=>{s=!1,e(u),s||c(null,null)}),n>0?x:0)}function Te(t,e){return e}function Ae(t,n,i,o,l,a=null){var s=t,u={flags:n,items:new Map,first:null};!(4&n)||(s=t.appendChild(et()));var c=null,f=!1,d=function(t){const e=I(t);return e.equals=T,e}((()=>{var t=i();return e(t)?t:null==t?[]:r(t)}));dt((()=>{var t=ce(d),e=t.length;f&&0===e||(f=0===e,function(t,e,n,i,o,l,a){var s,u,c,f,d,h,v=!!(8&o),p=!!(3&o),g=t.length,m=e.items,y=e.first,b=y,_=null,x=[],k=[];if(v)for(h=0;h<g;h+=1)f=l(c=t[h],h),void 0!==(d=m.get(f))&&(d.a?.measure(),(u??=new Set).add(d));for(h=0;h<g;h+=1)if(f=l(c=t[h],h),void 0!==(d=m.get(f))){if(p&&Ne(d,c,h,o),0!==(d.e.f&w)&&(xt(d.e),v&&(d.a?.unfix(),(u??=new Set).delete(d))),d!==b){if(void 0!==s&&s.has(d)){if(x.length<k.length){var S,C=k[0];_=C.prev;var M=x[0],E=x[x.length-1];for(S=0;S<x.length;S+=1)Oe(x[S],C,n);for(S=0;S<k.length;S+=1)s.delete(k[S]);Be(e,M.prev,E.next),Be(e,_,M),Be(e,E,C),b=C,_=E,h-=1,x=[],k=[]}else s.delete(d),Oe(d,b,n),Be(e,d.prev,d.next),Be(e,d,null===_?e.first:_.next),Be(e,_,d),_=d;continue}for(x=[],k=[];null!==b&&b.k!==f;)0===(b.e.f&w)&&(s??=new Set).add(b),k.push(b),b=b.next;if(null===b)continue;d=b}x.push(d),_=d,b=d.next}else{_=$e(b?b.e.nodes_start:n,e,_,null===_?e.first:_.next,c,f,h,i,o,a),m.set(f,_),x=[],k=[],b=_.next}if(null!==b||void 0!==s){for(var L=void 0===s?[]:r(s);null!==b;)0===(b.e.f&w)&&L.push(b),b=b.next;var T=L.length;if(T>0){var A=4&o&&0===g?n:null;if(v){for(h=0;h<T;h+=1)L[h].a?.measure();for(h=0;h<T;h+=1)L[h].a?.fix()}!function(t,e,n,r){for(var i=[],o=e.length,l=0;l<o;l++)_t(e[l].e,i,!0);var a=o>0&&0===i.length&&null!==n;if(a){var s=n.parentNode;s.textContent="",s.append(n),r.clear(),Be(t,e[0].prev,e[o-1].next)}wt(i,(()=>{for(var n=0;n<o;n++){var i=e[n];a||(r.delete(i.k),Be(t,i.prev,i.next)),gt(i.e,!a)}}))}(e,L,A,m)}}v&&Et((()=>{if(void 0!==u)for(d of u)d.a?.apply()}));It.first=e.first&&e.first.e,It.last=_&&_.e}(t,u,s,l,n,o,i),null!==a&&(0===e?c?xt(c):c=ht((()=>a(s))):null!==c&&bt(c,(()=>{c=null}))),ce(d))}))}function Ne(t,e,n,r){1&r&&X(t.v,e),2&r?X(t.i,n):t.i=n}function $e(t,e,n,r,i,o,l,a,s,u){var c=!!(1&s)?!(16&s)?V(i):z(i):i,f=2&s?z(l):l,d={i:f,v:c,k:o,a:null,e:null,prev:n,next:r};try{return d.e=ht((()=>a(t,c,f,u)),false),d.e.prev=n&&n.e,d.e.next=r&&r.e,null===n?e.first=d:(n.next=d,n.e.next=d.e),null!==r&&(r.prev=d,r.e.prev=d.e),d}finally{}}function Oe(t,e,n){for(var r=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,o=t.e.nodes_start;o!==r;){var l=rt(o);i.before(o),o=l}}function Be(t,e,n){null===e?t.first=n:(e.next=n,e.e.next=n&&n.e),null!==n&&(n.prev=e,n.e.prev=e&&e.e)}const De=[..." \t\n\r\f \v\ufeff"];function Pe(t,e,n,r,i,o){var l=t.__className;if(l!==n||void 0===l){var a=function(t,e,n){var r=null==t?"":""+t;if(e&&(r=r?r+" "+e:e),n)for(var i in n)if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,l=0;(l=r.indexOf(i,l))>=0;){var a=l+o;0!==l&&!De.includes(r[l-1])||a!==r.length&&!De.includes(r[a])?l=a:r=(0===l?"":r.substring(0,l))+r.substring(a+1)}return""===r?null:r}(n,r,o);null==a?t.removeAttribute("class"):t.className=a,t.__className=n}else if(o&&i!==o)for(var s in o){var u=!!o[s];null!=i&&u===!!i[s]||t.classList.toggle(s,u)}return o}function He(t,e,n,r){if(t.__style!==e){var i=function(t){return null==t?null:String(t)}(e);null==i?t.removeAttribute("style"):t.style.cssText=i,t.__style=e}return r}function Re(t,n,r){if(t.multiple){if(null==n)return;if(!e(n))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var i of t.options)i.selected=n.includes(Ie(i))}else{for(i of t.options){var o=Ie(i);if(l=o,a=n,Object.is(R(l),R(a)))return void(i.selected=!0)}var l,a;r&&void 0===n||(t.selectedIndex=-1)}}function Ie(t){return"__value"in t?t.__value:t.value}const je=Symbol("is custom element"),Fe=Symbol("is html");function qe(t,e,n,r){var i=Ue(t);i[e]!==(i[e]=n)&&("loading"===e&&(t[E]=n),null==n?t.removeAttribute(e):"string"!=typeof n&&function(t){var e,n=Ge.get(t.nodeName);if(n)return n;Ge.set(t.nodeName,n=[]);var r=t,i=Element.prototype;for(;i!==r;){for(var o in e=l(r))e[o].set&&n.push(o);r=u(r)}return n}(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Ue(t){return t.__attributes??={[je]:t.nodeName.includes("-"),[Fe]:"http://www.w3.org/1999/xhtml"===t.namespaceURI}}var Ge=new Map;function ze(t,e){return t===e||t?.[C]===e}function We(t={},e,n,r){return ct((()=>{var r,i;return st(8,(()=>{r=i,i=[],fe((()=>{t!==n(...i)&&(e(t,...i),r&&ze(n(...r),t)&&e(null,...r))}))}),!0),()=>{Et((()=>{i&&ze(n(...i),t)&&e(null,...i)}))}})),t}let Ve=!1;function Ye(t){return t.ctx?.d??!1}function Xe(t,e,n,r){var i,l=!!(1&n),a=!!(8&n),s=!!(16&n),u=!1;a?[i,u]=function(t){var e=Ve;try{return Ve=!1,[t(),Ve]}finally{Ve=e}}((()=>t[e])):i=t[e];var c,f=C in t||M in t,d=a&&(o(t,e)?.set??(f&&e in t&&(n=>t[e]=n)))||void 0,h=r,v=!0,p=!1,g=()=>(p=!0,v&&(v=!1,h=s?fe(r):r),h);if(void 0===i&&void 0!==r&&(d&&function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),i=g(),d&&d(i)),c=()=>{var n=t[e];return void 0===n?g():(v=!0,p=!1,n)},!(4&n))return c;if(d){var m=t.$$legacy;return function(t,e){return arguments.length>0?((!e||m||u)&&d(e?c():t),t):c()}}var y=!1,b=V(i),w=I((()=>{var t=c(),e=ce(b);return y?(y=!1,e):b.v=t}));return a&&ce(w),l||(w.equals=T),function(t,e){if(arguments.length>0){const n=e?ce(w):a?P(t):t;if(!w.equals(n)){if(y=!0,Y(b,n),p&&void 0!==h&&(h=n),Ye(w))return t;fe((()=>ce(w)))}return t}return Ye(w)?w.v:ce(w)}}function Je(t){null===$&&N(),ut((()=>{const e=fe(t);if("function"==typeof e)return e}))}function Ke(t){null===$&&N(),Je((()=>()=>fe(t)))}function Ze(t){return t[0].toUpperCase()+t.slice(1)}function Qe(t){return Ze(t.replace(/-/g," ").trim().toLowerCase())}"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");const tn=Math.sqrt(50),en=Math.sqrt(10),nn=Math.sqrt(2);function rn(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),l=o>=tn?10:o>=en?5:o>=nn?2:1;let a,s,u;return i<0?(u=Math.pow(10,-i)/l,a=Math.round(t*u),s=Math.round(e*u),a/u<t&&++a,s/u>e&&--s,u=-u):(u=Math.pow(10,i)*l,a=Math.round(t/u),s=Math.round(e/u),a*u<t&&++a,s*u>e&&--s),s<a&&.5<=n&&n<2?rn(t,e,2*n):[a,s,u]}function on(t,e,n){return rn(t=+t,e=+e,n=+n)[2]}function ln(t){return Math.max(1,Math.ceil(Math.log(function(t){let e=0;for(let n of t)null!=n&&(n=+n)>=n&&++e;return e}(t))/Math.LN2)+1)}var an=Array.prototype.slice;function sn(t,e){return t-e}var un=t=>()=>t;function cn(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=fn(t,e[r]))return n;return 0}function fn(t,e){for(var n=e[0],r=e[1],i=-1,o=0,l=t.length,a=l-1;o<l;a=o++){var s=t[o],u=s[0],c=s[1],f=t[a],d=f[0],h=f[1];if(dn(s,f,e))return 0;c>r!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(i=-i)}return i}function dn(t,e,n){var r,i,o,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)&&(i=t[r=+(t[0]===e[0])],o=n[r],l=e[r],i<=o&&o<=l||l<=o&&o<=i)}function hn(){}var vn=[[],[[[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 pn(){var t=1,e=1,n=ln,r=a;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(sn);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 i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}(t,gn);for(e=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,o,l]=r?rn(e,t,n):rn(t,e,n);if(!(o>=i))return[];const a=o-i+1,s=new Array(a);if(r)if(l<0)for(let t=0;t<a;++t)s[t]=(o-t)/-l;else for(let t=0;t<a;++t)s[t]=(o-t)*l;else if(l<0)for(let t=0;t<a;++t)s[t]=(i+t)/-l;else for(let t=0;t<a;++t)s[t]=(i+t)*l;return s}(...function(t,e,n){let r;for(;;){const i=on(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]<n[0];)e.shift()}return e.map((e=>o(t,e)))}function o(n,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var a=[],s=[];return function(n,r,i){var o,a,s,u,c,f,d=new Array,h=new Array;o=a=-1,u=mn(n[0],r),vn[u<<1].forEach(v);for(;++o<t-1;)s=u,u=mn(n[o+1],r),vn[s|u<<1].forEach(v);vn[u|0].forEach(v);for(;++a<e-1;){for(o=-1,u=mn(n[a*t+t],r),c=mn(n[a*t],r),vn[u<<1|c<<2].forEach(v);++o<t-1;)s=u,u=mn(n[a*t+t+o+1],r),f=c,c=mn(n[a*t+o+1],r),vn[s|u<<1|c<<2|f<<3].forEach(v);vn[u|c<<3].forEach(v)}o=-1,c=n[a*t]>=r,vn[c<<2].forEach(v);for(;++o<t-1;)f=c,c=mn(n[a*t+o+1],r),vn[c<<2|f<<3].forEach(v);function v(t){var e,n,r=[t[0][0]+o,t[0][1]+a],s=[t[1][0]+o,t[1][1]+a],u=l(r),c=l(s);(e=h[u])?(n=d[c])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(s),i(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(s),h[e.end=c]=e):(e=d[c])?(n=h[u])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(s),i(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(r),d[e.start=u]=e):d[u]=h[c]={start:u,end:c,ring:[r,s]}}vn[c<<3].forEach(v)}(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?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==cn((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function l(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((function(n){var o=n[0],l=n[1],a=0|o,s=0|l,u=yn(r[s*t+a]);o>0&&o<t&&a===o&&(n[0]=bn(o,yn(r[s*t+a-1]),u,i)),l>0&&l<e&&s===l&&(n[1]=bn(l,yn(r[(s-1)*t+a]),u,i))}))}return i.contour=o,i.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),o=Math.floor(n[1]);if(!(r>=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?un(an.call(t)):un(t),i):n},i.smooth=function(t){return arguments.length?(r=t?a:hn,i):r===a},i}function gn(t){return isFinite(t)?t:NaN}function mn(t,e){return null!=t&&+t>=e}function yn(t){return null==t||isNaN(t=+t)?-1/0:t}function bn(t,e,n,r){const i=r-e,o=n-e,l=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(l)?t:t+l-.5}function wn(t,e){return!(t.x<e.left||t.x>e.right||t.y>e.bottom||t.y<e.top)}function _n(t,e){for(const n of e)if(wn(t,n))return!0;return!1}function xn({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} h${t} v${e} h-${t}z`} /*! * vanilla-picker v2.12.3 * https://vanilla-picker.js.org * * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) * Released under the ISC license. */ var kn=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Sn=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}}(),Cn=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=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){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}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 Mn={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 En(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var Ln=function(){function t(e,n,r,i){kn(this,t);var o=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=Cn(n,4),i=r[0],l=r[1],a=r[2],s=r[3];void 0===s&&(s=1),i/=360,l/=100,a/=100,o.hsla=[i,l,a,s]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),c=Cn(u,4),f=c[0],d=c[1],h=c[2],v=c[3];void 0===v&&(v=1),o.rgba=[f,d,h,v]}else e.startsWith("#")?o.rgba=t.hexToRgb(e):o.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(l.toLowerCase())}else this.rgba=[e,n,r,void 0===i?1:i]}return Sn(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return En(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 En(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=Mn[n];return void 0===r?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=Cn(t,4),n=e[0],r=e[1],i=e[2],o=e[3];n/=255,r/=255,i/=255;var l=Math.max(n,r,i),a=Math.min(n,r,i),s=void 0,u=void 0,c=(l+a)/2;if(l===a)s=u=0;else{var f=l-a;switch(u=c>.5?f/(2-l-a):f/(l+a),l){case n:s=(r-i)/f+(r<i?6:0);break;case r:s=(i-n)/f+2;break;case i:s=(n-r)/f+4}s/=6}return[s,u,c,o]}},{key:"hslToRgb",value:function(t){var e=Cn(t,4),n=e[0],r=e[1],i=e[2],o=e[3],l=void 0,a=void 0,s=void 0;if(0===r)l=a=s=i;else{var u=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},c=i<.5?i*(1+r):i+r-i*r,f=2*i-c;l=u(f,c,n+1/3),a=u(f,c,n),s=u(f,c,n-1/3)}var d=[255*l,255*a,255*s].map(Math.round);return d[3]=o,d}}]),t}(),Tn=function(){function t(){kn(this,t),this._events=[]}return Sn(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(i){var o=!0;return e&&e!==i.target&&(o=!1),n&&n!==i.type&&(o=!1),r&&r!==i.handler&&(o=!1),o&&t._doRemove(i.target,i.type,i.handler),!o}))}},{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 An(t,e,n){var r=!1;function i(t,e,n){return Math.max(e,Math.min(t,n))}function o(t,o,l){if(l&&(r=!0),r){t.preventDefault();var a=e.getBoundingClientRect(),s=a.width,u=a.height,c=o.clientX,f=o.clientY,d=i(c-a.left,0,s),h=i(f-a.top,0,u);n(d/s,h/u)}}function l(t,e){1===(void 0===t.buttons?t.which:t.buttons)?o(t,t,e):r=!1}function a(t,e){1===t.touches.length?o(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 Nn="keydown",$n="mousedown",On="focusin";function Bn(t,e){return(e||document).querySelector(t)}function Dn(t,e,n,r,i){t.add(e,Nn,(function(t){n.indexOf(t.key)>=0&&r(t)}))}var Pn=function(){function t(e){kn(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new Tn,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return Sn(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){for(var n in t)e[n]=t[n]}(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 i=n.parent;if(i&&n.popup&&!this._popupInited){var o=function(t){return e.openHandler(t)};this._events.add(i,"click",o),Dn(this._events,i,[" ","Spacebar","Enter"],o),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===Nn?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===$n||e===On){var r=(this.__containedEvent||0)+100;t.timeStamp>r&&(n=!0)}else!function(t){t.preventDefault(),t.stopPropagation()}(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==$n&&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 Ln(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>',i=(e=r,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=i,this._domH=Bn(".picker_hue",i),this._domSL=Bn(".picker_sl",i),this._domA=Bn(".picker_alpha",i),this._domEdit=Bn(".picker_editor input",i),this._domSample=Bn(".picker_sample",i),this._domOkay=Bn(".picker_done button",i),this._domCancel=Bn(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup((function(){return i.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 i(t,e,n){r.add(t,e,n)}i(n,"click",(function(t){return t.preventDefault()})),An(r,this._domH,(function(t,n){return e._setHSLA(t)})),An(r,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&An(r,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var o=this._domEdit;i(o,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),i(o,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};i(window,$n,e),i(window,On,e),Dn(r,n,["Esc","Escape"],e);var o=function(e){t.__containedEvent=e.timeStamp};i(n,$n,o),i(n,On,o),i(t._domCancel,"click",e)}));var l=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};i(this._domOkay,"click",l),Dn(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,i){i=i||{};var o=this.colour,l=o.hsla;[t,e,n,r].forEach((function(t,e){(t||0===t)&&(l[e]=t)})),o.hsla=l,this._updateUI(i),this.onChange&&!i.silent&&this.onChange(o)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,r="hsl("+360*n[0]+", 100%, 50%)",i=e.hslString,o=e.hslaString,l=this._domH,a=this._domSL,s=this._domA,u=Bn(".picker_selector",l),c=Bn(".picker_selector",a),f=Bn(".picker_selector",s);y(0,u,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,y(0,c,n[1]),b(0,c,1-n[2]),a.style.color=i,b(0,f,1-n[3]);var d=i,h=d.replace("hsl","hsla").replace(")",", 0)"),v="linear-gradient("+[d,h]+")";if(this._domA.style.background=v+", 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 p=this.settings.editorFormat,g=this.settings.alpha,m=void 0;switch(p){case"rgb":m=e.printRGB(g);break;case"hsl":m=e.printHSL(g);break;default:m=e.printHex(g)}this._domEdit.value=m}this._domSample.style.color=o}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}(),Hn=_e('<div class="picker"></div>');function Rn(t,e){B(e,!0);let n=Xe(e,"value",15,"#AAAAAAFF"),r=Xe(e,"options",19,(()=>({}))),i=Xe(e,"onChange",3,(()=>{})),o=W(void 0),l=W(void 0);function a(t){var e;(e=t.hex)!==n()&&(i()(e,n()),n(e))}ut((()=>{ce(l)&&ce(l).setColor(n())})),Je((()=>{!function(t){if(!ce(o))return;ce(l)&&ce(l).destroy();t.onChange=a,Y(l,new Pn({parent:ce(o),color:n(),popup:!1,...t}),!0),ce(l).show(),ce(l).openHandler()}(r())})),Ke((()=>{ce(l)?.destroy()}));var s=Hn();return We(s,(t=>Y(o,t)),(()=>ce(o))),ke(t,s),D({setColor:function(t){ce(l).setColor(t)}})}const In=function(){const t=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","Comic Sans MS","Comic Sans","Apple Chancery","Bradley Hand","Brush Script MT","Brush Script Std","Snell Roundhand","URW Chancery L"].sort()),e={},n={},r=["monospace","sans-serif","serif","cursive"],i=document.getElementsByTagName("body")[0],o=document.createElement("span");o.style.fontSize="72px",o.innerHTML="mmmmmmmmmmlli",r.forEach((t=>{o.style.fontFamily=t,i.appendChild(o),e[t]=o.offsetWidth,n[t]=o.offsetHeight,i.removeChild(o)}));const l=[],a=t=>{let l=!1;for(const a of r){o.style.fontFamily=t+","+a,i.appendChild(o);const r=o.offsetWidth!=e[a]||o.offsetHeight!=n[a];i.removeChild(o),l=l||r}return l};for(const e of t.values())a(e)&&l.push(e);return l.sort()}();function jn(){let{fonts:t}=document;const e=t.entries();let n=[],r=!1;for(;!r;){const t=e.next();if(t.done)r=t.done;else{const e=t.value;let r;r=e.length?e[0].family:e.family,n.push(r)}}return[...new Set(n)]}function Fn(t,e,n,r,i,o){ce(e)[ce(n)]=!1,ce(r).parentNode.appendChild(ce(r)),i(ce(r),ce(o),"bringtofront",null)}function qn(t,e,n){ce(e).remove(),n()}var Un=_e("<span> </span>"),Gn=_e('<div class="select-tab"><b>Element</b> <!></div>'),zn=(t,e)=>e(+t.target.value),Wn=_e("<option> </option>"),Vn=_e("<select></select>"),Yn=_e("<span> </span>"),Xn=_e('<div class="select-tab"><b>Applied to:</b> <!></div>'),Jn=_e("<span> </span>"),Kn=_e('<div class="select-tab"><b>Property type:</b> <!></div>'),Zn=_e("<button><!></button>"),Qn=_e('<div class="icon-selector"></div> <span class="selected-label"> </span>',1),tr=_e("<span> </span>"),er=(t,e,n)=>e(ce(n)),nr=(t,e,n,r)=>e(ce(n),t.target.value,ce(r)[ce(n)].suffix,t.target),rr=_e('<input type="range"/> <span class="current-value"> </span>',1),ir=(t,e,n)=>e(ce(n),t.target.value),or=_e('<option selected="true">---</option>'),lr=_e("<option> </option>"),ar=_e("<select><!><!></select>"),sr=_e('<div><div class="prop-header"><div class="prop-name"><!></div> <button class="delete-btn" title="Reset to default"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4 L12 12 M12 4 L4 12"></path></svg></button></div> <!></div>'),ur=_e("<div>Bring to front</div>"),cr=_e('<div class="btn delete-elem">Delete element</div>'),fr=_e('<div class="editor"><!> <!> <!></div>'),dr=_e('<div style="position: absolute;"></div> <svg class="ise-helper-wrapper" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="overlay-clip" clip-rule="evenodd"><path></path></clipPath><rect y="0" x="0" height="100%" width="100%" class="overlay-over"></rect></svg> <div class="ise"><button class="close-button" title="Close"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M4 4 L12 12 M12 4 L4 12"></path></svg></button> <!> <!> <!> <!></div>',1);function hr(t,e){B(e,!0);const n=["altGlyph","circle","ellipse","line","path","polygon","polyline","rect","text","textPath","tref","tspan","g"],r={"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[...jn(),...In]}},"font-size":{type:"slider",min:0,max:40,suffix:"px"},"font-weight":{type:"slider",min:0,max:800},color:{type:"color"},"stroke-width":{type:"slider",min:0,max:5,step:.5,suffix:"px"},stroke:{type:"color"},"stroke-linejoin":{type:"select",choices:()=>["bevel","miter","round"]},fill:{type:"color"},"stroke-dasharray":{type:"slider",min:0,max:30,suffix:"px"},"background-color":{type:"color"}},i={stroke:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="2" y1="14" x2="14" y2="2"/></svg>',fill:'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="2" y="2" width="12" height="12" rx="2"/></svg>',color:'<svg viewBox="0 0 16 16" fill="currentColor"><text x="3" y="11" font-size="10" font-weight="bold">A</text><rect x="2" y="13" width="12" height="2"/></svg>',"border-color":'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="12" height="12" rx="1"/></svg>',"background-color":'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="4" y="4" width="10" height="10" rx="1" opacity="0.5"/><rect x="2" y="2" width="10" height="10" rx="1"/></svg>',"border-radius":'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 10 L2 2 L10 2" stroke-linecap="round"/><path d="M2 10 Q2 14 6 14 L14 14" stroke-linecap="round"/></svg>',"border-width":'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="2" y="2" width="12" height="2"/><rect x="2" y="7" width="12" height="3"/><rect x="2" y="13" width="12" height="1"/></svg>',"border-style":'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="2" y="2" width="12" height="1.5"/><rect x="2" y="7" width="3" height="1.5"/><rect x="7" y="7" width="3" height="1.5"/><rect x="2" y="12" width="1.5" height="1.5"/><rect x="5" y="12" width="1.5" height="1.5"/><rect x="8" y="12" width="1.5" height="1.5"/><rect x="11" y="12" width="1.5" height="1.5"/></svg>',"font-size":'<svg viewBox="0 0 16 16" fill="currentColor"><text x="1" y="12" font-size="12" font-weight="bold">T</text><text x="9" y="12" font-size="8" font-weight="bold">T</text></svg>',"font-weight":'<svg viewBox="0 0 16 16" fill="currentColor"><text x="3" y="13" font-size="14" font-weight="bold">B</text></svg>',"font-family":'<svg viewBox="0 0 16 16" fill="currentColor"><text x="4" y="13" font-size="14" font-style="italic" font-family="serif">F</text></svg>',"stroke-width":'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="2" y="2" width="12" height="2"/><rect x="2" y="7" width="12" height="3"/><rect x="2" y="13" width="12" height="1"/></svg>',"stroke-dasharray":'<svg viewBox="0 0 16 16" fill="currentColor"><rect x="1" y="7" width="4" height="2"/><rect x="7" y="7" width="4" height="2"/><rect x="13" y="7" width="2" height="2"/></svg>',"stroke-linejoin":'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><polyline points="3,12 8,4 13,12"/></svg>'},o=e.getElems??null,l=e.listenOnClick??!1,a=e.onStyleChanged??(()=>{}),s=e.customProps??{},u=e.inlineDeletable??(()=>!0),c=e.cssRuleFilter??null,f=e.getCssRuleName??((t,e)=>"inline"===t?"Selected element":t),d=e.ignoredProps??[],h="text",v="border",p="stroke",g="background",m="custom",y={[h]:["font-family","font-size","font-weight","color"],[v]:["border-radius","border-width","border-color","border-style"],[p]:["stroke-width","stroke","stroke-dasharray","stroke-linejoin","fill"],[g]:["background-color"],[m]:Object.keys(s)},b={slider:0,select:1,color:2};let w=W(null),_=W(null),x=W(void 0),k=W(void 0),S=W(void 0),C=W(""),M=W(P({width:0,height:0})),E=W(P([[]])),L=W(P([])),T=W(P([])),A=W(0),N=W(0),$=W(0),O=W(void 0),H=W(P({})),R=W(P([])),I=W(!1),F=W(P(window.location.href.replace(/#.*$/,"")));const q=j((()=>ce(E)[ce(A)]?.[0])),U=j((()=>ce(L)[ce(A)]?.[ce(N)]));let G=W(void 0);function z(){const t={...r,...s},e=(n=t,y[ce(G)].reduce(((t,e)=>(t[e]=n[e],t)),{}));var n;d.forEach((t=>delete e[t]));const i=ce(q)?.tagName?.toLowerCase();ce(G)!==h||"text"!==i&&"tspan"!==i||delete e.color,Object.keys(e).forEach((t=>{const n=e[t].type;let r="number";if("color"===n?r="rgb":"select"===n&&(r="raw"),e[t].getter){const n=e[t].getter(ce(q));if(null===n)return void delete e[t];e[t].value=n,e[t].displayed=n}else if(e[t].displayed=ht(ce(q),t,"raw"),e[t].value=ht(ce(q),t,r),"fill"===t){const n=ce(q).getAttribute?.("fill")||e[t].displayed;n&&n.includes("url(")&&(e[t].originalUrl=n,e[t].value="#00000000")}}));const o=Object.entries(e).reduce(((t,[e,n])=>{const r=n.type,i=t.find((t=>t.type===r));return i?i.props.push(e):t.push({selected:0,props:[e],type:r}),t}),[]).sort(((t,e)=>b[t.type]<b[e.type]?-1:b[t.type]>b[e.type]?1:0)),l