@htmlbricks/hb-pad-joystick 0.66.0 → 0.66.2
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(ue){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const pr=2,fe="[",Bt="[!",ce="]",ht={},y=Symbol(),Ut=!1;var mr=Array.isArray,gr=Array.prototype.indexOf,br=Array.from,Pt=Object.keys,Nt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,wr=Object.prototype,kr=Array.prototype,yr=Object.getPrototypeOf,he=Object.isExtensible;function $r(t){for(var e=0;e<t.length;e++)t[e]()}function xr(){var t,e,r=new Promise((i,s)=>{t=i,e=s});return{promise:r,resolve:t,reject:e}}const w=2,Gt=4,Sr=8,W=16,z=32,Z=64,Dt=128,A=512,$=1024,E=2048,q=4096,j=8192,Q=16384,Mt=32768,vt=65536,de=1<<17,ve=1<<18,_t=1<<19,Er=1<<20,st=32768,Jt=1<<21,_e=1<<22,bt=1<<23,Kt=Symbol("$state"),Cr=Symbol("legacy props"),pe=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=3,wt=8;function Tr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Rr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Lr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Pr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Nr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Mr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Yr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ar(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Yt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function jr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let g=!1;function pt(t){g=t}let m;function O(t){if(t===null)throw Yt(),ht;return m=t}function Zt(){return O(B(m))}function ge(t){if(g){if(B(m)!==null)throw Yt(),ht;m=t}}function Or(t=1){if(g){for(var e=t,r=m;e--;)r=B(r);m=r}}function be(t=!0){for(var e=0,r=m;;){if(r.nodeType===wt){var i=r.data;if(i===ce){if(e===0)return r;e-=1}else(i===fe||i===Bt)&&(e+=1)}var s=B(r);t&&r.remove(),r=s}}function Xr(t){if(!t||t.nodeType!==wt)throw Yt(),ht;return t.data}function we(t){return t===this.v}function Ir(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Ir(t,this.v)}let zr=!1,L=null;function At(t){L=t}function ke(t,e=!1,r){L={p:L,i:!1,c:null,e:null,s:t,x:null,l:null}}function ye(t){var e=L,r=e.e;if(r!==null){e.e=null;for(var i of r)ze(i)}return t!==void 0&&(e.x=t),e.i=!0,L=e.p,t??{}}function $e(){return!0}let at=[];function xe(){var t=at;at=[],$r(t)}function Qt(t){if(at.length===0&&!kt){var e=at;queueMicrotask(()=>{e===at&&xe()})}at.push(t)}function qr(){for(;at.length>0;)xe()}function Se(t){var e=p;if(e===null)return _.f|=bt,t;if((e.f&Mt)===0){if((e.f&Dt)===0)throw t;e.b.error(t)}else Ft(t,e)}function Ft(t,e){for(;e!==null;){if((e.f&Dt)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const jt=new Set;let k=null,P=null,N=[],Ot=null,te=!1,kt=!1;class F{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#i=0;#l=null;#s=[];#n=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#i>0}process(e){N=[],this.apply();var r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)this.#a(i,r);this.is_fork||this.#f(),this.is_deferred()?(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects)):(k=null,Ce(r.render_effects),Ce(r.effects),this.#l?.resolve()),P=null}#a(e,r){e.f^=$;for(var i=e.first;i!==null;){var s=i.f,n=(s&(z|Z))!==0,a=n&&(s&$)!==0,o=a||(s&j)!==0||this.skipped_effects.has(i);if((i.f&Dt)!==0&&i.b?.is_pending()&&(r={parent:r,effect:i,effects:[],render_effects:[],block_effects:[]}),!o&&i.fn!==null){n?i.f^=$:(s&Gt)!==0?r.effects.push(i):Ct(i)&&((i.f&W)!==0&&r.block_effects.push(i),Tt(i));var l=i.first;if(l!==null){i=l;continue}}var u=i.parent;for(i=i.next;i===null&&u!==null;)u===r.effect&&(this.#o(r.effects),this.#o(r.render_effects),this.#o(r.block_effects),r=r.parent),i=u.next,u=u.parent}}#o(e){for(const r of e)((r.f&E)!==0?this.#s:this.#n).push(r),this.#u(r.deps),S(r,$)}#u(e){if(e!==null)for(const r of e)(r.f&w)===0||(r.f&st)===0||(r.f^=st,this.#u(r.deps))}capture(e,r){this.previous.has(e)||this.previous.set(e,r),(e.f&bt)===0&&(this.current.set(e,e.v),P?.set(e,e.v))}activate(){k=this,this.apply()}deactivate(){k===this&&(k=null,P=null)}flush(){if(this.activate(),N.length>0){if(Ee(),k!==null&&k!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#f(){if(this.#i===0){for(const e of this.#e)e();this.#e.clear()}this.#r===0&&this.#c()}#c(){if(jt.size>1){this.previous.clear();var e=P,r=!0,i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of jt){if(n===this){r=!1;continue}const a=[];for(const[l,u]of this.current){if(n.current.has(l))if(r&&u!==n.current.get(l))n.current.set(l,u);else continue;a.push(l)}if(a.length===0)continue;const o=[...n.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var s=N;N=[];const l=new Set,u=new Map;for(const c of a)Te(c,o,l,u);if(N.length>0){k=n,n.apply();for(const c of N)n.#a(c,i);n.deactivate()}N=s}}k=null,P=e}this.committed=!0,jt.delete(this)}increment(e){this.#r+=1,e&&(this.#i+=1)}decrement(e){this.#r-=1,e&&(this.#i-=1),this.revive()}revive(){for(const e of this.#s)S(e,E),ot(e);for(const e of this.#n)S(e,q),ot(e);this.#s=[],this.#n=[],this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#l??=xr()).promise}static ensure(){if(k===null){const e=k=new F;jt.add(k),kt||F.enqueue(()=>{k===e&&e.flush()})}return k}static enqueue(e){Qt(e)}apply(){}}function Xt(t){var e=kt;kt=!0;try{for(var r;;){if(qr(),N.length===0&&(k?.flush(),N.length===0))return Ot=null,r;Ee()}}finally{kt=e}}function Ee(){var t=it;te=!0;var e=null;try{var r=0;for(zt(!0);N.length>0;){var i=F.ensure();if(r++>1e3){var s,n;Vr()}i.process(N),tt.clear()}}finally{te=!1,zt(t),Ot=null}}function Vr(){try{Nr()}catch(t){Ft(t,Ot)}}let V=null;function Ce(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if((i.f&(Q|j))===0&&Ct(i)&&(V=new Set,Tt(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null&&i.ac===null?Ue(i):i.fn=null),V?.size>0)){tt.clear();for(const s of V){if((s.f&(Q|j))!==0)continue;const n=[s];let a=s.parent;for(;a!==null;)V.has(a)&&(V.delete(a),n.push(a)),a=a.parent;for(let o=n.length-1;o>=0;o--){const l=n[o];(l.f&(Q|j))===0&&Tt(l)}}V.clear()}}V=null}}function Te(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const s of t.reactions){const n=s.f;(n&w)!==0?Te(s,e,r,i):(n&(_e|W))!==0&&(n&E)===0&&Re(s,e,i)&&(S(s,E),ot(s))}}function Re(t,e,r){const i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(const s of t.deps){if(e.includes(s))return!0;if((s.f&w)!==0&&Re(s,e,r))return r.set(s,!0),!0}return r.set(t,!1),!1}function ot(t){for(var e=Ot=t;e.parent!==null;){e=e.parent;var r=e.f;if(te&&e===p&&(r&W)!==0&&(r&ve)===0)return;if((r&(Z|z))!==0){if((r&$)===0)return;e.f^=$}}N.push(e)}function Hr(t){let e=0,r=It(0),i;return()=>{Wt()&&(I(r),qe(()=>(e===0&&(i=ar(()=>t(()=>yt(r)))),e+=1,()=>{Qt(()=>{e-=1,e===0&&(i?.(),i=void 0,yt(r))})})))}}var Br=vt|_t|Dt;function Ur(t,e,r){new Gr(t,e,r)}class Gr{parent;#e=!1;#t;#r=g?m:null;#i;#l;#s;#n=null;#a=null;#o=null;#u=null;#f=null;#c=0;#h=0;#v=!1;#d=null;#b=Hr(()=>(this.#d=It(this.#c),()=>{this.#d=null}));constructor(e,r,i){this.#t=e,this.#i=r,this.#l=i,this.parent=p.b,this.#e=!!this.#i.pending,this.#s=Ve(()=>{if(p.b=this,g){const n=this.#r;Zt(),n.nodeType===wt&&n.data===Bt?this.#k():this.#w()}else{var s=this.#m();try{this.#n=U(()=>i(s))}catch(n){this.error(n)}this.#h>0?this.#p():this.#e=!1}return()=>{this.#f?.remove()}},Br),g&&(this.#t=m)}#w(){try{this.#n=U(()=>this.#l(this.#t))}catch(e){this.error(e)}this.#e=!1}#k(){const e=this.#i.pending;e&&(this.#a=U(()=>e(this.#t)),F.enqueue(()=>{var r=this.#m();this.#n=this.#_(()=>(F.ensure(),U(()=>this.#l(r)))),this.#h>0?this.#p():(St(this.#a,()=>{this.#a=null}),this.#e=!1)}))}#m(){var e=this.#t;return this.#e&&(this.#f=rt(),this.#t.before(this.#f),e=this.#f),e}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#i.pending}#_(e){var r=p,i=_,s=L;nt(this.#s),D(this.#s),At(this.#s.ctx);try{return e()}catch(n){return Se(n),null}finally{nt(r),D(i),At(s)}}#p(){const e=this.#i.pending;this.#n!==null&&(this.#u=document.createDocumentFragment(),this.#u.append(this.#f),Ke(this.#n,this.#u)),this.#a===null&&(this.#a=U(()=>e(this.#t)))}#g(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(e);return}this.#h+=e,this.#h===0&&(this.#e=!1,this.#a&&St(this.#a,()=>{this.#a=null}),this.#u&&(this.#t.before(this.#u),this.#u=null))}update_pending_count(e){this.#g(e),this.#c+=e,this.#d&&De(this.#d,this.#c)}get_effect_pending(){return this.#b(),I(this.#d)}error(e){var r=this.#i.onerror;let i=this.#i.failed;if(this.#v||!r&&!i)throw e;this.#n&&(C(this.#n),this.#n=null),this.#a&&(C(this.#a),this.#a=null),this.#o&&(C(this.#o),this.#o=null),g&&(O(this.#r),Or(),O(be()));var s=!1,n=!1;const a=()=>{if(s){jr();return}s=!0,n&&Fr(),F.ensure(),this.#c=0,this.#o!==null&&St(this.#o,()=>{this.#o=null}),this.#e=this.has_pending_snippet(),this.#n=this.#_(()=>(this.#v=!1,U(()=>this.#l(this.#t)))),this.#h>0?this.#p():this.#e=!1};var o=_;try{D(null),n=!0,r?.(e,a),n=!1}catch(l){Ft(l,this.#s&&this.#s.parent)}finally{D(o)}i&&Qt(()=>{this.#o=this.#_(()=>{F.ensure(),this.#v=!0;try{return U(()=>{i(this.#t,()=>e,()=>a)})}catch(l){return Ft(l,this.#s.parent),null}finally{this.#v=!1}})})}}function Jr(t){var e=w|E,r=_!==null&&(_.f&w)!==0?_:null;return p!==null&&(p.f|=_t),{ctx:L,deps:null,effects:null,equals:we,f:e,fn:t,reactions:null,rv:0,v:y,wv:0,parent:r??p,ac:null}}function Le(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)C(e[r])}}function Kr(t){for(var e=t.parent;e!==null;){if((e.f&w)===0)return(e.f&Q)===0?e:null;e=e.parent}return null}function ee(t){var e,r=p;nt(Kr(t));try{t.f&=~st,Le(t),e=ir(t)}finally{nt(r)}return e}function Pe(t){var e=ee(t);if(t.equals(e)||(k?.is_fork||(t.v=e),t.wv=er()),!ut)if(P!==null)Wt()&&P.set(t,e);else{var r=(t.f&A)===0?q:$;S(t,r)}}let re=new Set;const tt=new Map;let Ne=!1;function It(t,e){var r={f:0,v:t,reactions:null,equals:we,rv:0,wv:0};return r}function et(t,e){const r=It(t);return ci(r),r}function Zr(t,e=!1,r=!0){const i=It(t);return e||(i.equals=Wr),i}function H(t,e,r=!1){_!==null&&(!X||(_.f&de)!==0)&&$e()&&(_.f&(w|W|_e|de))!==0&&!G?.includes(t)&&Ar();let i=r?$t(e):e;return De(t,i)}function De(t,e){if(!t.equals(e)){var r=t.v;ut?tt.set(t,e):tt.set(t,r),t.v=e;var i=F.ensure();i.capture(t,r),(t.f&w)!==0&&((t.f&E)!==0&&ee(t),S(t,(t.f&A)!==0?$:q)),t.wv=er(),Me(t,E),p!==null&&(p.f&$)!==0&&(p.f&(z|Z))===0&&(M===null?hi([t]):M.push(t)),!i.is_fork&&re.size>0&&!Ne&&Qr()}return e}function Qr(){Ne=!1;var t=it;zt(!0);const e=Array.from(re);try{for(const r of e)(r.f&$)!==0&&S(r,q),Ct(r)&&Tt(r)}finally{zt(t)}re.clear()}function yt(t){H(t,t.v+1)}function Me(t,e){var r=t.reactions;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s],a=n.f,o=(a&E)===0;if(o&&S(n,e),(a&w)!==0){var l=n;P?.delete(l),(a&st)===0&&(a&A&&(n.f|=st),Me(l,q))}else o&&((a&W)!==0&&V!==null&&V.add(n),ot(n))}}function $t(t){if(typeof t!="object"||t===null||Kt in t)return t;const e=yr(t);if(e!==wr&&e!==kr)return t;var r=new Map,i=mr(t),s=et(0),n=ft,a=o=>{if(ft===n)return o();var l=_,u=ft;D(null),tr(n);var c=o();return D(l),tr(u),c};return i&&r.set("length",et(t.length)),new Proxy(t,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Mr();var c=r.get(l);return c===void 0?c=a(()=>{var v=et(u.value);return r.set(l,v),v}):H(c,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const c=a(()=>et(y));r.set(l,c),yt(s)}}else H(u,y),yt(s);return!0},get(o,l,u){if(l===Kt)return t;var c=r.get(l),v=l in o;if(c===void 0&&(!v||dt(o,l)?.writable)&&(c=a(()=>{var h=$t(v?o[l]:y),d=et(h);return d}),r.set(l,c)),c!==void 0){var f=I(c);return f===y?void 0:f}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=r.get(l);c&&(u.value=I(c))}else if(u===void 0){var v=r.get(l),f=v?.v;if(v!==void 0&&f!==y)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(o,l){if(l===Kt)return!0;var u=r.get(l),c=u!==void 0&&u.v!==y||Reflect.has(o,l);if(u!==void 0||p!==null&&(!c||dt(o,l)?.writable)){u===void 0&&(u=a(()=>{var f=c?$t(o[l]):y,h=et(f);return h}),r.set(l,u));var v=I(u);if(v===y)return!1}return c},set(o,l,u,c){var v=r.get(l),f=l in o;if(i&&l==="length")for(var h=u;h<v.v;h+=1){var d=r.get(h+"");d!==void 0?H(d,y):h in o&&(d=a(()=>et(y)),r.set(h+"",d))}if(v===void 0)(!f||dt(o,l)?.writable)&&(v=a(()=>et(void 0)),H(v,$t(u)),r.set(l,v));else{f=v.v!==y;var b=a(()=>$t(u));H(v,b)}var T=Reflect.getOwnPropertyDescriptor(o,l);if(T?.set&&T.set.call(c,u),!f){if(i&&typeof l=="string"){var J=r.get("length"),Y=Number(l);Number.isInteger(Y)&&Y>=J.v&&H(J,Y+1)}yt(s)}return!0},ownKeys(o){I(s);var l=Reflect.ownKeys(o).filter(v=>{var f=r.get(v);return f===void 0||f.v!==y});for(var[u,c]of r)c.v!==y&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Yr()}})}var Ye,Ae,Fe,je;function ie(){if(Ye===void 0){Ye=window,Ae=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fe=dt(e,"firstChild").get,je=dt(e,"nextSibling").get,he(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),he(r)&&(r.__t=void 0)}}function rt(t=""){return document.createTextNode(t)}function xt(t){return Fe.call(t)}function B(t){return je.call(t)}function Oe(t,e){if(!g)return xt(t);var r=xt(m);return r===null&&(r=m.appendChild(rt())),O(r),r}function Xe(t,e=!1){if(!g){var r=xt(t);return r instanceof Comment&&r.data===""?B(r):r}if(e&&m?.nodeType!==me){var i=rt();return m?.before(i),O(i),i}return m}function ne(t,e=1,r=!1){let i=g?m:t;for(var s;e--;)s=i,i=B(i);if(!g)return i;if(r&&i?.nodeType!==me){var n=rt();return i===null?s?.after(n):i.before(n),O(n),n}return O(i),i}function ti(t){t.textContent=""}function ei(){return!1}function Ie(t){var e=_,r=p;D(null),nt(null);try{return t()}finally{D(e),nt(r)}}function ri(t){p===null&&(_===null&&Pr(),Lr()),ut&&Rr()}function ii(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function lt(t,e,r){var i=p;i!==null&&(i.f&j)!==0&&(t|=j);var s={ctx:L,deps:null,nodes_start:null,nodes_end:null,f:t|E|A,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{Tt(s),s.f|=Mt}catch(o){throw C(s),o}else e!==null&&ot(s);var n=s;if(r&&n.deps===null&&n.teardown===null&&n.nodes_start===null&&n.first===n.last&&(n.f&_t)===0&&(n=n.first,(t&W)!==0&&(t&vt)!==0&&n!==null&&(n.f|=vt)),n!==null&&(n.parent=i,i!==null&&ii(n,i),_!==null&&(_.f&w)!==0&&(t&Z)===0)){var a=_;(a.effects??=[]).push(n)}return s}function Wt(){return _!==null&&!X}function We(t){ri();var e=p.f,r=!_&&(e&z)!==0&&(e&Mt)===0;if(r){var i=L;(i.e??=[]).push(t)}else return ze(t)}function ze(t){return lt(Gt|Er,t,!1)}function ni(t){F.ensure();const e=lt(Z|_t,t,!0);return()=>{C(e)}}function si(t){F.ensure();const e=lt(Z|_t,t,!0);return(r={})=>new Promise(i=>{r.outro?St(e,()=>{C(e),i(void 0)}):(C(e),i(void 0))})}function ai(t){return lt(Gt,t,!1)}function qe(t,e=0){return lt(Sr|e,t,!0)}function Ve(t,e=0){var r=lt(W|e,t,!0);return r}function U(t){return lt(z|_t,t,!0)}function He(t){var e=t.teardown;if(e!==null){const r=ut,i=_;Ze(!0),D(null);try{e.call(null)}finally{Ze(r),D(i)}}}function Be(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&Ie(()=>{s.abort(pe)});var i=r.next;(r.f&Z)!==0?r.parent=null:C(r,e),r=i}}function oi(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&z)===0&&C(e),e=r}}function C(t,e=!0){var r=!1;(e||(t.f&ve)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(li(t.nodes_start,t.nodes_end),r=!0),Be(t,e&&!r),qt(t,0),S(t,Q);var i=t.transitions;if(i!==null)for(const n of i)n.stop();He(t);var s=t.parent;s!==null&&s.first!==null&&Ue(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function li(t,e){for(;t!==null;){var r=t===e?null:B(t);t.remove(),t=r}}function Ue(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function St(t,e,r=!0){var i=[];Ge(t,i,!0),ui(i,()=>{r&&C(t),e&&e()})}function ui(t,e){var r=t.length;if(r>0){var i=()=>--r||e();for(var s of t)s.out(i)}else e()}function Ge(t,e,r){if((t.f&j)===0){if(t.f^=j,t.transitions!==null)for(const a of t.transitions)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,n=(i.f&vt)!==0||(i.f&z)!==0&&(t.f&W)!==0;Ge(i,e,n?r:!1),i=s}}}function fi(t){Je(t,!0)}function Je(t,e){if((t.f&j)!==0){t.f^=j,(t.f&$)===0&&(S(t,E),ot(t));for(var r=t.first;r!==null;){var i=r.next,s=(r.f&vt)!==0||(r.f&z)!==0;Je(r,s?e:!1),r=i}if(t.transitions!==null)for(const n of t.transitions)(n.is_global||e)&&n.in()}}function Ke(t,e){for(var r=t.nodes_start,i=t.nodes_end;r!==null;){var s=r===i?null:B(r);e.append(r),r=s}}let it=!1;function zt(t){it=t}let ut=!1;function Ze(t){ut=t}let _=null,X=!1;function D(t){_=t}let p=null;function nt(t){p=t}let G=null;function ci(t){_!==null&&(G===null?G=[t]:G.push(t))}let x=null,R=0,M=null;function hi(t){M=t}let Qe=1,Et=0,ft=Et;function tr(t){ft=t}function er(){return++Qe}function Ct(t){var e=t.f;if((e&E)!==0)return!0;if(e&w&&(t.f&=~st),(e&q)!==0){var r=t.deps;if(r!==null)for(var i=r.length,s=0;s<i;s++){var n=r[s];if(Ct(n)&&Pe(n),n.wv>t.wv)return!0}(e&A)!==0&&P===null&&S(t,$)}return!1}function rr(t,e,r=!0){var i=t.reactions;if(i!==null&&!G?.includes(t))for(var s=0;s<i.length;s++){var n=i[s];(n.f&w)!==0?rr(n,e,!1):e===n&&(r?S(n,E):(n.f&$)!==0&&S(n,q),ot(n))}}function ir(t){var e=x,r=R,i=M,s=_,n=G,a=L,o=X,l=ft,u=t.f;x=null,R=0,M=null,_=(u&(z|Z))===0?t:null,G=null,At(t.ctx),X=!1,ft=++Et,t.ac!==null&&(Ie(()=>{t.ac.abort(pe)}),t.ac=null);try{t.f|=Jt;var c=t.fn,v=c(),f=t.deps;if(x!==null){var h;if(qt(t,R),f!==null&&R>0)for(f.length=R+x.length,h=0;h<x.length;h++)f[R+h]=x[h];else t.deps=f=x;if(it&&Wt()&&(t.f&A)!==0)for(h=R;h<f.length;h++)(f[h].reactions??=[]).push(t)}else f!==null&&R<f.length&&(qt(t,R),f.length=R);if($e()&&M!==null&&!X&&f!==null&&(t.f&(w|q|E))===0)for(h=0;h<M.length;h++)rr(M[h],t);return s!==null&&s!==t&&(Et++,M!==null&&(i===null?i=M:i.push(...M))),(t.f&bt)!==0&&(t.f^=bt),v}catch(d){return Se(d)}finally{t.f^=Jt,x=e,R=r,M=i,_=s,G=n,At(a),X=o,ft=l}}function di(t,e){let r=e.reactions;if(r!==null){var i=gr.call(r,t);if(i!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[i]=r[s],r.pop())}}r===null&&(e.f&w)!==0&&(x===null||!x.includes(e))&&(S(e,q),(e.f&A)!==0&&(e.f^=A,e.f&=~st),Le(e),qt(e,0))}function qt(t,e){var r=t.deps;if(r!==null)for(var i=e;i<r.length;i++)di(t,r[i])}function Tt(t){var e=t.f;if((e&Q)===0){S(t,$);var r=p,i=it;p=t,it=!0;try{(e&W)!==0?oi(t):Be(t),He(t);var s=ir(t);t.teardown=typeof s=="function"?s:null,t.wv=Qe;var n;Ut&&zr&&(t.f&E)!==0&&t.deps}finally{it=i,p=r}}}function I(t){var e=t.f,r=(e&w)!==0;if(_!==null&&!X){var i=p!==null&&(p.f&Q)!==0;if(!i&&!G?.includes(t)){var s=_.deps;if((_.f&Jt)!==0)t.rv<Et&&(t.rv=Et,x===null&&s!==null&&s[R]===t?R++:x===null?x=[t]:x.includes(t)||x.push(t));else{(_.deps??=[]).push(t);var n=t.reactions;n===null?t.reactions=[_]:n.includes(_)||n.push(_)}}}if(ut){if(tt.has(t))return tt.get(t);if(r){var a=t,o=a.v;return((a.f&$)===0&&a.reactions!==null||sr(a))&&(o=ee(a)),tt.set(a,o),o}}else r&&!P?.has(t)&&(a=t,Ct(a)&&Pe(a),it&&Wt()&&(a.f&A)===0&&nr(a));if(P?.has(t))return P.get(t);if((t.f&bt)!==0)throw t.v;return t.v}function nr(t){if(t.deps!==null){t.f^=A;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&w)!==0&&(e.f&A)===0&&nr(e)}}function sr(t){if(t.v===y)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(tt.has(e)||(e.f&w)!==0&&sr(e))return!0;return!1}function ar(t){var e=X;try{return X=!0,t()}finally{X=e}}const vi=-7169;function S(t,e){t.f=t.f&vi|e}const or=new Set,se=new Set;function _i(t){for(var e=0;e<t.length;e++)or.add(t[e]);for(var r of se)r(t)}let lr=null;function Vt(t){var e=this,r=e.ownerDocument,i=t.type,s=t.composedPath?.()||[],n=s[0]||t.target;lr=t;var a=0,o=lr===t&&t.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(n=s[a]||t.target,n!==e){Nt(t,"currentTarget",{configurable:!0,get(){return n||r}});var c=_,v=p;D(null),nt(null);try{for(var f,h=[];n!==null;){var d=n.assignedSlot||n.parentNode||n.host||null;try{var b=n["__"+i];b!=null&&(!n.disabled||t.target===n)&&b.call(n,t)}catch(T){f?h.push(T):f=T}if(t.cancelBubble||d===e||d===null)break;n=d}if(f){for(let T of h)queueMicrotask(()=>{throw T});throw f}}finally{t.__root=e,delete t.currentTarget,D(c),nt(v)}}}function pi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Rt(t,e){var r=p;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function ae(t,e){var r=(e&pr)!==0,i,s=!t.startsWith("<!>");return()=>{if(g)return Rt(m,null),m;i===void 0&&(i=pi(s?t:"<!>"+t),i=xt(i));var n=r||Ae?document.importNode(i,!0):i.cloneNode(!0);return Rt(n,n),n}}function ur(){if(g)return Rt(m,null),m;var t=document.createDocumentFragment(),e=document.createComment(""),r=rt();return t.append(e,r),Rt(e,r),t}function mt(t,e){if(g){var r=p;((r.f&Mt)===0||r.nodes_end===null)&&(r.nodes_end=m),Zt();return}t!==null&&t.before(e)}const mi=["touchstart","touchmove"];function gi(t){return mi.includes(t)}function fr(t,e){return cr(t,e)}function bi(t,e){ie(),e.intro=e.intro??!1;const r=e.target,i=g,s=m;try{for(var n=xt(r);n&&(n.nodeType!==wt||n.data!==fe);)n=B(n);if(!n)throw ht;pt(!0),O(n);const a=cr(t,{...e,anchor:n});return pt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
|
|
2
|
-
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ht&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Dr(),ie(),ti(r),pt(!1),fr(t,e)}finally{pt(i),O(s)}}const gt=new Map;function cr(t,{target:e,anchor:r,props:i={},events:s,context:n,intro:a=!0}){ie();var o=new Set,l=v=>{for(var f=0;f<v.length;f++){var h=v[f];if(!o.has(h)){o.add(h);var d=gi(h);e.addEventListener(h,Vt,{passive:d});var b=gt.get(h);b===void 0?(document.addEventListener(h,Vt,{passive:d}),gt.set(h,1)):gt.set(h,b+1)}}};l(br(or)),se.add(l);var u=void 0,c=si(()=>{var v=r??e.appendChild(rt());return Ur(v,{pending:()=>{}},f=>{if(n){ke({});var h=L;h.c=n}if(s&&(i.$$events=s),g&&Rt(f,null),u=t(f,i)||{},g&&(p.nodes_end=m,m===null||m.nodeType!==wt||m.data!==ce))throw Yt(),ht;n&&ye()}),()=>{for(var f of o){e.removeEventListener(f,Vt);var h=gt.get(f);--h===0?(document.removeEventListener(f,Vt),gt.delete(f)):gt.set(f,h)}se.delete(l),v!==r&&v.parentNode?.removeChild(v)}});return oe.set(u,c),u}let oe=new WeakMap;function wi(t,e){const r=oe.get(t);return r?(oe.delete(t),r(e)):Promise.resolve()}class ki{anchor;#e=new Map;#t=new Map;#r=new Map;#i=new Set;#l=!0;constructor(e,r=!0){this.anchor=e,this.#l=r}#s=()=>{var e=k;if(this.#e.has(e)){var r=this.#e.get(e),i=this.#t.get(r);if(i)fi(i),this.#i.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),i=s.effect)}for(const[n,a]of this.#e){if(this.#e.delete(n),n===e)break;const o=this.#r.get(a);o&&(C(o.effect),this.#r.delete(a))}for(const[n,a]of this.#t){if(n===r||this.#i.has(n))continue;const o=()=>{if(Array.from(this.#e.values()).includes(n)){var u=document.createDocumentFragment();Ke(a,u),u.append(rt()),this.#r.set(n,{effect:a,fragment:u})}else C(a);this.#i.delete(n),this.#t.delete(n)};this.#l||!i?(this.#i.add(n),St(a,o,!1)):o()}}};#n=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[i,s]of this.#r)r.includes(i)||(C(s.effect),this.#r.delete(i))};ensure(e,r){var i=k,s=ei();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(s){var n=document.createDocumentFragment(),a=rt();n.append(a),this.#r.set(e,{effect:U(()=>r(a)),fragment:n})}else this.#t.set(e,U(()=>r(this.anchor)));if(this.#e.set(i,e),s){for(const[o,l]of this.#t)o===e?i.skipped_effects.delete(l):i.skipped_effects.add(l);for(const[o,l]of this.#r)o===e?i.skipped_effects.delete(l.effect):i.skipped_effects.add(l.effect);i.oncommit(this.#s),i.ondiscard(this.#n)}else g&&(this.anchor=m),this.#s()}}function yi(t){L===null&&Tr(),We(()=>{const e=ar(t);if(typeof e=="function")return e})}function hr(t,e,r=!1){g&&Zt();var i=new ki(t),s=r?vt:0;function n(a,o){if(g){const u=Xr(t)===Bt;if(a===u){var l=be();O(l),i.anchor=l,pt(!1),i.ensure(a,o),pt(!0);return}}i.ensure(a,o)}Ve(()=>{var a=!1;e((o,l=!0)=>{a=!0,n(l,o)}),a||n(!1,null)},s)}function $i(t,e){ai(()=>{var r=t.getRootNode(),i=r.host?r:r.head??r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s)}})}function le(t,e,r,i){var s=i,n=!0,a=()=>(n&&(n=!1,s=i),s),o;o=t[e],o===void 0&&i!==void 0&&(o=a());var l;l=()=>{var f=t[e];return f===void 0?a():(n=!0,f)};var u=!1,c=Jr(()=>(u=!1,l())),v=p;return(function(f,h){if(arguments.length>0){const d=h?I(c):f;return H(c,d),u=!0,s!==void 0&&(s=d),f}return ut&&u||(v.f&Q)!==0?c.v:I(c)})}function xi(t){return new Si(t)}class Si{#e;#t;constructor(e){var r=new Map,i=(n,a)=>{var o=Zr(a,!1,!1);return r.set(n,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(n,a){return I(r.get(a)??i(a,Reflect.get(n,a)))},has(n,a){return a===Cr?!0:(I(r.get(a)??i(a,Reflect.get(n,a))),Reflect.has(n,a))},set(n,a,o){return H(r.get(a)??i(a,o),o),Reflect.set(n,a,o)}});this.#t=(e.hydrate?bi:fr)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Xt(),this.#e=s.$$events;for(const n of Object.keys(this.#t))n==="$set"||n==="$destroy"||n==="$on"||Nt(this,n,{get(){return this.#t[n]},set(a){this.#t[n]=a},enumerable:!0});this.#t.$set=n=>{Object.assign(s,n)},this.#t.$destroy=()=>{wi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const i=(...s)=>r.call(this,...s);return this.#e[e].push(i),()=>{this.#e[e]=this.#e[e].filter(s=>s!==i)}}$destroy(){this.#t.$destroy()}}let dr;typeof HTMLElement=="function"&&(dr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const i=this.$$c.$on(t,e);this.$$l_u.set(e,i)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return s=>{const n=document.createElement("slot");i!=="default"&&(n.name=i),mt(s,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Ei(this);for(const i of this.$$s)i in r&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),e.default=!0):e[i]=t(i));for(const i of this.attributes){const s=this.$$g_p(i.name);s in this.$$d||(this.$$d[s]=Ht(s,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=xi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=ni(()=>{qe(()=>{this.$$r=!0;for(const i of Pt(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const s=Ht(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const i in this.$$l)for(const s of this.$$l[i]){const n=this.$$c.$on(i,s);this.$$l_u.set(s,n)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ht(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Pt(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ht(t,e,r,i){const s=r[t]?.type;if(e=s==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(s){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ei(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Ci(t,e,r,i,s,n){let a=class extends dr{constructor(){super(t,r,s),this.$$p_d=e}static get observedAttributes(){return Pt(e).map(o=>(e[o].attribute||o).toLowerCase())}};return Pt(e).forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Ht(o,l,e),this.$$d[o]=l;var u=this.$$c;if(u){var c=dt(u,o)?.get;c?u[o]=l:u.$set({[o]:l})}}})}),i.forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c?.[o]}})}),t.element=a,a}class Ti{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const i={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(n){}};this.callback=r?.callback||i.callback,this.title=r?.parameters?.title||i.title,this.width=r?.parameters?.width||i.width,this.height=r?.parameters?.height||i.height,this.internalFillColor=r?.parameters?.internalFillColor||i.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||i.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||i.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||i.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||i.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||i.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const s=this.canvas.getContext("2d");console.log("canvas",s),this.context=s,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",n=>this._onTouchStart(n),!1),document.addEventListener("touchmove",n=>this._onTouchMove(n),!1),document.addEventListener("touchend",n=>this._onTouchEnd(n),!1)):(this.canvas.addEventListener("mousedown",n=>this._onMouseDown(n),!1),document.addEventListener("mousemove",n=>this._onMouseMove(n),!1),document.addEventListener("mouseup",n=>this._onMouseUp(n),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,i=this.movedY-this.centerY;return i>=this.directionVerticalLimitNeg&&i<=this.directionVerticalLimitPos&&(e="C"),i<this.directionVerticalLimitNeg&&(e="N"),i>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var ct={},vr;function Ri(){if(vr)return ct;vr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.LanguageTranslator=void 0,ct.getChildStyleToPass=t,ct.addComponent=e;function t(i,s){var n,a,o="";try{if(i&&s?.length&&(!((n=Object.keys(i))===null||n===void 0)&&n.length)&&(!((a=s?.filter(function(f){return Object.keys(i).includes(f.name)}))===null||a===void 0)&&a.length))for(var l=function(f){var h=s?.filter(function(d){return d.name===f&&d.defaultValue!==i[f]});h&&(o+="".concat(f,":").concat(i[f],";"))},u=0,c=Object.keys(i);u<c.length;u++){var v=c[u];l(v)}}catch(f){console.error("error getting child style to pass",f)}finally{return o}}function e(i){var s,n=((s=i?.repoName.split("/"))===null||s===void 0?void 0:s[1])||i?.repoName;if(!n)throw new Error("wrong componentPath "+i?.repoName);if(!i?.version)throw new Error("wrong version "+i?.version);var a=i?.iifePath||"main.iife.js";if(!document.getElementById(n+"-script"))try{var o=document.createElement("script");if(o.id=n+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(i.repoName,"@").concat(i.version,"/").concat(a),i?.local)o.src="".concat(i.local);else if(location.href.includes("localhost:6006")){var l=n.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(n.replace(l+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(u){console.warn(u)}}var r=(function(){function i(s){if(this.lang="",!s?.dictionary)throw new Error("no dictionary provided");this.dictionary=s.dictionary,this.setLang(s?.lang)}return i.prototype.setLang=function(s){s||(s=i.getDefaultLang()),this.lang=s},i.prototype.translateWord=function(s,n){return i.getDictionaryWord(s,this.dictionary,n||this.lang)},i.prototype.translateDate=function(s,n,a){return i.formatDate(s,n,a||this.lang)},i.getDefaultLang=function(){var s,n,a,o="en";return navigator?.languages&&(!((a=(n=(s=navigator.languages[0])===null||s===void 0?void 0:s.split("-")[0])===null||n===void 0?void 0:n.toLowerCase())===null||a===void 0)&&a.length)&&(o=navigator.languages[0].split("-")[0].toLowerCase()),o},i.getDictionaryWord=function(s,n,a){var o;if(!s)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(a&&(!((o=n[a])===null||o===void 0)&&o[s]))return n[a][s];var l="",u=i.getDefaultLang();if(!a||u!==a){var c=n?.[u];c?.[s]&&(l=c[s])}return l},i.formatDate=function(s,n,a){if(!s)throw new Error("no date provided");if(typeof s.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||i.getDefaultLang(),n);return o.format(s)},i})();return ct.LanguageTranslator=r,ct}Ri();var Li=ae('<div class="set svelte-k03ui8"><nav class="d-pad svelte-k03ui8"><button class="up svelte-k03ui8" aria-label="Move up"></button> <button class="right svelte-k03ui8" aria-label="Move right"></button> <button class="down svelte-k03ui8" aria-label="Move down"></button> <button class="left svelte-k03ui8" aria-label="Move left"></button></nav></div>'),Pi=ae('<div id="joystick" class="svelte-k03ui8"></div>'),Ni=ae("<div>Unknown type</div>");const Di={hash:"svelte-k03ui8",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;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-k03ui8 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-k03ui8 {overflow:hidden;}.set.svelte-k03ui8 .d-pad:where(.svelte-k03ui8) {display:inline-block;}.d-pad.svelte-k03ui8 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-k03ui8:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-k03ui8:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-k03ui8:hover:after {width:30%;height:30%;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8),
|
|
1
|
+
(function(de){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const xr=2,ve="[",_e="[!",pe="[?",me="]",ct={},x=Symbol(),Er="http://www.w3.org/1999/xhtml",Cr=!1;var Tr=Array.isArray,Rr=Array.prototype.indexOf,dt=Array.prototype.includes,Nr=Array.from,Dt=Object.keys,At=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,Mr=Object.prototype,Lr=Array.prototype,Pr=Object.getPrototypeOf,ge=Object.isExtensible;const Dr=()=>{};function Ar(t){for(var e=0;e<t.length;e++)t[e]()}function Yr(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}const $=2,_t=4,we=8,be=1<<24,J=16,F=32,K=64,qt=128,M=512,S=1024,E=2048,j=4096,X=8192,Z=16384,st=32768,ke=1<<25,pt=65536,ye=1<<17,Or=1<<18,mt=1<<19,Fr=1<<20,at=65536,Bt=1<<21,$e=1<<22,$t=1<<23,Ut=Symbol("$state"),jr=Symbol("legacy props"),Gt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Jt=3,Yt=8;function Xr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ir(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Hr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Vr(){throw new Error("https://svelte.dev/e/hydration_failed")}function qr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Br(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ur(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Gr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ot(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Jr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let k=!1;function gt(t){k=t}let g;function I(t){if(t===null)throw Ot(),ct;return g=t}function Kt(){return I(U(g))}function Se(t){if(k){if(U(g)!==null)throw Ot(),ct;g=t}}function Kr(t=1){if(k){for(var e=t,r=g;e--;)r=U(r);g=r}}function xe(t=!0){for(var e=0,r=g;;){if(r.nodeType===Yt){var n=r.data;if(n===me){if(e===0)return r;e-=1}else(n===ve||n===_e||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=U(r);t&&r.remove(),r=i}}function Zr(t){if(!t||t.nodeType!==Yt)throw Ot(),ct;return t.data}function Ee(t){return t===this.v}function Qr(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tn(t){return!Qr(t,this.v)}let en=!1,L=null;function Ft(t){L=t}function Ce(t,e=!1,r){L={p:L,i:!1,c:null,e:null,s:t,x:null,r:m,l:null}}function Te(t){var e=L,r=e.e;if(r!==null){e.e=null;for(var n of r)Qe(n)}return t!==void 0&&(e.x=t),e.i=!0,L=e.p,t??{}}function Re(){return!0}let ot=[];function Ne(){var t=ot;ot=[],Ar(t)}function wt(t){if(ot.length===0&&!St){var e=ot;queueMicrotask(()=>{e===ot&&Ne()})}ot.push(t)}function rn(){for(;ot.length>0;)Ne()}function Me(t){var e=m;if(e===null)return _.f|=$t,t;if((e.f&st)===0&&(e.f&_t)===0)throw t;bt(t,e)}function bt(t,e){for(;e!==null;){if((e.f&qt)!==0){if((e.f&st)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw t}const nn=-7169;function y(t,e){t.f=t.f&nn|e}function Zt(t){(t.f&M)!==0||t.deps===null?y(t,S):y(t,j)}function Le(t){if(t!==null)for(const e of t)(e.f&$)===0||(e.f&at)===0||(e.f^=at,Le(e.deps))}function Pe(t,e,r){(t.f&E)!==0?e.add(t):(t.f&j)!==0&&r.add(t),Le(t.deps),y(t,S)}const Q=new Set;let b=null,A=null,Qt=null,St=!1,te=!1,kt=null,jt=null;var De=0;let sn=1;class V{id=sn++;current=new Map;previous=new Map;#t=new Set;#r=new Set;#e=new Map;#i=new Map;#s=null;#n=[];#a=new Set;#o=new Set;#l=new Map;is_fork=!1;#h=!1;#u=new Set;#c(){return this.is_fork||this.#i.size>0}#v(){for(const n of this.#u)for(const i of n.#i.keys()){for(var e=!1,r=i;r.parent!==null;){if(this.#l.has(r)){e=!0;break}r=r.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]})}unskip_effect(e){var r=this.#l.get(e);if(r){this.#l.delete(e);for(var n of r.d)y(n,E),this.schedule(n);for(n of r.m)y(n,j),this.schedule(n)}}#d(){if(De++>1e3&&(Q.delete(this),an()),!this.#c()){for(const a of this.#a)this.#o.delete(a),y(a,E),this.schedule(a);for(const a of this.#o)y(a,j),this.schedule(a)}const e=this.#n;this.#n=[],this.apply();var r=kt=[],n=[],i=jt=[];for(const a of e)try{this.#f(a,r,n)}catch(l){throw je(a),l}if(b=null,i.length>0){var s=V.ensure();for(const a of i)s.schedule(a)}if(kt=null,jt=null,this.#c()||this.#v()){this.#_(n),this.#_(r);for(const[a,l]of this.#l)Fe(a,l)}else{this.#e.size===0&&Q.delete(this),this.#a.clear(),this.#o.clear();for(const a of this.#t)a(this);this.#t.clear(),Ae(n),Ae(r),this.#s?.resolve()}var o=b;if(this.#n.length>0){const a=o??=this;a.#n.push(...this.#n.filter(l=>!a.#n.includes(l)))}o!==null&&(Q.add(o),o.#d()),Q.has(this)||this.#p()}#f(e,r,n){e.f^=S;for(var i=e.first;i!==null;){var s=i.f,o=(s&(F|K))!==0,a=o&&(s&S)!==0,l=a||(s&X)!==0||this.#l.has(i);if(!l&&i.fn!==null){o?i.f^=S:(s&_t)!==0?r.push(i):Rt(i)&&((s&J)!==0&&this.#o.add(i),yt(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var f=i.next;if(f!==null){i=f;break}i=i.parent}}}#_(e){for(var r=0;r<e.length;r+=1)Pe(e[r],this.#a,this.#o)}capture(e,r,n=!1){r!==x&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&$t)===0&&(this.current.set(e,[e.v,n]),A?.set(e,e.v))}activate(){b=this}deactivate(){b=null,A=null}flush(){try{te=!0,b=this,this.#d()}finally{De=0,Qt=null,kt=null,jt=null,te=!1,b=null,A=null,tt.clear()}}discard(){for(const e of this.#r)e(this);this.#r.clear(),Q.delete(this)}#p(){for(const u of Q){var e=u.id<this.id,r=[];for(const[f,[v,h]]of this.current){if(u.current.has(f)){var n=u.current.get(f)[0];if(e&&v!==n)u.current.set(f,[v,h]);else continue}r.push(f)}var i=[...u.current.keys()].filter(f=>!this.current.has(f));if(i.length===0)e&&u.discard();else if(r.length>0){u.activate();var s=new Set,o=new Map;for(var a of r)Ye(a,i,s,o);if(u.#n.length>0){u.apply();for(var l of u.#n)u.#f(l,[],[]);u.#n=[]}u.deactivate()}}for(const u of Q)u.#u.has(this)&&(u.#u.delete(this),u.#u.size===0&&!u.#c()&&(u.activate(),u.#d()))}increment(e,r){let n=this.#e.get(r)??0;if(this.#e.set(r,n+1),e){let i=this.#i.get(r)??0;this.#i.set(r,i+1)}}decrement(e,r,n){let i=this.#e.get(r)??0;if(i===1?this.#e.delete(r):this.#e.set(r,i-1),e){let s=this.#i.get(r)??0;s===1?this.#i.delete(r):this.#i.set(r,s-1)}this.#h||n||(this.#h=!0,wt(()=>{this.#h=!1,this.flush()}))}transfer_effects(e,r){for(const n of e)this.#a.add(n);for(const n of r)this.#o.add(n);e.clear(),r.clear()}oncommit(e){this.#t.add(e)}ondiscard(e){this.#r.add(e)}settled(){return(this.#s??=Yr()).promise}static ensure(){if(b===null){const e=b=new V;te||(Q.add(b),St||wt(()=>{b===e&&e.flush()}))}return b}apply(){{A=null;return}}schedule(e){if(Qt=e,e.b?.is_pending&&(e.f&(_t|we|be))!==0&&(e.f&st)===0){e.b.defer_effect(e);return}for(var r=e;r.parent!==null;){r=r.parent;var n=r.f;if(kt!==null&&r===m&&(_===null||(_.f&$)===0))return;if((n&(K|F))!==0){if((n&S)===0)return;r.f^=S}}this.#n.push(r)}}function Xt(t){var e=St;St=!0;try{for(var r;;){if(rn(),b===null)return r;b.flush()}}finally{St=e}}function an(){try{Hr()}catch(t){bt(t,Qt)}}let q=null;function Ae(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Z|X))===0&&Rt(n)&&(q=new Set,yt(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&nr(n),q?.size>0)){tt.clear();for(const i of q){if((i.f&(Z|X))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)q.has(o)&&(q.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Z|X))===0&&yt(l)}}q.clear()}}q=null}}function Ye(t,e,r,n){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const i of t.reactions){const s=i.f;(s&$)!==0?Ye(i,e,r,n):(s&($e|J))!==0&&(s&E)===0&&Oe(i,e,n)&&(y(i,E),ee(i))}}function Oe(t,e,r){const n=r.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const i of t.deps){if(dt.call(e,i))return!0;if((i.f&$)!==0&&Oe(i,e,r))return r.set(i,!0),!0}return r.set(t,!1),!1}function ee(t){b.schedule(t)}function Fe(t,e){if(!((t.f&F)!==0&&(t.f&S)!==0)){(t.f&E)!==0?e.d.push(t):(t.f&j)!==0&&e.m.push(t),y(t,S);for(var r=t.first;r!==null;)Fe(r,e),r=r.next}}function je(t){y(t,S);for(var e=t.first;e!==null;)je(e),e=e.next}function on(t){let e=0,r=It(0),n;return()=>{oe()&&(W(r),tr(()=>(e===0&&(n=_r(()=>t(()=>xt(r)))),e+=1,()=>{wt(()=>{e-=1,e===0&&(n?.(),n=void 0,xt(r))})})))}}var ln=pt|mt;function un(t,e,r,n){new fn(t,e,r,n)}class fn{parent;is_pending=!1;transform_error;#t;#r=k?g:null;#e;#i;#s;#n=null;#a=null;#o=null;#l=null;#h=0;#u=0;#c=!1;#v=new Set;#d=new Set;#f=null;#_=on(()=>(this.#f=It(this.#h),()=>{this.#f=null}));constructor(e,r,n,i){this.#t=e,this.#e=r,this.#i=s=>{var o=m;o.b=this,o.f|=qt,n(s)},this.parent=m.b,this.transform_error=i??this.parent?.transform_error??(s=>s),this.#s=er(()=>{if(k){const s=this.#r;Kt();const o=s.data===_e;if(s.data.startsWith(pe)){const l=JSON.parse(s.data.slice(pe.length));this.#k(l)}else o?this.#y():this.#p()}else this.#w()},ln),k&&(this.#t=g)}#p(){try{this.#n=G(()=>this.#i(this.#t))}catch(e){this.error(e)}}#k(e){const r=this.#e.failed;r&&(this.#o=G(()=>{r(this.#t,()=>e,()=>()=>{})}))}#y(){const e=this.#e.pending;e&&(this.is_pending=!0,this.#a=G(()=>e(this.#t)),wt(()=>{var r=this.#l=document.createDocumentFragment(),n=rt();r.append(n),this.#n=this.#g(()=>G(()=>this.#i(n))),this.#u===0&&(this.#t.before(r),this.#l=null,Tt(this.#a,()=>{this.#a=null}),this.#m(b))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#h=0,this.#n=G(()=>{this.#i(this.#t)}),this.#u>0){var e=this.#l=document.createDocumentFragment();ar(this.#n,e);const r=this.#e.pending;this.#a=G(()=>r(this.#t))}else this.#m(b)}catch(r){this.error(r)}}#m(e){this.is_pending=!1,e.transfer_effects(this.#v,this.#d)}defer_effect(e){Pe(e,this.#v,this.#d)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#g(e){var r=m,n=_,i=L;it(this.#s),z(this.#s),Ft(this.#s.ctx);try{return V.ensure(),e()}catch(s){return Me(s),null}finally{it(r),z(n),Ft(i)}}#b(e,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(e,r);return}this.#u+=e,this.#u===0&&(this.#m(r),this.#a&&Tt(this.#a,()=>{this.#a=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(e,r){this.#b(e,r),this.#h+=e,!(!this.#f||this.#c)&&(this.#c=!0,wt(()=>{this.#c=!1,this.#f&&We(this.#f,this.#h)}))}get_effect_pending(){return this.#_(),W(this.#f)}error(e){var r=this.#e.onerror;let n=this.#e.failed;if(!r&&!n)throw e;this.#n&&(C(this.#n),this.#n=null),this.#a&&(C(this.#a),this.#a=null),this.#o&&(C(this.#o),this.#o=null),k&&(I(this.#r),Kr(),I(xe()));var i=!1,s=!1;const o=()=>{if(i){Jr();return}i=!0,s&&Gr(),this.#o!==null&&Tt(this.#o,()=>{this.#o=null}),this.#g(()=>{this.#w()})},a=l=>{try{s=!0,r?.(l,o),s=!1}catch(u){bt(u,this.#s&&this.#s.parent)}n&&(this.#o=this.#g(()=>{try{return G(()=>{var u=m;u.b=this,u.f|=qt,n(this.#t,()=>l,()=>o)})}catch(u){return bt(u,this.#s.parent),null}}))};wt(()=>{var l;try{l=this.transform_error(e)}catch(u){bt(u,this.#s&&this.#s.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,u=>bt(u,this.#s&&this.#s.parent)):a(l)})}}function hn(t){var e=$|E,r=_!==null&&(_.f&$)!==0?_:null;return m!==null&&(m.f|=mt),{ctx:L,deps:null,effects:null,equals:Ee,f:e,fn:t,reactions:null,rv:0,v:x,wv:0,parent:r??m,ac:null}}function cn(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)C(e[r])}}function dn(t){for(var e=t.parent;e!==null;){if((e.f&$)===0)return(e.f&Z)===0?e:null;e=e.parent}return null}function re(t){var e,r=m;it(dn(t));try{t.f&=~at,cn(t),e=cr(t)}finally{it(r)}return e}function Xe(t){var e=t.v,r=re(t);if(!t.equals(r)&&(t.wv=fr(),(!b?.is_fork||t.deps===null)&&(t.v=r,b?.capture(t,e,!0),t.deps===null))){y(t,S);return}nt||(A!==null?(oe()||b?.is_fork)&&A.set(t,r):Zt(t))}function vn(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(Gt),e.teardown=Dr,e.ac=null,Nt(e,0),le(e))}function Ie(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&yt(e)}let ne=new Set;const tt=new Map;let ze=!1;function It(t,e){var r={f:0,v:t,reactions:null,equals:Ee,rv:0,wv:0};return r}function et(t,e){const r=It(t);return Tn(r),r}function _n(t,e=!1,r=!0){const n=It(t);return e||(n.equals=tn),n}function B(t,e,r=!1){_!==null&&(!Y||(_.f&ye)!==0)&&Re()&&(_.f&($|J|$e|ye))!==0&&(P===null||!dt.call(P,t))&&Ur();let n=r?Et(e):e;return We(t,n,jt)}function We(t,e,r=null){if(!t.equals(e)){var n=t.v;nt?tt.set(t,e):tt.set(t,n),t.v=e;var i=V.ensure();if(i.capture(t,n),(t.f&$)!==0){const s=t;(t.f&E)!==0&&re(s),A===null&&Zt(s)}t.wv=fr(),He(t,E,r),m!==null&&(m.f&S)!==0&&(m.f&(F|K))===0&&(D===null?Rn([t]):D.push(t)),!i.is_fork&&ne.size>0&&!ze&&pn()}return e}function pn(){ze=!1;for(const t of ne)(t.f&S)!==0&&y(t,j),Rt(t)&&yt(t);ne.clear()}function xt(t){B(t,t.v+1)}function He(t,e,r){var n=t.reactions;if(n!==null)for(var i=n.length,s=0;s<i;s++){var o=n[s],a=o.f,l=(a&E)===0;if(l&&y(o,e),(a&$)!==0){var u=o;A?.delete(u),(a&at)===0&&(a&M&&(o.f|=at),He(u,j,r))}else if(l){var f=o;(a&J)!==0&&q!==null&&q.add(f),r!==null?r.push(f):ee(f)}}}function Et(t){if(typeof t!="object"||t===null||Ut in t)return t;const e=Pr(t);if(e!==Mr&&e!==Lr)return t;var r=new Map,n=Tr(t),i=et(0),s=ft,o=a=>{if(ft===s)return a();var l=_,u=ft;z(null),ur(s);var f=a();return z(l),ur(u),f};return n&&r.set("length",et(t.length)),new Proxy(t,{defineProperty(a,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&qr();var f=r.get(l);return f===void 0?o(()=>{var v=et(u.value);return r.set(l,v),v}):B(f,u.value,!0),!0},deleteProperty(a,l){var u=r.get(l);if(u===void 0){if(l in a){const f=o(()=>et(x));r.set(l,f),xt(i)}}else B(u,x),xt(i);return!0},get(a,l,u){if(l===Ut)return t;var f=r.get(l),v=l in a;if(f===void 0&&(!v||vt(a,l)?.writable)&&(f=o(()=>{var p=Et(v?a[l]:x),d=et(p);return d}),r.set(l,f)),f!==void 0){var h=W(f);return h===x?void 0:h}return Reflect.get(a,l,u)},getOwnPropertyDescriptor(a,l){var u=Reflect.getOwnPropertyDescriptor(a,l);if(u&&"value"in u){var f=r.get(l);f&&(u.value=W(f))}else if(u===void 0){var v=r.get(l),h=v?.v;if(v!==void 0&&h!==x)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(a,l){if(l===Ut)return!0;var u=r.get(l),f=u!==void 0&&u.v!==x||Reflect.has(a,l);if(u!==void 0||m!==null&&(!f||vt(a,l)?.writable)){u===void 0&&(u=o(()=>{var h=f?Et(a[l]):x,p=et(h);return p}),r.set(l,u));var v=W(u);if(v===x)return!1}return f},set(a,l,u,f){var v=r.get(l),h=l in a;if(n&&l==="length")for(var p=u;p<v.v;p+=1){var d=r.get(p+"");d!==void 0?B(d,x):p in a&&(d=o(()=>et(x)),r.set(p+"",d))}if(v===void 0)(!h||vt(a,l)?.writable)&&(v=o(()=>et(void 0)),B(v,Et(u)),r.set(l,v));else{h=v.v!==x;var c=o(()=>Et(u));B(v,c)}var w=Reflect.getOwnPropertyDescriptor(a,l);if(w?.set&&w.set.call(f,u),!h){if(n&&typeof l=="string"){var R=r.get("length"),O=Number(l);Number.isInteger(O)&&O>=R.v&&B(R,O+1)}xt(i)}return!0},ownKeys(a){W(i);var l=Reflect.ownKeys(a).filter(v=>{var h=r.get(v);return h===void 0||h.v!==x});for(var[u,f]of r)f.v!==x&&!(u in a)&&l.push(u);return l},setPrototypeOf(){Br()}})}var Ve,qe,Be,Ue;function ie(){if(Ve===void 0){Ve=window,qe=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Be=vt(e,"firstChild").get,Ue=vt(e,"nextSibling").get,ge(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ge(r)&&(r.__t=void 0)}}function rt(t=""){return document.createTextNode(t)}function Ct(t){return Be.call(t)}function U(t){return Ue.call(t)}function Ge(t,e){if(!k)return Ct(t);var r=Ct(g);return r===null&&(r=g.appendChild(rt())),I(r),r}function mn(t,e=!1){if(!k){var r=Ct(t);return r instanceof Comment&&r.data===""?U(r):r}if(e){if(g?.nodeType!==Jt){var n=rt();return g?.before(n),I(n),n}Je(g)}return g}function se(t,e=1,r=!1){let n=k?g:t;for(var i;e--;)i=n,n=U(n);if(!k)return n;if(r){if(n?.nodeType!==Jt){var s=rt();return n===null?i?.after(s):n.before(s),I(s),s}Je(n)}return I(n),n}function gn(t){t.textContent=""}function wn(){return!1}function ae(t,e,r){return document.createElementNS(Er,t,void 0)}function Je(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Jt;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Ke(t){var e=_,r=m;z(null),it(null);try{return t()}finally{z(e),it(r)}}function bn(t){m===null&&(_===null&&Wr(),zr()),nt&&Ir()}function kn(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function lt(t,e){var r=m;r!==null&&(r.f&X)!==0&&(t|=X);var n={ctx:L,deps:null,nodes:null,f:t|E|M,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null},i=n;if((t&_t)!==0)kt!==null?kt.push(n):V.ensure().schedule(n);else if(e!==null){try{yt(n)}catch(o){throw C(n),o}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&mt)===0&&(i=i.first,(t&J)!==0&&(t&pt)!==0&&i!==null&&(i.f|=pt))}if(i!==null&&(i.parent=r,r!==null&&kn(i,r),_!==null&&(_.f&$)!==0&&(t&K)===0)){var s=_;(s.effects??=[]).push(i)}return n}function oe(){return _!==null&&!Y}function Ze(t){bn();var e=m.f,r=!_&&(e&F)!==0&&(e&st)===0;if(r){var n=L;(n.e??=[]).push(t)}else return Qe(t)}function Qe(t){return lt(_t|Fr,t)}function yn(t){V.ensure();const e=lt(K|mt,t);return()=>{C(e)}}function $n(t){V.ensure();const e=lt(K|mt,t);return(r={})=>new Promise(n=>{r.outro?Tt(e,()=>{C(e),n(void 0)}):(C(e),n(void 0))})}function Sn(t){return lt(_t,t)}function tr(t,e=0){return lt(we|e,t)}function er(t,e=0){var r=lt(J|e,t);return r}function G(t){return lt(F|mt,t)}function rr(t){var e=t.teardown;if(e!==null){const r=nt,n=_;or(!0),z(null);try{e.call(null)}finally{or(r),z(n)}}}function le(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&Ke(()=>{i.abort(Gt)});var n=r.next;(r.f&K)!==0?r.parent=null:C(r,e),r=n}}function xn(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&F)===0&&C(e),e=r}}function C(t,e=!0){var r=!1;(e||(t.f&Or)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(En(t.nodes.start,t.nodes.end),r=!0),y(t,ke),le(t,e&&!r),Nt(t,0);var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)s.stop();rr(t),t.f^=ke,t.f|=Z;var i=t.parent;i!==null&&i.first!==null&&nr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function En(t,e){for(;t!==null;){var r=t===e?null:U(t);t.remove(),t=r}}function nr(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Tt(t,e,r=!0){var n=[];ir(t,n,!0);var i=()=>{r&&C(t),e&&e()},s=n.length;if(s>0){var o=()=>--s||i();for(var a of n)a.out(o)}else i()}function ir(t,e,r){if((t.f&X)===0){t.f^=X;var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,o=(i.f&pt)!==0||(i.f&F)!==0&&(t.f&J)!==0;ir(i,e,o?r:!1),i=s}}}function Cn(t){sr(t,!0)}function sr(t,e){if((t.f&X)!==0){t.f^=X,(t.f&S)===0&&(y(t,E),V.ensure().schedule(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&pt)!==0||(r.f&F)!==0;sr(r,i?e:!1),r=n}var s=t.nodes&&t.nodes.t;if(s!==null)for(const o of s)(o.is_global||e)&&o.in()}}function ar(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:U(r);e.append(r),r=i}}let zt=!1,nt=!1;function or(t){nt=t}let _=null,Y=!1;function z(t){_=t}let m=null;function it(t){m=t}let P=null;function Tn(t){_!==null&&(P===null?P=[t]:P.push(t))}let T=null,N=0,D=null;function Rn(t){D=t}let lr=1,ut=0,ft=ut;function ur(t){ft=t}function fr(){return++lr}function Rt(t){var e=t.f;if((e&E)!==0)return!0;if(e&$&&(t.f&=~at),(e&j)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var s=r[i];if(Rt(s)&&Xe(s),s.wv>t.wv)return!0}(e&M)!==0&&A===null&&y(t,S)}return!1}function hr(t,e,r=!0){var n=t.reactions;if(n!==null&&!(P!==null&&dt.call(P,t)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&$)!==0?hr(s,e,!1):e===s&&(r?y(s,E):(s.f&S)!==0&&y(s,j),ee(s))}}function cr(t){var e=T,r=N,n=D,i=_,s=P,o=L,a=Y,l=ft,u=t.f;T=null,N=0,D=null,_=(u&(F|K))===0?t:null,P=null,Ft(t.ctx),Y=!1,ft=++ut,t.ac!==null&&(Ke(()=>{t.ac.abort(Gt)}),t.ac=null);try{t.f|=Bt;var f=t.fn,v=f();t.f|=st;var h=t.deps,p=b?.is_fork;if(T!==null){var d;if(p||Nt(t,N),h!==null&&N>0)for(h.length=N+T.length,d=0;d<T.length;d++)h[N+d]=T[d];else t.deps=h=T;if(oe()&&(t.f&M)!==0)for(d=N;d<h.length;d++)(h[d].reactions??=[]).push(t)}else!p&&h!==null&&N<h.length&&(Nt(t,N),h.length=N);if(Re()&&D!==null&&!Y&&h!==null&&(t.f&($|j|E))===0)for(d=0;d<D.length;d++)hr(D[d],t);if(i!==null&&i!==t){if(ut++,i.deps!==null)for(let c=0;c<r;c+=1)i.deps[c].rv=ut;if(e!==null)for(const c of e)c.rv=ut;D!==null&&(n===null?n=D:n.push(...D))}return(t.f&$t)!==0&&(t.f^=$t),v}catch(c){return Me(c)}finally{t.f^=Bt,T=e,N=r,D=n,_=i,P=s,Ft(o),Y=a,ft=l}}function Nn(t,e){let r=e.reactions;if(r!==null){var n=Rr.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&$)!==0&&(T===null||!dt.call(T,e))){var s=e;(s.f&M)!==0&&(s.f^=M,s.f&=~at),Zt(s),vn(s),Nt(s,0)}}function Nt(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Nn(t,r[n])}function yt(t){var e=t.f;if((e&Z)===0){y(t,S);var r=m,n=zt;m=t,zt=!0;try{(e&(J|be))!==0?xn(t):le(t),rr(t);var i=cr(t);t.teardown=typeof i=="function"?i:null,t.wv=lr;var s;Cr&&en&&(t.f&E)!==0&&t.deps}finally{zt=n,m=r}}}function W(t){var e=t.f,r=(e&$)!==0;if(_!==null&&!Y){var n=m!==null&&(m.f&Z)!==0;if(!n&&(P===null||!dt.call(P,t))){var i=_.deps;if((_.f&Bt)!==0)t.rv<ut&&(t.rv=ut,T===null&&i!==null&&i[N]===t?N++:T===null?T=[t]:T.push(t));else{(_.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[_]:dt.call(s,_)||s.push(_)}}}if(nt&&tt.has(t))return tt.get(t);if(r){var o=t;if(nt){var a=o.v;return((o.f&S)===0&&o.reactions!==null||vr(o))&&(a=re(o)),tt.set(o,a),a}var l=(o.f&M)===0&&!Y&&_!==null&&(zt||(_.f&M)!==0),u=(o.f&st)===0;Rt(o)&&(l&&(o.f|=M),Xe(o)),l&&!u&&(Ie(o),dr(o))}if(A?.has(t))return A.get(t);if((t.f&$t)!==0)throw t.v;return t.v}function dr(t){if(t.f|=M,t.deps!==null)for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&$)!==0&&(e.f&M)===0&&(Ie(e),dr(e))}function vr(t){if(t.v===x)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(tt.has(e)||(e.f&$)!==0&&vr(e))return!0;return!1}function _r(t){var e=Y;try{return Y=!0,t()}finally{Y=e}}const Mt=Symbol("events"),pr=new Set,ue=new Set;function Wt(t,e,r){(e[Mt]??={})[t]=r}function Mn(t){for(var e=0;e<t.length;e++)pr.add(t[e]);for(var r of ue)r(t)}let mr=null;function gr(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;mr=t;var o=0,a=mr===t&&t[Mt];if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){t[Mt]=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(s=i[o]||t.target,s!==e){At(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=_,v=m;z(null),it(null);try{for(var h,p=[];s!==null;){var d=s.assignedSlot||s.parentNode||s.host||null;try{var c=s[Mt]?.[n];c!=null&&(!s.disabled||t.target===s)&&c.call(s,t)}catch(w){h?p.push(w):h=w}if(t.cancelBubble||d===e||d===null)break;s=d}if(h){for(let w of p)queueMicrotask(()=>{throw w});throw h}}finally{t[Mt]=e,delete t.currentTarget,z(f),it(v)}}}const Ln=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Pn(t){return Ln?.createHTML(t)??t}function Dn(t){var e=ae("template");return e.innerHTML=Pn(t.replaceAll("<!>","<!---->")),e.content}function Lt(t,e){var r=m;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function fe(t,e){var r=(e&xr)!==0,n,i=!t.startsWith("<!>");return()=>{if(k)return Lt(g,null),g;n===void 0&&(n=Dn(i?t:"<!>"+t),n=Ct(n));var s=r||qe?document.importNode(n,!0):n.cloneNode(!0);return Lt(s,s),s}}function An(){if(k)return Lt(g,null),g;var t=document.createDocumentFragment(),e=document.createComment(""),r=rt();return t.append(e,r),Lt(e,r),t}function Pt(t,e){if(k){var r=m;((r.f&st)===0||r.nodes.end===null)&&(r.nodes.end=g),Kt();return}t!==null&&t.before(e)}const Yn=["touchstart","touchmove"];function On(t){return Yn.includes(t)}function wr(t,e){return br(t,e)}function Fn(t,e){ie(),e.intro=e.intro??!1;const r=e.target,n=k,i=g;try{for(var s=Ct(r);s&&(s.nodeType!==Yt||s.data!==ve);)s=U(s);if(!s)throw ct;gt(!0),I(s);const o=br(t,{...e,anchor:s});return gt(!1),o}catch(o){if(o instanceof Error&&o.message.split(`
|
|
2
|
+
`).some(a=>a.startsWith("https://svelte.dev/e/")))throw o;return o!==ct&&console.warn("Failed to hydrate: ",o),e.recover===!1&&Vr(),ie(),gn(r),gt(!1),wr(t,e)}finally{gt(n),I(i)}}const Ht=new Map;function br(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0,transformError:a}){ie();var l=void 0,u=$n(()=>{var f=r??e.appendChild(rt());un(f,{pending:()=>{}},p=>{Ce({});var d=L;if(s&&(d.c=s),i&&(n.$$events=i),k&&Lt(p,null),l=t(p,n)||{},k&&(m.nodes.end=g,g===null||g.nodeType!==Yt||g.data!==me))throw Ot(),ct;Te()},a);var v=new Set,h=p=>{for(var d=0;d<p.length;d++){var c=p[d];if(!v.has(c)){v.add(c);var w=On(c);for(const H of[e,document]){var R=Ht.get(H);R===void 0&&(R=new Map,Ht.set(H,R));var O=R.get(c);O===void 0?(H.addEventListener(c,gr,{passive:w}),R.set(c,1)):R.set(c,O+1)}}}};return h(Nr(pr)),ue.add(h),()=>{for(var p of v)for(const w of[e,document]){var d=Ht.get(w),c=d.get(p);--c==0?(w.removeEventListener(p,gr),d.delete(p),d.size===0&&Ht.delete(w)):d.set(p,c)}ue.delete(h),f!==r&&f.parentNode?.removeChild(f)}});return he.set(l,u),l}let he=new WeakMap;function jn(t,e){const r=he.get(t);return r?(he.delete(t),r(e)):Promise.resolve()}class Xn{anchor;#t=new Map;#r=new Map;#e=new Map;#i=new Set;#s=!0;constructor(e,r=!0){this.anchor=e,this.#s=r}#n=e=>{if(this.#t.has(e)){var r=this.#t.get(e),n=this.#r.get(r);if(n)Cn(n),this.#i.delete(r);else{var i=this.#e.get(r);i&&(this.#r.set(r,i.effect),this.#e.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,o]of this.#t){if(this.#t.delete(s),s===e)break;const a=this.#e.get(o);a&&(C(a.effect),this.#e.delete(o))}for(const[s,o]of this.#r){if(s===r||this.#i.has(s))continue;const a=()=>{if(Array.from(this.#t.values()).includes(s)){var u=document.createDocumentFragment();ar(o,u),u.append(rt()),this.#e.set(s,{effect:o,fragment:u})}else C(o);this.#i.delete(s),this.#r.delete(s)};this.#s||!n?(this.#i.add(s),Tt(o,a,!1)):a()}}};#a=e=>{this.#t.delete(e);const r=Array.from(this.#t.values());for(const[n,i]of this.#e)r.includes(n)||(C(i.effect),this.#e.delete(n))};ensure(e,r){var n=b,i=wn();if(r&&!this.#r.has(e)&&!this.#e.has(e))if(i){var s=document.createDocumentFragment(),o=rt();s.append(o),this.#e.set(e,{effect:G(()=>r(o)),fragment:s})}else this.#r.set(e,G(()=>r(this.anchor)));if(this.#t.set(n,e),i){for(const[a,l]of this.#r)a===e?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of this.#e)a===e?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#n),n.ondiscard(this.#a)}else k&&(this.anchor=g),this.#n(n)}}function In(t){L===null&&Xr(),Ze(()=>{const e=_r(t);if(typeof e=="function")return e})}function zn(t,e,r=!1){var n;k&&(n=g,Kt());var i=new Xn(t),s=r?pt:0;function o(a,l){if(k){var u=Zr(n);if(a!==parseInt(u.substring(1))){var f=xe();I(f),i.anchor=f,gt(!1),i.ensure(a,l),gt(!0);return}}i.ensure(a,l)}er(()=>{var a=!1;e((l,u=0)=>{a=!0,o(u,l)}),a||o(-1,null)},s)}function Wn(t,e){Sn(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=ae("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}function ce(t,e,r,n){var i=n,s=!0,o=()=>(s&&(s=!1,i=n),i),a;a=t[e],a===void 0&&n!==void 0&&(a=o());var l;l=()=>{var h=t[e];return h===void 0?o():(s=!0,h)};var u=!1,f=hn(()=>(u=!1,l())),v=m;return(function(h,p){if(arguments.length>0){const d=p?W(f):h;return B(f,d),u=!0,i!==void 0&&(i=d),h}return nt&&u||(v.f&Z)!==0?f.v:W(f)})}function Hn(t){return new Vn(t)}class Vn{#t;#r;constructor(e){var r=new Map,n=(s,o)=>{var a=_n(o,!1,!1);return r.set(s,a),a};const i=new Proxy({...e.props||{},$$events:{}},{get(s,o){return W(r.get(o)??n(o,Reflect.get(s,o)))},has(s,o){return o===jr?!0:(W(r.get(o)??n(o,Reflect.get(s,o))),Reflect.has(s,o))},set(s,o,a){return B(r.get(o)??n(o,a),a),Reflect.set(s,o,a)}});this.#r=(e.hydrate?Fn:wr)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&Xt(),this.#t=i.$$events;for(const s of Object.keys(this.#r))s==="$set"||s==="$destroy"||s==="$on"||At(this,s,{get(){return this.#r[s]},set(o){this.#r[s]=o},enumerable:!0});this.#r.$set=s=>{Object.assign(i,s)},this.#r.$destroy=()=>{jn(this.#r)}}$set(e){this.#r.$set(e)}$on(e,r){this.#t[e]=this.#t[e]||[];const n=(...i)=>r.call(this,...i);return this.#t[e].push(n),()=>{this.#t[e]=this.#t[e].filter(i=>i!==n)}}$destroy(){this.#r.$destroy()}}let kr;typeof HTMLElement=="function"&&(kr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return i=>{const s=ae("slot");n!=="default"&&(s.name=n),Pt(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=qn(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Vt(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Hn({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=yn(()=>{tr(()=>{this.$$r=!0;for(const n of Dt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Vt(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Vt(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Dt(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Vt(t,e,r,n){const i=r[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function qn(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Bn(t,e,r,n,i,s){let o=class extends kr{constructor(){super(t,r,i),this.$$p_d=e}static get observedAttributes(){return Dt(e).map(a=>(e[a].attribute||a).toLowerCase())}};return Dt(e).forEach(a=>{At(o.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){l=Vt(a,l,e),this.$$d[a]=l;var u=this.$$c;if(u){var f=vt(u,a)?.get;f?u[a]=l:u.$set({[a]:l})}}})}),n.forEach(a=>{At(o.prototype,a,{get(){return this.$$c?.[a]}})}),t.element=o,o}class Un{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const n={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(s){}};this.callback=r?.callback||n.callback,this.title=r?.parameters?.title||n.title,this.width=r?.parameters?.width||n.width,this.height=r?.parameters?.height||n.height,this.internalFillColor=r?.parameters?.internalFillColor||n.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||n.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||n.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||n.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||n.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||n.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const i=this.canvas.getContext("2d");console.log("canvas",i),this.context=i,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",s=>this._onTouchStart(s),!1),document.addEventListener("touchmove",s=>this._onTouchMove(s),!1),document.addEventListener("touchend",s=>this._onTouchEnd(s),!1)):(this.canvas.addEventListener("mousedown",s=>this._onMouseDown(s),!1),document.addEventListener("mousemove",s=>this._onMouseMove(s),!1),document.addEventListener("mouseup",s=>this._onMouseUp(s),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,n=this.movedY-this.centerY;return n>=this.directionVerticalLimitNeg&&n<=this.directionVerticalLimitPos&&(e="C"),n<this.directionVerticalLimitNeg&&(e="N"),n>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var ht={},yr;function Gn(){if(yr)return ht;yr=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LanguageTranslator=void 0,ht.getChildStyleToPass=t,ht.addComponent=e;function t(n,i){var s,o,a="";try{if(n&&i?.length&&(!((s=Object.keys(n))===null||s===void 0)&&s.length)&&(!((o=i?.filter(function(h){return Object.keys(n).includes(h.name)}))===null||o===void 0)&&o.length))for(var l=function(h){var p=i?.filter(function(d){return d.name===h&&d.defaultValue!==n[h]});p&&(a+="".concat(h,":").concat(n[h],";"))},u=0,f=Object.keys(n);u<f.length;u++){var v=f[u];l(v)}}catch(h){console.error("error getting child style to pass",h)}finally{return a}}function e(n){var i,s=((i=n?.repoName.split("/"))===null||i===void 0?void 0:i[1])||n?.repoName;if(!s)throw new Error("wrong componentPath "+n?.repoName);if(!n?.version)throw new Error("wrong version "+n?.version);var o=n?.iifePath||"main.iife.js";if(!document.getElementById(s+"-script"))try{var a=document.createElement("script");if(a.id=s+"-script",a.src="https://cdn.jsdelivr.net/npm/".concat(n.repoName,"@").concat(n.version,"/").concat(o),n?.local)a.src="".concat(n.local);else if(location.href.includes("localhost:6006")){var l=s.split("-")[0];a.src="http://localhost:6006/webcomponents/".concat(s.replace(l+"-",""),"/").concat(o)}document.head.appendChild(a)}catch(u){console.warn(u)}}var r=(function(){function n(i){if(this.lang="",!i?.dictionary)throw new Error("no dictionary provided");this.dictionary=i.dictionary,this.setLang(i?.lang)}return n.prototype.setLang=function(i){i||(i=n.getDefaultLang()),this.lang=i},n.prototype.translateWord=function(i,s){return n.getDictionaryWord(i,this.dictionary,s||this.lang)},n.prototype.translateDate=function(i,s,o){return n.formatDate(i,s,o||this.lang)},n.getDefaultLang=function(){var i,s,o,a="en";return navigator?.languages&&(!((o=(s=(i=navigator.languages[0])===null||i===void 0?void 0:i.split("-")[0])===null||s===void 0?void 0:s.toLowerCase())===null||o===void 0)&&o.length)&&(a=navigator.languages[0].split("-")[0].toLowerCase()),a},n.getDictionaryWord=function(i,s,o){var a;if(!i)throw new Error("no wordKey provided");if(!s)throw new Error("no dictionary provided");if(o&&(!((a=s[o])===null||a===void 0)&&a[i]))return s[o][i];var l="",u=n.getDefaultLang();if(!o||u!==o){var f=s?.[u];f?.[i]&&(l=f[i])}return l},n.formatDate=function(i,s,o){if(!i)throw new Error("no date provided");if(typeof i.getMonth!="function")throw new Error("wrong date format");var a=new Intl.DateTimeFormat(o||n.getDefaultLang(),s);return a.format(i)},n})();return ht.LanguageTranslator=r,ht}Gn();var Jn=fe('<div class="set svelte-k03ui8"><nav class="d-pad svelte-k03ui8"><button class="up svelte-k03ui8" aria-label="Move up"></button> <button class="right svelte-k03ui8" aria-label="Move right"></button> <button class="down svelte-k03ui8" aria-label="Move down"></button> <button class="left svelte-k03ui8" aria-label="Move left"></button></nav></div>'),Kn=fe('<div id="joystick" class="svelte-k03ui8"></div>'),Zn=fe("<div>Unknown type</div>");const Qn={hash:"svelte-k03ui8",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;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-k03ui8 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-k03ui8 {overflow:hidden;}.set.svelte-k03ui8 .d-pad:where(.svelte-k03ui8) {display:inline-block;}.d-pad.svelte-k03ui8 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-k03ui8:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-k03ui8:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-k03ui8:hover:after {width:30%;height:30%;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-k03ui8 button:where(.svelte-k03ui8):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8),
|
|
3
3
|
.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {width:43%;height:33%;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after,
|
|
4
|
-
.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {width:78%;height:102%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):active:before {border-bottom-color:#333;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):active:before {border-top-color:#333;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):active:before {border-right-color:#333;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):active:before {border-left-color:#333;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover:before {right:var(--dpad-arrow-move);}`};function
|
|
4
|
+
.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {width:78%;height:102%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):active:before {border-bottom-color:#333;}.d-pad.svelte-k03ui8 button.up:where(.svelte-k03ui8):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):active:before {border-top-color:#333;}.d-pad.svelte-k03ui8 button.down:where(.svelte-k03ui8):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):active:before {border-right-color:#333;}.d-pad.svelte-k03ui8 button.left:where(.svelte-k03ui8):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):active:before {border-left-color:#333;}.d-pad.svelte-k03ui8 button.right:where(.svelte-k03ui8):hover:before {right:var(--dpad-arrow-move);}`};function $r(t,e){Ce(e,!0),Wn(t,Qn);function r(c,w){e.$$host.dispatchEvent(new CustomEvent(c,{detail:w}))}let n=ce(e,"id",7,""),i=ce(e,"pad_or_joystick",7,"dpad"),s=ce(e,"joystick_parameters",7,void 0),o;Ze(()=>{}),In(()=>{const c=e.$$host?.shadowRoot?.querySelector("#joystick");if(i()==="joystick"&&!o&&c?.style){const w="#F2eef6",R="#Ece2f7",O="silver";o=new Un(c,{parameters:{internalFillColor:s()?.internalFillColor||w,internalStrokeColor:s()?.internalStrokeColor||R,externalStrokeColor:s()?.externalStrokeColor||O},callback:H=>{l({x:H.x,y:H.y,cardinalDirection:H.cardinalDirection})}})}});function a(c){r("sendDirection",{id:n(),direction:c})}function l(c){r("sendJoystickPosition",Object.assign({id:n()},c))}var u={get id(){return n()},set id(c=""){n(c),Xt()},get pad_or_joystick(){return i()},set pad_or_joystick(c="dpad"){i(c),Xt()},get joystick_parameters(){return s()},set joystick_parameters(c=void 0){s(c),Xt()}},f=An(),v=mn(f);{var h=c=>{var w=Jn(),R=Ge(w),O=Ge(R),H=se(O,2),Sr=se(H,2),ti=se(Sr,2);Se(R),Se(w),Wt("click",O,()=>a("up")),Wt("click",H,()=>a("right")),Wt("click",Sr,()=>a("down")),Wt("click",ti,()=>a("left")),Pt(c,w)},p=c=>{var w=Kn();Pt(c,w)},d=c=>{var w=Zn();Pt(c,w)};zn(v,c=>{i()==="dpad"?c(h):i()==="joystick"?c(p,1):c(d,-1)})}return Pt(t,f),Te(u)}Mn(["click"]),customElements.define("hb-pad-joystick",Bn($r,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],{mode:"open"})),de.Component=$r,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
|
|
5
5
|
//# sourceMappingURL=main.iife.js.map
|