@htmlbricks/hb-pad-joystick 0.66.3 → 0.66.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.iife.js +3 -3
- package/main.iife.js.map +1 -1
- package/manifest.json +3 -1
- package/package.json +1 -1
package/main.iife.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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),
|
|
1
|
+
(function(ce){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const $r=2,de="[",ve="[!",_e="[?",pe="]",ht={},x=Symbol(),Sr="http://www.w3.org/1999/xhtml",xr=!1;var Er=Array.isArray,Cr=Array.prototype.indexOf,ct=Array.prototype.includes,Tr=Array.from,At=Object.keys,Lt=Object.defineProperty,dt=Object.getOwnPropertyDescriptor,Rr=Object.prototype,Nr=Array.prototype,Mr=Object.getPrototypeOf,me=Object.isExtensible;const Pr=()=>{};function Ar(t){for(var e=0;e<t.length;e++)t[e]()}function Lr(){var t,e,r=new Promise((i,n)=>{t=i,e=n});return{promise:r,resolve:t,reject:e}}const $=2,vt=4,ge=8,be=1<<24,J=16,F=32,K=64,Vt=128,M=512,S=1024,E=2048,j=4096,X=8192,Z=16384,st=32768,we=1<<25,_t=65536,ke=1<<17,Yr=1<<18,pt=1<<19,Dr=1<<20,at=65536,qt=1<<21,ye=1<<22,yt=1<<23,Bt=Symbol("$state"),Or=Symbol("legacy props"),Ut=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Gt=3,Yt=8;function Fr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function jr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Xr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ir(t){throw new Error("https://svelte.dev/e/effect_orphan")}function zr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Wr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Hr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Vr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function qr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Br(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Dt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Ur(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let k=!1;function mt(t){k=t}let g;function I(t){if(t===null)throw Dt(),ht;return g=t}function Jt(){return I(U(g))}function $e(t){if(k){if(U(g)!==null)throw Dt(),ht;g=t}}function Gr(t=1){if(k){for(var e=t,r=g;e--;)r=U(r);g=r}}function Se(t=!0){for(var e=0,r=g;;){if(r.nodeType===Yt){var i=r.data;if(i===pe){if(e===0)return r;e-=1}else(i===de||i===ve||i[0]==="["&&!isNaN(Number(i.slice(1))))&&(e+=1)}var n=U(r);t&&r.remove(),r=n}}function Jr(t){if(!t||t.nodeType!==Yt)throw Dt(),ht;return t.data}function xe(t){return t===this.v}function Kr(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Zr(t){return!Kr(t,this.v)}let Qr=!1,P=null;function Ot(t){P=t}function Ee(t,e=!1,r){P={p:P,i:!1,c:null,e:null,s:t,x:null,r:p,l:null}}function Ce(t){var e=P,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,P=e.p,t??{}}function Te(){return!0}let ot=[];function Re(){var t=ot;ot=[],Ar(t)}function gt(t){if(ot.length===0&&!$t){var e=ot;queueMicrotask(()=>{e===ot&&Re()})}ot.push(t)}function ti(){for(;ot.length>0;)Re()}function Ne(t){var e=p;if(e===null)return _.f|=yt,t;if((e.f&st)===0&&(e.f&vt)===0)throw t;bt(t,e)}function bt(t,e){for(;e!==null;){if((e.f&Vt)!==0){if((e.f&st)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw t}const ei=-7169;function y(t,e){t.f=t.f&ei|e}function Kt(t){(t.f&M)!==0||t.deps===null?y(t,S):y(t,j)}function Me(t){if(t!==null)for(const e of t)(e.f&$)===0||(e.f&at)===0||(e.f^=at,Me(e.deps))}function Pe(t,e,r){(t.f&E)!==0?e.add(t):(t.f&j)!==0&&r.add(t),Me(t.deps),y(t,S)}const Q=new Set;let w=null,Y=null,Zt=null,$t=!1,Qt=!1,wt=null,Ft=null;var Ae=0;let ri=1;class V{id=ri++;current=new Map;previous=new Map;#t=new Set;#r=new Set;#e=new Map;#n=new Map;#s=null;#i=[];#a=new Set;#o=new Set;#l=new Map;is_fork=!1;#h=!1;#u=new Set;#c(){return this.is_fork||this.#n.size>0}#v(){for(const i of this.#u)for(const n of i.#n.keys()){for(var e=!1,r=n;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 i of r.d)y(i,E),this.schedule(i);for(i of r.m)y(i,j),this.schedule(i)}}#d(){if(Ae++>1e3&&(Q.delete(this),ii()),!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.#i;this.#i=[],this.apply();var r=wt=[],i=[],n=Ft=[];for(const a of e)try{this.#f(a,r,i)}catch(l){throw Fe(a),l}if(w=null,n.length>0){var s=V.ensure();for(const a of n)s.schedule(a)}if(wt=null,Ft=null,this.#c()||this.#v()){this.#_(i),this.#_(r);for(const[a,l]of this.#l)Oe(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(),Le(i),Le(r),this.#s?.resolve()}var o=w;if(this.#i.length>0){const a=o??=this;a.#i.push(...this.#i.filter(l=>!a.#i.includes(l)))}o!==null&&(Q.add(o),o.#d()),Q.has(this)||this.#p()}#f(e,r,i){e.f^=S;for(var n=e.first;n!==null;){var s=n.f,o=(s&(F|K))!==0,a=o&&(s&S)!==0,l=a||(s&X)!==0||this.#l.has(n);if(!l&&n.fn!==null){o?n.f^=S:(s&vt)!==0?r.push(n):Tt(n)&&((s&J)!==0&&this.#o.add(n),kt(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var f=n.next;if(f!==null){n=f;break}n=n.parent}}}#_(e){for(var r=0;r<e.length;r+=1)Pe(e[r],this.#a,this.#o)}capture(e,r,i=!1){r!==x&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&yt)===0&&(this.current.set(e,[e.v,i]),Y?.set(e,e.v))}activate(){w=this}deactivate(){w=null,Y=null}flush(){try{Qt=!0,w=this,this.#d()}finally{Ae=0,Zt=null,wt=null,Ft=null,Qt=!1,w=null,Y=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,c]]of this.current){if(u.current.has(f)){var i=u.current.get(f)[0];if(e&&v!==i)u.current.set(f,[v,c]);else continue}r.push(f)}var n=[...u.current.keys()].filter(f=>!this.current.has(f));if(n.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,n,s,o);if(u.#i.length>0){u.apply();for(var l of u.#i)u.#f(l,[],[]);u.#i=[]}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 i=this.#e.get(r)??0;if(this.#e.set(r,i+1),e){let n=this.#n.get(r)??0;this.#n.set(r,n+1)}}decrement(e,r,i){let n=this.#e.get(r)??0;if(n===1?this.#e.delete(r):this.#e.set(r,n-1),e){let s=this.#n.get(r)??0;s===1?this.#n.delete(r):this.#n.set(r,s-1)}this.#h||i||(this.#h=!0,gt(()=>{this.#h=!1,this.flush()}))}transfer_effects(e,r){for(const i of e)this.#a.add(i);for(const i of r)this.#o.add(i);e.clear(),r.clear()}oncommit(e){this.#t.add(e)}ondiscard(e){this.#r.add(e)}settled(){return(this.#s??=Lr()).promise}static ensure(){if(w===null){const e=w=new V;Qt||(Q.add(w),$t||gt(()=>{w===e&&e.flush()}))}return w}apply(){{Y=null;return}}schedule(e){if(Zt=e,e.b?.is_pending&&(e.f&(vt|ge|be))!==0&&(e.f&st)===0){e.b.defer_effect(e);return}for(var r=e;r.parent!==null;){r=r.parent;var i=r.f;if(wt!==null&&r===p&&(_===null||(_.f&$)===0))return;if((i&(K|F))!==0){if((i&S)===0)return;r.f^=S}}this.#i.push(r)}}function jt(t){var e=$t;$t=!0;try{for(var r;;){if(ti(),w===null)return r;w.flush()}}finally{$t=e}}function ii(){try{zr()}catch(t){bt(t,Zt)}}let q=null;function Le(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if((i.f&(Z|X))===0&&Tt(i)&&(q=new Set,kt(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&rr(i),q?.size>0)){tt.clear();for(const n of q){if((n.f&(Z|X))!==0)continue;const s=[n];let o=n.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&&kt(l)}}q.clear()}}q=null}}function Ye(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const n of t.reactions){const s=n.f;(s&$)!==0?Ye(n,e,r,i):(s&(ye|J))!==0&&(s&E)===0&&De(n,e,i)&&(y(n,E),te(n))}}function De(t,e,r){const i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(const n of t.deps){if(ct.call(e,n))return!0;if((n.f&$)!==0&&De(n,e,r))return r.set(n,!0),!0}return r.set(t,!1),!1}function te(t){w.schedule(t)}function Oe(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;)Oe(r,e),r=r.next}}function Fe(t){y(t,S);for(var e=t.first;e!==null;)Fe(e),e=e.next}function ni(t){let e=0,r=Xt(0),i;return()=>{ae()&&(W(r),Qe(()=>(e===0&&(i=vr(()=>t(()=>St(r)))),e+=1,()=>{gt(()=>{e-=1,e===0&&(i?.(),i=void 0,St(r))})})))}}var si=_t|pt;function ai(t,e,r,i){new oi(t,e,r,i)}class oi{parent;is_pending=!1;transform_error;#t;#r=k?g:null;#e;#n;#s;#i=null;#a=null;#o=null;#l=null;#h=0;#u=0;#c=!1;#v=new Set;#d=new Set;#f=null;#_=ni(()=>(this.#f=Xt(this.#h),()=>{this.#f=null}));constructor(e,r,i,n){this.#t=e,this.#e=r,this.#n=s=>{var o=p;o.b=this,o.f|=Vt,i(s)},this.parent=p.b,this.transform_error=n??this.parent?.transform_error??(s=>s),this.#s=tr(()=>{if(k){const s=this.#r;Jt();const o=s.data===ve;if(s.data.startsWith(_e)){const l=JSON.parse(s.data.slice(_e.length));this.#k(l)}else o?this.#y():this.#p()}else this.#b()},si),k&&(this.#t=g)}#p(){try{this.#i=G(()=>this.#n(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)),gt(()=>{var r=this.#l=document.createDocumentFragment(),i=rt();r.append(i),this.#i=this.#g(()=>G(()=>this.#n(i))),this.#u===0&&(this.#t.before(r),this.#l=null,Ct(this.#a,()=>{this.#a=null}),this.#m(w))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#h=0,this.#i=G(()=>{this.#n(this.#t)}),this.#u>0){var e=this.#l=document.createDocumentFragment();sr(this.#i,e);const r=this.#e.pending;this.#a=G(()=>r(this.#t))}else this.#m(w)}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=p,i=_,n=P;nt(this.#s),z(this.#s),Ot(this.#s.ctx);try{return V.ensure(),e()}catch(s){return Ne(s),null}finally{nt(r),z(i),Ot(n)}}#w(e,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(e,r);return}this.#u+=e,this.#u===0&&(this.#m(r),this.#a&&Ct(this.#a,()=>{this.#a=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(e,r){this.#w(e,r),this.#h+=e,!(!this.#f||this.#c)&&(this.#c=!0,gt(()=>{this.#c=!1,this.#f&&ze(this.#f,this.#h)}))}get_effect_pending(){return this.#_(),W(this.#f)}error(e){var r=this.#e.onerror;let i=this.#e.failed;if(!r&&!i)throw e;this.#i&&(C(this.#i),this.#i=null),this.#a&&(C(this.#a),this.#a=null),this.#o&&(C(this.#o),this.#o=null),k&&(I(this.#r),Gr(),I(Se()));var n=!1,s=!1;const o=()=>{if(n){Ur();return}n=!0,s&&Br(),this.#o!==null&&Ct(this.#o,()=>{this.#o=null}),this.#g(()=>{this.#b()})},a=l=>{try{s=!0,r?.(l,o),s=!1}catch(u){bt(u,this.#s&&this.#s.parent)}i&&(this.#o=this.#g(()=>{try{return G(()=>{var u=p;u.b=this,u.f|=Vt,i(this.#t,()=>l,()=>o)})}catch(u){return bt(u,this.#s.parent),null}}))};gt(()=>{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 li(t){var e=$|E,r=_!==null&&(_.f&$)!==0?_:null;return p!==null&&(p.f|=pt),{ctx:P,deps:null,effects:null,equals:xe,f:e,fn:t,reactions:null,rv:0,v:x,wv:0,parent:r??p,ac:null}}function ui(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)C(e[r])}}function fi(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 ee(t){var e,r=p;nt(fi(t));try{t.f&=~at,ui(t),e=hr(t)}finally{nt(r)}return e}function je(t){var e=t.v,r=ee(t);if(!t.equals(r)&&(t.wv=ur(),(!w?.is_fork||t.deps===null)&&(t.v=r,w?.capture(t,e,!0),t.deps===null))){y(t,S);return}it||(Y!==null?(ae()||w?.is_fork)&&Y.set(t,r):Kt(t))}function hi(t){if(t.effects!==null)for(const e of t.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(Ut),e.teardown=Pr,e.ac=null,Rt(e,0),oe(e))}function Xe(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&kt(e)}let re=new Set;const tt=new Map;let Ie=!1;function Xt(t,e){var r={f:0,v:t,reactions:null,equals:xe,rv:0,wv:0};return r}function et(t,e){const r=Xt(t);return xi(r),r}function ci(t,e=!1,r=!0){const i=Xt(t);return e||(i.equals=Zr),i}function B(t,e,r=!1){_!==null&&(!D||(_.f&ke)!==0)&&Te()&&(_.f&($|J|ye|ke))!==0&&(A===null||!ct.call(A,t))&&qr();let i=r?xt(e):e;return ze(t,i,Ft)}function ze(t,e,r=null){if(!t.equals(e)){var i=t.v;it?tt.set(t,e):tt.set(t,i),t.v=e;var n=V.ensure();if(n.capture(t,i),(t.f&$)!==0){const s=t;(t.f&E)!==0&&ee(s),Y===null&&Kt(s)}t.wv=ur(),We(t,E,r),p!==null&&(p.f&S)!==0&&(p.f&(F|K))===0&&(L===null?Ei([t]):L.push(t)),!n.is_fork&&re.size>0&&!Ie&&di()}return e}function di(){Ie=!1;for(const t of re)(t.f&S)!==0&&y(t,j),Tt(t)&&kt(t);re.clear()}function St(t){B(t,t.v+1)}function We(t,e,r){var i=t.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var o=i[s],a=o.f,l=(a&E)===0;if(l&&y(o,e),(a&$)!==0){var u=o;Y?.delete(u),(a&at)===0&&(a&M&&(o.f|=at),We(u,j,r))}else if(l){var f=o;(a&J)!==0&&q!==null&&q.add(f),r!==null?r.push(f):te(f)}}}function xt(t){if(typeof t!="object"||t===null||Bt in t)return t;const e=Mr(t);if(e!==Rr&&e!==Nr)return t;var r=new Map,i=Er(t),n=et(0),s=ft,o=a=>{if(ft===s)return a();var l=_,u=ft;z(null),lr(s);var f=a();return z(l),lr(u),f};return i&&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)&&Hr();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),St(n)}}else B(u,x),St(n);return!0},get(a,l,u){if(l===Bt)return t;var f=r.get(l),v=l in a;if(f===void 0&&(!v||dt(a,l)?.writable)&&(f=o(()=>{var m=xt(v?a[l]:x),d=et(m);return d}),r.set(l,f)),f!==void 0){var c=W(f);return c===x?void 0:c}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),c=v?.v;if(v!==void 0&&c!==x)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return u},has(a,l){if(l===Bt)return!0;var u=r.get(l),f=u!==void 0&&u.v!==x||Reflect.has(a,l);if(u!==void 0||p!==null&&(!f||dt(a,l)?.writable)){u===void 0&&(u=o(()=>{var c=f?xt(a[l]):x,m=et(c);return m}),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),c=l in a;if(i&&l==="length")for(var m=u;m<v.v;m+=1){var d=r.get(m+"");d!==void 0?B(d,x):m in a&&(d=o(()=>et(x)),r.set(m+"",d))}if(v===void 0)(!c||dt(a,l)?.writable)&&(v=o(()=>et(void 0)),B(v,xt(u)),r.set(l,v));else{c=v.v!==x;var h=o(()=>xt(u));B(v,h)}var b=Reflect.getOwnPropertyDescriptor(a,l);if(b?.set&&b.set.call(f,u),!c){if(i&&typeof l=="string"){var R=r.get("length"),O=Number(l);Number.isInteger(O)&&O>=R.v&&B(R,O+1)}St(n)}return!0},ownKeys(a){W(n);var l=Reflect.ownKeys(a).filter(v=>{var c=r.get(v);return c===void 0||c.v!==x});for(var[u,f]of r)f.v!==x&&!(u in a)&&l.push(u);return l},setPrototypeOf(){Vr()}})}var He,Ve,qe,Be;function ie(){if(He===void 0){He=window,Ve=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;qe=dt(e,"firstChild").get,Be=dt(e,"nextSibling").get,me(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),me(r)&&(r.__t=void 0)}}function rt(t=""){return document.createTextNode(t)}function Et(t){return qe.call(t)}function U(t){return Be.call(t)}function Ue(t,e){if(!k)return Et(t);var r=Et(g);return r===null&&(r=g.appendChild(rt())),I(r),r}function vi(t,e=!1){if(!k){var r=Et(t);return r instanceof Comment&&r.data===""?U(r):r}if(e){if(g?.nodeType!==Gt){var i=rt();return g?.before(i),I(i),i}Ge(g)}return g}function ne(t,e=1,r=!1){let i=k?g:t;for(var n;e--;)n=i,i=U(i);if(!k)return i;if(r){if(i?.nodeType!==Gt){var s=rt();return i===null?n?.after(s):i.before(s),I(s),s}Ge(i)}return I(i),i}function _i(t){t.textContent=""}function pi(){return!1}function se(t,e,r){return document.createElementNS(Sr,t,void 0)}function Ge(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Gt;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function Je(t){var e=_,r=p;z(null),nt(null);try{return t()}finally{z(e),nt(r)}}function mi(t){p===null&&(_===null&&Ir(),Xr()),it&&jr()}function gi(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=p;r!==null&&(r.f&X)!==0&&(t|=X);var i={ctx:P,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},n=i;if((t&vt)!==0)wt!==null?wt.push(i):V.ensure().schedule(i);else if(e!==null){try{kt(i)}catch(o){throw C(i),o}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&pt)===0&&(n=n.first,(t&J)!==0&&(t&_t)!==0&&n!==null&&(n.f|=_t))}if(n!==null&&(n.parent=r,r!==null&&gi(n,r),_!==null&&(_.f&$)!==0&&(t&K)===0)){var s=_;(s.effects??=[]).push(n)}return i}function ae(){return _!==null&&!D}function Ke(t){mi();var e=p.f,r=!_&&(e&F)!==0&&(e&st)===0;if(r){var i=P;(i.e??=[]).push(t)}else return Ze(t)}function Ze(t){return lt(vt|Dr,t)}function bi(t){V.ensure();const e=lt(K|pt,t);return()=>{C(e)}}function wi(t){V.ensure();const e=lt(K|pt,t);return(r={})=>new Promise(i=>{r.outro?Ct(e,()=>{C(e),i(void 0)}):(C(e),i(void 0))})}function ki(t){return lt(vt,t)}function Qe(t,e=0){return lt(ge|e,t)}function tr(t,e=0){var r=lt(J|e,t);return r}function G(t){return lt(F|pt,t)}function er(t){var e=t.teardown;if(e!==null){const r=it,i=_;ar(!0),z(null);try{e.call(null)}finally{ar(r),z(i)}}}function oe(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const n=r.ac;n!==null&&Je(()=>{n.abort(Ut)});var i=r.next;(r.f&K)!==0?r.parent=null:C(r,e),r=i}}function yi(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&Yr)!==0)&&t.nodes!==null&&t.nodes.end!==null&&($i(t.nodes.start,t.nodes.end),r=!0),y(t,we),oe(t,e&&!r),Rt(t,0);var i=t.nodes&&t.nodes.t;if(i!==null)for(const s of i)s.stop();er(t),t.f^=we,t.f|=Z;var n=t.parent;n!==null&&n.first!==null&&rr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function $i(t,e){for(;t!==null;){var r=t===e?null:U(t);t.remove(),t=r}}function rr(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 Ct(t,e,r=!0){var i=[];ir(t,i,!0);var n=()=>{r&&C(t),e&&e()},s=i.length;if(s>0){var o=()=>--s||n();for(var a of i)a.out(o)}else n()}function ir(t,e,r){if((t.f&X)===0){t.f^=X;var i=t.nodes&&t.nodes.t;if(i!==null)for(const a of i)(a.is_global||r)&&e.push(a);for(var n=t.first;n!==null;){var s=n.next,o=(n.f&_t)!==0||(n.f&F)!==0&&(t.f&J)!==0;ir(n,e,o?r:!1),n=s}}}function Si(t){nr(t,!0)}function nr(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 i=r.next,n=(r.f&_t)!==0||(r.f&F)!==0;nr(r,n?e:!1),r=i}var s=t.nodes&&t.nodes.t;if(s!==null)for(const o of s)(o.is_global||e)&&o.in()}}function sr(t,e){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end;r!==null;){var n=r===i?null:U(r);e.append(r),r=n}}let It=!1,it=!1;function ar(t){it=t}let _=null,D=!1;function z(t){_=t}let p=null;function nt(t){p=t}let A=null;function xi(t){_!==null&&(A===null?A=[t]:A.push(t))}let T=null,N=0,L=null;function Ei(t){L=t}let or=1,ut=0,ft=ut;function lr(t){ft=t}function ur(){return++or}function Tt(t){var e=t.f;if((e&E)!==0)return!0;if(e&$&&(t.f&=~at),(e&j)!==0){for(var r=t.deps,i=r.length,n=0;n<i;n++){var s=r[n];if(Tt(s)&&je(s),s.wv>t.wv)return!0}(e&M)!==0&&Y===null&&y(t,S)}return!1}function fr(t,e,r=!0){var i=t.reactions;if(i!==null&&!(A!==null&&ct.call(A,t)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&$)!==0?fr(s,e,!1):e===s&&(r?y(s,E):(s.f&S)!==0&&y(s,j),te(s))}}function hr(t){var e=T,r=N,i=L,n=_,s=A,o=P,a=D,l=ft,u=t.f;T=null,N=0,L=null,_=(u&(F|K))===0?t:null,A=null,Ot(t.ctx),D=!1,ft=++ut,t.ac!==null&&(Je(()=>{t.ac.abort(Ut)}),t.ac=null);try{t.f|=qt;var f=t.fn,v=f();t.f|=st;var c=t.deps,m=w?.is_fork;if(T!==null){var d;if(m||Rt(t,N),c!==null&&N>0)for(c.length=N+T.length,d=0;d<T.length;d++)c[N+d]=T[d];else t.deps=c=T;if(ae()&&(t.f&M)!==0)for(d=N;d<c.length;d++)(c[d].reactions??=[]).push(t)}else!m&&c!==null&&N<c.length&&(Rt(t,N),c.length=N);if(Te()&&L!==null&&!D&&c!==null&&(t.f&($|j|E))===0)for(d=0;d<L.length;d++)fr(L[d],t);if(n!==null&&n!==t){if(ut++,n.deps!==null)for(let h=0;h<r;h+=1)n.deps[h].rv=ut;if(e!==null)for(const h of e)h.rv=ut;L!==null&&(i===null?i=L:i.push(...L))}return(t.f&yt)!==0&&(t.f^=yt),v}catch(h){return Ne(h)}finally{t.f^=qt,T=e,N=r,L=i,_=n,A=s,Ot(o),D=a,ft=l}}function Ci(t,e){let r=e.reactions;if(r!==null){var i=Cr.call(r,t);if(i!==-1){var n=r.length-1;n===0?r=e.reactions=null:(r[i]=r[n],r.pop())}}if(r===null&&(e.f&$)!==0&&(T===null||!ct.call(T,e))){var s=e;(s.f&M)!==0&&(s.f^=M,s.f&=~at),Kt(s),hi(s),Rt(s,0)}}function Rt(t,e){var r=t.deps;if(r!==null)for(var i=e;i<r.length;i++)Ci(t,r[i])}function kt(t){var e=t.f;if((e&Z)===0){y(t,S);var r=p,i=It;p=t,It=!0;try{(e&(J|be))!==0?yi(t):oe(t),er(t);var n=hr(t);t.teardown=typeof n=="function"?n:null,t.wv=or;var s;xr&&Qr&&(t.f&E)!==0&&t.deps}finally{It=i,p=r}}}function W(t){var e=t.f,r=(e&$)!==0;if(_!==null&&!D){var i=p!==null&&(p.f&Z)!==0;if(!i&&(A===null||!ct.call(A,t))){var n=_.deps;if((_.f&qt)!==0)t.rv<ut&&(t.rv=ut,T===null&&n!==null&&n[N]===t?N++:T===null?T=[t]:T.push(t));else{(_.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[_]:ct.call(s,_)||s.push(_)}}}if(it&&tt.has(t))return tt.get(t);if(r){var o=t;if(it){var a=o.v;return((o.f&S)===0&&o.reactions!==null||dr(o))&&(a=ee(o)),tt.set(o,a),a}var l=(o.f&M)===0&&!D&&_!==null&&(It||(_.f&M)!==0),u=(o.f&st)===0;Tt(o)&&(l&&(o.f|=M),je(o)),l&&!u&&(Xe(o),cr(o))}if(Y?.has(t))return Y.get(t);if((t.f&yt)!==0)throw t.v;return t.v}function cr(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&&(Xe(e),cr(e))}function dr(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&&dr(e))return!0;return!1}function vr(t){var e=D;try{return D=!0,t()}finally{D=e}}const Nt=Symbol("events"),_r=new Set,le=new Set;function zt(t,e,r){(e[Nt]??={})[t]=r}function Ti(t){for(var e=0;e<t.length;e++)_r.add(t[e]);for(var r of le)r(t)}let pr=null;function mr(t){var e=this,r=e.ownerDocument,i=t.type,n=t.composedPath?.()||[],s=n[0]||t.target;pr=t;var o=0,a=pr===t&&t[Nt];if(a){var l=n.indexOf(a);if(l!==-1&&(e===document||e===window)){t[Nt]=e;return}var u=n.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(s=n[o]||t.target,s!==e){Lt(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=_,v=p;z(null),nt(null);try{for(var c,m=[];s!==null;){var d=s.assignedSlot||s.parentNode||s.host||null;try{var h=s[Nt]?.[i];h!=null&&(!s.disabled||t.target===s)&&h.call(s,t)}catch(b){c?m.push(b):c=b}if(t.cancelBubble||d===e||d===null)break;s=d}if(c){for(let b of m)queueMicrotask(()=>{throw b});throw c}}finally{t[Nt]=e,delete t.currentTarget,z(f),nt(v)}}}const Ri=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ni(t){return Ri?.createHTML(t)??t}function Mi(t){var e=se("template");return e.innerHTML=Ni(t.replaceAll("<!>","<!---->")),e.content}function Mt(t,e){var r=p;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function ue(t,e){var r=(e&$r)!==0,i,n=!t.startsWith("<!>");return()=>{if(k)return Mt(g,null),g;i===void 0&&(i=Mi(n?t:"<!>"+t),i=Et(i));var s=r||Ve?document.importNode(i,!0):i.cloneNode(!0);return Mt(s,s),s}}function Pi(){if(k)return Mt(g,null),g;var t=document.createDocumentFragment(),e=document.createComment(""),r=rt();return t.append(e,r),Mt(e,r),t}function Pt(t,e){if(k){var r=p;((r.f&st)===0||r.nodes.end===null)&&(r.nodes.end=g),Jt();return}t!==null&&t.before(e)}const Ai=["touchstart","touchmove"];function Li(t){return Ai.includes(t)}function gr(t,e){return br(t,e)}function Yi(t,e){ie(),e.intro=e.intro??!1;const r=e.target,i=k,n=g;try{for(var s=Et(r);s&&(s.nodeType!==Yt||s.data!==de);)s=U(s);if(!s)throw ht;mt(!0),I(s);const o=br(t,{...e,anchor:s});return mt(!1),o}catch(o){if(o instanceof Error&&o.message.split(`
|
|
2
|
+
`).some(a=>a.startsWith("https://svelte.dev/e/")))throw o;return o!==ht&&console.warn("Failed to hydrate: ",o),e.recover===!1&&Wr(),ie(),_i(r),mt(!1),gr(t,e)}finally{mt(i),I(n)}}const Wt=new Map;function br(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:o=!0,transformError:a}){ie();var l=void 0,u=wi(()=>{var f=r??e.appendChild(rt());ai(f,{pending:()=>{}},m=>{Ee({});var d=P;if(s&&(d.c=s),n&&(i.$$events=n),k&&Mt(m,null),l=t(m,i)||{},k&&(p.nodes.end=g,g===null||g.nodeType!==Yt||g.data!==pe))throw Dt(),ht;Ce()},a);var v=new Set,c=m=>{for(var d=0;d<m.length;d++){var h=m[d];if(!v.has(h)){v.add(h);var b=Li(h);for(const H of[e,document]){var R=Wt.get(H);R===void 0&&(R=new Map,Wt.set(H,R));var O=R.get(h);O===void 0?(H.addEventListener(h,mr,{passive:b}),R.set(h,1)):R.set(h,O+1)}}}};return c(Tr(_r)),le.add(c),()=>{for(var m of v)for(const b of[e,document]){var d=Wt.get(b),h=d.get(m);--h==0?(b.removeEventListener(m,mr),d.delete(m),d.size===0&&Wt.delete(b)):d.set(m,h)}le.delete(c),f!==r&&f.parentNode?.removeChild(f)}});return fe.set(l,u),l}let fe=new WeakMap;function Di(t,e){const r=fe.get(t);return r?(fe.delete(t),r(e)):Promise.resolve()}class Oi{anchor;#t=new Map;#r=new Map;#e=new Map;#n=new Set;#s=!0;constructor(e,r=!0){this.anchor=e,this.#s=r}#i=e=>{if(this.#t.has(e)){var r=this.#t.get(e),i=this.#r.get(r);if(i)Si(i),this.#n.delete(r);else{var n=this.#e.get(r);n&&(this.#r.set(r,n.effect),this.#e.delete(r),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.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.#n.has(s))continue;const a=()=>{if(Array.from(this.#t.values()).includes(s)){var u=document.createDocumentFragment();sr(o,u),u.append(rt()),this.#e.set(s,{effect:o,fragment:u})}else C(o);this.#n.delete(s),this.#r.delete(s)};this.#s||!i?(this.#n.add(s),Ct(o,a,!1)):a()}}};#a=e=>{this.#t.delete(e);const r=Array.from(this.#t.values());for(const[i,n]of this.#e)r.includes(i)||(C(n.effect),this.#e.delete(i))};ensure(e,r){var i=w,n=pi();if(r&&!this.#r.has(e)&&!this.#e.has(e))if(n){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(i,e),n){for(const[a,l]of this.#r)a===e?i.unskip_effect(l):i.skip_effect(l);for(const[a,l]of this.#e)a===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit(this.#i),i.ondiscard(this.#a)}else k&&(this.anchor=g),this.#i(i)}}function Fi(t){P===null&&Fr(),Ke(()=>{const e=vr(t);if(typeof e=="function")return e})}function ji(t,e,r=!1){var i;k&&(i=g,Jt());var n=new Oi(t),s=r?_t:0;function o(a,l){if(k){var u=Jr(i);if(a!==parseInt(u.substring(1))){var f=Se();I(f),n.anchor=f,mt(!1),n.ensure(a,l),mt(!0);return}}n.ensure(a,l)}tr(()=>{var a=!1;e((l,u=0)=>{a=!0,o(u,l)}),a||o(-1,null)},s)}function Xi(t,e){ki(()=>{var r=t.getRootNode(),i=r.host?r:r.head??r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){const n=se("style");n.id=e.hash,n.textContent=e.code,i.appendChild(n)}})}function he(t,e,r,i){var n=i,s=!0,o=()=>(s&&(s=!1,n=i),n),a;a=t[e],a===void 0&&i!==void 0&&(a=o());var l;l=()=>{var c=t[e];return c===void 0?o():(s=!0,c)};var u=!1,f=li(()=>(u=!1,l())),v=p;return(function(c,m){if(arguments.length>0){const d=m?W(f):c;return B(f,d),u=!0,n!==void 0&&(n=d),c}return it&&u||(v.f&Z)!==0?f.v:W(f)})}function Ii(t){return new zi(t)}class zi{#t;#r;constructor(e){var r=new Map,i=(s,o)=>{var a=ci(o,!1,!1);return r.set(s,a),a};const n=new Proxy({...e.props||{},$$events:{}},{get(s,o){return W(r.get(o)??i(o,Reflect.get(s,o)))},has(s,o){return o===Or?!0:(W(r.get(o)??i(o,Reflect.get(s,o))),Reflect.has(s,o))},set(s,o,a){return B(r.get(o)??i(o,a),a),Reflect.set(s,o,a)}});this.#r=(e.hydrate?Yi:gr)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&jt(),this.#t=n.$$events;for(const s of Object.keys(this.#r))s==="$set"||s==="$destroy"||s==="$on"||Lt(this,s,{get(){return this.#r[s]},set(o){this.#r[s]=o},enumerable:!0});this.#r.$set=s=>{Object.assign(n,s)},this.#r.$destroy=()=>{Di(this.#r)}}$set(e){this.#r.$set(e)}$on(e,r){this.#t[e]=this.#t[e]||[];const i=(...n)=>r.call(this,...n);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(n=>n!==i)}}$destroy(){this.#r.$destroy()}}let wr;typeof HTMLElement=="function"&&(wr=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 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 n=>{const s=se("slot");i!=="default"&&(s.name=i),Pt(n,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Wi(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 n=this.$$g_p(i.name);n in this.$$d||(this.$$d[n]=Ht(n,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=Ii({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=bi(()=>{Qe(()=>{this.$$r=!0;for(const i of At(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const n=Ht(i,this.$$d[i],this.$$p_d,"toAttribute");n==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,n)}this.$$r=!1})});for(const i in this.$$l)for(const n of this.$$l[i]){const s=this.$$c.$on(i,n);this.$$l_u.set(n,s)}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 At(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 n=r[t]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){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(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Wi(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Hi(t,e,r,i,n,s){let o=class extends wr{constructor(){super(t,r,n),this.$$p_d=e}static get observedAttributes(){return At(e).map(a=>(e[a].attribute||a).toLowerCase())}};return At(e).forEach(a=>{Lt(o.prototype,a,{get(){return this.$$c&&a in this.$$c?this.$$c[a]:this.$$d[a]},set(l){l=Ht(a,l,e),this.$$d[a]=l;var u=this.$$c;if(u){var f=dt(u,a)?.get;f?u[a]=l:u.$set({[a]:l})}}})}),i.forEach(a=>{Lt(o.prototype,a,{get(){return this.$$c?.[a]}})}),t.element=o,o}class Vi{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(s){}};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 n=this.canvas.getContext("2d");console.log("canvas",n),this.context=n,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,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 qi=ue('<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>'),Bi=ue('<div id="joystick" class="svelte-k03ui8"></div>'),Ui=ue("<div>Unknown type</div>");const Gi={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 kr(t,e){Ee(e,!0),Xi(t,Gi);function r(h,b){e.$$host.dispatchEvent(new CustomEvent(h,{detail:b}))}let i=he(e,"id",7,""),n=he(e,"pad_or_joystick",7,"dpad"),s=he(e,"joystick_parameters",7,void 0),o;Ke(()=>{}),Fi(()=>{const h=e.$$host?.shadowRoot?.querySelector("#joystick");if(n()==="joystick"&&!o&&h?.style){const b="#F2eef6",R="#Ece2f7",O="silver";o=new Vi(h,{parameters:{internalFillColor:s()?.internalFillColor||b,internalStrokeColor:s()?.internalStrokeColor||R,externalStrokeColor:s()?.externalStrokeColor||O},callback:H=>{l({x:H.x,y:H.y,cardinalDirection:H.cardinalDirection})}})}});function a(h){r("sendDirection",{id:i(),direction:h})}function l(h){r("sendJoystickPosition",Object.assign({id:i()},h))}var u={get id(){return i()},set id(h=""){i(h),jt()},get pad_or_joystick(){return n()},set pad_or_joystick(h="dpad"){n(h),jt()},get joystick_parameters(){return s()},set joystick_parameters(h=void 0){s(h),jt()}},f=Pi(),v=vi(f);{var c=h=>{var b=qi(),R=Ue(b),O=Ue(R),H=ne(O,2),yr=ne(H,2),Ji=ne(yr,2);$e(R),$e(b),zt("click",O,()=>a("up")),zt("click",H,()=>a("right")),zt("click",yr,()=>a("down")),zt("click",Ji,()=>a("left")),Pt(h,b)},m=h=>{var b=Bi();Pt(h,b)},d=h=>{var b=Ui();Pt(h,b)};ji(v,h=>{n()==="dpad"?h(c):n()==="joystick"?h(m,1):h(d,-1)})}return Pt(t,f),Ce(u)}Ti(["click"]),customElements.define("hb-pad-joystick",Hi(kr,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],{mode:"open"})),ce.Component=kr,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
|
|
5
5
|
//# sourceMappingURL=main.iife.js.map
|