@m3e/core 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{isServer as e,nothing as t,noChange as s,unsafeCSS as i,html as r,css as a,LitElement as o}from"lit";function n(e,t,s,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(a<3?r(o):a>3?r(t,s,o):r(t,s))||o);return a>3&&o&&Object.defineProperty(t,s,o),o}function l(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function h(e,t,s,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,s):r?r.value=s:t.set(e,s),s}var d,c,p,m,u,v,f,y,g,b,x,w,$,k,_,E,S,A,C,z,L,M,W,P,T,F,H,D,O,U,N,I,R,B,q,V,j,K,X,Z,G,J,Y,Q,ee,te,se,ie,re,ae,oe,ne,le,he,de,ce,pe,me,ue,ve,fe,ye,ge,be,xe,we,$e,ke,_e;"function"==typeof SuppressedError&&SuppressedError;class Ee{constructor(e,t){d.set(this,void 0),c.set(this,void 0),p.set(this,new Set),h(this,d,e,"f"),h(this,c,t.target,"f"),l(this,d,"f").addController(this)}get targets(){return l(this,p,"f").values()}hostConnected(){null!==l(this,c,"f")&&this.observe(l(this,c,"f")??l(this,d,"f"))}hostDisconnected(){l(this,p,"f").forEach(e=>this.unobserve(e)),l(this,p,"f").clear()}observe(e){l(this,p,"f").has(e)||(l(this,p,"f").add(e),this._observe(e))}isObserving(e){return l(this,p,"f").has(e)}unobserve(e){l(this,p,"f").delete(e)&&this._unobserve(e)}}d=new WeakMap,c=new WeakMap,p=new WeakMap;class Se extends Ee{constructor(e,t){super(e,t),m.add(this),u.set(this,void 0),v.set(this,e=>l(this,m,"m",y).call(this,e)),f.set(this,e=>l(this,m,"m",g).call(this,e)),h(this,u,t.callback,"f")}_observe(e){e.addEventListener("keydown",l(this,v,"f")),e.addEventListener("focusin",l(this,v,"f")),e.addEventListener("focusout",l(this,f,"f"))}_unobserve(e){e.removeEventListener("keydown",l(this,v,"f")),e.removeEventListener("focusin",l(this,v,"f")),e.removeEventListener("focusout",l(this,f,"f"))}}u=new WeakMap,v=new WeakMap,f=new WeakMap,m=new WeakSet,y=function(e){const t=e.target;l(this,u,"f").call(this,!0,t.matches(":focus-visible")||matchMedia("(forced-colors: active)").matches,t)},g=function(e){l(this,u,"f").call(this,!1,!1,e.target)};class Ae extends Ee{constructor(e,t){super(e,t),b.add(this),x.set(this,void 0),w.set(this,new Map),$.set(this,new Map),k.set(this,e=>l(this,b,"m",C).call(this,e)),_.set(this,e=>l(this,b,"m",z).call(this,e)),h(this,x,t.callback,"f"),this.startDelay=t.startDelay??0,this.endDelay=t.endDelay??0}clearDelays(){for(const e of this.targets)l(this,b,"m",E).call(this,e)}_observe(e){e.addEventListener("pointerenter",l(this,k,"f")),e.addEventListener("pointerleave",l(this,_,"f"))}_unobserve(e){e.removeEventListener("pointerenter",l(this,k,"f")),e.removeEventListener("pointerleave",l(this,_,"f"))}}x=new WeakMap,w=new WeakMap,$=new WeakMap,k=new WeakMap,_=new WeakMap,b=new WeakSet,E=function(e){l(this,b,"m",S).call(this,e),l(this,b,"m",A).call(this,e)},S=function(e){return!!l(this,w,"f").has(e)&&(clearTimeout(l(this,w,"f").get(e)),l(this,w,"f").delete(e))},A=function(e){return!!l(this,$,"f").has(e)&&(clearTimeout(l(this,$,"f").get(e)),l(this,$,"f").delete(e))},C=function(e){const t=e.target;l(this,b,"m",A).call(this,t),this.startDelay>0?(l(this,b,"m",S).call(this,t),l(this,w,"f").set(t,setTimeout(()=>{l(this,w,"f").delete(t),l(this,x,"f").call(this,!0,t)},this.startDelay))):l(this,x,"f").call(this,!0,t)},z=function(e){const t=e.target;l(this,b,"m",S).call(this,t)||(this.endDelay>0?(l(this,b,"m",A).call(this,t),l(this,$,"f").set(t,setTimeout(()=>{l(this,$,"f").delete(t),l(this,x,"f").call(this,!1,t)},this.endDelay))):l(this,x,"f").call(this,!1,t))};class Ce extends Ee{constructor(t,s){super(t,s),L.set(this,void 0),M.set(this,void 0),W.set(this,!1),P.set(this,void 0),T.set(this,!0),h(this,L,t,"f"),h(this,M,s.callback,"f"),h(this,W,s.skipInitial??!1,"f"),e||(window.IntersectionObserver?h(this,P,new IntersectionObserver((e,t)=>{l(this,M,"f").call(this,e,t),l(this,L,"f").requestUpdate()},s.init),"f"):console.warn("IntersectionController error: the browser does not support IntersectionObserver."))}async hostUpdated(){l(this,P,"f")&&!l(this,W,"f")&&l(this,T,"f")&&l(this,M,"f").call(this,[],l(this,P,"f")),h(this,T,!1,"f")}_observe(e){l(this,P,"f")?.observe(e),h(this,T,!0,"f"),l(this,L,"f").requestUpdate()}_unobserve(e){l(this,P,"f")?.unobserve(e)}}L=new WeakMap,M=new WeakMap,W=new WeakMap,P=new WeakMap,T=new WeakMap;class ze extends Ee{constructor(e,t){super(e,t),F.add(this),H.set(this,void 0),D.set(this,void 0),O.set(this,new Set),U.set(this,new Map),N.set(this,e=>l(this,F,"m",R).call(this,e)),I.set(this,e=>l(this,F,"m",B).call(this,e)),h(this,H,t.callback,"f"),h(this,D,t.threshold??500,"f")}_observe(e){e.addEventListener("touchstart",l(this,N,"f")),e.addEventListener("touchend",l(this,I,"f")),e.addEventListener("touchcancel",l(this,I,"f"))}_unobserve(e){e.removeEventListener("touchstart",l(this,N,"f")),e.removeEventListener("touchend",l(this,I,"f")),e.removeEventListener("touchcancel",l(this,I,"f"))}}H=new WeakMap,D=new WeakMap,O=new WeakMap,U=new WeakMap,N=new WeakMap,I=new WeakMap,F=new WeakSet,R=function(e){if(e.currentTarget instanceof HTMLElement&&this.isObserving(e.currentTarget)){const t=e.currentTarget;l(this,U,"f").set(t,setTimeout(()=>{l(this,O,"f").add(t),l(this,U,"f").delete(t),l(this,H,"f").call(this,!0,t)},l(this,D,"f")))}},B=function(e){if(e.currentTarget instanceof HTMLElement&&this.isObserving(e.currentTarget)){const t=e.currentTarget;l(this,O,"f").has(t)&&(l(this,H,"f").call(this,!1,t),l(this,O,"f").delete(t)),l(this,U,"f").has(t)&&(clearTimeout(l(this,U,"f").get(t)),l(this,U,"f").delete(t))}};class Le extends Ee{constructor(t,s){super(t,s),q.set(this,void 0),V.set(this,void 0),j.set(this,!1),K.set(this,void 0),X.set(this,void 0),Z.set(this,!0),h(this,q,t,"f"),h(this,V,s.callback,"f"),h(this,j,s.skipInitial??!1,"f"),h(this,K,s.config,"f"),e||(window.MutationObserver?h(this,X,new MutationObserver((e,t)=>{l(this,V,"f").call(this,e,t),l(this,q,"f").requestUpdate()}),"f"):console.warn("MutationController error: the browser does not support MutationObserver."))}async hostUpdated(){if(l(this,X,"f")&&!l(this,j,"f")&&l(this,Z,"f")){const e=l(this,X,"f").takeRecords();e.length>0&&l(this,V,"f").call(this,e,l(this,X,"f"))}h(this,Z,!1,"f")}hostDisconnected(){super.hostDisconnected(),l(this,X,"f")?.disconnect()}_observe(e){l(this,X,"f")?.observe(e,l(this,K,"f")),h(this,Z,!0,"f"),l(this,q,"f").requestUpdate()}_unobserve(){l(this,X,"f")?.disconnect();for(const e of this.targets)l(this,X,"f")?.observe(e,l(this,K,"f"))}}q=new WeakMap,V=new WeakMap,j=new WeakMap,K=new WeakMap,X=new WeakMap,Z=new WeakMap;class Me extends Ee{constructor(e,t){super(e,t),G.add(this),J.set(this,void 0),Y.set(this,void 0),Q.set(this,void 0),ee.set(this,new Map),te.set(this,void 0),se.set(this,e=>l(this,G,"m",ne).call(this,e)),ie.set(this,e=>l(this,G,"m",le).call(this,e)),re.set(this,e=>l(this,G,"m",he).call(this,e)),ae.set(this,e=>l(this,G,"m",de).call(this,e)),oe.set(this,e=>l(this,G,"m",ce).call(this,e)),h(this,J,t.capture,"f"),h(this,Y,t.callback,"f"),h(this,Q,t.isPressedKey,"f"),h(this,te,t.minPressedDuration??0,"f")}hostConnected(){document.addEventListener("pointerup",l(this,ie,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchend",l(this,re,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchcancel",l(this,re,"f"),{capture:l(this,J,"f")}),super.hostConnected()}hostDisconnected(){document.removeEventListener("pointerup",l(this,ie,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchend",l(this,re,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchcancel",l(this,re,"f"),{capture:l(this,J,"f")}),super.hostDisconnected(),l(this,ee,"f").clear()}_observe(e){e.addEventListener("pointerdown",l(this,se,"f"),{capture:l(this,J,"f")}),l(this,Q,"f")&&(e.addEventListener("keydown",l(this,ae,"f"),{capture:l(this,J,"f")}),e.addEventListener("keyup",l(this,oe,"f"),{capture:l(this,J,"f")}))}_unobserve(e){e.removeEventListener("pointerdown",l(this,se,"f"),{capture:l(this,J,"f")}),l(this,Q,"f")&&(e.removeEventListener("keydown",l(this,ae,"f"),{capture:l(this,J,"f")}),e.removeEventListener("keyup",l(this,oe,"f"),{capture:l(this,J,"f")}))}}J=new WeakMap,Y=new WeakMap,Q=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,ie=new WeakMap,re=new WeakMap,ae=new WeakMap,oe=new WeakMap,G=new WeakSet,ne=function(e){if(!("mouse"===e.pointerType&&e.button>1))for(const t of e.composedPath())if(t instanceof HTMLElement&&this.isObserving(t)){l(this,ee,"f").has(t)||(l(this,ee,"f").set(t,performance.now()),l(this,Y,"f").call(this,!0,{x:e.x,y:e.y},t));break}},le=function(e){if("mouse"===e.pointerType&&e.button>1)return;const t=e.x,s=e.y;for(const e of l(this,ee,"f").keys()){const i=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(e));i>0?setTimeout(()=>{l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e)},i):(l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e))}},he=function(e){const t=e.touches[0]?.clientX??0,s=e.touches[0]?.clientY??0;for(const e of l(this,ee,"f").keys()){const i=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(e));i>0?setTimeout(()=>{l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e)},i):(l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e))}},de=function(e){if(e.target!==e.currentTarget)return;const t=e.currentTarget;if(!l(this,ee,"f").has(t)&&l(this,Q,"f")?.call(this,e.key)){" "===e.key&&e.preventDefault(),l(this,ee,"f").set(t,performance.now());const s=t.getBoundingClientRect();l(this,Y,"f").call(this,!0,{x:s.x+s.width/2,y:s.y+s.height/2},t)}},ce=function(e){const t=e.target;if(l(this,ee,"f").has(t)&&l(this,Q,"f")?.call(this,e.key)){const e=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(t)),s=t.getBoundingClientRect();e>0?setTimeout(()=>{l(this,ee,"f").delete(t),l(this,Y,"f").call(this,!1,{x:s.x+s.width/2,y:s.y+s.height/2},t)},e):(l(this,ee,"f").delete(t),l(this,Y,"f").call(this,!1,{x:s.x+s.width/2,y:s.y+s.height/2},t))}};class We extends Ee{constructor(t,s){super(t,s),pe.set(this,void 0),me.set(this,void 0),ue.set(this,void 0),ve.set(this,void 0),fe.set(this,void 0),ye.set(this,!0),h(this,pe,t,"f"),h(this,me,s.callback,"f"),h(this,ue,s.skipInitial??!1,"f"),h(this,ve,s.config,"f"),e||(window.ResizeObserver?h(this,fe,new ResizeObserver((e,t)=>{l(this,me,"f").call(this,e,t),l(this,pe,"f").requestUpdate()}),"f"):console.warn("ResizeController error: the browser does not support ResizeObserver."))}async hostUpdated(){l(this,fe,"f")&&!l(this,ue,"f")&&l(this,ye,"f")&&l(this,me,"f").call(this,[],l(this,fe,"f")),h(this,ye,!1,"f")}_observe(e){l(this,fe,"f")?.observe(e,l(this,ve,"f")),h(this,ye,!0,"f"),l(this,pe,"f").requestUpdate()}_unobserve(e){l(this,fe,"f")?.unobserve(e)}}function Pe(e){const t=Symbol("_id");return(s,i,r)=>{const a=r.value;return r.value=function(...s){clearTimeout(this[t]),this[t]=setTimeout(()=>a.apply(this,s),e)},r}}pe=new WeakMap,me=new WeakMap,ue=new WeakMap,ve=new WeakMap,fe=new WeakMap,ye=new WeakMap;class Te extends Ee{constructor(e,t){super(e,t),ge.add(this),be.set(this,void 0),xe.set(this,void 0),we.set(this,e=>l(this,ge,"m",_e).call(this,e)),$e.set(this,new Map),h(this,be,!0===t.debounce,"f"),h(this,xe,t.callback,"f")}getScrollContainers(e){return l(this,$e,"f").get(e)}_observe(e){const t=l(this,ge,"m",ke).call(this,e);if(t.length>0){l(this,$e,"f").set(e,t);for(const e of t)(e===document.documentElement?document:e).addEventListener("scroll",l(this,we,"f"),{passive:!0})}}_unobserve(e){if(l(this,$e,"f").has(e)){for(const t of l(this,$e,"f").get(e))(t===document.documentElement?document:t).removeEventListener("scroll",l(this,we,"f"));l(this,$e,"f").delete(e)}}_debounceCallback(e){l(this,xe,"f").call(this,e)}}be=new WeakMap,xe=new WeakMap,we=new WeakMap,$e=new WeakMap,ge=new WeakSet,ke=function(e){const t=new Array;let s=e;for(;s;){const e=getComputedStyle(s);/(auto|scroll)/.test(e.overflow+e.overflowY+e.overflowX)&&t.push(s),s=s.parentElement}return t},_e=function(e){const t=e.target===document?document.documentElement:e.target;l(this,be,"f")?this._debounceCallback(t):l(this,xe,"f").call(this,t)},n([Pe(40)],Te.prototype,"_debounceCallback",null);
6
+ import{isServer as e,nothing as t,noChange as s,unsafeCSS as i,html as r,css as a,LitElement as o}from"lit";function n(e,t,s,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(a<3?r(o):a>3?r(t,s,o):r(t,s))||o);return a>3&&o&&Object.defineProperty(t,s,o),o}function l(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function h(e,t,s,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,s):r?r.value=s:t.set(e,s),s}var d,c,p,m,u,v,f,y,g,b,x,w,$,k,_,E,S,A,C,z,L,M,W,P,T,F,H,D,O,U,N,I,R,B,q,V,j,K,X,Z,G,J,Y,Q,ee,te,se,ie,re,ae,oe,ne,le,he,de,ce,pe,me,ue,ve,fe,ye,ge,be,xe,we,$e,ke,_e;"function"==typeof SuppressedError&&SuppressedError;class Ee{constructor(e,t){d.set(this,void 0),c.set(this,void 0),p.set(this,new Set),h(this,d,e,"f"),h(this,c,t.target,"f"),l(this,d,"f").addController(this)}get targets(){return l(this,p,"f").values()}hostConnected(){null!==l(this,c,"f")&&this.observe(l(this,c,"f")??l(this,d,"f"))}hostDisconnected(){l(this,p,"f").forEach(e=>this.unobserve(e)),l(this,p,"f").clear()}observe(e){l(this,p,"f").has(e)||(l(this,p,"f").add(e),this._observe(e))}isObserving(e){return l(this,p,"f").has(e)}unobserve(e){l(this,p,"f").delete(e)&&this._unobserve(e)}}d=new WeakMap,c=new WeakMap,p=new WeakMap;class Se extends Ee{constructor(e,t){super(e,t),m.add(this),u.set(this,void 0),v.set(this,e=>l(this,m,"m",y).call(this,e)),f.set(this,e=>l(this,m,"m",g).call(this,e)),h(this,u,t.callback,"f")}_observe(e){e.addEventListener("keydown",l(this,v,"f")),e.addEventListener("focusin",l(this,v,"f")),e.addEventListener("focusout",l(this,f,"f"))}_unobserve(e){e.removeEventListener("keydown",l(this,v,"f")),e.removeEventListener("focusin",l(this,v,"f")),e.removeEventListener("focusout",l(this,f,"f"))}}u=new WeakMap,v=new WeakMap,f=new WeakMap,m=new WeakSet,y=function(e){const t=e.target;l(this,u,"f").call(this,!0,t.matches(":focus-visible")||matchMedia("(forced-colors: active)").matches,t)},g=function(e){l(this,u,"f").call(this,!1,!1,e.target)};class Ae extends Ee{constructor(e,t){super(e,t),b.add(this),x.set(this,void 0),w.set(this,new Map),$.set(this,new Map),k.set(this,e=>l(this,b,"m",C).call(this,e)),_.set(this,e=>l(this,b,"m",z).call(this,e)),h(this,x,t.callback,"f"),this.startDelay=t.startDelay??0,this.endDelay=t.endDelay??0}clearDelays(){for(const e of this.targets)l(this,b,"m",E).call(this,e)}_observe(e){e.addEventListener("pointerenter",l(this,k,"f")),e.addEventListener("pointerleave",l(this,_,"f"))}_unobserve(e){e.removeEventListener("pointerenter",l(this,k,"f")),e.removeEventListener("pointerleave",l(this,_,"f"))}}x=new WeakMap,w=new WeakMap,$=new WeakMap,k=new WeakMap,_=new WeakMap,b=new WeakSet,E=function(e){l(this,b,"m",S).call(this,e),l(this,b,"m",A).call(this,e)},S=function(e){return!!l(this,w,"f").has(e)&&(clearTimeout(l(this,w,"f").get(e)),l(this,w,"f").delete(e))},A=function(e){return!!l(this,$,"f").has(e)&&(clearTimeout(l(this,$,"f").get(e)),l(this,$,"f").delete(e))},C=function(e){const t=e.target;l(this,b,"m",A).call(this,t),this.startDelay>0?(l(this,b,"m",S).call(this,t),l(this,w,"f").set(t,setTimeout(()=>{l(this,w,"f").delete(t),l(this,x,"f").call(this,!0,t)},this.startDelay))):l(this,x,"f").call(this,!0,t)},z=function(e){const t=e.target;l(this,b,"m",S).call(this,t)||(this.endDelay>0?(l(this,b,"m",A).call(this,t),l(this,$,"f").set(t,setTimeout(()=>{l(this,$,"f").delete(t),l(this,x,"f").call(this,!1,t)},this.endDelay))):l(this,x,"f").call(this,!1,t))};class Ce extends Ee{constructor(t,s){super(t,s),L.set(this,void 0),M.set(this,void 0),W.set(this,!1),P.set(this,void 0),T.set(this,!0),h(this,L,t,"f"),h(this,M,s.callback,"f"),h(this,W,s.skipInitial??!1,"f"),e||(window.IntersectionObserver?h(this,P,new IntersectionObserver((e,t)=>{l(this,M,"f").call(this,e,t),l(this,L,"f").requestUpdate()},s.init),"f"):console.warn("IntersectionController error: the browser does not support IntersectionObserver."))}async hostUpdated(){l(this,P,"f")&&!l(this,W,"f")&&l(this,T,"f")&&l(this,M,"f").call(this,[],l(this,P,"f")),h(this,T,!1,"f")}_observe(e){l(this,P,"f")?.observe(e),h(this,T,!0,"f"),l(this,L,"f").requestUpdate()}_unobserve(e){l(this,P,"f")?.unobserve(e)}}L=new WeakMap,M=new WeakMap,W=new WeakMap,P=new WeakMap,T=new WeakMap;class ze extends Ee{constructor(e,t){super(e,t),F.add(this),H.set(this,void 0),D.set(this,void 0),O.set(this,new Set),U.set(this,new Map),N.set(this,e=>l(this,F,"m",R).call(this,e)),I.set(this,e=>l(this,F,"m",B).call(this,e)),h(this,H,t.callback,"f"),h(this,D,t.threshold??500,"f")}_observe(e){e.addEventListener("touchstart",l(this,N,"f")),e.addEventListener("touchend",l(this,I,"f")),e.addEventListener("touchcancel",l(this,I,"f"))}_unobserve(e){e.removeEventListener("touchstart",l(this,N,"f")),e.removeEventListener("touchend",l(this,I,"f")),e.removeEventListener("touchcancel",l(this,I,"f"))}}H=new WeakMap,D=new WeakMap,O=new WeakMap,U=new WeakMap,N=new WeakMap,I=new WeakMap,F=new WeakSet,R=function(e){if(e.currentTarget instanceof HTMLElement&&this.isObserving(e.currentTarget)){const t=e.currentTarget;l(this,U,"f").set(t,setTimeout(()=>{l(this,O,"f").add(t),l(this,U,"f").delete(t),l(this,H,"f").call(this,!0,t)},l(this,D,"f")))}},B=function(e){if(e.currentTarget instanceof HTMLElement&&this.isObserving(e.currentTarget)){const t=e.currentTarget;l(this,O,"f").has(t)&&(l(this,H,"f").call(this,!1,t),l(this,O,"f").delete(t)),l(this,U,"f").has(t)&&(clearTimeout(l(this,U,"f").get(t)),l(this,U,"f").delete(t))}};class Le extends Ee{constructor(t,s){super(t,s),q.set(this,void 0),V.set(this,void 0),j.set(this,!1),K.set(this,void 0),X.set(this,void 0),Z.set(this,!0),h(this,q,t,"f"),h(this,V,s.callback,"f"),h(this,j,s.skipInitial??!1,"f"),h(this,K,s.config,"f"),e||(window.MutationObserver?h(this,X,new MutationObserver((e,t)=>{l(this,V,"f").call(this,e,t),l(this,q,"f").requestUpdate()}),"f"):console.warn("MutationController error: the browser does not support MutationObserver."))}async hostUpdated(){if(l(this,X,"f")&&!l(this,j,"f")&&l(this,Z,"f")){const e=l(this,X,"f").takeRecords();e.length>0&&l(this,V,"f").call(this,e,l(this,X,"f"))}h(this,Z,!1,"f")}hostDisconnected(){super.hostDisconnected(),l(this,X,"f")?.disconnect()}_observe(e){l(this,X,"f")?.observe(e,l(this,K,"f")),h(this,Z,!0,"f"),l(this,q,"f").requestUpdate()}_unobserve(){l(this,X,"f")?.disconnect();for(const e of this.targets)l(this,X,"f")?.observe(e,l(this,K,"f"))}}q=new WeakMap,V=new WeakMap,j=new WeakMap,K=new WeakMap,X=new WeakMap,Z=new WeakMap;class Me extends Ee{constructor(e,t){super(e,t),G.add(this),J.set(this,void 0),Y.set(this,void 0),Q.set(this,void 0),ee.set(this,new Map),te.set(this,void 0),se.set(this,e=>l(this,G,"m",ne).call(this,e)),ie.set(this,e=>l(this,G,"m",le).call(this,e)),re.set(this,e=>l(this,G,"m",he).call(this,e)),ae.set(this,e=>l(this,G,"m",de).call(this,e)),oe.set(this,e=>l(this,G,"m",ce).call(this,e)),h(this,J,t.capture,"f"),h(this,Y,t.callback,"f"),h(this,Q,t.isPressedKey,"f"),h(this,te,t.minPressedDuration??0,"f")}hostConnected(){document.addEventListener("pointerup",l(this,ie,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchend",l(this,re,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchcancel",l(this,re,"f"),{capture:l(this,J,"f")}),super.hostConnected()}hostDisconnected(){document.removeEventListener("pointerup",l(this,ie,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchend",l(this,re,"f"),{capture:l(this,J,"f")}),document.addEventListener("touchcancel",l(this,re,"f"),{capture:l(this,J,"f")}),super.hostDisconnected(),l(this,ee,"f").clear()}_observe(e){e.addEventListener("pointerdown",l(this,se,"f"),{capture:l(this,J,"f")}),l(this,Q,"f")&&(e.addEventListener("keydown",l(this,ae,"f"),{capture:l(this,J,"f")}),e.addEventListener("keyup",l(this,oe,"f"),{capture:l(this,J,"f")}))}_unobserve(e){e.removeEventListener("pointerdown",l(this,se,"f"),{capture:l(this,J,"f")}),l(this,Q,"f")&&(e.removeEventListener("keydown",l(this,ae,"f"),{capture:l(this,J,"f")}),e.removeEventListener("keyup",l(this,oe,"f"),{capture:l(this,J,"f")}))}}J=new WeakMap,Y=new WeakMap,Q=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,ie=new WeakMap,re=new WeakMap,ae=new WeakMap,oe=new WeakMap,G=new WeakSet,ne=function(e){if(!("mouse"===e.pointerType&&e.button>1))for(const t of e.composedPath())if(t instanceof HTMLElement&&this.isObserving(t)){l(this,ee,"f").has(t)||(l(this,ee,"f").set(t,performance.now()),l(this,Y,"f").call(this,!0,{x:e.x,y:e.y},t));break}},le=function(e){if("mouse"===e.pointerType&&e.button>1)return;const t=e.x,s=e.y;for(const e of l(this,ee,"f").keys()){const i=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(e));i>0?setTimeout(()=>{l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e)},i):(l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e))}},he=function(e){const t=e.touches[0]?.clientX??0,s=e.touches[0]?.clientY??0;for(const e of l(this,ee,"f").keys()){const i=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(e));i>0?setTimeout(()=>{l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e)},i):(l(this,ee,"f").delete(e),l(this,Y,"f").call(this,!1,{x:t,y:s},e))}},de=function(e){if(e.target!==e.currentTarget)return;const t=e.currentTarget;if(l(this,Q,"f")?.call(this,e.key)&&(" "===e.key&&e.preventDefault(),!l(this,ee,"f").has(t))){l(this,ee,"f").set(t,performance.now());const e=t.getBoundingClientRect();l(this,Y,"f").call(this,!0,{x:e.x+e.width/2,y:e.y+e.height/2},t)}},ce=function(e){const t=e.target;if(l(this,ee,"f").has(t)&&l(this,Q,"f")?.call(this,e.key)){const e=l(this,te,"f")-(performance.now()-l(this,ee,"f").get(t)),s=t.getBoundingClientRect();e>0?setTimeout(()=>{l(this,ee,"f").delete(t),l(this,Y,"f").call(this,!1,{x:s.x+s.width/2,y:s.y+s.height/2},t)},e):(l(this,ee,"f").delete(t),l(this,Y,"f").call(this,!1,{x:s.x+s.width/2,y:s.y+s.height/2},t))}};class We extends Ee{constructor(t,s){super(t,s),pe.set(this,void 0),me.set(this,void 0),ue.set(this,void 0),ve.set(this,void 0),fe.set(this,void 0),ye.set(this,!0),h(this,pe,t,"f"),h(this,me,s.callback,"f"),h(this,ue,s.skipInitial??!1,"f"),h(this,ve,s.config,"f"),e||(window.ResizeObserver?h(this,fe,new ResizeObserver((e,t)=>{l(this,me,"f").call(this,e,t),l(this,pe,"f").requestUpdate()}),"f"):console.warn("ResizeController error: the browser does not support ResizeObserver."))}async hostUpdated(){l(this,fe,"f")&&!l(this,ue,"f")&&l(this,ye,"f")&&l(this,me,"f").call(this,[],l(this,fe,"f")),h(this,ye,!1,"f")}_observe(e){l(this,fe,"f")?.observe(e,l(this,ve,"f")),h(this,ye,!0,"f"),l(this,pe,"f").requestUpdate()}_unobserve(e){l(this,fe,"f")?.unobserve(e)}}function Pe(e){const t=Symbol("_id");return(s,i,r)=>{const a=r.value;return r.value=function(...s){clearTimeout(this[t]),this[t]=setTimeout(()=>a.apply(this,s),e)},r}}pe=new WeakMap,me=new WeakMap,ue=new WeakMap,ve=new WeakMap,fe=new WeakMap,ye=new WeakMap;class Te extends Ee{constructor(e,t){super(e,t),ge.add(this),be.set(this,void 0),xe.set(this,void 0),we.set(this,e=>l(this,ge,"m",_e).call(this,e)),$e.set(this,new Map),h(this,be,!0===t.debounce,"f"),h(this,xe,t.callback,"f")}getScrollContainers(e){return l(this,$e,"f").get(e)}_observe(e){const t=l(this,ge,"m",ke).call(this,e);if(t.length>0){l(this,$e,"f").set(e,t);for(const e of t)(e===document.documentElement?document:e).addEventListener("scroll",l(this,we,"f"),{passive:!0})}}_unobserve(e){if(l(this,$e,"f").has(e)){for(const t of l(this,$e,"f").get(e))(t===document.documentElement?document:t).removeEventListener("scroll",l(this,we,"f"));l(this,$e,"f").delete(e)}}_debounceCallback(e){l(this,xe,"f").call(this,e)}}be=new WeakMap,xe=new WeakMap,we=new WeakMap,$e=new WeakMap,ge=new WeakSet,ke=function(e){const t=new Array;let s=e;for(;s;){const e=getComputedStyle(s);/(auto|scroll)/.test(e.overflow+e.overflowY+e.overflowX)&&t.push(s),s=s.parentElement}return t},_e=function(e){const t=e.target===document?document.documentElement:e.target;l(this,be,"f")?this._debounceCallback(t):l(this,xe,"f").call(this,t)},n([Pe(40)],Te.prototype,"_debounceCallback",null);
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC