aptechka 0.8.4 → 0.9.0

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.
Files changed (164) hide show
  1. package/lib/{Animation-BInSRYNr.cjs → Animation-BCA-DBje.cjs} +1 -1
  2. package/lib/{Animation-uimN7sdT.js → Animation-DrSYnbgb.js} +1 -1
  3. package/lib/{Composed-Iihn8fT4.cjs → Composed-7Fe7TW_T.cjs} +1 -1
  4. package/lib/{Composed-Fa7owymK.js → Composed-pnupzTOv.js} +1 -1
  5. package/lib/{Damped-yrNXlkDE.js → Damped-C2FuK_3K.js} +1 -1
  6. package/lib/{Damped-Da3EnNN4.cjs → Damped-CSEZ0qwp.cjs} +1 -1
  7. package/lib/{Derived-DIWinC7Y.js → Derived-CFnbeEgJ.js} +1 -1
  8. package/lib/{Derived-D9VrDuf9.cjs → Derived-Dko3EP7m.cjs} +1 -1
  9. package/lib/ElementConstructor-9S0f1yAH.cjs +1 -0
  10. package/lib/ElementConstructor-CZKbNIQK.js +366 -0
  11. package/lib/Resource-BhF6Tj1p.js +49 -0
  12. package/lib/Resource-WCQEgLpB.cjs +1 -0
  13. package/lib/{SourceManager--L_rA28b.js → SourceManager-CmhlHGx7.js} +1 -1
  14. package/lib/{SourceManager-D6D2LVKf.cjs → SourceManager-DYnGpBi1.cjs} +1 -1
  15. package/lib/{Store-Qr3SNOSf.js → Store-Dsft7GtM.js} +1 -1
  16. package/lib/{Store-Cr3VaD9G.cjs → Store-kzJycezD.cjs} +1 -1
  17. package/lib/{Tweened-CjgvoOwL.js → Tweened-BrD2cPSC.js} +1 -1
  18. package/lib/{Tweened-DksN-Rz6.cjs → Tweened-D6dAu8Zi.cjs} +1 -1
  19. package/lib/{Viewport-BBYt1Ivy.cjs → Viewport-DRNfjjDY.cjs} +1 -1
  20. package/lib/{Viewport-Cgtq2I_K.js → Viewport-Ud7nellV.js} +1 -1
  21. package/lib/_createStore-Cf1MyeHa.cjs +1 -0
  22. package/lib/_createStore-Ck9bHolX.js +12 -0
  23. package/lib/accordion/AccordionElement.d.ts +1 -2
  24. package/lib/accordion/index.cjs +1 -1
  25. package/lib/accordion/index.js +110 -122
  26. package/lib/animation/index.cjs +1 -1
  27. package/lib/animation/index.js +3 -3
  28. package/lib/attribute/index.cjs +1 -1
  29. package/lib/attribute/index.js +1 -1
  30. package/lib/canvas/index.cjs +1 -1
  31. package/lib/canvas/index.d.ts +1 -2
  32. package/lib/canvas/index.js +69 -75
  33. package/lib/checkbox/index.cjs +1 -1
  34. package/lib/checkbox/index.d.ts +1 -3
  35. package/lib/checkbox/index.js +42 -46
  36. package/lib/class-linked-status/index.cjs +1 -1
  37. package/lib/class-linked-status/index.js +1 -1
  38. package/lib/controls/index.cjs +1 -1
  39. package/lib/controls/index.js +2 -2
  40. package/lib/counter/index.d.ts +1 -3
  41. package/lib/{createStylesheet-BxKITIVV.js → createStylesheet-C2gpLy4r.js} +1 -1
  42. package/lib/{createStylesheet-BsMSWX0q.cjs → createStylesheet-Di9WRypw.cjs} +1 -1
  43. package/lib/css-property/index.cjs +1 -1
  44. package/lib/css-property/index.js +1 -1
  45. package/lib/dev/index.cjs +1 -1
  46. package/lib/dev/index.js +1 -1
  47. package/lib/device/index.cjs +1 -1
  48. package/lib/device/index.js +1 -1
  49. package/lib/element-constructor/index.cjs +1 -1
  50. package/lib/element-constructor/index.js +114 -113
  51. package/lib/en3/helpers/index.cjs +1 -1
  52. package/lib/en3/helpers/index.js +2 -2
  53. package/lib/en3/misc/index.cjs +1 -1
  54. package/lib/en3/misc/index.js +2 -2
  55. package/lib/en3/objects/fluid/En3FluidElement.d.ts +1 -2
  56. package/lib/globals-DMjysUXI.js +8 -0
  57. package/lib/globals-bYKki-b9.cjs +1 -0
  58. package/lib/image/index.cjs +1 -1
  59. package/lib/image/index.js +8 -16
  60. package/lib/index-BtB-3MG7.js +265 -0
  61. package/lib/index-DQo2-dnB.cjs +9 -0
  62. package/lib/instantiate-BPZZn8jK.js +134 -0
  63. package/lib/instantiate-BWM-ipPW.cjs +1 -0
  64. package/lib/jsx/ComponentElement.d.ts +18 -0
  65. package/lib/jsx/globals.d.ts +13 -0
  66. package/lib/jsx/h.d.ts +6 -0
  67. package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
  68. package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
  69. package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
  70. package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
  71. package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
  72. package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
  73. package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
  74. package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
  75. package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
  76. package/lib/jsx/hooks/onAnimationFrame.js +22 -0
  77. package/lib/jsx/hooks/onElementResize.cjs +1 -0
  78. package/lib/jsx/hooks/onElementResize.d.ts +5 -0
  79. package/lib/jsx/hooks/onElementResize.js +11 -0
  80. package/lib/jsx/hooks/onIntersection.cjs +1 -0
  81. package/lib/jsx/hooks/onIntersection.d.ts +5 -0
  82. package/lib/jsx/hooks/onIntersection.js +11 -0
  83. package/lib/jsx/hooks/onWindowResize.cjs +1 -0
  84. package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
  85. package/lib/jsx/hooks/onWindowResize.js +8 -0
  86. package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
  87. package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
  88. package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
  89. package/lib/jsx/hooks/store/createResource.d.ts +3 -0
  90. package/lib/jsx/hooks/store/createStore.d.ts +3 -0
  91. package/lib/jsx/hooks/store/index.cjs +1 -0
  92. package/lib/jsx/hooks/store/index.d.ts +5 -0
  93. package/lib/jsx/hooks/store/index.js +27 -0
  94. package/lib/jsx/hooks/watchAttribute.cjs +1 -0
  95. package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
  96. package/lib/jsx/hooks/watchAttribute.js +17 -0
  97. package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
  98. package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
  99. package/lib/jsx/hooks/watchCSSProperty.js +17 -0
  100. package/lib/jsx/index.cjs +1 -0
  101. package/lib/jsx/index.d.ts +13 -0
  102. package/lib/jsx/index.js +91 -0
  103. package/lib/jsx/instantiate.d.ts +5 -0
  104. package/lib/jsx/register.d.ts +1 -0
  105. package/lib/jsx/render.d.ts +6 -0
  106. package/lib/jsx/type.d.ts +192 -0
  107. package/lib/ladder/index.cjs +1 -1
  108. package/lib/ladder/index.js +1 -1
  109. package/lib/media/index.cjs +1 -1
  110. package/lib/media/index.js +1 -1
  111. package/lib/modal/index.cjs +1 -1
  112. package/lib/modal/index.js +33 -36
  113. package/lib/onConnect-DGP866cj.cjs +1 -0
  114. package/lib/onConnect-y5DrxJ9P.js +7 -0
  115. package/lib/pointer/PointerElement.d.ts +1 -2
  116. package/lib/pointer/index.cjs +1 -1
  117. package/lib/pointer/index.js +106 -118
  118. package/lib/popover/PopoverButtonElement.d.ts +1 -2
  119. package/lib/popover/PopoverElement.d.ts +1 -2
  120. package/lib/popover/index.cjs +1 -1
  121. package/lib/popover/index.js +109 -125
  122. package/lib/router/index.cjs +1 -1
  123. package/lib/router/index.js +76 -73
  124. package/lib/scroll/ScrollElement.d.ts +1 -2
  125. package/lib/scroll/ScrollUserElement.d.ts +1 -2
  126. package/lib/scroll/index.cjs +1 -1
  127. package/lib/scroll/index.js +674 -753
  128. package/lib/select/SelectElement.d.ts +1 -3
  129. package/lib/select/SelectUserElement.d.ts +1 -2
  130. package/lib/select/index.cjs +1 -1
  131. package/lib/select/index.js +1 -1
  132. package/lib/sequence/index.cjs +1 -1
  133. package/lib/sequence/index.js +105 -108
  134. package/lib/slicer/SlicerElement.d.ts +1 -2
  135. package/lib/slicer/index.cjs +5 -5
  136. package/lib/slicer/index.js +88 -106
  137. package/lib/source/SourceElement.d.ts +1 -2
  138. package/lib/source/index.cjs +2 -2
  139. package/lib/source/index.js +20 -21
  140. package/lib/store/Derived.d.ts +3 -3
  141. package/lib/store/DerivedArray.d.ts +8 -0
  142. package/lib/store/Keyed.d.ts +13 -0
  143. package/lib/store/index.cjs +1 -1
  144. package/lib/store/index.d.ts +2 -0
  145. package/lib/store/index.js +32 -32
  146. package/lib/tags-BBOGIzDK.cjs +1 -0
  147. package/lib/tags-CefGDQtF.js +485 -0
  148. package/lib/theme/index.cjs +1 -1
  149. package/lib/theme/index.js +2 -2
  150. package/lib/tweaker/TweakerFieldElement.d.ts +1 -2
  151. package/lib/tweaker/TweakerFolderElement.d.ts +1 -2
  152. package/lib/tweaker/TweakerStoreManagerElement.d.ts +1 -2
  153. package/lib/tweaker/index.cjs +3 -3
  154. package/lib/tweaker/index.js +392 -472
  155. package/lib/video/index.cjs +1 -1
  156. package/lib/video/index.js +26 -30
  157. package/package.json +65 -9
  158. package/lib/custom-element/index.cjs +0 -1
  159. package/lib/custom-element/index.d.ts +0 -8
  160. package/lib/custom-element/index.js +0 -30
  161. package/lib/index-CzpP1Tg6.cjs +0 -9
  162. package/lib/index-Dwd_62sm.js +0 -301
  163. package/lib/tags-CAfasCGV.cjs +0 -1
  164. package/lib/tags-D9lNDPX8.js +0 -848
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var D=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(i,e,s)=>e in i?J(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,O=(i,e)=>{for(var s in e||(e={}))K.call(e,s)&&k(i,s,e[s]);if(D)for(var s of D(e))N.call(e,s)&&k(i,s,e[s]);return i};var T=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(T(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},l=(i,e,s,o)=>(T(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-Cr3VaD9G.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),A=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const M=require("../Damped-Da3EnNN4.cjs"),B=require("../element-resizer/index.cjs"),G=require("../window-resizer/index.cjs"),H=require("../custom-element/index.cjs"),x=require("../css-property/index.cjs");var c,u,m,v,f,d,P,w,_,C,E,y;class F{constructor(e){a(this,c,void 0);a(this,u,void 0);a(this,m,void 0);a(this,v,void 0);a(this,f,void 0);a(this,d,void 0);a(this,P,0);a(this,w,0);a(this,_,e=>{t(this,v).set(1)});a(this,C,e=>{t(this,v).set(0)});a(this,E,e=>{const s=q.getPointerPosition(e,t(this,c).getBoundingClientRect()),o={width:t(this,P),height:t(this,w)},n={x:s.x,y:s.y};if(t(this,f)){const p=q.screenToCartesian(n,o);n.x=p.x,n.y=p.y}if(t(this,d)){const p=q.normalize(n,o);n.x=A.clamp(p.x*2,-1,1),n.y=A.clamp(p.y*2,-1,1)}t(this,u).set(n.x),t(this,m).set(n.y)});a(this,y,()=>{l(this,P,this.element.clientWidth),l(this,w,this.element.clientHeight);let e=0,s=0,o=0,n=0;t(this,f)?t(this,d)?(e=-1,s=1,o=-1,n=1):(e=t(this,P)/2*-1,s=t(this,P)/2*1,o=t(this,w)/2*-1,n=t(this,w)/2*1):t(this,d)?(e=0,s=1,o=0,n=1):(e=0,s=t(this,P),o=0,n=t(this,w)),t(this,u).min=e,t(this,u).max=s,t(this,m).min=o,t(this,m).max=n});l(this,c,Q.getElement(e.element)),l(this,u,new M.Damped(0,e.damped)),l(this,m,new M.Damped(0,e.damped)),l(this,v,new M.Damped(0,O({min:0,max:1},e.damped))),l(this,f,e.cartesian||!1),l(this,d,e.normalize||!1)}get element(){return t(this,c)}get x(){return t(this,u)}get y(){return t(this,m)}get z(){return t(this,v)}get cartesian(){return t(this,f)}set cartesian(e){l(this,f,e),t(this,y).call(this)}get normalize(){return t(this,d)}set normalize(e){l(this,d,e),t(this,y).call(this)}connect(){t(this,c).addEventListener("pointerenter",t(this,_)),t(this,c).addEventListener("pointerleave",t(this,C)),t(this,c).addEventListener("pointermove",t(this,E)),B.elementResizer.subscribe(t(this,c),t(this,y)),G.windowResizer.subscribe(t(this,y))}disconnect(){t(this,c).removeEventListener("pointerenter",t(this,_)),t(this,c).removeEventListener("pointerleave",t(this,C)),t(this,c).removeEventListener("pointermove",t(this,E)),B.elementResizer.unsubscribe(t(this,y)),G.windowResizer.unsubscribe(t(this,y)),t(this,u).reset(),t(this,m).reset(),t(this,v).reset()}}c=new WeakMap,u=new WeakMap,m=new WeakMap,v=new WeakMap,f=new WeakMap,d=new WeakMap,P=new WeakMap,w=new WeakMap,_=new WeakMap,C=new WeakMap,E=new WeakMap,y=new WeakMap;var U=Object.defineProperty,V=Object.getOwnPropertyDescriptor,X=(i,e,s,o)=>{for(var n=o>1?void 0:o?V(e,s):e,p=i.length-1,L;p>=0;p--)(L=i[p])&&(n=(o?L(e,s,n):L(n))||n);return o&&n&&U(e,s,n),n},I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},r=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),b=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},Y=(i,e,s,o)=>(I(i,e,"write to private field"),e.set(i,s),s),h,S,g,z,W,R;exports.PointerElement=class extends H.CustomElement{constructor(){super(),b(this,h,void 0),b(this,S,new x.CSSProperty(this,"--damping",20)),b(this,g,new x.CSSProperty(this,"--mass",0)),b(this,z,new x.CSSProperty(this,"--stiffness",0)),b(this,W,new x.CSSProperty(this,"--cartesian",!1)),b(this,R,new x.CSSProperty(this,"--normalize",!1)),Y(this,h,new F({element:this})),r(this,S).subscribe(e=>{r(this,h).x.damping=e.current,r(this,h).y.damping=e.current,r(this,h).z.damping=e.current}),r(this,W).subscribe(e=>{r(this,h).cartesian=e.current}),r(this,R).subscribe(e=>{r(this,h).normalize=e.current}),r(this,g).subscribe(e=>{r(this,h).x.mass=e.current,r(this,h).y.mass=e.current,r(this,h).z.mass=e.current}),r(this,z).subscribe(e=>{r(this,h).x.stiffness=e.current,r(this,h).y.stiffness=e.current,r(this,h).z.stiffness=e.current}),r(this,h).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),r(this,h).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),r(this,h).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}get pointer(){return r(this,h)}connectedCallback(){r(this,h).connect(),r(this,S).observe(),r(this,g).observe(),r(this,z).observe()}disconnectedCallback(){r(this,h).disconnect(),r(this,S).unobserve(),r(this,g).unobserve(),r(this,z).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};h=new WeakMap;S=new WeakMap;g=new WeakMap;z=new WeakMap;W=new WeakMap;R=new WeakMap;exports.PointerElement=X([H.define("e-pointer")],exports.PointerElement);exports.Pointer=F;
1
+ "use strict";var W=Object.defineProperty;var D=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var M=(i,s,t)=>s in i?W(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))A.call(s,t)&&M(i,t,s[t]);if(D)for(var t of D(s))F.call(s,t)&&M(i,t,s[t]);return i};var _=(i,s,t)=>{if(!s.has(i))throw TypeError("Cannot "+t)};var e=(i,s,t)=>(_(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>{if(s.has(i))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(i):s.set(i,t)},c=(i,s,t,m)=>(_(i,s,"write to private field"),m?m.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-kzJycezD.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),G=require("../dom-JBOkFLTh.cjs"),k=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const R=require("../Damped-CSEZ0qwp.cjs"),H=require("../element-resizer/index.cjs"),j=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,a,l,d,y,u,b,x,f,w,C,p;class B{constructor(s){n(this,o,void 0);n(this,a,void 0);n(this,l,void 0);n(this,d,void 0);n(this,y,void 0);n(this,u,void 0);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,d).set(1)});n(this,w,s=>{e(this,d).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),m={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,m);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,m);h.x=k.clamp(z.x*2,-1,1),h.y=k.clamp(z.y*2,-1,1)}e(this,a).set(h.x),e(this,l).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,m=0,h=0;e(this,y)?e(this,u)?(s=-1,t=1,m=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,m=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,u)?(s=0,t=1,m=0,h=1):(s=0,t=e(this,b),m=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=m,e(this,l).max=h});c(this,o,G.getElement(s.element)),c(this,a,new R.Damped(0,s.damped)),c(this,l,new R.Damped(0,s.damped)),c(this,d,new R.Damped(0,T({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,d)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),H.elementResizer.subscribe(e(this,o),e(this,p)),j.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),H.elementResizer.unsubscribe(e(this,p)),j.windowResizer.unsubscribe(e(this,p)),e(this,a).reset(),e(this,l).reset(),e(this,d).reset()}}o=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,y=new WeakMap,u=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,g,v,S,E,L;class O extends HTMLElement{constructor(){super();n(this,r,void 0);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new B({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",O);exports.Pointer=B;exports.PointerElement=O;
@@ -1,167 +1,155 @@
1
- var F = Object.defineProperty;
2
- var D = Object.getOwnPropertySymbols;
3
- var I = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
4
- var O = (e, t, i) => t in e ? F(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, R = (e, t) => {
5
- for (var i in t || (t = {}))
6
- I.call(t, i) && O(e, i, t[i]);
7
- if (D)
8
- for (var i of D(t))
9
- J.call(t, i) && O(e, i, t[i]);
10
- return e;
1
+ var j = Object.defineProperty;
2
+ var k = Object.getOwnPropertySymbols;
3
+ var q = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
4
+ var D = (i, s, e) => s in i ? j(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, H = (i, s) => {
5
+ for (var e in s || (s = {}))
6
+ q.call(s, e) && D(i, e, s[e]);
7
+ if (k)
8
+ for (var e of k(s))
9
+ A.call(s, e) && D(i, e, s[e]);
10
+ return i;
11
11
  };
12
- var T = (e, t, i) => {
13
- if (!t.has(e))
14
- throw TypeError("Cannot " + i);
12
+ var M = (i, s, e) => {
13
+ if (!s.has(i))
14
+ throw TypeError("Cannot " + e);
15
15
  };
16
- var s = (e, t, i) => (T(e, t, "read from private field"), i ? i.call(e) : t.get(e)), a = (e, t, i) => {
17
- if (t.has(e))
16
+ var t = (i, s, e) => (M(i, s, "read from private field"), e ? e.call(i) : s.get(i)), n = (i, s, e) => {
17
+ if (s.has(i))
18
18
  throw TypeError("Cannot add the same private member more than once");
19
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
20
- }, p = (e, t, i, o) => (T(e, t, "write to private field"), o ? o.call(e, i) : t.set(e, i), i);
21
- import "../Store-Qr3SNOSf.js";
22
- import { g as K, s as N, n as Q } from "../coordinates-CgdGoSYs.js";
23
- import { a as U } from "../dom-P5QbAASX.js";
24
- import { c as A } from "../math-BOBiC4TN.js";
19
+ s instanceof WeakSet ? s.add(i) : s.set(i, e);
20
+ }, c = (i, s, e, m) => (M(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e);
21
+ import "../Store-Dsft7GtM.js";
22
+ import { g as F, s as G, n as I } from "../coordinates-CgdGoSYs.js";
23
+ import { a as J } from "../dom-P5QbAASX.js";
24
+ import { c as T } from "../math-BOBiC4TN.js";
25
25
  import "../ticker/index.js";
26
- import { D as W } from "../Damped-yrNXlkDE.js";
26
+ import { D as R } from "../Damped-C2FuK_3K.js";
27
27
  import { elementResizer as B } from "../element-resizer/index.js";
28
- import { windowResizer as G } from "../window-resizer/index.js";
29
- import { CustomElement as V, define as X } from "../custom-element/index.js";
30
- import { CSSProperty as g } from "../css-property/index.js";
31
- var c, l, u, d, y, v, b, w, S, C, E, f;
32
- class Y {
33
- constructor(t) {
34
- a(this, c, void 0);
35
- a(this, l, void 0);
36
- a(this, u, void 0);
37
- a(this, d, void 0);
38
- a(this, y, void 0);
39
- a(this, v, void 0);
40
- a(this, b, 0);
41
- a(this, w, 0);
42
- a(this, S, (t) => {
43
- s(this, d).set(1);
28
+ import { windowResizer as W } from "../window-resizer/index.js";
29
+ import { CSSProperty as P } from "../css-property/index.js";
30
+ var o, a, l, y, b, u, d, f, S, w, E, p;
31
+ class K {
32
+ constructor(s) {
33
+ n(this, o, void 0);
34
+ n(this, a, void 0);
35
+ n(this, l, void 0);
36
+ n(this, y, void 0);
37
+ n(this, b, void 0);
38
+ n(this, u, void 0);
39
+ n(this, d, 0);
40
+ n(this, f, 0);
41
+ n(this, S, (s) => {
42
+ t(this, y).set(1);
44
43
  });
45
- a(this, C, (t) => {
46
- s(this, d).set(0);
44
+ n(this, w, (s) => {
45
+ t(this, y).set(0);
47
46
  });
48
- a(this, E, (t) => {
49
- const i = K(t, s(this, c).getBoundingClientRect()), o = {
50
- width: s(this, b),
51
- height: s(this, w)
52
- }, n = {
53
- x: i.x,
54
- y: i.y
47
+ n(this, E, (s) => {
48
+ const e = F(s, t(this, o).getBoundingClientRect()), m = {
49
+ width: t(this, d),
50
+ height: t(this, f)
51
+ }, h = {
52
+ x: e.x,
53
+ y: e.y
55
54
  };
56
- if (s(this, y)) {
57
- const m = N(n, o);
58
- n.x = m.x, n.y = m.y;
55
+ if (t(this, b)) {
56
+ const z = G(h, m);
57
+ h.x = z.x, h.y = z.y;
59
58
  }
60
- if (s(this, v)) {
61
- const m = Q(n, o);
62
- n.x = A(m.x * 2, -1, 1), n.y = A(m.y * 2, -1, 1);
59
+ if (t(this, u)) {
60
+ const z = I(h, m);
61
+ h.x = T(z.x * 2, -1, 1), h.y = T(z.y * 2, -1, 1);
63
62
  }
64
- s(this, l).set(n.x), s(this, u).set(n.y);
63
+ t(this, a).set(h.x), t(this, l).set(h.y);
65
64
  });
66
- a(this, f, () => {
67
- p(this, b, this.element.clientWidth), p(this, w, this.element.clientHeight);
68
- let t = 0, i = 0, o = 0, n = 0;
69
- s(this, y) ? s(this, v) ? (t = -1, i = 1, o = -1, n = 1) : (t = s(this, b) / 2 * -1, i = s(this, b) / 2 * 1, o = s(this, w) / 2 * -1, n = s(this, w) / 2 * 1) : s(this, v) ? (t = 0, i = 1, o = 0, n = 1) : (t = 0, i = s(this, b), o = 0, n = s(this, w)), s(this, l).min = t, s(this, l).max = i, s(this, u).min = o, s(this, u).max = n;
65
+ n(this, p, () => {
66
+ c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
67
+ let s = 0, e = 0, m = 0, h = 0;
68
+ t(this, b) ? t(this, u) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, u) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
70
69
  });
71
- p(this, c, U(t.element)), p(this, l, new W(0, t.damped)), p(this, u, new W(0, t.damped)), p(this, d, new W(0, R({ min: 0, max: 1 }, t.damped))), p(this, y, t.cartesian || !1), p(this, v, t.normalize || !1);
70
+ c(this, o, J(s.element)), c(this, a, new R(0, s.damped)), c(this, l, new R(0, s.damped)), c(this, y, new R(0, H({ min: 0, max: 1 }, s.damped))), c(this, b, s.cartesian || !1), c(this, u, s.normalize || !1);
72
71
  }
73
72
  get element() {
74
- return s(this, c);
73
+ return t(this, o);
75
74
  }
76
75
  get x() {
77
- return s(this, l);
76
+ return t(this, a);
78
77
  }
79
78
  get y() {
80
- return s(this, u);
79
+ return t(this, l);
81
80
  }
82
81
  get z() {
83
- return s(this, d);
82
+ return t(this, y);
84
83
  }
85
84
  get cartesian() {
86
- return s(this, y);
85
+ return t(this, b);
87
86
  }
88
- set cartesian(t) {
89
- p(this, y, t), s(this, f).call(this);
87
+ set cartesian(s) {
88
+ c(this, b, s), t(this, p).call(this);
90
89
  }
91
90
  get normalize() {
92
- return s(this, v);
91
+ return t(this, u);
93
92
  }
94
- set normalize(t) {
95
- p(this, v, t), s(this, f).call(this);
93
+ set normalize(s) {
94
+ c(this, u, s), t(this, p).call(this);
96
95
  }
97
96
  connect() {
98
- s(this, c).addEventListener("pointerenter", s(this, S)), s(this, c).addEventListener("pointerleave", s(this, C)), s(this, c).addEventListener("pointermove", s(this, E)), B.subscribe(s(this, c), s(this, f)), G.subscribe(s(this, f));
97
+ t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), B.subscribe(t(this, o), t(this, p)), W.subscribe(t(this, p));
99
98
  }
100
99
  disconnect() {
101
- s(this, c).removeEventListener(
100
+ t(this, o).removeEventListener(
102
101
  "pointerenter",
103
- s(this, S)
104
- ), s(this, c).removeEventListener(
102
+ t(this, S)
103
+ ), t(this, o).removeEventListener(
105
104
  "pointerleave",
106
- s(this, C)
107
- ), s(this, c).removeEventListener("pointermove", s(this, E)), B.unsubscribe(s(this, f)), G.unsubscribe(s(this, f)), s(this, l).reset(), s(this, u).reset(), s(this, d).reset();
105
+ t(this, w)
106
+ ), t(this, o).removeEventListener("pointermove", t(this, E)), B.unsubscribe(t(this, p)), W.unsubscribe(t(this, p)), t(this, a).reset(), t(this, l).reset(), t(this, y).reset();
108
107
  }
109
108
  }
110
- c = new WeakMap(), l = new WeakMap(), u = new WeakMap(), d = new WeakMap(), y = new WeakMap(), v = new WeakMap(), b = new WeakMap(), w = new WeakMap(), S = new WeakMap(), C = new WeakMap(), E = new WeakMap(), f = new WeakMap();
111
- var Z = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, j = (e, t, i, o) => {
112
- for (var n = o > 1 ? void 0 : o ? $(t, i) : t, m = e.length - 1, L; m >= 0; m--)
113
- (L = e[m]) && (n = (o ? L(t, i, n) : L(n)) || n);
114
- return o && n && Z(t, i, n), n;
115
- }, q = (e, t, i) => {
116
- if (!t.has(e))
117
- throw TypeError("Cannot " + i);
118
- }, r = (e, t, i) => (q(e, t, "read from private field"), i ? i.call(e) : t.get(e)), x = (e, t, i) => {
119
- if (t.has(e))
120
- throw TypeError("Cannot add the same private member more than once");
121
- t instanceof WeakSet ? t.add(e) : t.set(e, i);
122
- }, tt = (e, t, i, o) => (q(e, t, "write to private field"), t.set(e, i), i), h, z, P, _, M, k;
123
- let H = class extends V {
109
+ o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(), u = new WeakMap(), d = new WeakMap(), f = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), p = new WeakMap();
110
+ var r, g, v, x, L, C;
111
+ class N extends HTMLElement {
124
112
  constructor() {
125
- super(), x(this, h, void 0), x(this, z, new g(this, "--damping", 20)), x(this, P, new g(this, "--mass", 0)), x(this, _, new g(this, "--stiffness", 0)), x(this, M, new g(this, "--cartesian", !1)), x(this, k, new g(this, "--normalize", !1)), tt(this, h, new Y({
113
+ super();
114
+ n(this, r, void 0);
115
+ n(this, g, new P(this, "--damping", 20));
116
+ n(this, v, new P(this, "--mass", 0));
117
+ n(this, x, new P(this, "--stiffness", 0));
118
+ n(this, L, new P(this, "--cartesian", !1));
119
+ n(this, C, new P(this, "--normalize", !1));
120
+ c(this, r, new K({
126
121
  element: this
127
- })), r(this, z).subscribe((e) => {
128
- r(this, h).x.damping = e.current, r(this, h).y.damping = e.current, r(this, h).z.damping = e.current;
129
- }), r(this, M).subscribe((e) => {
130
- r(this, h).cartesian = e.current;
131
- }), r(this, k).subscribe((e) => {
132
- r(this, h).normalize = e.current;
133
- }), r(this, P).subscribe((e) => {
134
- r(this, h).x.mass = e.current, r(this, h).y.mass = e.current, r(this, h).z.mass = e.current;
135
- }), r(this, _).subscribe((e) => {
136
- r(this, h).x.stiffness = e.current, r(this, h).y.stiffness = e.current, r(this, h).z.stiffness = e.current;
137
- }), r(this, h).x.subscribe((e) => {
122
+ })), t(this, g).subscribe((e) => {
123
+ t(this, r).x.damping = e.current, t(this, r).y.damping = e.current, t(this, r).z.damping = e.current;
124
+ }), t(this, L).subscribe((e) => {
125
+ t(this, r).cartesian = e.current;
126
+ }), t(this, C).subscribe((e) => {
127
+ t(this, r).normalize = e.current;
128
+ }), t(this, v).subscribe((e) => {
129
+ t(this, r).x.mass = e.current, t(this, r).y.mass = e.current, t(this, r).z.mass = e.current;
130
+ }), t(this, x).subscribe((e) => {
131
+ t(this, r).x.stiffness = e.current, t(this, r).y.stiffness = e.current, t(this, r).z.stiffness = e.current;
132
+ }), t(this, r).x.subscribe((e) => {
138
133
  this.style.setProperty("--x", e.current.toString());
139
- }), r(this, h).y.subscribe((e) => {
134
+ }), t(this, r).y.subscribe((e) => {
140
135
  this.style.setProperty("--y", e.current.toString());
141
- }), r(this, h).z.subscribe((e) => {
136
+ }), t(this, r).z.subscribe((e) => {
142
137
  this.style.setProperty("--z", e.current.toString());
143
138
  });
144
139
  }
145
140
  get pointer() {
146
- return r(this, h);
141
+ return t(this, r);
147
142
  }
148
143
  connectedCallback() {
149
- r(this, h).connect(), r(this, z).observe(), r(this, P).observe(), r(this, _).observe();
144
+ t(this, r).connect(), t(this, g).observe(), t(this, v).observe(), t(this, x).observe();
150
145
  }
151
146
  disconnectedCallback() {
152
- r(this, h).disconnect(), r(this, z).unobserve(), r(this, P).unobserve(), r(this, _).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
147
+ t(this, r).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, x).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
153
148
  }
154
- };
155
- h = /* @__PURE__ */ new WeakMap();
156
- z = /* @__PURE__ */ new WeakMap();
157
- P = /* @__PURE__ */ new WeakMap();
158
- _ = /* @__PURE__ */ new WeakMap();
159
- M = /* @__PURE__ */ new WeakMap();
160
- k = /* @__PURE__ */ new WeakMap();
161
- H = j([
162
- X("e-pointer")
163
- ], H);
149
+ }
150
+ r = new WeakMap(), g = new WeakMap(), v = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap();
151
+ customElements.get("e-pointer") || customElements.define("e-pointer", N);
164
152
  export {
165
- Y as Pointer,
166
- H as PointerElement
153
+ K as Pointer,
154
+ N as PointerElement
167
155
  };
@@ -1,8 +1,7 @@
1
- import { CustomElement } from '../custom-element';
2
1
  import { PopoverElement } from './PopoverElement';
3
2
 
4
3
  export type PopoverButtonType = 'open' | 'close' | 'toggle';
5
- export declare class PopoverButtonElement extends CustomElement {
4
+ export declare class PopoverButtonElement extends HTMLElement {
6
5
  #private;
7
6
  constructor();
8
7
  get popoverElement(): PopoverElement | undefined;
@@ -1,8 +1,7 @@
1
1
  import { Attribute } from '../attribute';
2
- import { CustomElement } from '../custom-element';
3
2
  import { Store } from '../store';
4
3
 
5
- export declare class PopoverElement extends CustomElement {
4
+ export declare class PopoverElement extends HTMLElement {
6
5
  #private;
7
6
  private static __opened;
8
7
  constructor();
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../attribute/index.cjs"),S=require("../custom-element/index.cjs"),D=require("../Store-Cr3VaD9G.cjs"),H=require("../style-At6aDoqG.cjs"),I=require("../browser-CpzFX2xg.cjs"),N=require("../tags-CAfasCGV.cjs");var R=Object.defineProperty,G=Object.getOwnPropertyDescriptor,K=(t,e,s,r)=>{for(var a=r>1?void 0:r?G(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&R(e,s,a),a},b=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},i=(t,e,s)=>(b(t,e,"read from private field"),s?s.call(t):e.get(t)),h=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},W=(t,e,s,r)=>(b(t,e,"write to private field"),e.set(t,s),s),q=(t,e,s)=>(b(t,e,"access private method"),s),M,c,m,d,v,f,O,x,u,g,w,y,L,$,E;exports.PopoverElement=class extends S.CustomElement{constructor(){super(),h(this,O),h(this,u),h(this,L),h(this,M,-1),h(this,c,new D.Store(!1)),h(this,m,void 0),h(this,d,new A.Attribute(this,"history",!1)),h(this,v,new A.Attribute(this,"single",!1)),h(this,f,!1),this.open=(e=!0)=>{if(i(this,c).current)return;i(this,c).current=!0,i(this,v).current&&(exports.PopoverElement.__opened.forEach(r=>r.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),W(this,M,exports.PopoverElement.__opened.length-1),i(this,d).current&&i(this,f)&&history.pushState("","",i(this,O,x)),clearTimeout(i(this,m)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const s=()=>{addEventListener("click",i(this,w)),addEventListener("keydown",i(this,y)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};e?setTimeout(s):s()},this.close=()=>{if(i(this,c).current){if(i(this,c).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,d).current){const e=new URL(location.href);e.searchParams.delete(i(this,u,g)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",i(this,w)),removeEventListener("keydown",i(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},H.getElementTransitionDurationMS(this)+10)}},h(this,w,e=>{q(this,L,$).call(this,()=>{var p;const r=e.composedPath()[0],a=r instanceof HTMLElement&&(this.contains(r)||((p=this.shadowRoot)==null?void 0:p.contains(r))),l=r instanceof HTMLElement&&r.hasAttribute("outside");(!a||l)&&this.close()})}),h(this,y,e=>{q(this,L,$).call(this,()=>{e.code==="Escape"&&this.close()})}),h(this,E,()=>{W(this,f,!1),i(this,c).current&&i(this,d).current&&!location.search.includes(i(this,u,g))?this.close():!i(this,c).current&&i(this,d).current&&location.search.includes(i(this,u,g))&&this.open(),W(this,f,!0)}),this.setAttribute("popover-target","")}get history(){return i(this,d)}get single(){return i(this,v)}get opened(){return i(this,c)}connectedCallback(){i(this,d).observe(),i(this,v).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,E)),setTimeout(()=>{i(this,E).call(this)},0)}disconnectedCallback(){i(this,d).unobserve(),i(this,v).unobserve(),exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),clearTimeout(i(this,m)),removeEventListener("popstate",i(this,E))}};M=new WeakMap;c=new WeakMap;m=new WeakMap;d=new WeakMap;v=new WeakMap;f=new WeakMap;O=new WeakSet;x=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${i(this,u,g)}`};u=new WeakSet;g=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;L=new WeakSet;$=function(t){(exports.PopoverElement.__opened[i(this,M)-1]||exports.PopoverElement.__opened.length===1)&&t()};E=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=K([S.define("e-popover")],exports.PopoverElement);var U=Object.defineProperty,z=Object.getOwnPropertyDescriptor,F=(t,e,s,r)=>{for(var a=r>1?void 0:r?z(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&U(e,s,a),a},B=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},o=(t,e,s)=>(B(t,e,"read from private field"),s?s.call(t):e.get(t)),_=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},J=(t,e,s,r)=>(B(t,e,"write to private field"),e.set(t,s),s),n,P,C,k,T;exports.PopoverButtonElement=class extends S.CustomElement{constructor(){super(),_(this,n,void 0),_(this,P,()=>{this.classList.add("triggered")}),_(this,C,()=>{this.classList.add("opened")}),_(this,k,()=>{this.classList.remove("opened")}),_(this,T,()=>{this.classList.remove("triggered")}),I.isBrowser&&N.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(o(this,n)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!o(this,n).opened.current?o(this,n).open():(e==="close"||e==="toggle"&&o(this,n).opened.current)&&o(this,n).close()}},onKeydown:e=>{e.code==="Space"&&e.currentTarget.click()}})}get popoverElement(){return o(this,n)}connectedCallback(){var s;const e=this.getAttribute("target");if(e){let r=null;e==="parent"?r=this.closest("[popover-target]"):e==="sibling"?r=(s=this.parentElement)==null?void 0:s.querySelector("[popover-target]"):r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`),r instanceof HTMLElement?(J(this,n,r),o(this,n).addEventListener("popoverTriggered",o(this,P)),o(this,n).addEventListener("popoverOpened",o(this,C)),o(this,n).addEventListener("popoverClosing",o(this,k)),o(this,n).addEventListener("popoverClosed",o(this,T))):console.warn(this,`target ${e} not found`)}}disconnectedCallback(){o(this,n)&&(o(this,n).removeEventListener("popoverTriggered",o(this,P)),o(this,n).removeEventListener("popoverOpened",o(this,C)),o(this,n).removeEventListener("popoverClosing",o(this,k)),o(this,n).removeEventListener("popoverClosed",o(this,T)))}};n=new WeakMap;P=new WeakMap;C=new WeakMap;k=new WeakMap;T=new WeakMap;exports.PopoverButtonElement=F([S.define("e-popover-button")],exports.PopoverButtonElement);
1
+ "use strict";var q=(o,n,t)=>{if(!n.has(o))throw TypeError("Cannot "+t)};var e=(o,n,t)=>(q(o,n,"read from private field"),t?t.call(o):n.get(o)),i=(o,n,t)=>{if(n.has(o))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(o):n.set(o,t)},h=(o,n,t,a)=>(q(o,n,"write to private field"),a?a.call(o,t):n.set(o,t),t);var A=(o,n,t)=>(q(o,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../attribute/index.cjs"),I=require("../Store-kzJycezD.cjs"),R=require("../style-At6aDoqG.cjs"),N=require("../browser-CpzFX2xg.cjs"),j=require("../tags-BBOGIzDK.cjs");var m,l,y,p,d,u,_,x,v,L,f,E,b,M,g;const c=class c extends HTMLElement{constructor(){super();i(this,_);i(this,v);i(this,b);i(this,m,void 0);i(this,l,void 0);i(this,y,void 0);i(this,p,void 0);i(this,d,void 0);i(this,u,void 0);i(this,f,void 0);i(this,E,void 0);i(this,g,void 0);h(this,m,-1),h(this,l,new I.Store(!1)),h(this,p,new $.Attribute(this,"history",!1)),h(this,d,new $.Attribute(this,"single",!1)),h(this,u,!1),this.open=(t=!0)=>{if(e(this,l).current)return;e(this,l).current=!0,e(this,d).current&&(c.__opened.forEach(r=>r.close()),c.__opened=[]),c.__opened.push(this),h(this,m,c.__opened.length-1),e(this,p).current&&e(this,u)&&history.pushState("","",e(this,_,x)),clearTimeout(e(this,y)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const a=()=>{addEventListener("click",e(this,f)),addEventListener("keydown",e(this,E)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};t?setTimeout(a):a()},this.close=()=>{if(e(this,l).current){if(e(this,l).current=!1,c.__opened=c.__opened.filter(t=>t!==this),e(this,p).current){const t=new URL(location.href);t.searchParams.delete(e(this,v,L)),history.replaceState(null,"",t.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",e(this,f)),removeEventListener("keydown",e(this,E)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},R.getElementTransitionDurationMS(this)+10)}},h(this,f,t=>{A(this,b,M).call(this,()=>{var O;const r=t.composedPath()[0],P=r instanceof HTMLElement&&(this.contains(r)||((O=this.shadowRoot)==null?void 0:O.contains(r))),B=r instanceof HTMLElement&&r.hasAttribute("outside");(!P||B)&&this.close()})}),h(this,E,t=>{A(this,b,M).call(this,()=>{t.code==="Escape"&&this.close()})}),h(this,g,()=>{h(this,u,!1),e(this,l).current&&e(this,p).current&&!location.search.includes(e(this,v,L))?this.close():!e(this,l).current&&e(this,p).current&&location.search.includes(e(this,v,L))&&this.open(),h(this,u,!0)}),this.setAttribute("popover-target","")}get history(){return e(this,p)}get single(){return e(this,d)}get opened(){return e(this,l)}connectedCallback(){e(this,p).observe(),e(this,d).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",e(this,g)),setTimeout(()=>{e(this,g).call(this)},0)}disconnectedCallback(){e(this,p).unobserve(),e(this,d).unobserve(),c.__opened=c.__opened.filter(t=>t!==this),clearTimeout(e(this,y)),removeEventListener("popstate",e(this,g))}};m=new WeakMap,l=new WeakMap,y=new WeakMap,p=new WeakMap,d=new WeakMap,u=new WeakMap,_=new WeakSet,x=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${e(this,v,L)}`},v=new WeakSet,L=function(){return`modal-${this.id}`},f=new WeakMap,E=new WeakMap,b=new WeakSet,M=function(t){(c.__opened[e(this,m)-1]||c.__opened.length===1)&&t()},g=new WeakMap,c.__opened=[];let S=c;customElements.get("e-popover")||customElements.define("e-popover",S);var s,T,w,C,k;class H extends HTMLElement{constructor(){super();i(this,s,void 0);i(this,T,()=>{this.classList.add("triggered")});i(this,w,()=>{this.classList.add("opened")});i(this,C,()=>{this.classList.remove("opened")});i(this,k,()=>{this.classList.remove("triggered")});N.isBrowser&&j.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(e(this,s)){const t=this.getAttribute("type")||"open";t==="open"||t==="toggle"&&!e(this,s).opened.current?e(this,s).open():(t==="close"||t==="toggle"&&e(this,s).opened.current)&&e(this,s).close()}},onKeydown:t=>{t.code==="Space"&&t.currentTarget.click()}})}get popoverElement(){return e(this,s)}connectedCallback(){var a;const t=this.getAttribute("target");if(t){let r=null;t==="parent"?r=this.closest("[popover-target]"):t==="sibling"?r=(a=this.parentElement)==null?void 0:a.querySelector("[popover-target]"):r=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`),r instanceof HTMLElement?(h(this,s,r),e(this,s).addEventListener("popoverTriggered",e(this,T)),e(this,s).addEventListener("popoverOpened",e(this,w)),e(this,s).addEventListener("popoverClosing",e(this,C)),e(this,s).addEventListener("popoverClosed",e(this,k))):console.warn(this,`target ${t} not found`)}}disconnectedCallback(){e(this,s)&&(e(this,s).removeEventListener("popoverTriggered",e(this,T)),e(this,s).removeEventListener("popoverOpened",e(this,w)),e(this,s).removeEventListener("popoverClosing",e(this,C)),e(this,s).removeEventListener("popoverClosed",e(this,k)))}}s=new WeakMap,T=new WeakMap,w=new WeakMap,C=new WeakMap,k=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",H);exports.PopoverButtonElement=H;exports.PopoverElement=S;