aptechka 0.69.2 → 0.69.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.
@@ -1 +1 @@
1
- "use strict";var L=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||L("Cannot "+e);var o=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?L("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),y=(t,s,e,i)=>(m(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),p=(t,s,e)=>(m(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../css-property/index.cjs"),w=require("../index-DekP7OZe.cjs"),E=require("../stylesheet-HWF2a3nr.cjs");var n,a,c,u,d,b;class g extends HTMLElement{constructor(){super();r(this,d);r(this,n,new v.CSSProperty(this,"--columns",2));r(this,a,[]);r(this,c,null);r(this,u,()=>{p(this,d,b).call(this)});const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[E.createStylesheet({":host":{display:"grid",gridTemplateColumns:"repeat(var(--columns), 1fr)"},".column":{display:"grid",width:"100%",gap:"var(--gap, 0rem)",gridAutoRows:"max-content"}})]}connectedCallback(){y(this,c,new MutationObserver(o(this,u))),o(this,c).observe(this,{childList:!0}),o(this,n).subscribe(e=>{var i;this.shadowRoot.innerHTML="",y(this,a,[]);for(let l=0;l<e.current;l++){const h=document.createElement("div");h.classList.add("column"),h.innerHTML=`<slot name="col-${l}"></slot>`,o(this,a).push(h),(i=this.shadowRoot)==null||i.appendChild(h)}p(this,d,b).call(this)}),o(this,n).observe()}disconnectedCallback(){o(this,n).close(),o(this,c).disconnect(),this.classList.remove("distributed")}}n=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakSet,b=function(){[...this.children].forEach((i,l)=>{i.slot=`col-${l%o(this,n).current}`}),this.classList.add("distributed")};w.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",g);exports.MasonryLayoutElement=g;
1
+ "use strict";var v=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||v("Cannot "+e);var o=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),y=(t,s,e,i)=>(m(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),p=(t,s,e)=>(m(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../css-property/index.cjs"),E=require("../index-DekP7OZe.cjs"),w=require("../events-KVanG9sR.cjs"),S=require("../stylesheet-HWF2a3nr.cjs");var n,c,l,h,d,b;class L extends HTMLElement{constructor(){super();r(this,d);r(this,n,new g.CSSProperty(this,"--columns",2));r(this,c,[]);r(this,l,null);r(this,h,()=>{p(this,d,b).call(this)});const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[S.createStylesheet({":host":{display:"grid",gridTemplateColumns:"repeat(var(--columns), 1fr)"},".column":{display:"grid",width:"100%",gap:"var(--gap, 0rem)",gridAutoRows:"max-content"}})]}get columnElements(){return o(this,c)}connectedCallback(){y(this,l,new MutationObserver(o(this,h))),o(this,l).observe(this,{childList:!0}),o(this,n).subscribe(e=>{var i;this.shadowRoot.innerHTML="",y(this,c,[]);for(let a=0;a<e.current;a++){const u=document.createElement("div");u.classList.add("column"),u.innerHTML=`<slot name="col-${a}"></slot>`,o(this,c).push(u),(i=this.shadowRoot)==null||i.appendChild(u)}p(this,d,b).call(this)}),o(this,n).observe()}disconnectedCallback(){o(this,n).close(),o(this,l).disconnect(),this.classList.remove("distributed")}}n=new WeakMap,c=new WeakMap,l=new WeakMap,h=new WeakMap,d=new WeakSet,b=function(){[...this.children].forEach((i,a)=>{i.slot=`col-${a%o(this,n).current}`}),this.classList.add("distributed"),w.dispatchEvent(this,"masonryLayoutDistributed",{custom:!0})};E.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",L);exports.MasonryLayoutElement=L;
@@ -1,6 +1,10 @@
1
+ export interface MasonryLayoutElementEvents {
2
+ masonryLayoutDistributed: CustomEvent;
3
+ }
1
4
  export declare class MasonryLayoutElement extends HTMLElement {
2
5
  #private;
3
6
  constructor();
7
+ get columnElements(): HTMLElement[];
4
8
  protected connectedCallback(): void;
5
9
  protected disconnectedCallback(): void;
6
10
  }
@@ -8,4 +12,6 @@ declare global {
8
12
  interface HTMLElementTagNameMap {
9
13
  'e-masonry-layout': MasonryLayoutElement;
10
14
  }
15
+ interface HTMLElementEventMap extends MasonryLayoutElementEvents {
16
+ }
11
17
  }
@@ -1,25 +1,26 @@
1
1
  var L = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var u = (t, s, e) => s.has(t) || L("Cannot " + e);
5
- var o = (t, s, e) => (u(t, s, "read from private field"), e ? e.call(t) : s.get(t)), n = (t, s, e) => s.has(t) ? L("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), p = (t, s, e, i) => (u(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e), b = (t, s, e) => (u(t, s, "access private method"), e);
4
+ var u = (t, e, s) => e.has(t) || L("Cannot " + s);
5
+ var o = (t, e, s) => (u(t, e, "read from private field"), s ? s.call(t) : e.get(t)), n = (t, e, s) => e.has(t) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), p = (t, e, s, i) => (u(t, e, "write to private field"), i ? i.call(t, s) : e.set(t, s), s), y = (t, e, s) => (u(t, e, "access private method"), s);
6
6
  import { CSSProperty as f } from "../css-property/index.js";
7
7
  import { i as v } from "../index-Bv9zgfdb.js";
8
- import { c as w } from "../stylesheet-DpnWNVyD.js";
9
- var r, a, c, m, d, y;
10
- class g extends HTMLElement {
8
+ import { d as E } from "../events-CsVF98U6.js";
9
+ import { c as g } from "../stylesheet-DpnWNVyD.js";
10
+ var r, c, a, h, d, b;
11
+ class w extends HTMLElement {
11
12
  constructor() {
12
13
  super();
13
14
  n(this, d);
14
15
  n(this, r, new f(this, "--columns", 2));
15
- n(this, a, []);
16
- n(this, c, null);
17
- n(this, m, () => {
18
- b(this, d, y).call(this);
16
+ n(this, c, []);
17
+ n(this, a, null);
18
+ n(this, h, () => {
19
+ y(this, d, b).call(this);
19
20
  });
20
- const e = this.attachShadow({ mode: "open" });
21
- e.adoptedStyleSheets = [
22
- w({
21
+ const s = this.attachShadow({ mode: "open" });
22
+ s.adoptedStyleSheets = [
23
+ g({
23
24
  ":host": {
24
25
  display: "grid",
25
26
  gridTemplateColumns: "repeat(var(--columns), 1fr)"
@@ -33,29 +34,32 @@ class g extends HTMLElement {
33
34
  })
34
35
  ];
35
36
  }
37
+ get columnElements() {
38
+ return o(this, c);
39
+ }
36
40
  connectedCallback() {
37
- p(this, c, new MutationObserver(o(this, m))), o(this, c).observe(this, {
41
+ p(this, a, new MutationObserver(o(this, h))), o(this, a).observe(this, {
38
42
  childList: !0
39
- }), o(this, r).subscribe((e) => {
43
+ }), o(this, r).subscribe((s) => {
40
44
  var i;
41
- this.shadowRoot.innerHTML = "", p(this, a, []);
42
- for (let l = 0; l < e.current; l++) {
43
- const h = document.createElement("div");
44
- h.classList.add("column"), h.innerHTML = `<slot name="col-${l}"></slot>`, o(this, a).push(h), (i = this.shadowRoot) == null || i.appendChild(h);
45
+ this.shadowRoot.innerHTML = "", p(this, c, []);
46
+ for (let l = 0; l < s.current; l++) {
47
+ const m = document.createElement("div");
48
+ m.classList.add("column"), m.innerHTML = `<slot name="col-${l}"></slot>`, o(this, c).push(m), (i = this.shadowRoot) == null || i.appendChild(m);
45
49
  }
46
- b(this, d, y).call(this);
50
+ y(this, d, b).call(this);
47
51
  }), o(this, r).observe();
48
52
  }
49
53
  disconnectedCallback() {
50
- o(this, r).close(), o(this, c).disconnect(), this.classList.remove("distributed");
54
+ o(this, r).close(), o(this, a).disconnect(), this.classList.remove("distributed");
51
55
  }
52
56
  }
53
- r = new WeakMap(), a = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakSet(), y = function() {
57
+ r = new WeakMap(), c = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakSet(), b = function() {
54
58
  [...this.children].forEach((i, l) => {
55
59
  i.slot = `col-${l % o(this, r).current}`;
56
- }), this.classList.add("distributed");
60
+ }), this.classList.add("distributed"), E(this, "masonryLayoutDistributed", { custom: !0 });
57
61
  };
58
- v && !customElements.get("e-masonry-layout") && customElements.define("e-masonry-layout", g);
62
+ v && !customElements.get("e-masonry-layout") && customElements.define("e-masonry-layout", w);
59
63
  export {
60
- g as MasonryLayoutElement
64
+ w as MasonryLayoutElement
61
65
  };
@@ -15,6 +15,7 @@ export declare class PopoverElement extends HTMLElement {
15
15
  urlValue: string;
16
16
  constructor();
17
17
  get openClass(): string | null;
18
+ get closingClass(): string | null;
18
19
  get history(): CSSProperty<false>;
19
20
  get restore(): CSSProperty<false>;
20
21
  get closeRest(): CSSProperty<boolean>;
@@ -1 +1 @@
1
- "use strict";var re=c=>{throw TypeError(c)};var _=(c,n,t)=>n.has(c)||re("Cannot "+t);var e=(c,n,t)=>(_(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?re("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(_(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),y=(c,n,t)=>(_(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("../element-linked-store/index.cjs"),g=require("../css-property/index.cjs"),se=require("../index-DekP7OZe.cjs"),J=require("../events-KVanG9sR.cjs"),ue=require("../function-MthRj-GJ.cjs"),oe=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ne=require("../url-BT4fssbO.cjs"),he=require("../window-resizer/index.cjs"),K=require("../Viewport-DB0qAZPJ.cjs");var u,b,Z,N;class pe{constructor(){r(this,u,new Map);r(this,b,[]);r(this,Z,n=>{var s;const t=[...e(this,b)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(ie=>ie instanceof HTMLElement&&ie.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),G=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||G)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,b)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,Z)),addEventListener("keydown",e(this,N))}get groups(){return e(this,u)}get stack(){return e(this,b)}add(n,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(n);s!=null&&s.length||(s=[],e(this,u).set(n,s)),e(this,b).push(t),s.push(t)}remove(n,t){if(o(this,b,e(this,b).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(n);e(this,u).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(n);s&&(s=s.filter(i=>i!==t),e(this,u).set(n,s))}}}u=new WeakMap,b=new WeakMap,Z=new WeakMap,N=new WeakMap;var f,M,B,C,H,v,w,A,x,m,R,q,L,S,$,a,O,z,P,ce,Q,V,T,U,j,W;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,M);r(this,B);r(this,C);r(this,H);r(this,v);r(this,w);r(this,A);r(this,x);r(this,m);r(this,R);r(this,q);r(this,L);r(this,S);r(this,$);r(this,a);r(this,O);r(this,z);r(this,V);r(this,T);r(this,U);r(this,j);r(this,W);this.urlValue="",o(this,f,!1),o(this,v,new g.CSSProperty(this,"--history",!1)),o(this,w,new g.CSSProperty(this,"--restore",!1)),o(this,A,new g.CSSProperty(this,"--close-rest",!1)),o(this,x,new g.CSSProperty(this,"--close-rest-in-group",!1)),o(this,m,new g.CSSProperty(this,"--group","")),o(this,R,new g.CSSProperty(this,"--click-outside",!1)),o(this,q,new g.CSSProperty(this,"--escape",!1)),o(this,L,new g.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,S,!1),o(this,a,new ae.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),o(this,O,[]),o(this,z,[]),o(this,V,()=>{o(this,S,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,S,!0)}),o(this,T,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,U).call(this)}),o(this,U,ue.debounce(()=>{e(this,j).call(this)},10)),o(this,j,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>K.viewport.width?s=K.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>K.viewport.height?i=K.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,W,()=>{this.close()}),e(this,m).subscribe(t=>{t.previous&&(E.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,m)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ne.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,B)),this.openClass&&this.openClass.split(" ").map(i=>{document.documentElement.classList.add(i.trim())}),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),J.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,v).current&&e(this,S)&&history.pushState(history.state,"",e(this,P,ce)),o(this,f,!0);const s=()=>{E.stack.add(e(this,m).current,this),e(this,z).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),e(this,T).call(this),e(this,a).set("opened",!0),J.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,C,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0)},oe.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,C,setTimeout(s,10))}close(){e(this,f)&&(o(this,f,!1),clearTimeout(e(this,C)),clearTimeout(e(this,H)),E.stack.remove(e(this,m).current,this),y(this,P,Q).call(this),this.openClass&&this.openClass.split(" ").map(t=>{document.documentElement.classList.remove(t.trim())}),e(this,a).set("transitionend",!1),o(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),J.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),J.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},oe.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,O,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,O).forEach(t=>{t.addEventListener("click",e(this,W))}),o(this,z,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,v).observe(),e(this,w).observe(),e(this,A).observe(),e(this,x).observe(),e(this,m).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ne.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(this,P,Q).call(this),o(this,S,!0))},0),e(this,L).subscribe(()=>{e(this,T).call(this)}),he.windowResizer.subscribe(e(this,T))}disconnectedCallback(){e(this,O).forEach(t=>{t.removeEventListener("click",e(this,W))}),E.stack.remove(e(this,m).current,this),he.windowResizer.unsubscribe(e(this,T)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,A).close(),e(this,x).close(),e(this,m).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,B)),clearTimeout(e(this,C)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),y(this,P,Q).call(this)}};f=new WeakMap,M=new WeakMap,B=new WeakMap,C=new WeakMap,H=new WeakMap,v=new WeakMap,w=new WeakMap,A=new WeakMap,x=new WeakMap,m=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,S=new WeakMap,$=new WeakMap,a=new WeakMap,O=new WeakMap,z=new WeakMap,P=new WeakSet,ce=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},Q=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,T=new WeakMap,U=new WeakMap,j=new WeakMap,W=new WeakMap,E.stack=new pe;let D=E;se.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",D);var h,d,k,ee,X,Y,F,I,te;class le extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new g.CSSProperty(this,"--type","open"));r(this,X,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,Y,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,F,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,I,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});se.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(y(this,k,ee).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let G=p.querySelector("[data-popover]");return!G&&(p!=null&&p.parentElement)&&(G=l(p.parentElement)),G};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,X)),e(this,h).addEventListener("popoverOpened",e(this,Y)),e(this,h).addEventListener("popoverClosing",e(this,F)),e(this,h).addEventListener("popoverClosed",e(this,I))):console.warn(this,`target ${t} not found`)}y(this,k,te).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,te).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(this,k,ee).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,ee=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,X)),e(this,h).removeEventListener("popoverOpened",e(this,Y)),e(this,h).removeEventListener("popoverClosing",e(this,F)),e(this,h).removeEventListener("popoverClosed",e(this,I)))},X=new WeakMap,Y=new WeakMap,F=new WeakMap,I=new WeakMap,te=function(t){e(this,h)instanceof D&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};se.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",le);exports.PopoverButtonElement=le;exports.PopoverElement=D;
1
+ "use strict";var oe=c=>{throw TypeError(c)};var ee=(c,n,t)=>n.has(c)||oe("Cannot "+t);var e=(c,n,t)=>(ee(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(ee(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),f=(c,n,t)=>(ee(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),y=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),K=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-BT4fssbO.cjs"),ce=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var u,E,_,N;class de{constructor(){r(this,u,new Map);r(this,E,[]);r(this,_,n=>{var s;const t=[...e(this,E)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),D=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||D)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,E)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,u)}get stack(){return e(this,E)}add(n,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(n);s!=null&&s.length||(s=[],e(this,u).set(n,s)),e(this,E).push(t),s.push(t)}remove(n,t){if(o(this,E,e(this,E).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(n);e(this,u).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(n);s&&(s=s.filter(i=>i!==t),e(this,u).set(n,s))}}}u=new WeakMap,E=new WeakMap,_=new WeakMap,N=new WeakMap;var v,B,H,k,z,m,L,A,x,b,R,q,S,T,$,a,O,G,p,le,M,Z,V,P,j,X,W;const w=class w extends HTMLElement{constructor(){super();r(this,p);r(this,v);r(this,B);r(this,H);r(this,k);r(this,z);r(this,m);r(this,L);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,S);r(this,T);r(this,$);r(this,a);r(this,O);r(this,G);r(this,V);r(this,P);r(this,j);r(this,X);r(this,W);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,L,new y.CSSProperty(this,"--restore",!1)),o(this,A,new y.CSSProperty(this,"--close-rest",!1)),o(this,x,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,R,new y.CSSProperty(this,"--click-outside",!1)),o(this,q,new y.CSSProperty(this,"--escape",!1)),o(this,S,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,T,!1),o(this,a,new ue.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),o(this,O,[]),o(this,G,[]),o(this,V,()=>{o(this,T,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,T,!0)}),o(this,P,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,S).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,W,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(w.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=w.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,L)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),f(this,p,M).call(this,!0,this.openClass),f(this,p,M).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),K.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,T)&&history.pushState(history.state,"",e(this,p,le)),o(this,v,!0);const s=()=>{w.stack.add(e(this,b).current,this),e(this,G).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),e(this,P).call(this),e(this,a).set("opened",!0),K.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!0)},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,setTimeout(s,10))}close(){e(this,v)&&(o(this,v,!1),clearTimeout(e(this,k)),clearTimeout(e(this,z)),w.stack.remove(e(this,b).current,this),f(this,p,Z).call(this),f(this,p,M).call(this,!1,this.openClass),e(this,a).set("transitionend",!1),o(this,B,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),f(this,p,M).call(this,!0,this.closingClass),K.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),f(this,p,M).call(this,!1,this.closingClass),K.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,O,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,O).forEach(t=>{t.addEventListener("click",e(this,W))}),o(this,G,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,L).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,S).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,L).current?(this.urlValue=he.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(f(this,p,Z).call(this),o(this,T,!0))},0),e(this,S).subscribe(()=>{e(this,P).call(this)}),ce.windowResizer.subscribe(e(this,P))}disconnectedCallback(){e(this,O).forEach(t=>{t.removeEventListener("click",e(this,W))}),w.stack.remove(e(this,b).current,this),ce.windowResizer.unsubscribe(e(this,P)),e(this,a).close(),e(this,m).close(),e(this,L).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,S).close(),this.removeAttribute("role"),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,k)),clearTimeout(e(this,z)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),f(this,p,Z).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,k=new WeakMap,z=new WeakMap,m=new WeakMap,L=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,S=new WeakMap,T=new WeakMap,$=new WeakMap,a=new WeakMap,O=new WeakMap,G=new WeakMap,p=new WeakSet,le=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},M=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,P=new WeakMap,j=new WeakMap,X=new WeakMap,W=new WeakMap,w.stack=new de;let U=w;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,C,te,Y,F,I,J,se;class ae extends HTMLElement{constructor(){super();r(this,C);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,()=>{e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,F,()=>{e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,I,()=>{e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,J,()=>{e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(f(this,C,te).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=d=>{if(!d)return null;let D=d.querySelector("[data-popover]");return!D&&(d!=null&&d.parentElement)&&(D=l(d.parentElement)),D};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,F)),e(this,h).addEventListener("popoverClosing",e(this,I)),e(this,h).addEventListener("popoverClosed",e(this,J))):console.warn(this,`target ${t} not found`)}f(this,C,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{f(this,C,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),f(this,C,te).call(this)}}h=new WeakMap,g=new WeakMap,C=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,F)),e(this,h).removeEventListener("popoverClosing",e(this,I)),e(this,h).removeEventListener("popoverClosed",e(this,J)))},Y=new WeakMap,F=new WeakMap,I=new WeakMap,J=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
@@ -1,74 +1,74 @@
1
- var rt = (c) => {
2
- throw TypeError(c);
1
+ var ot = (l) => {
2
+ throw TypeError(l);
3
3
  };
4
- var _ = (c, h, e) => h.has(c) || rt("Cannot " + e);
5
- var t = (c, h, e) => (_(c, h, "read from private field"), e ? e.call(c) : h.get(c)), r = (c, h, e) => h.has(c) ? rt("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(c) : h.set(c, e), o = (c, h, e, s) => (_(c, h, "write to private field"), s ? s.call(c, e) : h.set(c, e), e), E = (c, h, e) => (_(c, h, "access private method"), e);
4
+ var tt = (l, h, e) => h.has(l) || ot("Cannot " + e);
5
+ var t = (l, h, e) => (tt(l, h, "read from private field"), e ? e.call(l) : h.get(l)), r = (l, h, e) => h.has(l) ? ot("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(l) : h.set(l, e), o = (l, h, e, s) => (tt(l, h, "write to private field"), s ? s.call(l, e) : h.set(l, e), e), f = (l, h, e) => (tt(l, h, "access private method"), e);
6
6
  import { ElementLinkedStore as ct } from "../element-linked-store/index.js";
7
- import { CSSProperty as g } from "../css-property/index.js";
8
- import { i as st } from "../index-Bv9zgfdb.js";
9
- import { d as I } from "../events-CsVF98U6.js";
10
- import { d as lt } from "../function-C10DGppn.js";
11
- import { g as ot } from "../style-j2TwriJ_.js";
7
+ import { CSSProperty as E } from "../css-property/index.js";
8
+ import { i as it } from "../index-Bv9zgfdb.js";
9
+ import { d as J } from "../events-CsVF98U6.js";
10
+ import { d as at } from "../function-C10DGppn.js";
11
+ import { g as ht } from "../style-j2TwriJ_.js";
12
12
  import "construct-style-sheets-polyfill";
13
- import { u as at, p as ut } from "../url-Cb0SFRMc.js";
14
- import { windowResizer as ht } from "../window-resizer/index.js";
15
- import { v as J } from "../Viewport-DA10iWAO.js";
16
- var u, b, Z, N;
17
- class pt {
13
+ import { u as ut, p as pt } from "../url-Cb0SFRMc.js";
14
+ import { windowResizer as nt } from "../window-resizer/index.js";
15
+ import { v as K } from "../Viewport-DA10iWAO.js";
16
+ var u, y, N, _;
17
+ class dt {
18
18
  constructor() {
19
19
  r(this, u, /* @__PURE__ */ new Map());
20
- r(this, b, []);
21
- r(this, Z, (h) => {
20
+ r(this, y, []);
21
+ r(this, N, (h) => {
22
22
  var s;
23
- const e = [...t(this, b)].reverse().find((i) => i.clickOutside.current);
23
+ const e = [...t(this, y)].reverse().find((i) => i.clickOutside.current);
24
24
  if (e) {
25
25
  const i = h.composedPath();
26
26
  if (i.find(
27
- (it) => it instanceof HTMLElement && it.hasAttribute("data-popover-content")
27
+ (rt) => rt instanceof HTMLElement && rt.hasAttribute("data-popover-content")
28
28
  ))
29
29
  return;
30
- const l = i[0], p = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), B = l instanceof HTMLElement && l.hasAttribute("data-outside");
31
- (!p || B) && e.close();
30
+ const c = i[0], d = c instanceof Node && (e.contains(c) || ((s = e.shadowRoot) == null ? void 0 : s.contains(c))), D = c instanceof HTMLElement && c.hasAttribute("data-outside");
31
+ (!d || D) && e.close();
32
32
  }
33
33
  });
34
- r(this, N, (h) => {
34
+ r(this, _, (h) => {
35
35
  if (h.code === "Escape") {
36
- const e = [...t(this, b)].reverse().find((s) => s.escape.current);
36
+ const e = [...t(this, y)].reverse().find((s) => s.escape.current);
37
37
  e && e.close();
38
38
  }
39
39
  });
40
40
  document.documentElement.addEventListener(
41
41
  "click",
42
- t(this, Z)
43
- ), addEventListener("keydown", t(this, N));
42
+ t(this, N)
43
+ ), addEventListener("keydown", t(this, _));
44
44
  }
45
45
  get groups() {
46
46
  return t(this, u);
47
47
  }
48
48
  get stack() {
49
- return t(this, b);
49
+ return t(this, y);
50
50
  }
51
51
  add(h, e) {
52
52
  if (e.closeRest.current)
53
53
  t(this, u).forEach((i) => {
54
- i.forEach((l) => {
55
- l.close();
54
+ i.forEach((c) => {
55
+ c.close();
56
56
  });
57
57
  });
58
58
  else if (e.closeRestInGroup.current) {
59
59
  let i = t(this, u).get(h);
60
- i == null || i.forEach((l) => {
61
- l.close();
60
+ i == null || i.forEach((c) => {
61
+ c.close();
62
62
  });
63
63
  }
64
64
  let s = t(this, u).get(h);
65
- s != null && s.length || (s = [], t(this, u).set(h, s)), t(this, b).push(e), s.push(e);
65
+ s != null && s.length || (s = [], t(this, u).set(h, s)), t(this, y).push(e), s.push(e);
66
66
  }
67
67
  remove(h, e) {
68
- if (o(this, b, t(this, b).filter((s) => s !== e)), e.closeRest.current) {
68
+ if (o(this, y, t(this, y).filter((s) => s !== e)), e.closeRest.current) {
69
69
  let s = [];
70
70
  t(this, u).forEach((i) => {
71
- i.forEach((l) => s.push(l));
71
+ i.forEach((c) => s.push(c));
72
72
  }), t(this, u).clear(), s.forEach((i) => i.close());
73
73
  } else if (e.closeRestInGroup.current) {
74
74
  const s = t(this, u).get(h);
@@ -81,60 +81,60 @@ class pt {
81
81
  }
82
82
  }
83
83
  }
84
- u = new WeakMap(), b = new WeakMap(), Z = new WeakMap(), N = new WeakMap();
85
- var f, H, q, P, W, m, L, x, S, v, R, $, w, T, O, a, V, G, A, nt, K, M, k, D, U, z;
86
- const y = class y extends HTMLElement {
84
+ u = new WeakMap(), y = new WeakMap(), N = new WeakMap(), _ = new WeakMap();
85
+ var m, q, G, P, W, v, w, x, S, b, R, $, T, k, O, a, V, z, p, lt, H, Q, M, A, U, X, B;
86
+ const L = class L extends HTMLElement {
87
87
  constructor() {
88
88
  super();
89
- r(this, A);
90
- r(this, f);
91
- r(this, H);
89
+ r(this, p);
90
+ r(this, m);
92
91
  r(this, q);
92
+ r(this, G);
93
93
  r(this, P);
94
94
  r(this, W);
95
- r(this, m);
96
- r(this, L);
95
+ r(this, v);
96
+ r(this, w);
97
97
  r(this, x);
98
98
  r(this, S);
99
- r(this, v);
99
+ r(this, b);
100
100
  r(this, R);
101
101
  r(this, $);
102
- r(this, w);
103
102
  r(this, T);
103
+ r(this, k);
104
104
  r(this, O);
105
105
  r(this, a);
106
106
  r(this, V);
107
- r(this, G);
107
+ r(this, z);
108
108
  r(this, M);
109
- r(this, k);
110
- r(this, D);
109
+ r(this, A);
111
110
  r(this, U);
112
- r(this, z);
113
- this.urlValue = "", o(this, f, !1), o(this, m, new g(this, "--history", !1)), o(this, L, new g(this, "--restore", !1)), o(this, x, new g(this, "--close-rest", !1)), o(this, S, new g(
111
+ r(this, X);
112
+ r(this, B);
113
+ this.urlValue = "", o(this, m, !1), o(this, v, new E(this, "--history", !1)), o(this, w, new E(this, "--restore", !1)), o(this, x, new E(this, "--close-rest", !1)), o(this, S, new E(
114
114
  this,
115
115
  "--close-rest-in-group",
116
116
  !1
117
- )), o(this, v, new g(this, "--group", "")), o(this, R, new g(this, "--click-outside", !1)), o(this, $, new g(this, "--escape", !1)), o(this, w, new g(this, "--check-viewport-bounds", !1)), o(this, T, !1), o(this, a, new ct(this, {
117
+ )), o(this, b, new E(this, "--group", "")), o(this, R, new E(this, "--click-outside", !1)), o(this, $, new E(this, "--escape", !1)), o(this, T, new E(this, "--check-viewport-bounds", !1)), o(this, k, !1), o(this, a, new ct(this, {
118
118
  opened: !1,
119
119
  closing: !1,
120
120
  triggered: !1,
121
121
  transitionend: !1
122
- })), o(this, V, []), o(this, G, []), o(this, M, () => {
123
- o(this, T, !1), t(this, f) && t(this, m).current && !location.search.includes(this.id) ? this.close() : !t(this, f) && t(this, m).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, T, !0);
124
- }), o(this, k, () => {
125
- this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), t(this, D).call(this);
126
- }), o(this, D, lt(() => {
127
- t(this, U).call(this);
128
- }, 10)), o(this, U, () => {
129
- if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, w).current) {
122
+ })), o(this, V, []), o(this, z, []), o(this, M, () => {
123
+ o(this, k, !1), t(this, m) && t(this, v).current && !location.search.includes(this.id) ? this.close() : !t(this, m) && t(this, v).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, k, !0);
124
+ }), o(this, A, () => {
125
+ this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), t(this, U).call(this);
126
+ }), o(this, U, at(() => {
127
+ t(this, X).call(this);
128
+ }, 10)), o(this, X, () => {
129
+ if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, T).current) {
130
130
  const e = this.getBoundingClientRect();
131
131
  let s = 0, i = 0;
132
- e.right > J.width ? s = J.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > J.height ? i = J.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
132
+ e.right > K.width ? s = K.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > K.height ? i = K.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
133
133
  }
134
- }), o(this, z, () => {
134
+ }), o(this, B, () => {
135
135
  this.close();
136
- }), t(this, v).subscribe((e) => {
137
- e.previous && (y.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
136
+ }), t(this, b).subscribe((e) => {
137
+ e.previous && (L.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
138
138
  `${this.group.previous}-closing`
139
139
  ), document.documentElement.classList.remove(
140
140
  `${this.group.previous}-opened`
@@ -145,7 +145,7 @@ const y = class y extends HTMLElement {
145
145
  `${this.group.current}-closing`,
146
146
  e.current.closing
147
147
  );
148
- const s = y.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
148
+ const s = L.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((c) => c.opened);
149
149
  document.documentElement.classList.toggle(
150
150
  `${this.group.current}-opened`,
151
151
  !!i
@@ -156,11 +156,14 @@ const y = class y extends HTMLElement {
156
156
  get openClass() {
157
157
  return this.getAttribute("data-open-global-class");
158
158
  }
159
+ get closingClass() {
160
+ return this.getAttribute("data-closing-global-class");
161
+ }
159
162
  get history() {
160
- return t(this, m);
163
+ return t(this, v);
161
164
  }
162
165
  get restore() {
163
- return t(this, L);
166
+ return t(this, w);
164
167
  }
165
168
  get closeRest() {
166
169
  return t(this, x);
@@ -169,7 +172,7 @@ const y = class y extends HTMLElement {
169
172
  return t(this, S);
170
173
  }
171
174
  get group() {
172
- return t(this, v);
175
+ return t(this, b);
173
176
  }
174
177
  get clickOutside() {
175
178
  return t(this, R);
@@ -178,7 +181,7 @@ const y = class y extends HTMLElement {
178
181
  return t(this, $);
179
182
  }
180
183
  get opened() {
181
- return t(this, f);
184
+ return t(this, m);
182
185
  }
183
186
  get lastTrigger() {
184
187
  return t(this, O);
@@ -187,27 +190,25 @@ const y = class y extends HTMLElement {
187
190
  return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
188
191
  }
189
192
  updateUrlValue(e) {
190
- this.urlValue = (e == null ? void 0 : e.toString()) || "", t(this, f) && at(this.id, e);
193
+ this.urlValue = (e == null ? void 0 : e.toString()) || "", t(this, m) && ut(this.id, e);
191
194
  }
192
195
  open(e) {
193
- if (t(this, f))
196
+ if (t(this, m))
194
197
  return;
195
- o(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, H)), clearTimeout(t(this, q)), this.openClass && this.openClass.split(" ").map((i) => {
196
- document.documentElement.classList.add(i.trim());
197
- }), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), I(this, "popoverTriggered", {
198
+ o(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, q)), clearTimeout(t(this, G)), f(this, p, H).call(this, !0, this.openClass), f(this, p, H).call(this, !1, this.closingClass), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), J(this, "popoverTriggered", {
198
199
  custom: !0,
199
200
  detail: {
200
201
  trigger: t(this, O)
201
202
  }
202
- }), t(this, m).current && t(this, T) && history.pushState(history.state, "", t(this, A, nt)), o(this, f, !0);
203
+ }), t(this, v).current && t(this, k) && history.pushState(history.state, "", t(this, p, lt)), o(this, m, !0);
203
204
  const s = () => {
204
- y.stack.add(t(this, v).current, this), t(this, G).forEach((i) => {
205
+ L.stack.add(t(this, b).current, this), t(this, z).forEach((i) => {
205
206
  i.scroll({
206
207
  top: 0,
207
208
  left: 0,
208
209
  behavior: "instant"
209
210
  });
210
- }), t(this, k).call(this), t(this, a).set("opened", !0), I(this, "popoverOpened", {
211
+ }), t(this, A).call(this), t(this, a).set("opened", !0), J(this, "popoverOpened", {
211
212
  custom: !0,
212
213
  detail: {
213
214
  trigger: t(this, O)
@@ -215,23 +216,21 @@ const y = class y extends HTMLElement {
215
216
  bubbles: !0
216
217
  }), o(this, P, void 0), o(this, W, setTimeout(() => {
217
218
  t(this, a).set("transitionend", !0);
218
- }, ot(this) + 10));
219
+ }, ht(this) + 10));
219
220
  };
220
221
  e != null && e.skipTransition ? s() : o(this, P, setTimeout(s, 10));
221
222
  }
222
223
  close() {
223
- t(this, f) && (o(this, f, !1), clearTimeout(t(this, P)), clearTimeout(t(this, W)), y.stack.remove(t(this, v).current, this), E(this, A, K).call(this), this.openClass && this.openClass.split(" ").map((e) => {
224
- document.documentElement.classList.remove(e.trim());
225
- }), t(this, a).set("transitionend", !1), o(this, H, setTimeout(() => {
226
- t(this, a).set("opened", !1), t(this, a).set("closing", !0), I(this, "popoverClosing", {
224
+ t(this, m) && (o(this, m, !1), clearTimeout(t(this, P)), clearTimeout(t(this, W)), L.stack.remove(t(this, b).current, this), f(this, p, Q).call(this), f(this, p, H).call(this, !1, this.openClass), t(this, a).set("transitionend", !1), o(this, q, setTimeout(() => {
225
+ t(this, a).set("opened", !1), t(this, a).set("closing", !0), f(this, p, H).call(this, !0, this.closingClass), J(this, "popoverClosing", {
227
226
  custom: !0,
228
227
  bubbles: !0
229
- }), o(this, q, setTimeout(() => {
230
- t(this, a).set("triggered", !1), t(this, a).set("closing", !1), I(this, "popoverClosed", {
228
+ }), o(this, G, setTimeout(() => {
229
+ t(this, a).set("triggered", !1), t(this, a).set("closing", !1), f(this, p, H).call(this, !1, this.closingClass), J(this, "popoverClosed", {
231
230
  custom: !0,
232
231
  bubbles: !0
233
232
  });
234
- }, ot(this) + 10));
233
+ }, ht(this) + 10));
235
234
  }, 10)));
236
235
  }
237
236
  connectedCallback() {
@@ -240,55 +239,59 @@ const y = class y extends HTMLElement {
240
239
  `[data-popover-close${this.id ? `="${this.id}"` : ""}]`
241
240
  )
242
241
  ]), t(this, V).forEach((e) => {
243
- e.addEventListener("click", t(this, z));
244
- }), o(this, G, [
242
+ e.addEventListener("click", t(this, B));
243
+ }), o(this, z, [
245
244
  ...this.querySelectorAll(
246
245
  `[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
247
246
  )
248
- ]), t(this, m).observe(), t(this, L).observe(), t(this, x).observe(), t(this, S).observe(), t(this, v).observe(), t(this, R).observe(), t(this, $).observe(), t(this, w).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, M)), setTimeout(() => {
249
- t(this, L).current ? (this.urlValue = ut(location.search)[this.id], t(this, M).call(this)) : (E(this, A, K).call(this), o(this, T, !0));
250
- }, 0), t(this, w).subscribe(() => {
251
- t(this, k).call(this);
252
- }), ht.subscribe(t(this, k));
247
+ ]), t(this, v).observe(), t(this, w).observe(), t(this, x).observe(), t(this, S).observe(), t(this, b).observe(), t(this, R).observe(), t(this, $).observe(), t(this, T).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, M)), setTimeout(() => {
248
+ t(this, w).current ? (this.urlValue = pt(location.search)[this.id], t(this, M).call(this)) : (f(this, p, Q).call(this), o(this, k, !0));
249
+ }, 0), t(this, T).subscribe(() => {
250
+ t(this, A).call(this);
251
+ }), nt.subscribe(t(this, A));
253
252
  }
254
253
  disconnectedCallback() {
255
254
  t(this, V).forEach((e) => {
256
- e.removeEventListener("click", t(this, z));
257
- }), y.stack.remove(t(this, v).current, this), ht.unsubscribe(t(this, k)), t(this, a).close(), t(this, m).close(), t(this, L).close(), t(this, x).close(), t(this, S).close(), t(this, v).close(), t(this, R).close(), t(this, $).close(), t(this, w).close(), this.removeAttribute("role"), clearTimeout(t(this, H)), clearTimeout(t(this, q)), clearTimeout(t(this, P)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, M)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), E(this, A, K).call(this);
255
+ e.removeEventListener("click", t(this, B));
256
+ }), L.stack.remove(t(this, b).current, this), nt.unsubscribe(t(this, A)), t(this, a).close(), t(this, v).close(), t(this, w).close(), t(this, x).close(), t(this, S).close(), t(this, b).close(), t(this, R).close(), t(this, $).close(), t(this, T).close(), this.removeAttribute("role"), clearTimeout(t(this, q)), clearTimeout(t(this, G)), clearTimeout(t(this, P)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, M)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), f(this, p, Q).call(this);
258
257
  }
259
258
  };
260
- f = new WeakMap(), H = new WeakMap(), q = new WeakMap(), P = new WeakMap(), W = new WeakMap(), m = new WeakMap(), L = new WeakMap(), x = new WeakMap(), S = new WeakMap(), v = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), w = new WeakMap(), T = new WeakMap(), O = new WeakMap(), a = new WeakMap(), V = new WeakMap(), G = new WeakMap(), A = new WeakSet(), nt = function() {
259
+ m = new WeakMap(), q = new WeakMap(), G = new WeakMap(), P = new WeakMap(), W = new WeakMap(), v = new WeakMap(), w = new WeakMap(), x = new WeakMap(), S = new WeakMap(), b = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), T = new WeakMap(), k = new WeakMap(), O = new WeakMap(), a = new WeakMap(), V = new WeakMap(), z = new WeakMap(), p = new WeakSet(), lt = function() {
261
260
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
262
- }, K = function() {
263
- if (t(this, m).current) {
261
+ }, H = function(e, s) {
262
+ s && s.split(" ").map((i) => {
263
+ document.documentElement.classList.toggle(i.trim(), e);
264
+ });
265
+ }, Q = function() {
266
+ if (t(this, v).current) {
264
267
  const e = new URL(location.href);
265
268
  e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
266
269
  }
267
- }, M = new WeakMap(), k = new WeakMap(), D = new WeakMap(), U = new WeakMap(), z = new WeakMap(), y.stack = new pt();
268
- let Q = y;
269
- st && !customElements.get("e-popover") && customElements.define("e-popover", Q);
270
- var n, d, C, tt, X, Y, j, F, et;
271
- class dt extends HTMLElement {
270
+ }, M = new WeakMap(), A = new WeakMap(), U = new WeakMap(), X = new WeakMap(), B = new WeakMap(), L.stack = new dt();
271
+ let Z = L;
272
+ it && !customElements.get("e-popover") && customElements.define("e-popover", Z);
273
+ var n, g, C, et, Y, j, F, I, st;
274
+ class ft extends HTMLElement {
272
275
  constructor() {
273
276
  super();
274
277
  r(this, C);
275
278
  r(this, n);
276
- r(this, d, new g(this, "--type", "open"));
277
- r(this, X, () => {
278
- t(this, d).current !== "close" && this.classList.add("triggered");
279
- });
279
+ r(this, g, new E(this, "--type", "open"));
280
280
  r(this, Y, () => {
281
- t(this, d).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
281
+ t(this, g).current !== "close" && this.classList.add("triggered");
282
282
  });
283
283
  r(this, j, () => {
284
- t(this, d).current !== "close" && this.classList.remove("opened");
284
+ t(this, g).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
285
285
  });
286
286
  r(this, F, () => {
287
- t(this, d).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
287
+ t(this, g).current !== "close" && this.classList.remove("opened");
288
288
  });
289
- st && (this.addEventListener("click", () => {
289
+ r(this, I, () => {
290
+ t(this, g).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
291
+ });
292
+ it && (this.addEventListener("click", () => {
290
293
  if (t(this, n)) {
291
- const e = t(this, d).current;
294
+ const e = t(this, g).current;
292
295
  e === "open" || e === "toggle" && !t(this, n).opened ? t(this, n).open({ trigger: this }) : (e === "close" || e === "toggle" && t(this, n).opened) && t(this, n).close();
293
296
  }
294
297
  }), this.addEventListener("keydown", (e) => {
@@ -296,84 +299,84 @@ class dt extends HTMLElement {
296
299
  }));
297
300
  }
298
301
  get type() {
299
- return t(this, d);
302
+ return t(this, g);
300
303
  }
301
304
  get popoverElement() {
302
305
  return t(this, n);
303
306
  }
304
307
  changePopover(e) {
305
308
  var s;
306
- if (E(this, C, tt).call(this), e) {
309
+ if (f(this, C, et).call(this), e) {
307
310
  let i = null;
308
311
  if (e === "parent") {
309
- const l = this.closest("[data-popover]");
310
- if (l)
311
- i = l;
312
+ const c = this.closest("[data-popover]");
313
+ if (c)
314
+ i = c;
312
315
  else {
313
- const p = this.getRootNode();
314
- p instanceof ShadowRoot ? i = p.host.closest("[data-popover]") : p instanceof HTMLElement && (i = p.closest("[data-popover]"));
316
+ const d = this.getRootNode();
317
+ d instanceof ShadowRoot ? i = d.host.closest("[data-popover]") : d instanceof HTMLElement && (i = d.closest("[data-popover]"));
315
318
  }
316
319
  } else if (e === "sibling")
317
320
  i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
318
321
  else if (e === "ancestor-child") {
319
- const l = (p) => {
320
- if (!p)
322
+ const c = (d) => {
323
+ if (!d)
321
324
  return null;
322
- let B = p.querySelector("[data-popover]");
323
- return !B && (p != null && p.parentElement) && (B = l(p.parentElement)), B;
325
+ let D = d.querySelector("[data-popover]");
326
+ return !D && (d != null && d.parentElement) && (D = c(d.parentElement)), D;
324
327
  };
325
- i = l(this.parentElement) || null;
328
+ i = c(this.parentElement) || null;
326
329
  } else
327
330
  !e.startsWith(".") && !e.startsWith("[") && (e = `#${e}`), i = document.querySelector(e) || this.getRootNode().querySelector(e);
328
331
  i instanceof HTMLElement ? (o(this, n, i), t(this, n).addEventListener(
329
332
  "popoverTriggered",
330
- t(this, X)
333
+ t(this, Y)
331
334
  ), t(this, n).addEventListener(
332
335
  "popoverOpened",
333
- t(this, Y)
336
+ t(this, j)
334
337
  ), t(this, n).addEventListener(
335
338
  "popoverClosing",
336
- t(this, j)
339
+ t(this, F)
337
340
  ), t(this, n).addEventListener(
338
341
  "popoverClosed",
339
- t(this, F)
342
+ t(this, I)
340
343
  )) : console.warn(this, `target ${e} not found`);
341
344
  }
342
- E(this, C, et).call(this, t(this, d).current);
345
+ f(this, C, st).call(this, t(this, g).current);
343
346
  }
344
347
  connectedCallback() {
345
- t(this, d).subscribe((s) => {
346
- E(this, C, et).call(this, s.current);
348
+ t(this, g).subscribe((s) => {
349
+ f(this, C, st).call(this, s.current);
347
350
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
348
351
  const e = this.getAttribute("target");
349
- e && this.changePopover(e), this.isConnected && t(this, d).observe();
352
+ e && this.changePopover(e), this.isConnected && t(this, g).observe();
350
353
  }
351
354
  disconnectedCallback() {
352
- t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), E(this, C, tt).call(this);
355
+ t(this, g).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), f(this, C, et).call(this);
353
356
  }
354
357
  }
355
- n = new WeakMap(), d = new WeakMap(), C = new WeakSet(), tt = function() {
358
+ n = new WeakMap(), g = new WeakMap(), C = new WeakSet(), et = function() {
356
359
  t(this, n) && (t(this, n).removeEventListener(
357
360
  "popoverTriggered",
358
- t(this, X)
361
+ t(this, Y)
359
362
  ), t(this, n).removeEventListener(
360
363
  "popoverOpened",
361
- t(this, Y)
364
+ t(this, j)
362
365
  ), t(this, n).removeEventListener(
363
366
  "popoverClosing",
364
- t(this, j)
367
+ t(this, F)
365
368
  ), t(this, n).removeEventListener(
366
369
  "popoverClosed",
367
- t(this, F)
370
+ t(this, I)
368
371
  ));
369
- }, X = new WeakMap(), Y = new WeakMap(), j = new WeakMap(), F = new WeakMap(), et = function(e) {
370
- t(this, n) instanceof Q && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
372
+ }, Y = new WeakMap(), j = new WeakMap(), F = new WeakMap(), I = new WeakMap(), st = function(e) {
373
+ t(this, n) instanceof Z && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
371
374
  "aria-expanded",
372
375
  t(this, n).opened ? "true" : "false"
373
376
  ), this.setAttribute("aria-controls", t(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
374
377
  };
375
- st && !customElements.get("e-popover-button") && customElements.define("e-popover-button", dt);
378
+ it && !customElements.get("e-popover-button") && customElements.define("e-popover-button", ft);
376
379
  export {
377
- dt as PopoverButtonElement,
378
- Q as PopoverElement
380
+ ft as PopoverButtonElement,
381
+ Z as PopoverElement
379
382
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.69.2",
3
+ "version": "0.69.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"