@htmlbricks/hb-stylus-notebook 0.66.6 → 0.66.8
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/main.iife.js +3 -3
- package/main.iife.js.map +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
package/main.iife.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(Ot){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const Kn=2,Rt="[",Ct="[!",Mt="[?",It="]",Oe={},k=Symbol(),Lt="http://www.w3.org/1999/xhtml",Wn=!1;var Xn=Array.isArray,Zn=Array.prototype.indexOf,$e=Array.prototype.includes,Qn=Array.from,Be=Object.keys,Ue=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,er=Object.getOwnPropertyDescriptors,tr=Object.prototype,nr=Array.prototype,Pt=Object.getPrototypeOf,Dt=Object.isExtensible;const rr=()=>{};function ir(e){for(var t=0;t<e.length;t++)e[t]()}function jt(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const T=2,Se=4,Ye=8,Ft=1<<24,ne=16,K=32,re=64,et=128,P=512,x=1024,O=2048,J=4096,ie=8192,U=16384,se=32768,Ht=1<<25,Ve=65536,Bt=1<<17,sr=1<<18,_e=1<<19,lr=1<<20,ve=65536,tt=1<<21,nt=1<<22,le=1<<23,rt=Symbol("$state"),or=Symbol("legacy props"),ar=Symbol(""),W=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fr=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),it=3,st=8;function ur(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function cr(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function dr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function hr(e){throw new Error("https://svelte.dev/e/effect_orphan")}function _r(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function vr(){throw new Error("https://svelte.dev/e/hydration_failed")}function pr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function gr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function br(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function lt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function yr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let $=!1;function Te(e){$=e}let y;function X(e){if(e===null)throw lt(),Oe;return y=e}function Ut(){return X(Q(y))}function Yt(e){if($){if(Q(y)!==null)throw lt(),Oe;y=e}}function mr(e=1){if($){for(var t=e,n=y;t--;)n=Q(n);y=n}}function $r(e=!0){for(var t=0,n=y;;){if(n.nodeType===st){var r=n.data;if(r===It){if(t===0)return n;t-=1}else(r===Rt||r===Ct||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Q(n);e&&n.remove(),n=i}}function Vt(e){return e===this.v}function Er(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Sr(e){return!Er(e,this.v)}let Tr=!1,D=null;function xe(e){D=e}function qt(e,t=!1,n){D={p:D,i:!1,c:null,e:null,s:e,x:null,r:g,l:null}}function Jt(e){var t=D,n=t.e;if(n!==null){t.e=null;for(var r of n)wn(r)}return e!==void 0&&(t.x=e),t.i=!0,D=t.p,e??{}}function zt(){return!0}let pe=[];function Gt(){var e=pe;pe=[],ir(e)}function ge(e){if(pe.length===0&&!Re){var t=pe;queueMicrotask(()=>{t===pe&&Gt()})}pe.push(e)}function xr(){for(;pe.length>0;)Gt()}function Kt(e){var t=g;if(t===null)return p.f|=le,e;if((t.f&se)===0&&(t.f&Se)===0)throw e;oe(e,t)}function oe(e,t){for(;t!==null;){if((t.f&et)!==0){if((t.f&se)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Nr=-7169;function E(e,t){e.f=e.f&Nr|t}function ot(e){(e.f&P)!==0||e.deps===null?E(e,x):E(e,J)}function Wt(e){if(e!==null)for(const t of e)(t.f&T)===0||(t.f&ve)===0||(t.f^=ve,Wt(t.deps))}function Xt(e,t,n){(e.f&O)!==0?t.add(e):(e.f&J)!==0&&n.add(e),Wt(e.deps),E(e,x)}const ae=new Set;let m=null,Y=null,at=null,Re=!1,ft=!1,Ne=null,qe=null;var Zt=0;let kr=1;class fe{id=kr++;current=new Map;previous=new Map;#e=new Set;#n=new Set;#s=new Map;#a=new Map;#l=null;#t=[];#r=new Set;#i=new Set;#o=new Map;is_fork=!1;#c=!1;#f=new Set;#d(){return this.is_fork||this.#a.size>0}#_(){for(const r of this.#f)for(const i of r.#a.keys()){for(var t=!1,n=i;n.parent!==null;){if(this.#o.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#o.has(t)||this.#o.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#o.get(t);if(n){this.#o.delete(t);for(var r of n.d)E(r,O),this.schedule(r);for(r of n.m)E(r,J),this.schedule(r)}}#h(){if(Zt++>1e3&&(ae.delete(this),Ar()),!this.#d()){for(const o of this.#r)this.#i.delete(o),E(o,O),this.schedule(o);for(const o of this.#i)E(o,J),this.schedule(o)}const t=this.#t;this.#t=[],this.apply();var n=Ne=[],r=[],i=qe=[];for(const o of t)try{this.#u(o,n,r)}catch(f){throw rn(o),f}if(m=null,i.length>0){var s=fe.ensure();for(const o of i)s.schedule(o)}if(Ne=null,qe=null,this.#d()||this.#_()){this.#v(r),this.#v(n);for(const[o,f]of this.#o)nn(o,f)}else{this.#s.size===0&&ae.delete(this),this.#r.clear(),this.#i.clear();for(const o of this.#e)o(this);this.#e.clear(),Qt(r),Qt(n),this.#l?.resolve()}var l=m;if(this.#t.length>0){const o=l??=this;o.#t.push(...this.#t.filter(f=>!o.#t.includes(f)))}l!==null&&(ae.add(l),l.#h()),ae.has(this)||this.#p()}#u(t,n,r){t.f^=x;for(var i=t.first;i!==null;){var s=i.f,l=(s&(K|re))!==0,o=l&&(s&x)!==0,f=o||(s&ie)!==0||this.#o.has(i);if(!f&&i.fn!==null){l?i.f^=x:(s&Se)!==0?n.push(i):De(i)&&((s&ne)!==0&&this.#i.add(i),ke(i));var a=i.first;if(a!==null){i=a;continue}}for(;i!==null;){var u=i.next;if(u!==null){i=u;break}i=i.parent}}}#v(t){for(var n=0;n<t.length;n+=1)Xt(t[n],this.#r,this.#i)}capture(t,n,r=!1){n!==k&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&le)===0&&(this.current.set(t,[t.v,r]),Y?.set(t,t.v))}activate(){m=this}deactivate(){m=null,Y=null}flush(){try{ft=!0,m=this,this.#h()}finally{Zt=0,at=null,Ne=null,qe=null,ft=!1,m=null,Y=null,ue.clear()}}discard(){for(const t of this.#n)t(this);this.#n.clear(),ae.delete(this)}#p(){for(const a of ae){var t=a.id<this.id,n=[];for(const[u,[h,d]]of this.current){if(a.current.has(u)){var r=a.current.get(u)[0];if(t&&h!==r)a.current.set(u,[h,d]);else continue}n.push(u)}var i=[...a.current.keys()].filter(u=>!this.current.has(u));if(i.length===0)t&&a.discard();else if(n.length>0){a.activate();var s=new Set,l=new Map;for(var o of n)en(o,i,s,l);if(a.#t.length>0){a.apply();for(var f of a.#t)a.#u(f,[],[]);a.#t=[]}a.deactivate()}}for(const a of ae)a.#f.has(this)&&(a.#f.delete(this),a.#f.size===0&&!a.#d()&&(a.activate(),a.#h()))}increment(t,n){let r=this.#s.get(n)??0;if(this.#s.set(n,r+1),t){let i=this.#a.get(n)??0;this.#a.set(n,i+1)}}decrement(t,n,r){let i=this.#s.get(n)??0;if(i===1?this.#s.delete(n):this.#s.set(n,i-1),t){let s=this.#a.get(n)??0;s===1?this.#a.delete(n):this.#a.set(n,s-1)}this.#c||r||(this.#c=!0,ge(()=>{this.#c=!1,this.flush()}))}transfer_effects(t,n){for(const r of t)this.#r.add(r);for(const r of n)this.#i.add(r);t.clear(),n.clear()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#n.add(t)}settled(){return(this.#l??=jt()).promise}static ensure(){if(m===null){const t=m=new fe;ft||(ae.add(m),Re||ge(()=>{m===t&&t.flush()}))}return m}apply(){{Y=null;return}}schedule(t){if(at=t,t.b?.is_pending&&(t.f&(Se|Ye|Ft))!==0&&(t.f&se)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(Ne!==null&&n===g&&(p===null||(p.f&T)===0))return;if((r&(re|K))!==0){if((r&x)===0)return;n.f^=x}}this.#t.push(n)}}function ut(e){var t=Re;Re=!0;try{for(var n;;){if(xr(),m===null)return n;m.flush()}}finally{Re=t}}function Ar(){try{_r()}catch(e){oe(e,at)}}let Z=null;function Qt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(U|ie))===0&&De(r)&&(Z=new Set,ke(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&mn(r),Z?.size>0)){ue.clear();for(const i of Z){if((i.f&(U|ie))!==0)continue;const s=[i];let l=i.parent;for(;l!==null;)Z.has(l)&&(Z.delete(l),s.push(l)),l=l.parent;for(let o=s.length-1;o>=0;o--){const f=s[o];(f.f&(U|ie))===0&&ke(f)}}Z.clear()}}Z=null}}function en(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&T)!==0?en(i,t,n,r):(s&(nt|ne))!==0&&(s&O)===0&&tn(i,t,r)&&(E(i,O),ct(i))}}function tn(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if($e.call(t,i))return!0;if((i.f&T)!==0&&tn(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function ct(e){m.schedule(e)}function nn(e,t){if(!((e.f&K)!==0&&(e.f&x)!==0)){(e.f&O)!==0?t.d.push(e):(e.f&J)!==0&&t.m.push(e),E(e,x);for(var n=e.first;n!==null;)nn(n,t),n=n.next}}function rn(e){E(e,x);for(var t=e.first;t!==null;)rn(t),t=t.next}function Or(e){let t=0,n=Ce(0),r;return()=>{wt()&&(c(n),bn(()=>(t===0&&(r=ii(()=>e(()=>Me(n)))),t+=1,()=>{ge(()=>{t-=1,t===0&&(r?.(),r=void 0,Me(n))})})))}}var Rr=Ve|_e;function Cr(e,t,n,r){new Mr(e,t,n,r)}class Mr{parent;is_pending=!1;transform_error;#e;#n=$?y:null;#s;#a;#l;#t=null;#r=null;#i=null;#o=null;#c=0;#f=0;#d=!1;#_=new Set;#h=new Set;#u=null;#v=Or(()=>(this.#u=Ce(this.#c),()=>{this.#u=null}));constructor(t,n,r,i){this.#e=t,this.#s=n,this.#a=s=>{var l=g;l.b=this,l.f|=et,r(s)},this.parent=g.b,this.transform_error=i??this.parent?.transform_error??(s=>s),this.#l=Zr(()=>{if($){const s=this.#n;Ut();const l=s.data===Ct;if(s.data.startsWith(Mt)){const f=JSON.parse(s.data.slice(Mt.length));this.#m(f)}else l?this.#$():this.#p()}else this.#b()},Rr),$&&(this.#e=y)}#p(){try{this.#t=be(()=>this.#a(this.#e))}catch(t){this.error(t)}}#m(t){const n=this.#s.failed;n&&(this.#i=be(()=>{n(this.#e,()=>t,()=>()=>{})}))}#$(){const t=this.#s.pending;t&&(this.is_pending=!0,this.#r=be(()=>t(this.#e)),ge(()=>{var n=this.#o=document.createDocumentFragment(),r=Le();n.append(r),this.#t=this.#w(()=>be(()=>this.#a(r))),this.#f===0&&(this.#e.before(n),this.#o=null,Ge(this.#r,()=>{this.#r=null}),this.#g(m))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#f=0,this.#c=0,this.#t=be(()=>{this.#a(this.#e)}),this.#f>0){var t=this.#o=document.createDocumentFragment();ti(this.#t,t);const n=this.#s.pending;this.#r=be(()=>n(this.#e))}else this.#g(m)}catch(n){this.error(n)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#_,this.#h)}defer_effect(t){Xt(t,this.#_,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#s.pending}#w(t){var n=g,r=p,i=D;j(this.#l),R(this.#l),xe(this.#l.ctx);try{return fe.ensure(),t()}catch(s){return Kt(s),null}finally{j(n),R(r),xe(i)}}#y(t,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t,n);return}this.#f+=t,this.#f===0&&(this.#g(n),this.#r&&Ge(this.#r,()=>{this.#r=null}),this.#o&&(this.#e.before(this.#o),this.#o=null))}update_pending_count(t,n){this.#y(t,n),this.#c+=t,!(!this.#u||this.#d)&&(this.#d=!0,ge(()=>{this.#d=!1,this.#u&&ze(this.#u,this.#c)}))}get_effect_pending(){return this.#v(),c(this.#u)}error(t){var n=this.#s.onerror;let r=this.#s.failed;if(!n&&!r)throw t;this.#t&&(V(this.#t),this.#t=null),this.#r&&(V(this.#r),this.#r=null),this.#i&&(V(this.#i),this.#i=null),$&&(X(this.#n),mr(),X($r()));var i=!1,s=!1;const l=()=>{if(i){yr();return}i=!0,s&&br(),this.#i!==null&&Ge(this.#i,()=>{this.#i=null}),this.#w(()=>{this.#b()})},o=f=>{try{s=!0,n?.(f,l),s=!1}catch(a){oe(a,this.#l&&this.#l.parent)}r&&(this.#i=this.#w(()=>{try{return be(()=>{var a=g;a.b=this,a.f|=et,r(this.#e,()=>f,()=>l)})}catch(a){return oe(a,this.#l.parent),null}}))};ge(()=>{var f;try{f=this.transform_error(t)}catch(a){oe(a,this.#l&&this.#l.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(o,a=>oe(a,this.#l&&this.#l.parent)):o(f)})}}function Ir(e,t,n,r){const i=dt;var s=e.filter(d=>!d.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var l=g,o=Lr(),f=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function a(d){o();try{r(d)}catch(v){(l.f&U)===0&&oe(v,l)}Je()}if(n.length===0){f.then(()=>a(t.map(i)));return}var u=sn();function h(){Promise.all(n.map(d=>Pr(d))).then(d=>a([...t.map(i),...d])).catch(d=>oe(d,l)).finally(()=>u())}f?f.then(()=>{o(),h(),Je()}):h()}function Lr(){var e=g,t=p,n=D,r=m;return function(s=!0){j(e),R(t),xe(n),s&&(e.f&U)===0&&(r?.activate(),r?.apply())}}function Je(e=!0){j(null),R(null),xe(null),e&&m?.deactivate()}function sn(){var e=g,t=e.b,n=m,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function dt(e){var t=T|O,n=p!==null&&(p.f&T)!==0?p:null;return g!==null&&(g.f|=_e),{ctx:D,deps:null,effects:null,equals:Vt,f:t,fn:e,reactions:null,rv:0,v:k,wv:0,parent:n??g,ac:null}}function Pr(e,t,n){let r=g;r===null&&ur();var i=void 0,s=Ce(k),l=!p,o=new Map;return Xr(()=>{var f=g,a=jt();i=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).finally(Je)}catch(v){a.reject(v),Je()}var u=m;if(l){if((f.f&se)!==0)var h=sn();if(r.b.is_rendered())o.get(u)?.reject(W),o.delete(u);else{for(const v of o.values())v.reject(W);o.clear()}o.set(u,a)}const d=(v,_=void 0)=>{if(h){var b=_===W;h(b)}if(!(_===W||(f.f&U)!==0)){if(u.activate(),_)s.f|=le,ze(s,_);else{(s.f&le)!==0&&(s.f^=le),ze(s,v);for(const[N,I]of o){if(o.delete(N),N===u)break;I.reject(W)}}u.deactivate()}};a.promise.then(d,v=>d(null,v||"unknown"))}),gn(()=>{for(const f of o.values())f.reject(W)}),new Promise(f=>{function a(u){function h(){u===i?f(s):a(i)}u.then(h,h)}a(i)})}function ln(e){const t=dt(e);return Sn(t),t}function Dr(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)V(t[n])}}function jr(e){for(var t=e.parent;t!==null;){if((t.f&T)===0)return(t.f&U)===0?t:null;t=t.parent}return null}function ht(e){var t,n=g;j(jr(e));try{e.f&=~ve,Dr(e),t=An(e)}finally{j(n)}return t}function on(e){var t=e.v,n=ht(e);if(!e.equals(n)&&(e.wv=Nn(),(!m?.is_fork||e.deps===null)&&(e.v=n,m?.capture(e,t,!0),e.deps===null))){E(e,x);return}ce||(Y!==null?(wt()||m?.is_fork)&&Y.set(e,n):ot(e))}function Fr(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(W),t.teardown=rr,t.ac=null,je(t,0),bt(t))}function an(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&ke(t)}let _t=new Set;const ue=new Map;let fn=!1;function Ce(e,t){var n={f:0,v:e,reactions:null,equals:Vt,rv:0,wv:0};return n}function A(e,t){const n=Ce(e);return Sn(n),n}function Hr(e,t=!1,n=!0){const r=Ce(e);return t||(r.equals=Sr),r}function S(e,t,n=!1){p!==null&&(!q||(p.f&Bt)!==0)&&zt()&&(p.f&(T|ne|nt|Bt))!==0&&(F===null||!$e.call(F,e))&&wr();let r=n?Ie(t):t;return ze(e,r,qe)}function ze(e,t,n=null){if(!e.equals(t)){var r=e.v;ce?ue.set(e,t):ue.set(e,r),e.v=t;var i=fe.ensure();if(i.capture(e,r),(e.f&T)!==0){const s=e;(e.f&O)!==0&&ht(s),Y===null&&ot(s)}e.wv=Nn(),un(e,O,n),g!==null&&(g.f&x)!==0&&(g.f&(K|re))===0&&(H===null?ni([e]):H.push(e)),!i.is_fork&&_t.size>0&&!fn&&Br()}return t}function Br(){fn=!1;for(const e of _t)(e.f&x)!==0&&E(e,J),De(e)&&ke(e);_t.clear()}function Ur(e,t=1){var n=c(e),r=t===1?n++:n--;return S(e,n),r}function Me(e){S(e,e.v+1)}function un(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var l=r[s],o=l.f,f=(o&O)===0;if(f&&E(l,t),(o&T)!==0){var a=l;Y?.delete(a),(o&ve)===0&&(o&P&&(l.f|=ve),un(a,J,n))}else if(f){var u=l;(o&ne)!==0&&Z!==null&&Z.add(u),n!==null?n.push(u):ct(u)}}}function Ie(e){if(typeof e!="object"||e===null||rt in e)return e;const t=Pt(e);if(t!==tr&&t!==nr)return e;var n=new Map,r=Xn(e),i=A(0),s=me,l=o=>{if(me===s)return o();var f=p,a=me;R(null),xn(s);var u=o();return R(f),xn(a),u};return r&&n.set("length",A(e.length)),new Proxy(e,{defineProperty(o,f,a){(!("value"in a)||a.configurable===!1||a.enumerable===!1||a.writable===!1)&&pr();var u=n.get(f);return u===void 0?l(()=>{var h=A(a.value);return n.set(f,h),h}):S(u,a.value,!0),!0},deleteProperty(o,f){var a=n.get(f);if(a===void 0){if(f in o){const u=l(()=>A(k));n.set(f,u),Me(i)}}else S(a,k),Me(i);return!0},get(o,f,a){if(f===rt)return e;var u=n.get(f),h=f in o;if(u===void 0&&(!h||Ee(o,f)?.writable)&&(u=l(()=>{var v=Ie(h?o[f]:k),_=A(v);return _}),n.set(f,u)),u!==void 0){var d=c(u);return d===k?void 0:d}return Reflect.get(o,f,a)},getOwnPropertyDescriptor(o,f){var a=Reflect.getOwnPropertyDescriptor(o,f);if(a&&"value"in a){var u=n.get(f);u&&(a.value=c(u))}else if(a===void 0){var h=n.get(f),d=h?.v;if(h!==void 0&&d!==k)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return a},has(o,f){if(f===rt)return!0;var a=n.get(f),u=a!==void 0&&a.v!==k||Reflect.has(o,f);if(a!==void 0||g!==null&&(!u||Ee(o,f)?.writable)){a===void 0&&(a=l(()=>{var d=u?Ie(o[f]):k,v=A(d);return v}),n.set(f,a));var h=c(a);if(h===k)return!1}return u},set(o,f,a,u){var h=n.get(f),d=f in o;if(r&&f==="length")for(var v=a;v<h.v;v+=1){var _=n.get(v+"");_!==void 0?S(_,k):v in o&&(_=l(()=>A(k)),n.set(v+"",_))}if(h===void 0)(!d||Ee(o,f)?.writable)&&(h=l(()=>A(void 0)),S(h,Ie(a)),n.set(f,h));else{d=h.v!==k;var b=l(()=>Ie(a));S(h,b)}var N=Reflect.getOwnPropertyDescriptor(o,f);if(N?.set&&N.set.call(u,a),!d){if(r&&typeof f=="string"){var I=n.get("length"),de=Number(f);Number.isInteger(de)&&de>=I.v&&S(I,de+1)}Me(i)}return!0},ownKeys(o){c(i);var f=Reflect.ownKeys(o).filter(h=>{var d=n.get(h);return d===void 0||d.v!==k});for(var[a,u]of n)u.v!==k&&!(a in o)&&f.push(a);return f},setPrototypeOf(){gr()}})}var cn,dn,hn,_n;function vt(){if(cn===void 0){cn=window,dn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;hn=Ee(t,"firstChild").get,_n=Ee(t,"nextSibling").get,Dt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Dt(n)&&(n.__t=void 0)}}function Le(e=""){return document.createTextNode(e)}function Pe(e){return hn.call(e)}function Q(e){return _n.call(e)}function vn(e,t){if(!$)return Pe(e);var n=Pe(y);return n===null&&(n=y.appendChild(Le())),X(n),n}function Yr(e,t=!1){if(!$){var n=Pe(e);return n instanceof Comment&&n.data===""?Q(n):n}if(t){if(y?.nodeType!==it){var r=Le();return y?.before(r),X(r),r}pn(y)}return y}function ee(e,t=1,n=!1){let r=$?y:e;for(var i;t--;)i=r,r=Q(r);if(!$)return r;if(n){if(r?.nodeType!==it){var s=Le();return r===null?i?.after(s):r.before(s),X(s),s}pn(r)}return X(r),r}function Vr(e){e.textContent=""}function pt(e,t,n){return document.createElementNS(Lt,e,void 0)}function pn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===it;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function gt(e){var t=p,n=g;R(null),j(null);try{return e()}finally{R(t),j(n)}}function qr(e){g===null&&(p===null&&hr(),dr()),ce&&cr()}function Jr(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function z(e,t){var n=g;n!==null&&(n.f&ie)!==0&&(e|=ie);var r={ctx:D,deps:null,nodes:null,f:e|O|P,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if((e&Se)!==0)Ne!==null?Ne.push(r):fe.ensure().schedule(r);else if(t!==null){try{ke(r)}catch(l){throw V(r),l}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&_e)===0&&(i=i.first,(e&ne)!==0&&(e&Ve)!==0&&i!==null&&(i.f|=Ve))}if(i!==null&&(i.parent=n,n!==null&&Jr(i,n),p!==null&&(p.f&T)!==0&&(e&re)===0)){var s=p;(s.effects??=[]).push(i)}return r}function wt(){return p!==null&&!q}function gn(e){const t=z(Ye,null);return E(t,x),t.teardown=e,t}function zr(e){qr();var t=g.f,n=!p&&(t&K)!==0&&(t&se)===0;if(n){var r=D;(r.e??=[]).push(e)}else return wn(e)}function wn(e){return z(Se|lr,e)}function Gr(e){fe.ensure();const t=z(re|_e,e);return()=>{V(t)}}function Kr(e){fe.ensure();const t=z(re|_e,e);return(n={})=>new Promise(r=>{n.outro?Ge(t,()=>{V(t),r(void 0)}):(V(t),r(void 0))})}function Wr(e){return z(Se,e)}function Xr(e){return z(nt|_e,e)}function bn(e,t=0){return z(Ye|t,e)}function we(e,t=[],n=[],r=[]){Ir(r,t,n,i=>{z(Ye,()=>e(...i.map(c)))})}function Zr(e,t=0){var n=z(ne|t,e);return n}function be(e){return z(K|_e,e)}function yn(e){var t=e.teardown;if(t!==null){const n=ce,r=p;En(!0),R(null);try{t.call(null)}finally{En(n),R(r)}}}function bt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&>(()=>{i.abort(W)});var r=n.next;(n.f&re)!==0?n.parent=null:V(n,t),n=r}}function Qr(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&K)===0&&V(t),t=n}}function V(e,t=!0){var n=!1;(t||(e.f&sr)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ei(e.nodes.start,e.nodes.end),n=!0),E(e,Ht),bt(e,t&&!n),je(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();yn(e),e.f^=Ht,e.f|=U;var i=e.parent;i!==null&&i.first!==null&&mn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ei(e,t){for(;e!==null;){var n=e===t?null:Q(e);e.remove(),e=n}}function mn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ge(e,t,n=!0){var r=[];$n(e,r,!0);var i=()=>{n&&V(e),t&&t()},s=r.length;if(s>0){var l=()=>--s||i();for(var o of r)o.out(l)}else i()}function $n(e,t,n){if((e.f&ie)===0){e.f^=ie;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,l=(i.f&Ve)!==0||(i.f&K)!==0&&(e.f&ne)!==0;$n(i,t,l?n:!1),i=s}}}function ti(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Q(n);t.append(n),n=i}}let Ke=!1,ce=!1;function En(e){ce=e}let p=null,q=!1;function R(e){p=e}let g=null;function j(e){g=e}let F=null;function Sn(e){p!==null&&(F===null?F=[e]:F.push(e))}let C=null,M=0,H=null;function ni(e){H=e}let Tn=1,ye=0,me=ye;function xn(e){me=e}function Nn(){return++Tn}function De(e){var t=e.f;if((t&O)!==0)return!0;if(t&T&&(e.f&=~ve),(t&J)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var s=n[i];if(De(s)&&on(s),s.wv>e.wv)return!0}(t&P)!==0&&Y===null&&E(e,x)}return!1}function kn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(F!==null&&$e.call(F,e)))for(var i=0;i<r.length;i++){var s=r[i];(s.f&T)!==0?kn(s,t,!1):t===s&&(n?E(s,O):(s.f&x)!==0&&E(s,J),ct(s))}}function An(e){var t=C,n=M,r=H,i=p,s=F,l=D,o=q,f=me,a=e.f;C=null,M=0,H=null,p=(a&(K|re))===0?e:null,F=null,xe(e.ctx),q=!1,me=++ye,e.ac!==null&&(gt(()=>{e.ac.abort(W)}),e.ac=null);try{e.f|=tt;var u=e.fn,h=u();e.f|=se;var d=e.deps,v=m?.is_fork;if(C!==null){var _;if(v||je(e,M),d!==null&&M>0)for(d.length=M+C.length,_=0;_<C.length;_++)d[M+_]=C[_];else e.deps=d=C;if(wt()&&(e.f&P)!==0)for(_=M;_<d.length;_++)(d[_].reactions??=[]).push(e)}else!v&&d!==null&&M<d.length&&(je(e,M),d.length=M);if(zt()&&H!==null&&!q&&d!==null&&(e.f&(T|J|O))===0)for(_=0;_<H.length;_++)kn(H[_],e);if(i!==null&&i!==e){if(ye++,i.deps!==null)for(let b=0;b<n;b+=1)i.deps[b].rv=ye;if(t!==null)for(const b of t)b.rv=ye;H!==null&&(r===null?r=H:r.push(...H))}return(e.f&le)!==0&&(e.f^=le),h}catch(b){return Kt(b)}finally{e.f^=tt,C=t,M=n,H=r,p=i,F=s,xe(l),q=o,me=f}}function ri(e,t){let n=t.reactions;if(n!==null){var r=Zn.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(t.f&T)!==0&&(C===null||!$e.call(C,t))){var s=t;(s.f&P)!==0&&(s.f^=P,s.f&=~ve),ot(s),Fr(s),je(s,0)}}function je(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ri(e,n[r])}function ke(e){var t=e.f;if((t&U)===0){E(e,x);var n=g,r=Ke;g=e,Ke=!0;try{(t&(ne|Ft))!==0?Qr(e):bt(e),yn(e);var i=An(e);e.teardown=typeof i=="function"?i:null,e.wv=Tn;var s;Wn&&Tr&&(e.f&O)!==0&&e.deps}finally{Ke=r,g=n}}}function c(e){var t=e.f,n=(t&T)!==0;if(p!==null&&!q){var r=g!==null&&(g.f&U)!==0;if(!r&&(F===null||!$e.call(F,e))){var i=p.deps;if((p.f&tt)!==0)e.rv<ye&&(e.rv=ye,C===null&&i!==null&&i[M]===e?M++:C===null?C=[e]:C.push(e));else{(p.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[p]:$e.call(s,p)||s.push(p)}}}if(ce&&ue.has(e))return ue.get(e);if(n){var l=e;if(ce){var o=l.v;return((l.f&x)===0&&l.reactions!==null||Rn(l))&&(o=ht(l)),ue.set(l,o),o}var f=(l.f&P)===0&&!q&&p!==null&&(Ke||(p.f&P)!==0),a=(l.f&se)===0;De(l)&&(f&&(l.f|=P),on(l)),f&&!a&&(an(l),On(l))}if(Y?.has(e))return Y.get(e);if((e.f&le)!==0)throw e.v;return e.v}function On(e){if(e.f|=P,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&T)!==0&&(t.f&P)===0&&(an(t),On(t))}function Rn(e){if(e.v===k)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(ue.has(t)||(t.f&T)!==0&&Rn(t))return!0;return!1}function ii(e){var t=q;try{return q=!0,e()}finally{q=t}}const Fe=Symbol("events"),Cn=new Set,yt=new Set;function si(e,t,n,r={}){function i(s){if(r.capture||mt.call(t,s),!s.cancelBubble)return gt(()=>n?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ge(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function We(e,t,n,r,i){var s={capture:r,passive:i},l=si(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&gn(()=>{t.removeEventListener(e,l,s)})}function Ae(e,t,n){(t[Fe]??={})[e]=n}function li(e){for(var t=0;t<e.length;t++)Cn.add(e[t]);for(var n of yt)n(e)}let Mn=null;function mt(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;Mn=e;var l=0,o=Mn===e&&e[Fe];if(o){var f=i.indexOf(o);if(f!==-1&&(t===document||t===window)){e[Fe]=t;return}var a=i.indexOf(t);if(a===-1)return;f<=a&&(l=f)}if(s=i[l]||e.target,s!==t){Ue(e,"currentTarget",{configurable:!0,get(){return s||n}});var u=p,h=g;R(null),j(null);try{for(var d,v=[];s!==null;){var _=s.assignedSlot||s.parentNode||s.host||null;try{var b=s[Fe]?.[r];b!=null&&(!s.disabled||e.target===s)&&b.call(s,e)}catch(N){d?v.push(N):d=N}if(e.cancelBubble||_===t||_===null)break;s=_}if(d){for(let N of v)queueMicrotask(()=>{throw N});throw d}}finally{e[Fe]=t,delete e.currentTarget,R(u),j(h)}}}const oi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function ai(e){return oi?.createHTML(e)??e}function fi(e){var t=pt("template");return t.innerHTML=ai(e.replaceAll("<!>","<!---->")),t.content}function $t(e,t){var n=g;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ui(e,t){var n=(t&Kn)!==0,r,i=!e.startsWith("<!>");return()=>{if($)return $t(y,null),y;r===void 0&&(r=fi(i?e:"<!>"+e));var s=n||dn?document.importNode(r,!0):r.cloneNode(!0);{var l=Pe(s),o=s.lastChild;$t(l,o)}return s}}function In(e,t){if($){var n=g;((n.f&se)===0||n.nodes.end===null)&&(n.nodes.end=y),Ut();return}e!==null&&e.before(t)}const ci=["touchstart","touchmove"];function di(e){return ci.includes(e)}function Ln(e,t){return Pn(e,t)}function hi(e,t){vt(),t.intro=t.intro??!1;const n=t.target,r=$,i=y;try{for(var s=Pe(n);s&&(s.nodeType!==st||s.data!==Rt);)s=Q(s);if(!s)throw Oe;Te(!0),X(s);const l=Pn(e,{...t,anchor:s});return Te(!1),l}catch(l){if(l instanceof Error&&l.message.split(`
|
|
2
|
-
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw l;return l!==Oe&&console.warn("Failed to hydrate: ",l),t.recover===!1&&vr(),vt(),Vr(n),Te(!1),Ln(e,t)}finally{Te(r),X(i)}}const Xe=new Map;function Pn(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:l=!0,transformError:o}){vt();var f=void 0,a=Kr(()=>{var u=n??t.appendChild(Le());Cr(u,{pending:()=>{}},v=>{qt({});var _=D;if(s&&(_.c=s),i&&(r.$$events=i),$&&$t(v,null),f=e(v,r)||{},$&&(g.nodes.end=y,y===null||y.nodeType!==st||y.data!==It))throw lt(),Oe;Jt()},o);var h=new Set,d=v=>{for(var _=0;_<v.length;_++){var b=v[_];if(!h.has(b)){h.add(b);var N=di(b);for(const He of[t,document]){var I=Xe.get(He);I===void 0&&(I=new Map,Xe.set(He,I));var de=I.get(b);de===void 0?(He.addEventListener(b,mt,{passive:N}),I.set(b,1)):I.set(b,de+1)}}}};return d(Qn(Cn)),yt.add(d),()=>{for(var v of h)for(const N of[t,document]){var _=Xe.get(N),b=_.get(v);--b==0?(N.removeEventListener(v,mt),_.delete(v),_.size===0&&Xe.delete(N)):_.set(v,b)}yt.delete(d),u!==n&&u.parentNode?.removeChild(u)}});return Et.set(f,a),f}let Et=new WeakMap;function _i(e,t){const n=Et.get(e);return n?(Et.delete(e),n(t)):Promise.resolve()}function vi(e,t){Wr(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const i=pt("style");i.id=t.hash,i.textContent=t.code,r.appendChild(i)}})}const pi=Symbol("is custom element"),gi=Symbol("is html"),wi=fr?"link":"LINK";function bi(e,t,n,r){var i=yi(e);$&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===wi)||i[t]!==(i[t]=n)&&(t==="loading"&&(e[ar]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Dn(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function B(e,t,n){var r=p,i=g;let s=$;$&&Te(!1),R(null),j(null);try{t!=="style"&&(St.has(e.getAttribute("is")||e.nodeName)||!customElements||customElements.get(e.getAttribute("is")||e.nodeName.toLowerCase())?Dn(e).includes(t):n&&typeof n=="object")?e[t]=n:bi(e,t,n==null?n:String(n))}finally{R(r),j(i),s&&Te(!0)}}function yi(e){return e.__attributes??={[pi]:e.nodeName.includes("-"),[gi]:e.namespaceURI===Lt}}var St=new Map;function Dn(e){var t=e.getAttribute("is")||e.nodeName,n=St.get(t);if(n)return n;St.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=er(i);for(var l in r)r[l].set&&n.push(l);i=Pt(i)}return n}function jn(e,t,n,r){var i=r,s=!0,l=()=>(s&&(s=!1,i=r),i),o;o=e[t],o===void 0&&r!==void 0&&(o=l());var f;f=()=>{var d=e[t];return d===void 0?l():(s=!0,d)};var a=!1,u=dt(()=>(a=!1,f())),h=g;return(function(d,v){if(arguments.length>0){const _=v?c(u):d;return S(u,_),a=!0,i!==void 0&&(i=_),d}return ce&&a||(h.f&U)!==0?u.v:c(u)})}function mi(e){return new $i(e)}class $i{#e;#n;constructor(t){var n=new Map,r=(s,l)=>{var o=Hr(l,!1,!1);return n.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,l){return c(n.get(l)??r(l,Reflect.get(s,l)))},has(s,l){return l===or?!0:(c(n.get(l)??r(l,Reflect.get(s,l))),Reflect.has(s,l))},set(s,l,o){return S(n.get(l)??r(l,o),o),Reflect.set(s,l,o)}});this.#n=(t.hydrate?hi:Ln)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&ut(),this.#e=i.$$events;for(const s of Object.keys(this.#n))s==="$set"||s==="$destroy"||s==="$on"||Ue(this,s,{get(){return this.#n[s]},set(l){this.#n[s]=l},enumerable:!0});this.#n.$set=s=>{Object.assign(i,s)},this.#n.$destroy=()=>{_i(this.#n)}}$set(t){this.#n.$set(t)}$on(t,n){this.#e[t]=this.#e[t]||[];const r=(...i)=>n.call(this,...i);return this.#e[t].push(r),()=>{this.#e[t]=this.#e[t].filter(i=>i!==r)}}$destroy(){this.#n.$destroy()}}let Fn;typeof HTMLElement=="function"&&(Fn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return i=>{const s=pt("slot");r!=="default"&&(s.name=r),In(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=Ei(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=Ze(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=mi({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Gr(()=>{bn(()=>{this.$$r=!0;for(const r of Be(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=Ze(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const s=this.$$c.$on(r,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ze(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Be(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ze(e,t,n,r){const i=n[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ei(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function Si(e,t,n,r,i,s){let l=class extends Fn{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return Be(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Be(t).forEach(o=>{Ue(l.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(f){f=Ze(o,f,t),this.$$d[o]=f;var a=this.$$c;if(a){var u=Ee(a,o)?.get;u?a[o]=f:a.$set({[o]:f})}}})}),r.forEach(o=>{Ue(l.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=l,l}const Hn={version:"0.66.6"};function Bn(e){const t=e?.repoName.split("/")?.[1]||e?.repoName;if(!t)throw new Error("wrong componentPath "+e?.repoName);if(!e?.version)throw new Error("wrong version "+e?.version);const n=e?.iifePath||"main.iife.js";if(!document.getElementById(t+"-script"))try{const r=document.createElement("script");if(r.id=t+"-script",r.src=`https://cdn.jsdelivr.net/npm/${e.repoName}@${e.version}/${n}`,e?.local)r.src=`${e.local}`;else if(location.href.includes("localhost:6006")){const i=t.split("-")[0];r.src=`http://localhost:6006/webcomponents/${t.replace(i+"-","")}/${n}`}document.head.appendChild(r)}catch(r){console.warn(r)}}var Ti=ui('<div part="controller" id="controller" class="svelte-1swbd4i"><button>clear</button> <button>select</button> <button>draw</button> <button>undo</button> <button>redo</button> <button>save</button> <button>brush</button> <br/>load:<hb-input-file></hb-input-file> insert:<hb-input-file></hb-input-file></div> <div part="paper-container" id="paper-container" style="position:relative" class="svelte-1swbd4i"><hb-stylus-paper></hb-stylus-paper></div>',3);const xi={hash:"svelte-1swbd4i",code:'@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr;}#controller.svelte-1swbd4i {grid-area:header;}#paper-container.svelte-1swbd4i {grid-area:paper;background:green;}'};function Un(e,t){qt(t,!0),vi(e,xi);let n=jn(t,"id",7,""),r=jn(t,"load_draw"),i=A("draw"),s=A(0),l=A(void 0),o=A(!1),f=A(void 0),a=A(void 0),u=A(void 0),h=A(void 0),d=ln(()=>(c(l)===0||c(l))&&c(l)<c(s)),v=ln(()=>(c(s)||c(s)===0)&&c(o)&&(!c(l)||c(l)!==-1)&&(!c(h)||c(h)<c(s)&&(!c(l)||c(l)<c(h))));zr(()=>{if(typeof r()=="string"&&r()?.length)try{r(JSON.parse(r()))}catch(w){console.error("error parsing json",w)}}),Bn({repoName:"@htmlbricks/hb-stylus-paper",version:Hn.version}),Bn({repoName:"@htmlbricks/hb-input-file",version:Hn.version});function _(w,he){var te="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(w)),L=document.createElement("a");L.setAttribute("href",te),L.setAttribute("download",he),document.body.appendChild(L),L.click(),L.remove()}function b(w){S(i,w,!0)}function N(){console.log("ch",c(s),c(l)),c(s)>=0&&(!c(l)||c(l)>-1)&&(S(l,c(l)||c(l)===0?c(l)-1:c(s)-1,!0),console.log("undo",c(s),c(l)))}function I(){console.log(c(s),c(l)),(c(l)||c(l)===0)&&c(l)<=c(s)&&(Ur(l),console.log("redo",c(s),c(l)))}function de(w){c(o)||S(o,!0),console.log("h",w),S(s,w.index-1),w.start_index&&S(h,w.start_index,!0),S(l,void 0)}function He(){S(f,{name:"test",type:"json"},!0)}function Ni(w){const he=w.value?.name;if(he){const te=new FileReader;te.readAsDataURL(w.value),te.onload=function(L){try{if(console.log("insert file",L.target,L.target?.result),L.target?.result){const Ci=L.target.result.toString().split(";")[0].split("/")[1];S(a,{base64:L.target.result.toString(),type:Ci,name:he},!0)}}catch{console.error("error loading file")}},te.onerror=function(L){console.error("error reading file")}}}function ki(w){console.log("save",w),S(f,void 0),_(w,w?.name+".json")}function Ai(w){if(console.log("file",w),w.value?.name){const he=new FileReader;he.readAsText(w.value,"UTF-8"),he.onload=function(te){if(te?.target?.result?.toString())try{r(JSON.parse(te.target.result.toString()))}catch{console.error("error loading file")}},he.onerror=function(te){console.error("error reading file")}}}var Oi={get id(){return n()},set id(w=""){n(w),ut()},get load_draw(){return r()},set load_draw(w){r(w),ut()}},Yn=Ti(),Tt=Yr(Yn),Vn=vn(Tt),qn=ee(Vn,2),Jn=ee(qn,2),xt=ee(Jn,2),Nt=ee(xt,2),kt=ee(Nt,2),zn=ee(kt,2),Qe=ee(zn,4);B(Qe,"id","loadfile"),B(Qe,"schemaentry",JSON.stringify({label:"ciao",id:"xxxxxxx"}));var At=ee(Qe,2);B(At,"id","insertfile"),B(At,"schemaentry",JSON.stringify({label:"ciao"})),Yt(Tt);var Gn=ee(Tt,2),G=vn(Gn);return B(G,"id","stylus-paper"),we(()=>B(G,"goto",c(l))),B(G,"background_color","green"),we(()=>B(G,"mode",c(i))),we(()=>B(G,"save_as",c(f)?JSON.stringify(c(f)):"")),we(()=>B(G,"load_draw",r()?JSON.stringify(r()):null)),we(()=>B(G,"insert_image",c(a)?JSON.stringify(c(a)):null)),we(()=>B(G,"insert_text",c(u)?JSON.stringify(c(u)):null)),Yt(Gn),we(()=>{xt.disabled=!c(v),Nt.disabled=!c(d),kt.disabled=!c(v),zn.disabled=c(i)!=="draw"}),Ae("click",Vn,()=>b("eraser")),Ae("click",qn,()=>b("select")),Ae("click",Jn,()=>b("draw")),Ae("click",xt,()=>N()),Ae("click",Nt,()=>I()),Ae("click",kt,()=>He()),We("setVal",Qe,w=>Ai(w.detail)),We("setVal",At,w=>Ni(w.detail)),We("historyIndex",G,w=>de(w.detail)),We("save",G,w=>ki(w.detail)),In(e,Yn),Jt(Oi)}li(["click"]),customElements.define("hb-stylus-notebook",Si(Un,{id:{},load_draw:{}},[],[],{mode:"open"})),Ot.Component=Un,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})})(this["stylus-notebook"]=this["stylus-notebook"]||{});
|
|
3
|
-
//# sourceMappingURL=main.iife.js.map
|
|
1
|
+
(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var t={},n=Symbol(),r=`http://www.w3.org/1999/xhtml`,i=Array.isArray,a=Array.prototype.indexOf,o=Array.prototype.includes,s=Array.from,c=Object.keys,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,ee=()=>{};function te(e){for(var t=0;t<e.length;t++)e[t]()}function g(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,ne=8192,re=16384,ie=32768,ae=1<<25,oe=65536,b=1<<19,se=1<<20,x=65536,ce=1<<21,le=1<<22,ue=1<<23,S=Symbol(`$state`),de=Symbol(`legacy props`),fe=Symbol(``),C=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},pe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function me(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function he(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ge(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function _e(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function ve(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ye(){throw Error(`https://svelte.dev/e/hydration_failed`)}function be(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function xe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Se(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ce(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function we(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Te(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function De(e){w=e}var T;function E(e){if(e===null)throw Te(),t;return T=e}function Oe(){return E(L(T))}function ke(e){if(w){if(L(T)!==null)throw Te(),t;T=e}}function Ae(e=1){if(w){for(var t=e,n=T;t--;)n=L(n);T=n}}function je(e=!0){for(var t=0,n=T;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=L(n);e&&n.remove(),n=i}}function Me(e){return e===this.v}function Ne(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Pe(e){return!Ne(e,this.v)}var Fe=!1,Ie=!1,D=null;function Le(e){D=e}function Re(e,t=!1,n){D={p:D,i:!1,c:null,e:null,s:e,x:null,r:G,l:Ie&&!t?{s:null,u:null,$:[]}:null}}function ze(e){var t=D,n=t.e;if(n!==null){t.e=null;for(var r of n)cn(r)}return e!==void 0&&(t.x=e),t.i=!0,D=t.p,e??{}}function Be(){return!Ie||D!==null&&D.l===null}var Ve=[];function He(){var e=Ve;Ve=[],te(e)}function Ue(e){if(Ve.length===0&&!et){var t=Ve;queueMicrotask(()=>{t===Ve&&He()})}Ve.push(e)}function We(){for(;Ve.length>0;)He()}function Ge(e){var t=G;if(t===null)return H.f|=ue,e;if(!(t.f&32768)&&!(t.f&4))throw e;O(e,t)}function O(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Ke=~(v|y|_);function k(e,t){e.f=e.f&Ke|t}function qe(e){e.f&512||e.deps===null?k(e,_):k(e,y)}function Je(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=x,Je(t.deps))}function Ye(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Je(e.deps),k(e,_)}var Xe=!1,Ze=!1;function Qe(e){var t=Ze;try{return Ze=!1,[e(),Ze]}finally{Ze=t}}var A=new Set,j=null,M=null,$e=null,et=!1,tt=!1,nt=null,rt=null,it=0,at=1,ot=class e{id=at++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u=new Set;#d(){return this.is_fork||this.#r.size>0}#f(){for(let n of this.#u)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#c.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)k(n,v),this.schedule(n);for(n of t.m)k(n,y),this.schedule(n)}}#p(){if(it++>1e3&&(A.delete(this),ct()),!this.#d()){for(let e of this.#o)this.#s.delete(e),k(e,v),this.schedule(e);for(let e of this.#s)k(e,y),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=nt=[],r=[],i=rt=[];for(let e of t)try{this.#m(e,n,r)}catch(t){throw mt(e),t}if(j=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(nt=null,rt=null,this.#d()||this.#f()){this.#h(r),this.#h(n);for(let[e,t]of this.#c)pt(e,t)}else{this.#n.size===0&&A.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),lt(r),lt(n),this.#i?.resolve()}var o=j;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(A.add(o),o.#p()),A.has(this)||this.#g()}#m(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Fe&&i&16777224?n.push(r):Pn(r)&&(i&16&&this.#s.add(r),zn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#h(e){for(var t=0;t<e.length;t+=1)Ye(e[t],this.#o,this.#s)}capture(e,t,r=!1){t!==n&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,r]),M?.set(e,e.v))}activate(){j=this}deactivate(){j=null,M=null}flush(){try{tt=!0,j=this,this.#p()}finally{it=0,$e=null,nt=null,rt=null,tt=!1,j=null,M=null,P.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),A.delete(this)}#g(){for(let c of A){var e=c.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(c.current.has(r)){var n=c.current.get(r)[0];if(e&&i!==n)c.current.set(r,[i,a]);else continue}t.push(r)}var r=[...c.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&c.discard();else if(t.length>0){c.activate();var i=new Set,a=new Map;for(var o of t)ut(o,r,i,a);if(c.#a.length>0){c.apply();for(var s of c.#a)c.#m(s,[],[]);c.#a=[]}c.deactivate()}}for(let e of A)e.#u.has(this)&&(e.#u.delete(this),e.#u.size===0&&!e.#d()&&(e.activate(),e.#p()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#l||n||(this.#l=!0,Ue(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=g()).promise}static ensure(){if(j===null){let t=j=new e;tt||(A.add(j),et||Ue(()=>{j===t&&t.flush()}))}return j}apply(){if(!Fe||!this.is_fork&&A.size===1){M=null;return}M=new Map;for(let[e,[t]]of this.current)M.set(e,t);for(let n of A)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#u.add(n);else for(let[e,t]of n.previous)M.has(e)||M.set(e,t)}}schedule(e){if($e=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(nt!==null&&t===G&&(Fe||(H===null||!(H.f&2))&&!Xe))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#a.push(t)}};function st(e){var t=et;et=!0;try{var n;for(e&&(j!==null&&!j.is_fork&&j.flush(),n=e());;){if(We(),j===null)return n;j.flush()}}finally{et=t}}function ct(){try{ve()}catch(e){O(e,$e)}}var N=null;function lt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Pn(r)&&(N=new Set,zn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&xn(r),N?.size>0)){P.clear();for(let e of N){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)N.has(n)&&(N.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||zn(n)}}N.clear()}}N=null}}function ut(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?ut(i,t,n,r):e&4194320&&!(e&2048)&&dt(i,t,r)&&(k(i,v),ft(i))}}function dt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(o.call(t,r))return!0;if(r.f&2&&dt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function ft(e){j.schedule(e)}function pt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,_);for(var n=e.first;n!==null;)pt(n,t),n=n.next}}function mt(e){k(e,_);for(var t=e.first;t!==null;)mt(t),t=t.next}function ht(e){let t=0,n=Ft(0),r;return()=>{an()&&(Q(n),pn(()=>(t===0&&(r=Hn(()=>e(()=>Bt(n)))),t+=1,()=>{Ue(()=>{--t,t===0&&(r?.(),r=void 0,Bt(n))})})))}}var gt=oe|b;function _t(e,t,n,r){new vt(e,t,n,r)}var vt=class{parent;is_pending=!1;transform_error;#e;#t=w?T:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=ht(()=>(this.#m=Ft(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=G;t.b=this,t.f|=128,n(e)},this.parent=G.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=hn(()=>{if(w){let e=this.#t;Oe();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},gt),w&&(this.#e=T)}#g(){try{this.#a=gn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=gn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=gn(()=>e(this.#e)),Ue(()=>{var e=this.#c=document.createDocumentFragment(),t=Jt();e.append(t),this.#a=this.#x(()=>gn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Sn(this.#o,()=>{this.#o=null}),this.#b(j))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=gn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();wn(this.#a,e);let t=this.#n.pending;this.#o=gn(()=>t(this.#e))}else this.#b(j)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ye(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=G,n=H,r=D;K(this.#i),W(this.#i),Le(this.#i.ctx);try{return ot.ensure(),e()}catch(e){return Ge(e),null}finally{K(t),W(n),Le(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Sn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ue(()=>{this.#d=!1,this.#m&&Lt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Q(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(B(this.#a),null),this.#o&&=(B(this.#o),null),this.#s&&=(B(this.#s),null),w&&(E(this.#t),Ae(),E(je()));var r=!1,i=!1;let a=()=>{if(r){Ee();return}r=!0,i&&we(),this.#s!==null&&Sn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){O(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return gn(()=>{var t=G;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return O(e,this.#i.parent),null}}))};Ue(()=>{var t;try{t=this.transform_error(e)}catch(e){O(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>O(e,this.#i&&this.#i.parent)):o(t)})}};function yt(e,t,n,r){let i=Be()?Ct:Et;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=G,s=bt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||O(e,o)}xt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=St();function d(){Promise.all(n.map(e=>wt(e))).then(e=>l([...t.map(i),...e])).catch(e=>O(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),xt()}):d()}function bt(){var e=G,t=H,n=D,r=j;return function(i=!0){K(e),W(t),Le(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function xt(e=!0){K(null),W(null),Le(null),e&&j?.deactivate()}function St(){var e=G,t=e.b,n=j,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ct(e){var t=2|v,r=H!==null&&H.f&2?H:null;return G!==null&&(G.f|=b),{ctx:D,deps:null,effects:null,equals:Me,f:t,fn:e,reactions:null,rv:0,v:n,wv:0,parent:r??G,ac:null}}function wt(e,t,r){let i=G;i===null&&me();var a=void 0,o=Ft(n),s=!H,c=new Map;return fn(()=>{var t=G,n=g();a=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(xt)}catch(e){n.reject(e),xt()}var r=j;if(s){if(t.f&32768)var l=St();if(i.b.is_rendered())c.get(r)?.reject(C),c.delete(r);else{for(let e of c.values())e.reject(C);c.clear()}c.set(r,n)}let u=(e,n=void 0)=>{if(l&&l(n===C),!(n===C||t.f&16384)){if(r.activate(),n)o.f|=ue,Lt(o,n);else{o.f&8388608&&(o.f^=ue),Lt(o,e);for(let[e,t]of c){if(c.delete(e),e===r)break;t.reject(C)}}r.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),on(()=>{for(let e of c.values())e.reject(C)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function Tt(e){let t=Ct(e);return Fe||On(t),t}function Et(e){let t=Ct(e);return t.equals=Pe,t}function Dt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)B(t[n])}}function Ot(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function kt(e){var t,n=G;K(Ot(e));try{e.f&=~x,Dt(e),t=In(e)}finally{K(n)}return t}function At(e){var t=e.v,n=kt(e);if(!e.equals(n)&&(e.wv=Nn(),(!j?.is_fork||e.deps===null)&&(e.v=n,j?.capture(e,t,!0),e.deps===null))){k(e,_);return}V||(M===null?qe(e):(an()||j?.is_fork)&&M.set(e,n))}function jt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(C),t.teardown=ee,t.ac=null,Rn(t,0),vn(t))}function Mt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&zn(t)}var Nt=new Set,P=new Map,Pt=!1;function Ft(e,t){return{f:0,v:e,reactions:null,equals:Me,rv:0,wv:0}}function F(e,t){let n=Ft(e,t);return On(n),n}function It(e,t=!1,n=!0){let r=Ft(e);return t||(r.equals=Pe),Ie&&n&&D!==null&&D.l!==null&&(D.l.s??=[]).push(r),r}function I(e,t,n=!1){return H!==null&&(!U||H.f&131072)&&Be()&&H.f&4325394&&(q===null||!o.call(q,e))&&Ce(),Lt(e,n?Ht(t):t,rt)}function Lt(e,t,n=null){if(!e.equals(t)){var r=e.v;V?P.set(e,t):P.set(e,r),e.v=t;var i=ot.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&kt(t),M===null&&qe(t)}e.wv=Nn(),Vt(e,v,n),Be()&&G!==null&&G.f&1024&&!(G.f&96)&&(X===null?kn([e]):X.push(e)),!i.is_fork&&Nt.size>0&&!Pt&&Rt()}return t}function Rt(){Pt=!1;for(let e of Nt)e.f&1024&&k(e,y),Pn(e)&&zn(e);Nt.clear()}function zt(e,t=1){var n=Q(e),r=t===1?n++:n--;return I(e,n),r}function Bt(e){I(e,e.v+1)}function Vt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Be(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===G)){var l=(c&v)===0;if(l&&k(s,t),c&2){var u=s;M?.delete(u),c&65536||(c&512&&(s.f|=x),Vt(u,y,n))}else if(l){var d=s;c&16&&N!==null&&N.add(d),n===null?ft(d):n.push(d)}}}}function Ht(e){if(typeof e!=`object`||!e||S in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var r=new Map,a=i(e),o=F(0),s=null,c=Z,l=e=>{if(Z===c)return e();var t=H,n=Z;W(null),Mn(c);var r=e();return W(t),Mn(n),r};return a&&r.set(`length`,F(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&xe();var i=r.get(t);return i===void 0?l(()=>{var e=F(n.value,s);return r.set(t,e),e}):I(i,n.value,!0),!0},deleteProperty(e,t){var i=r.get(t);if(i===void 0){if(t in e){let e=l(()=>F(n,s));r.set(t,e),Bt(o)}}else I(i,n),Bt(o);return!0},get(t,i,a){if(i===S)return e;var o=r.get(i),c=i in t;if(o===void 0&&(!c||u(t,i)?.writable)&&(o=l(()=>F(Ht(c?t[i]:n),s)),r.set(i,o)),o!==void 0){var d=Q(o);return d===n?void 0:d}return Reflect.get(t,i,a)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i&&`value`in i){var a=r.get(t);a&&(i.value=Q(a))}else if(i===void 0){var o=r.get(t),s=o?.v;if(o!==void 0&&s!==n)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(e,t){if(t===S)return!0;var i=r.get(t),a=i!==void 0&&i.v!==n||Reflect.has(e,t);return(i!==void 0||G!==null&&(!a||u(e,t)?.writable))&&(i===void 0&&(i=l(()=>F(a?Ht(e[t]):n,s)),r.set(t,i)),Q(i)===n)?!1:a},set(e,t,i,c){var d=r.get(t),f=t in e;if(a&&t===`length`)for(var p=i;p<d.v;p+=1){var m=r.get(p+``);m===void 0?p in e&&(m=l(()=>F(n,s)),r.set(p+``,m)):I(m,n)}if(d===void 0)(!f||u(e,t)?.writable)&&(d=l(()=>F(void 0,s)),I(d,Ht(i)),r.set(t,d));else{f=d.v!==n;var h=l(()=>Ht(i));I(d,h)}var ee=Reflect.getOwnPropertyDescriptor(e,t);if(ee?.set&&ee.set.call(c,i),!f){if(a&&typeof t==`string`){var te=r.get(`length`),g=Number(t);Number.isInteger(g)&&g>=te.v&&I(te,g+1)}Bt(o)}return!0},ownKeys(e){Q(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==n});for(var[i,a]of r)a.v!==n&&!(i in e)&&t.push(i);return t},setPrototypeOf(){Se()}})}var Ut,Wt,Gt,Kt;function qt(){if(Ut===void 0){Ut=window,Wt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Gt=u(t,`firstChild`).get,Kt=u(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function Jt(e=``){return document.createTextNode(e)}function Yt(e){return Gt.call(e)}function L(e){return Kt.call(e)}function Xt(e,t){if(!w)return Yt(e);var n=Yt(T);if(n===null)n=T.appendChild(Jt());else if(t&&n.nodeType!==3){var r=Jt();return n?.before(r),E(r),r}return t&&en(n),E(n),n}function Zt(e,t=!1){if(!w){var n=Yt(e);return n instanceof Comment&&n.data===``?L(n):n}if(t){if(T?.nodeType!==3){var r=Jt();return T?.before(r),E(r),r}en(T)}return T}function R(e,t=1,n=!1){let r=w?T:e;for(var i;t--;)i=r,r=L(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=Jt();return r===null?i?.after(a):r.before(a),E(a),a}en(r)}return E(r),r}function Qt(e){e.textContent=``}function $t(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function en(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function tn(e){var t=H,n=G;W(null),K(null);try{return e()}finally{W(t),K(n)}}function nn(e){G===null&&(H===null&&_e(e),ge()),V&&he(e)}function rn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function z(e,t){var n=G;n!==null&&n.f&8192&&(e|=ne);var r={ctx:D,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)nt===null?ot.ensure().schedule(r):nt.push(r);else if(t!==null){try{zn(r)}catch(e){throw B(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=oe))}if(i!==null&&(i.parent=n,n!==null&&rn(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function an(){return H!==null&&!U}function on(e){let t=z(8,null);return k(t,_),t.teardown=e,t}function sn(e){nn(`$effect`);var t=G.f;if(!H&&t&32&&!(t&32768)){var n=D;(n.e??=[]).push(e)}else return cn(e)}function cn(e){return z(4|se,e)}function ln(e){ot.ensure();let t=z(64|b,e);return()=>{B(t)}}function un(e){ot.ensure();let t=z(64|b,e);return(e={})=>new Promise(n=>{e.outro?Sn(t,()=>{B(t),n(void 0)}):(B(t),n(void 0))})}function dn(e){return z(4,e)}function fn(e){return z(le|b,e)}function pn(e,t=0){return z(8|t,e)}function mn(e,t=[],n=[],r=[]){yt(r,t,n,t=>{z(8,()=>e(...t.map(Q)))})}function hn(e,t=0){return z(16|t,e)}function gn(e){return z(32|b,e)}function _n(e){var t=e.teardown;if(t!==null){let e=V,n=H;Dn(!0),W(null);try{t.call(null)}finally{Dn(e),W(n)}}}function vn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&tn(()=>{e.abort(C)});var r=n.next;n.f&64?n.parent=null:B(n,t),n=r}}function yn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||B(t),t=n}}function B(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(bn(e.nodes.start,e.nodes.end),n=!0),k(e,ae),vn(e,t&&!n),Rn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();_n(e),e.f^=ae,e.f|=re;var i=e.parent;i!==null&&i.first!==null&&xn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function bn(e,t){for(;e!==null;){var n=e===t?null:L(e);e.remove(),e=n}}function xn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Sn(e,t,n=!0){var r=[];Cn(e,r,!0);var i=()=>{n&&B(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Cn(e,t,n){if(!(e.f&8192)){e.f^=ne;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Cn(i,t,o?n:!1),i=a}}}function wn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:L(n);t.append(n),n=i}}var Tn=null,En=!1,V=!1;function Dn(e){V=e}var H=null,U=!1;function W(e){H=e}var G=null;function K(e){G=e}var q=null;function On(e){H!==null&&(!Fe||H.f&2)&&(q===null?q=[e]:q.push(e))}var J=null,Y=0,X=null;function kn(e){X=e}var An=1,jn=0,Z=jn;function Mn(e){Z=e}function Nn(){return++An}function Pn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~x),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Pn(a)&&At(a),a.wv>e.wv)return!0}t&512&&M===null&&k(e,_)}return!1}function Fn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Fe&&q!==null&&o.call(q,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Fn(a,t,!1):t===a&&(n?k(a,v):a.f&1024&&k(a,y),ft(a))}}function In(e){var t=J,n=Y,r=X,i=H,a=q,o=D,s=U,c=Z,l=e.f;J=null,Y=0,X=null,H=l&96?null:e,q=null,Le(e.ctx),U=!1,Z=++jn,e.ac!==null&&(tn(()=>{e.ac.abort(C)}),e.ac=null);try{e.f|=ce;var u=e.fn,d=u();e.f|=ie;var f=e.deps,p=j?.is_fork;if(J!==null){var m;if(p||Rn(e,Y),f!==null&&Y>0)for(f.length=Y+J.length,m=0;m<J.length;m++)f[Y+m]=J[m];else e.deps=f=J;if(an()&&e.f&512)for(m=Y;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Y<f.length&&(Rn(e,Y),f.length=Y);if(Be()&&X!==null&&!U&&f!==null&&!(e.f&6146))for(m=0;m<X.length;m++)Fn(X[m],e);if(i!==null&&i!==e){if(jn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=jn;if(t!==null)for(let e of t)e.rv=jn;X!==null&&(r===null?r=X:r.push(...X))}return e.f&8388608&&(e.f^=ue),d}catch(e){return Ge(e)}finally{e.f^=ce,J=t,Y=n,X=r,H=i,q=a,Le(o),U=s,Z=c}}function Ln(e,t){let n=t.reactions;if(n!==null){var r=a.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(J===null||!o.call(J,t))){var s=t;s.f&512&&(s.f^=512,s.f&=~x),qe(s),jt(s),Rn(s,0)}}function Rn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ln(e,n[r])}function zn(e){var t=e.f;if(!(t&16384)){k(e,_);var n=G,r=En;G=e,En=!0;try{t&16777232?yn(e):vn(e),_n(e);var i=In(e);e.teardown=typeof i==`function`?i:null,e.wv=An}finally{En=r,G=n}}}function Q(e){var t=(e.f&2)!=0;if(Tn?.add(e),H!==null&&!U&&!(G!==null&&G.f&16384)&&(q===null||!o.call(q,e))){var n=H.deps;if(H.f&2097152)e.rv<jn&&(e.rv=jn,J===null&&n!==null&&n[Y]===e?Y++:J===null?J=[e]:J.push(e));else{(H.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[H]:o.call(r,H)||r.push(H)}}if(V&&P.has(e))return P.get(e);if(t){var i=e;if(V){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Vn(i))&&(a=kt(i)),P.set(i,a),a}var s=(i.f&512)==0&&!U&&H!==null&&(En||(H.f&512)!=0),c=(i.f&ie)===0;Pn(i)&&(s&&(i.f|=512),At(i)),s&&!c&&(Mt(i),Bn(i))}if(M?.has(e))return M.get(e);if(e.f&8388608)throw e.v;return e.v}function Bn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Mt(t),Bn(t))}function Vn(e){if(e.v===n)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(P.has(t)||t.f&2&&Vn(t))return!0;return!1}function Hn(e){var t=U;try{return U=!0,e()}finally{U=t}}var Un=Symbol(`events`),Wn=new Set,Gn=new Set;function Kn(e,t,n,r={}){function i(e){if(r.capture||Zn.call(t,e),!e.cancelBubble)return tn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Ue(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function qn(e,t,n,r,i){var a={capture:r,passive:i},o=Kn(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&on(()=>{t.removeEventListener(e,o,a)})}function Jn(e,t,n){(t[Un]??={})[e]=n}function Yn(e){for(var t=0;t<e.length;t++)Wn.add(e[t]);for(var n of Gn)n(e)}var Xn=null;function Zn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Xn=e;var o=0,s=Xn===e&&e[Un];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Un]=t;return}var u=i.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(a=i[o]||e.target,a!==t){l(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=H,f=G;W(null),K(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var ee=a[Un]?.[r];ee!=null&&(!a.disabled||e.target===a)&&ee.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Un]=t,delete e.currentTarget,W(d),K(f)}}}var Qn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function $n(e){return Qn?.createHTML(e)??e}function er(e){var t=$t(`template`);return t.innerHTML=$n(e.replaceAll(`<!>`,`<!---->`)),t.content}function tr(e,t){var n=G;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function nr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(w)return tr(T,null),T;i===void 0&&(i=er(a?e:`<!>`+e),n||(i=Yt(i)));var t=r||Wt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Yt(t),s=t.lastChild;tr(o,s)}else tr(t,t);return t}}function rr(e,t){if(w){var n=G;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=T),Oe();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var ir=[`touchstart`,`touchmove`];function ar(e){return ir.includes(e)}function or(e,t){return lr(e,t)}function sr(e,n){qt(),n.intro=n.intro??!1;let r=n.target,i=w,a=T;try{for(var o=Yt(r);o&&(o.nodeType!==8||o.data!==`[`);)o=L(o);if(!o)throw t;De(!0),E(o);let i=lr(e,{...n,anchor:o});return De(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
|
|
2
|
+
`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==t&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&ye(),qt(),Qt(r),De(!1),or(e,n)}finally{De(i),E(a)}}var cr=new Map;function lr(e,{target:n,anchor:r,props:i={},events:a,context:o,intro:c=!0,transformError:l}){qt();var u=void 0,d=un(()=>{var c=r??n.appendChild(Jt());_t(c,{pending:()=>{}},n=>{Re({});var r=D;if(o&&(r.c=o),a&&(i.$$events=a),w&&tr(n,null),u=e(n,i)||{},w&&(G.nodes.end=T,T===null||T.nodeType!==8||T.data!==`]`))throw Te(),t;ze()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=ar(r);for(let e of[n,document]){var a=cr.get(e);a===void 0&&(a=new Map,cr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Zn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(s(Wn)),Gn.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=cr.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Zn),t.delete(e),t.size===0&&cr.delete(r)):t.set(e,i)}Gn.delete(f),c!==r&&c.parentNode?.removeChild(c)}});return ur.set(u,d),u}var ur=new WeakMap;function dr(e,t){let n=ur.get(e);return n?(ur.delete(e),n(t)):Promise.resolve()}function fr(e,t){dn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=$t(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}var pr=Symbol(`is custom element`),mr=Symbol(`is html`),hr=pe?`link`:`LINK`;function gr(e,t,n,r){var i=_r(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===hr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&yr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $(e,t,n){var r=H,i=G;let a=w;w&&De(!1),W(null),K(null);try{t!==`style`&&(vr.has(e.getAttribute(`is`)||e.nodeName)||!customElements||customElements.get(e.getAttribute(`is`)||e.nodeName.toLowerCase())?yr(e).includes(t):n&&typeof n==`object`)?e[t]=n:gr(e,t,n==null?n:String(n))}finally{W(r),K(i),a&&De(!0)}}function _r(e){return e.__attributes??={[pr]:e.nodeName.includes(`-`),[mr]:e.namespaceURI===r}}var vr=new Map;function yr(e){var t=e.getAttribute(`is`)||e.nodeName,n=vr.get(t);if(n)return n;vr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&n.push(o);i=m(i)}return n}function br(e,t,n,r){var i=!Ie||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Hn(r):r),s);let d;if(a){var f=S in e||de in e;d=u(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Qe(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),d&&(i&&be(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var ee=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||ee||m)&&d(t?h():e),e):h()})}var te=!1,g=(n&1?Ct:Et)(()=>(te=!1,h()));a&&Q(g);var _=G;return(function(e,t){if(arguments.length>0){let n=t?Q(g):i&&a?Ht(e):e;return I(g,n),te=!0,s!==void 0&&(s=n),e}return V&&te||_.f&16384?g.v:Q(g)})}function xr(e){return new Sr(e)}var Sr=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=It(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Q(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===de?!0:(Q(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return I(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?sr:or)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!Fe&&(!e?.props?.$$host||e.sync===!1)&&st(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||l(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{dr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Cr;typeof HTMLElement==`function`&&(Cr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=$t(`slot`);e!==`default`&&(n.name=e),rr(t,n)}}let t={},n=Tr(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=wr(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=xr({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ln(()=>{pn(()=>{this.$$r=!0;for(let e of c(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=wr(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=wr(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return c(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function wr(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function Tr(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function Er(e,t,n,r,i,a){let o=class extends Cr{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return c(t).map(e=>(t[e].attribute||e).toLowerCase())}};return c(t).forEach(e=>{l(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=wr(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(u(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{l(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var Dr={name:`@htmlbricks/svelte-webcomponent`,private:!0,version:`0.66.8`,type:`module`,scripts:{dev:`vite --open`,build:`vite build`,"publish:wc":`node publish.ts`,"build:wc":`node build.ts`,"watch:wc":`node watch.ts`,preview:`vite preview`,check:`svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json`,"release:patch":`npm version patch && git push && git push --tags && npm run build:wc && npm run publish:wc`,"release:minor":`npm version minor && git push && git push --tags && npm run build:wc && npm run publish:wc`,"release:major":`npm version major && git push && git push --tags && npm run build:wc && npm run publish:wc`},devDependencies:{"@google-pay/button-element":`^3.2.1`,"@paypal/paypal-js":`^9.5.0`,"@sveltejs/vite-plugin-svelte":`^7.0.0`,"@tsconfig/svelte":`^5.0.8`,"@types/debounce":`^1.2.4`,"@types/node":`^24.10.1`,"@types/rgb-hex":`^3.0.0`,"chart.js":`^4.5.1`,"date-holidays":`^3.26.12`,dayjs:`^1.11.20`,"hls.js":`^1.6.15`,"html5-joystick-new":`^0.0.6`,ol:`^10.8.0`,"perfect-freehand":`^1.2.3`,prettier:`^3.8.1`,"rollup-plugin-terser":`^7.0.2`,"sass-embedded":`^1.98.0`,"simple-serverless-auth-client":`^0.0.6`,"simple-webrtc-element":`^0.0.1`,"simple-webrtc-element-whep":`^0.2.3`,"style-to-object":`^1.0.14`,svelte:`^5.55.0`,"svelte-check":`^4.4.5`,terser:`^5.46.1`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.2`,vite:`^8.0.3`},dependencies:{"@floating-ui/dom":`^1.7.6`,"@popperjs/core":`^2.11.8`,bootstrap:`^5.3.8`,debounce:`^3.0.0`,"html-colors":`^0.0.6`,marked:`^17.0.5`,raphael:`^2.3.0`,"rgb-hex":`^4.1.0`,"wc-js-utils":`^0.4.7`}};function Or(e){let t=e?.repoName.split(`/`)?.[1]||e?.repoName;if(!t)throw Error(`wrong componentPath `+e?.repoName);if(!e?.version)throw Error(`wrong version `+e?.version);let n=e?.iifePath||`main.iife.js`;if(!document.getElementById(t+`-script`))try{let r=document.createElement(`script`);if(r.id=t+`-script`,r.src=`https://cdn.jsdelivr.net/npm/${e.repoName}@${e.version}/${n}`,e?.local)r.src=`${e.local}`;else if(location.href.includes(`localhost:6006`)){let e=t.split(`-`)[0];r.src=`http://localhost:6006/webcomponents/${t.replace(e+`-`,``)}/${n}`}document.head.appendChild(r)}catch(e){console.warn(e)}}var kr=nr(`<div part="controller" id="controller" class="svelte-1swbd4i"><button>clear</button> <button>select</button> <button>draw</button> <button>undo</button> <button>redo</button> <button>save</button> <button>brush</button> <br/>load:<hb-input-file></hb-input-file> insert:<hb-input-file></hb-input-file></div> <div part="paper-container" id="paper-container" style="position:relative" class="svelte-1swbd4i"><hb-stylus-paper></hb-stylus-paper></div>`,3),Ar={hash:`svelte-1swbd4i`,code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr;}#controller.svelte-1swbd4i {grid-area:header;}#paper-container.svelte-1swbd4i {grid-area:paper;background:green;}`};function jr(e,t){Re(t,!0),fr(e,Ar);let n=br(t,`id`,7,``),r=br(t,`load_draw`,7),i=F(`draw`),a=F(0),o=F(void 0),s=F(!1),c=F(void 0),l=F(void 0),u=F(void 0),d=F(void 0),f=Tt(()=>(Q(o)===0||Q(o))&&Q(o)<Q(a)),p=Tt(()=>(Q(a)||Q(a)===0)&&Q(s)&&(!Q(o)||Q(o)!==-1)&&(!Q(d)||Q(d)<Q(a)&&(!Q(o)||Q(o)<Q(d))));sn(()=>{if(typeof r()==`string`&&r()?.length)try{r(JSON.parse(r()))}catch(e){console.error(`error parsing json`,e)}}),Or({repoName:`@htmlbricks/hb-stylus-paper`,version:Dr.version}),Or({repoName:`@htmlbricks/hb-input-file`,version:Dr.version});function m(e,t){var n=`data:text/json;charset=utf-8,`+encodeURIComponent(JSON.stringify(e)),r=document.createElement(`a`);r.setAttribute(`href`,n),r.setAttribute(`download`,t),document.body.appendChild(r),r.click(),r.remove()}function h(e){I(i,e,!0)}function ee(){console.log(`ch`,Q(a),Q(o)),Q(a)>=0&&(!Q(o)||Q(o)>-1)&&(I(o,Q(o)||Q(o)===0?Q(o)-1:Q(a)-1,!0),console.log(`undo`,Q(a),Q(o)))}function te(){console.log(Q(a),Q(o)),(Q(o)||Q(o)===0)&&Q(o)<=Q(a)&&(zt(o),console.log(`redo`,Q(a),Q(o)))}function g(e){Q(s)||I(s,!0),console.log(`h`,e),I(a,e.index-1),e.start_index&&I(d,e.start_index,!0),I(o,void 0)}function _(){I(c,{name:`test`,type:`json`},!0)}function v(e){let t=e.value?.name;if(t){let n=new FileReader;n.readAsDataURL(e.value),n.onload=function(e){try{if(console.log(`insert file`,e.target,e.target?.result),e.target?.result){let n=e.target.result.toString().split(`;`)[0].split(`/`)[1];I(l,{base64:e.target.result.toString(),type:n,name:t},!0)}}catch{console.error(`error loading file`)}},n.onerror=function(e){console.error(`error reading file`)}}}function y(e){console.log(`save`,e),I(c,void 0),m(e,e?.name+`.json`)}function ne(e){if(console.log(`file`,e),e.value?.name){let t=new FileReader;t.readAsText(e.value,`UTF-8`),t.onload=function(e){if(e?.target?.result?.toString())try{r(JSON.parse(e.target.result.toString()))}catch{console.error(`error loading file`)}},t.onerror=function(e){console.error(`error reading file`)}}}var re={get id(){return n()},set id(e=``){n(e),st()},get load_draw(){return r()},set load_draw(e){r(e),st()}},ie=kr(),ae=Zt(ie),oe=Xt(ae),b=R(oe,2),se=R(b,2),x=R(se,2),ce=R(x,2),le=R(ce,2),ue=R(le,2),S=R(ue,4);$(S,`id`,`loadfile`),$(S,`schemaentry`,JSON.stringify({label:`ciao`,id:`xxxxxxx`}));var de=R(S,2);$(de,`id`,`insertfile`),$(de,`schemaentry`,JSON.stringify({label:`ciao`})),ke(ae);var fe=R(ae,2),C=Xt(fe);return $(C,`id`,`stylus-paper`),mn(()=>$(C,`goto`,Q(o))),$(C,`background_color`,`green`),mn(()=>$(C,`mode`,Q(i))),mn(()=>$(C,`save_as`,Q(c)?JSON.stringify(Q(c)):``)),mn(()=>$(C,`load_draw`,r()?JSON.stringify(r()):null)),mn(()=>$(C,`insert_image`,Q(l)?JSON.stringify(Q(l)):null)),mn(()=>$(C,`insert_text`,Q(u)?JSON.stringify(Q(u)):null)),ke(fe),mn(()=>{x.disabled=!Q(p),ce.disabled=!Q(f),le.disabled=!Q(p),ue.disabled=Q(i)!==`draw`}),Jn(`click`,oe,()=>h(`eraser`)),Jn(`click`,b,()=>h(`select`)),Jn(`click`,se,()=>h(`draw`)),Jn(`click`,x,()=>ee()),Jn(`click`,ce,()=>te()),Jn(`click`,le,()=>_()),qn(`setVal`,S,e=>ne(e.detail)),qn(`setVal`,de,e=>v(e.detail)),qn(`historyIndex`,C,e=>g(e.detail)),qn(`save`,C,e=>y(e.detail)),rr(e,ie),ze(re)}Yn([`click`]),customElements.define(`hb-stylus-notebook`,Er(jr,{id:{},load_draw:{}},[],[],{mode:`open`})),e.Component=jr})(this[`stylus-notebook`]=this[`stylus-notebook`]||{});
|
|
3
|
+
//# sourceMappingURL=main.iife.js.map
|