aptechka 0.82.5 → 0.83.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 (141) hide show
  1. package/lib/{Animation-DxtCzFP3.js → Animation-BzTjZIE-.js} +2 -2
  2. package/lib/{Animation-jmvFcNfM.cjs → Animation-C39Ah-LM.cjs} +1 -1
  3. package/lib/{Composed-DtS09lSU.js → Composed-C-mnUGX6.js} +2 -2
  4. package/lib/{Composed-CSeUTRCg.cjs → Composed-RFcm2x5c.cjs} +1 -1
  5. package/lib/{Damped-DMnIOXpC.js → Damped-CRusiRIV.js} +2 -2
  6. package/lib/{Damped-77Urmi3q.cjs → Damped-Prr0iKu1.cjs} +1 -1
  7. package/lib/{DerivedArray-B8A0-8uT.cjs → DerivedArray-DdCR-Oy7.cjs} +1 -1
  8. package/lib/{DerivedArray-DG9iR0mf.js → DerivedArray-opbeygTL.js} +1 -1
  9. package/lib/{DragControls-BlL26P1V.cjs → DragControls-8rNZwQrs.cjs} +1 -1
  10. package/lib/{DragControls-DCC8iEOR.js → DragControls-DBNdMBA4.js} +4 -4
  11. package/lib/{LocalLinks-Bua7BGRF.cjs → LocalLinks-BxhSFv_Q.cjs} +1 -1
  12. package/lib/{LocalLinks-TQkTpAMx.js → LocalLinks-DRAQ-fxE.js} +3 -3
  13. package/lib/{PageAnnouncerElement-sfh0_4vl.js → PageAnnouncerElement-0LxZjtVH.js} +1 -1
  14. package/lib/{PageAnnouncerElement-C4k2kDJ5.cjs → PageAnnouncerElement-AQ0Ja6HM.cjs} +1 -1
  15. package/lib/{PageScroll-cQ3B5-6N.js → PageScroll-0LxFblry.js} +1 -1
  16. package/lib/{PageScroll-C7QBpx0G.cjs → PageScroll-BXJUQwG7.cjs} +1 -1
  17. package/lib/{SourceElement-TzgPNQOd.cjs → SourceElement-BHqPFbna.cjs} +1 -1
  18. package/lib/{SourceElement-BQ7g2KWK.js → SourceElement-DjbHjynf.js} +2 -2
  19. package/lib/{Store-1JrMCgdX.cjs → Store-Blf4msDz.cjs} +1 -1
  20. package/lib/{Store-CgQ3ReoB.js → Store-ZThXYBQd.js} +1 -1
  21. package/lib/{Tweened-lT68VACv.js → Tweened-Bw1Cn1PJ.js} +2 -2
  22. package/lib/{Tweened-CXQrFQth.cjs → Tweened-DWtk9E-O.cjs} +1 -1
  23. package/lib/{Viewport-Cx50Hufs.cjs → Viewport-BxCr0GlB.cjs} +1 -1
  24. package/lib/{Viewport-DGnJ31b4.js → Viewport-Dt-d9DPi.js} +2 -2
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +1 -1
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +3 -3
  29. package/lib/api-fetcher/index.cjs +1 -0
  30. package/lib/api-fetcher/index.d.ts +16 -0
  31. package/lib/api-fetcher/index.js +100 -0
  32. package/lib/attribute/index.cjs +1 -1
  33. package/lib/attribute/index.js +3 -3
  34. package/lib/billboard/index.cjs +1 -1
  35. package/lib/billboard/index.js +2 -2
  36. package/lib/canvas/index.cjs +1 -1
  37. package/lib/canvas/index.js +2 -2
  38. package/lib/controls/index.cjs +1 -1
  39. package/lib/controls/index.js +1 -1
  40. package/lib/css-property/index.cjs +1 -1
  41. package/lib/css-property/index.js +3 -3
  42. package/lib/css-value-parser/index.cjs +1 -1
  43. package/lib/css-value-parser/index.js +1 -1
  44. package/lib/dev/index.cjs +1 -1
  45. package/lib/dev/index.js +2 -2
  46. package/lib/device/index.cjs +1 -1
  47. package/lib/device/index.js +1 -1
  48. package/lib/dom-BETkVSSZ.js +82 -0
  49. package/lib/dom-CBLlqORw.cjs +1 -0
  50. package/lib/element-linked-store/index.cjs +1 -1
  51. package/lib/element-linked-store/index.js +2 -2
  52. package/lib/element-resizer/index.cjs +1 -1
  53. package/lib/element-resizer/index.js +2 -2
  54. package/lib/en3/index.cjs +1 -1
  55. package/lib/en3/index.js +2 -2
  56. package/lib/iframe/index.cjs +1 -1
  57. package/lib/iframe/index.js +3 -3
  58. package/lib/image/index.cjs +1 -1
  59. package/lib/image/index.js +4 -4
  60. package/lib/{index-CKTweR3M.cjs → index-OE2INULi.cjs} +1 -1
  61. package/lib/{index-LReFyN6i.js → index-e9eDuagL.js} +1 -1
  62. package/lib/intersector/index.cjs +1 -1
  63. package/lib/intersector/index.js +2 -2
  64. package/lib/jsx/index.cjs +1 -1
  65. package/lib/jsx/index.js +6 -6
  66. package/lib/ladder/index.cjs +1 -1
  67. package/lib/ladder/index.js +2 -2
  68. package/lib/layout-box/index.cjs +1 -1
  69. package/lib/layout-box/index.js +2 -2
  70. package/lib/loading/index.cjs +1 -1
  71. package/lib/loading/index.js +1 -1
  72. package/lib/local-links/index.cjs +1 -1
  73. package/lib/local-links/index.js +1 -1
  74. package/lib/masonry-layout/index.cjs +1 -1
  75. package/lib/masonry-layout/index.js +2 -2
  76. package/lib/media/index.cjs +1 -1
  77. package/lib/media/index.js +2 -2
  78. package/lib/morph/index.cjs +1 -1
  79. package/lib/morph/index.js +294 -301
  80. package/lib/{morph-BQErz7qP.js → morph-D_ybmXWR.js} +8 -8
  81. package/lib/need_redo_tweaker/index.cjs +1 -1
  82. package/lib/need_redo_tweaker/index.js +3 -3
  83. package/lib/page-announcer/index.cjs +1 -1
  84. package/lib/page-announcer/index.js +1 -1
  85. package/lib/page-scroll/index.cjs +1 -1
  86. package/lib/page-scroll/index.js +1 -1
  87. package/lib/pixel-perfect/index.cjs +1 -1
  88. package/lib/pixel-perfect/index.js +3 -3
  89. package/lib/pointer/index.cjs +1 -1
  90. package/lib/pointer/index.js +4 -4
  91. package/lib/popover/index.cjs +1 -1
  92. package/lib/popover/index.js +3 -3
  93. package/lib/radio/index.cjs +1 -1
  94. package/lib/radio/index.js +1 -1
  95. package/lib/render-1u700s93.js +212 -0
  96. package/lib/render-BIOfUddT.cjs +1 -0
  97. package/lib/router/index.cjs +1 -1
  98. package/lib/router/index.js +6 -6
  99. package/lib/scroll/index.cjs +1 -1
  100. package/lib/scroll/index.js +8 -8
  101. package/lib/{scroll-DxcPU0vk.cjs → scroll-BA2WnUrb.cjs} +1 -1
  102. package/lib/{scroll-jcbHDexr.js → scroll-DY5senkF.js} +2 -2
  103. package/lib/scroll-entries/index.cjs +1 -1
  104. package/lib/scroll-entries/index.js +1 -1
  105. package/lib/scroll-kit/index.cjs +1 -1
  106. package/lib/scroll-kit/index.js +4 -4
  107. package/lib/sequence/index.cjs +1 -1
  108. package/lib/sequence/index.js +3 -3
  109. package/lib/size-element/index.cjs +1 -1
  110. package/lib/size-element/index.js +1 -1
  111. package/lib/slicer/index.cjs +1 -1
  112. package/lib/slicer/index.js +1 -1
  113. package/lib/source/index.cjs +1 -1
  114. package/lib/source/index.js +1 -1
  115. package/lib/spa/index.cjs +1 -1
  116. package/lib/spa/index.js +6 -6
  117. package/lib/store/index.cjs +1 -1
  118. package/lib/store/index.js +3 -3
  119. package/lib/{stylesheet-BcwbfhBp.cjs → stylesheet-5_o7PFzM.cjs} +1 -1
  120. package/lib/{stylesheet-DbHOxtjw.js → stylesheet-DdBzowZY.js} +1 -1
  121. package/lib/ticker/index.cjs +1 -1
  122. package/lib/ticker/index.js +2 -2
  123. package/lib/url-CHgcNwJ1.cjs +1 -0
  124. package/lib/url-CYgo5vrG.js +113 -0
  125. package/lib/utils/dom.d.ts +3 -0
  126. package/lib/utils/index.cjs +1 -1
  127. package/lib/utils/index.js +142 -137
  128. package/lib/utils/url.d.ts +6 -0
  129. package/lib/video/index.cjs +1 -1
  130. package/lib/video/index.js +3 -3
  131. package/lib/window-resizer/index.cjs +1 -1
  132. package/lib/window-resizer/index.js +1 -1
  133. package/lib/youtube/index.cjs +1 -1
  134. package/lib/youtube/index.js +3 -3
  135. package/package.json +13 -5
  136. package/lib/dom-BIeVMHfK.js +0 -57
  137. package/lib/dom-hTEdqeoj.cjs +0 -1
  138. package/lib/render-B3Hf-O7M.js +0 -205
  139. package/lib/render-BWjKu0M_.cjs +0 -1
  140. package/lib/url-CPgw9bd5.cjs +0 -1
  141. package/lib/url-DAl-mgbC.js +0 -97
@@ -1 +1 @@
1
- "use strict";var m=i=>{throw TypeError(i)};var v=(i,t,s)=>t.has(i)||m("Cannot "+s);var e=(i,t,s)=>(v(i,t,"read from private field"),s?s.call(i):t.get(i)),r=(i,t,s)=>t.has(i)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),n=(i,t,s,d)=>(v(i,t,"write to private field"),d?d.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../events-KVanG9sR.cjs"),E=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");var o,a,h,l,u,c,p;class q{constructor(){r(this,o,new Map);r(this,a,!1);r(this,h,0);r(this,l,0);r(this,u,E.debounce(()=>{e(this,a)||(n(this,a,!0),g.dispatchEvent(document,"loadingStart"),e(this,c).call(this))},0));r(this,c,t=>{if(!e(this,a))return;const s=e(this,o).size,d=Array.from(e(this,o)).filter(b=>b[1]).length,f=d/s;n(this,h,d),n(this,l,f),g.dispatchEvent(document,"loadingProgress",{detail:{total:s,loaded:d,progress:f,resourceName:t}}),f===1&&e(this,p).call(this)});r(this,p,E.debounce(()=>{n(this,a,!1),g.dispatchEvent(document,"loadingComplete",{detail:{total:e(this,o).size}}),n(this,h,0),n(this,l,0),e(this,o).clear()},0))}get total(){return e(this,o).size}get loaded(){return e(this,h)}get progress(){return e(this,l)}get map(){return e(this,o)}add(t){e(this,o).set(t,!1),e(this,u).call(this)}complete(t){e(this,o).set(t,!0),e(this,c).call(this,t)}error(t){e(this,o).has(t)&&(console.error(`Failed to load ${t}`),e(this,o).delete(t),g.dispatchEvent(document,"loadingError",{detail:{name:t}})),e(this,c).call(this)}}o=new WeakMap,a=new WeakMap,h=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap;const S=new q;exports.loading=S;
1
+ "use strict";var m=i=>{throw TypeError(i)};var v=(i,t,s)=>t.has(i)||m("Cannot "+s);var e=(i,t,s)=>(v(i,t,"read from private field"),s?s.call(i):t.get(i)),r=(i,t,s)=>t.has(i)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),n=(i,t,s,d)=>(v(i,t,"write to private field"),d?d.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../events-KVanG9sR.cjs"),E=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");var o,a,h,l,u,c,p;class q{constructor(){r(this,o,new Map);r(this,a,!1);r(this,h,0);r(this,l,0);r(this,u,E.debounce(()=>{e(this,a)||(n(this,a,!0),g.dispatchEvent(document,"loadingStart"),e(this,c).call(this))},0));r(this,c,t=>{if(!e(this,a))return;const s=e(this,o).size,d=Array.from(e(this,o)).filter(b=>b[1]).length,f=d/s;n(this,h,d),n(this,l,f),g.dispatchEvent(document,"loadingProgress",{detail:{total:s,loaded:d,progress:f,resourceName:t}}),f===1&&e(this,p).call(this)});r(this,p,E.debounce(()=>{n(this,a,!1),g.dispatchEvent(document,"loadingComplete",{detail:{total:e(this,o).size}}),n(this,h,0),n(this,l,0),e(this,o).clear()},0))}get total(){return e(this,o).size}get loaded(){return e(this,h)}get progress(){return e(this,l)}get map(){return e(this,o)}add(t){e(this,o).set(t,!1),e(this,u).call(this)}complete(t){e(this,o).set(t,!0),e(this,c).call(this,t)}error(t){e(this,o).has(t)&&(console.error(`Failed to load ${t}`),e(this,o).delete(t),g.dispatchEvent(document,"loadingError",{detail:{name:t}})),e(this,c).call(this)}}o=new WeakMap,a=new WeakMap,h=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap;const S=new q;exports.loading=S;
@@ -6,7 +6,7 @@ var s = (i, t, e) => (z(i, t, "read from private field"), e ? e.call(i) : t.get(
6
6
  import { d as p } from "../events-CsVF98U6.js";
7
7
  import { d as w } from "../function-C10DGppn.js";
8
8
  import "construct-style-sheets-polyfill";
9
- import "../index-LReFyN6i.js";
9
+ import "../index-e9eDuagL.js";
10
10
  var o, d, l, n, c, g, m;
11
11
  class S {
12
12
  constructor() {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../LocalLinks-Bua7BGRF.cjs");exports.LocalLinks=e.LocalLinks;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../LocalLinks-BxhSFv_Q.cjs");exports.LocalLinks=e.LocalLinks;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../LocalLinks-TQkTpAMx.js";
1
+ import { L as a } from "../LocalLinks-DRAQ-fxE.js";
2
2
  export {
3
3
  a as LocalLinks
4
4
  };
@@ -1 +1 @@
1
- "use strict";var v=e=>{throw TypeError(e)};var p=(e,s,t)=>s.has(e)||v("Cannot "+t);var o=(e,s,t)=>(p(e,s,"read from private field"),t?t.call(e):s.get(e)),c=(e,s,t)=>s.has(e)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),f=(e,s,t,i)=>(p(e,s,"write to private field"),i?i.call(e,t):s.set(e,t),t),m=(e,s,t)=>(p(e,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../css-property/index.cjs"),C=require("../index-CKTweR3M.cjs"),x=require("../events-KVanG9sR.cjs"),R=require("../stylesheet-BcwbfhBp.cjs");var l,u,a,h,y,d,b;class E extends HTMLElement{constructor(){super();c(this,d);c(this,l,new w.CSSProperty(this,"--distribute-rule","default",{skipSubscribeNotification:!0}));c(this,u,new w.CSSProperty(this,"--columns",2));c(this,a,[]);c(this,h,null);c(this,y,()=>{m(this,d,b).call(this)});const t=this.attachShadow({mode:"open"});t.adoptedStyleSheets=[R.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,a)}connectedCallback(){f(this,h,new MutationObserver(o(this,y))),o(this,h).observe(this,{childList:!0}),o(this,l).subscribe(()=>{m(this,d,b).call(this)}),o(this,u).subscribe(t=>{var i;this.shadowRoot.innerHTML="",f(this,a,[]);for(let n=0;n<t.current;n++){const r=document.createElement("div");r.classList.add("column"),r.innerHTML=`<slot name="col-${n}"></slot>`,o(this,a).push(r),(i=this.shadowRoot)==null||i.appendChild(r)}m(this,d,b).call(this)}),o(this,l).observe(),o(this,u).observe()}disconnectedCallback(){o(this,u).close(),o(this,h).disconnect(),this.classList.remove("distributed")}}l=new WeakMap,u=new WeakMap,a=new WeakMap,h=new WeakMap,y=new WeakMap,d=new WeakSet,b=function(){const t=[...this.children],i=o(this,u).current;o(this,l).current==="chessboard"&&i%2===0?t.forEach((n,r)=>{const L=Math.floor(r/i),S=r%i,g=L%2,M=(S+g)%i;n.slot=`col-${M}`}):o(this,l).current==="default"&&t.forEach((n,r)=>{n.slot=`col-${r%i}`}),this.classList.add("distributed"),x.dispatchEvent(this,"masonryLayoutDistributed",{custom:!0})};C.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",E);exports.MasonryLayoutElement=E;
1
+ "use strict";var v=e=>{throw TypeError(e)};var p=(e,s,t)=>s.has(e)||v("Cannot "+t);var o=(e,s,t)=>(p(e,s,"read from private field"),t?t.call(e):s.get(e)),c=(e,s,t)=>s.has(e)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),f=(e,s,t,i)=>(p(e,s,"write to private field"),i?i.call(e,t):s.set(e,t),t),m=(e,s,t)=>(p(e,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../css-property/index.cjs"),C=require("../index-OE2INULi.cjs"),x=require("../events-KVanG9sR.cjs"),R=require("../stylesheet-5_o7PFzM.cjs");var l,u,a,h,y,d,b;class E extends HTMLElement{constructor(){super();c(this,d);c(this,l,new w.CSSProperty(this,"--distribute-rule","default",{skipSubscribeNotification:!0}));c(this,u,new w.CSSProperty(this,"--columns",2));c(this,a,[]);c(this,h,null);c(this,y,()=>{m(this,d,b).call(this)});const t=this.attachShadow({mode:"open"});t.adoptedStyleSheets=[R.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,a)}connectedCallback(){f(this,h,new MutationObserver(o(this,y))),o(this,h).observe(this,{childList:!0}),o(this,l).subscribe(()=>{m(this,d,b).call(this)}),o(this,u).subscribe(t=>{var i;this.shadowRoot.innerHTML="",f(this,a,[]);for(let n=0;n<t.current;n++){const r=document.createElement("div");r.classList.add("column"),r.innerHTML=`<slot name="col-${n}"></slot>`,o(this,a).push(r),(i=this.shadowRoot)==null||i.appendChild(r)}m(this,d,b).call(this)}),o(this,l).observe(),o(this,u).observe()}disconnectedCallback(){o(this,u).close(),o(this,h).disconnect(),this.classList.remove("distributed")}}l=new WeakMap,u=new WeakMap,a=new WeakMap,h=new WeakMap,y=new WeakMap,d=new WeakSet,b=function(){const t=[...this.children],i=o(this,u).current;o(this,l).current==="chessboard"&&i%2===0?t.forEach((n,r)=>{const L=Math.floor(r/i),S=r%i,g=L%2,M=(S+g)%i;n.slot=`col-${M}`}):o(this,l).current==="default"&&t.forEach((n,r)=>{n.slot=`col-${r%i}`}),this.classList.add("distributed"),x.dispatchEvent(this,"masonryLayoutDistributed",{custom:!0})};C.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",E);exports.MasonryLayoutElement=E;
@@ -4,9 +4,9 @@ var w = (s) => {
4
4
  var f = (s, e, t) => e.has(s) || w("Cannot " + t);
5
5
  var o = (s, e, t) => (f(s, e, "read from private field"), t ? t.call(s) : e.get(s)), c = (s, e, t) => e.has(s) ? w("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), y = (s, e, t, i) => (f(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), m = (s, e, t) => (f(s, e, "access private method"), t);
6
6
  import { CSSProperty as v } from "../css-property/index.js";
7
- import { i as M } from "../index-LReFyN6i.js";
7
+ import { i as M } from "../index-e9eDuagL.js";
8
8
  import { d as C } from "../events-CsVF98U6.js";
9
- import { c as R } from "../stylesheet-DbHOxtjw.js";
9
+ import { c as R } from "../stylesheet-DdBzowZY.js";
10
10
  var l, a, h, u, b, d, p;
11
11
  class x extends HTMLElement {
12
12
  constructor() {
@@ -1 +1 @@
1
- "use strict";var a=e=>{throw TypeError(e)};var d=(e,r,s)=>r.has(e)||a("Cannot "+s);var o=(e,r,s)=>(d(e,r,"read from private field"),s?s.call(e):r.get(e)),u=(e,r,s)=>r.has(e)?a("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),n=(e,r,s,i)=>(d(e,r,"write to private field"),i?i.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-1JrMCgdX.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");var t,c;class q extends b.Store{constructor(s){super(!1);u(this,t);u(this,c);n(this,t,s);const i=()=>{matchMedia(o(this,t)).matches?this.current=!0:this.current=!1};n(this,c,h.windowResizer.subscribe(i,l.RESIZE_ORDER.MEDIA)),i()}close(){super.close(),o(this,c).call(this)}}t=new WeakMap,c=new WeakMap;exports.Media=q;
1
+ "use strict";var a=e=>{throw TypeError(e)};var d=(e,r,s)=>r.has(e)||a("Cannot "+s);var o=(e,r,s)=>(d(e,r,"read from private field"),s?s.call(e):r.get(e)),u=(e,r,s)=>r.has(e)?a("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),n=(e,r,s,i)=>(d(e,r,"write to private field"),i?i.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-Blf4msDz.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");var t,c;class q extends b.Store{constructor(s){super(!1);u(this,t);u(this,c);n(this,t,s);const i=()=>{matchMedia(o(this,t)).matches?this.current=!0:this.current=!1};n(this,c,h.windowResizer.subscribe(i,l.RESIZE_ORDER.MEDIA)),i()}close(){super.close(),o(this,c).call(this)}}t=new WeakMap,c=new WeakMap;exports.Media=q;
@@ -5,9 +5,9 @@ var h = (s, e, r) => e.has(s) || u("Cannot " + r);
5
5
  var c = (s, e, r) => (h(s, e, "read from private field"), r ? r.call(s) : e.get(s)), m = (s, e, r) => e.has(s) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, r), a = (s, e, r, t) => (h(s, e, "write to private field"), t ? t.call(s, r) : e.set(s, r), r);
6
6
  import { RESIZE_ORDER as l } from "../order/index.js";
7
7
  import { windowResizer as n } from "../window-resizer/index.js";
8
- import { S as p } from "../Store-CgQ3ReoB.js";
8
+ import { S as p } from "../Store-ZThXYBQd.js";
9
9
  import "construct-style-sheets-polyfill";
10
- import "../index-LReFyN6i.js";
10
+ import "../index-e9eDuagL.js";
11
11
  var i, o;
12
12
  class M extends p {
13
13
  constructor(r) {
@@ -1 +1 @@
1
- "use strict";var ve=Object.defineProperty,Le=Object.defineProperties;var Se=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var ye=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var se=(h,e)=>(e=Symbol[h])?e:Symbol.for("Symbol."+h),ie=h=>{throw TypeError(h)};var ae=(h,e,s)=>e in h?ve(h,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):h[e]=s,Tt=(h,e)=>{for(var s in e||(e={}))ye.call(e,s)&&ae(h,s,e[s]);if(ee)for(var s of ee(e))be.call(e,s)&&ae(h,s,e[s]);return h},qt=(h,e)=>Le(h,Se(e));var zt=(h,e,s)=>e.has(h)||ie("Cannot "+s);var t=(h,e,s)=>(zt(h,e,"read from private field"),s?s.call(h):e.get(h)),l=(h,e,s)=>e.has(h)?ie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,s),n=(h,e,s,a)=>(zt(h,e,"write to private field"),a?a.call(h,s):e.set(h,s),s),g=(h,e,s)=>(zt(h,e,"access private method"),s);var J=(h,e,s)=>new Promise((a,o)=>{var L=c=>{try{p(s.next(c))}catch(E){o(E)}},y=c=>{try{p(s.throw(c))}catch(E){o(E)}},p=c=>c.done?a(c.value):Promise.resolve(c.value).then(L,y);p((s=s.apply(h,e)).next())});var re=(h,e,s)=>(e=h[se("asyncIterator")])?e.call(h):(h=h[se("iterator")](),e={},s=(a,o)=>(o=h[a])&&(e[a]=L=>new Promise((y,p,c)=>(L=o.call(h,L),c=L.done,Promise.resolve(L.value).then(E=>y({value:E,done:c}),p)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../index-CKTweR3M.cjs"),z=require("../events-KVanG9sR.cjs"),ne=require("../scroll-DxcPU0vk.cjs");require("construct-style-sheets-polyfill");const ft=require("../url-CPgw9bd5.cjs"),we=require("../css-value-parser/index.cjs"),le=require("../string-DUXXtU8v.cjs");class ce extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}he.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",ce);var x,i,D,it,de,Et,rt;class It{constructor(e,s){l(this,D);l(this,x);l(this,i);l(this,Et,e=>{e.preventDefault(),g(this,D,de).call(this)});l(this,rt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,x).prefetch(t(this,D,it),e),t(this,i).removeEventListener("pointerenter",t(this,rt))});n(this,x,s),n(this,i,e),t(this,i).addEventListener("click",t(this,Et)),this.checkCurrent(location.href.replace(location.origin,"")),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,rt))}get element(){return t(this,i)}checkCurrent(e){var E,st;const s=t(this,x).normalizePath(e),a=t(this,x).normalizePath(t(this,D,it));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(E=t(this,i).getAttribute("data-associated-paths"))!=null&&E.split(",").find(A=>s.pathname.includes(A))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[o,L]=(st=t(this,D,it).split("#")[0])==null?void 0:st.split("?"),y=new URLSearchParams(L),p=new URLSearchParams(location.search);let c=0;for(const[A]of p)y.has(A)&&p.get(A)===y.get(A)&&c++;c?(t(this,i).classList.toggle("all-params-matched",p.size===c),t(this,i).classList.toggle("some-params-matched",p.size!==c)):!p.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const A in t(this,i).dataset){const at=le.camelToKebab(A);if(at.startsWith("match-param-")){const q=at.split("match-param-")[1],w=t(this,i).dataset[A],G=`param-${q}-matched`;p.has(q)&&p.get(q)===w||!p.has(q)&&(w===""||w==="*"||w==="all"||w==="any"||w==="vse")?t(this,i).classList.add(G):t(this,i).classList.remove(G)}}}destroy(){t(this,i).removeEventListener("click",t(this,Et)),t(this,i).removeEventListener("pointerenter",t(this,rt)),t(this,i).classList.remove("current","exact")}}x=new WeakMap,i=new WeakMap,D=new WeakSet,it=function(){const e=new URL(t(this,i).href);return t(this,x).normalizePath(e.pathname+e.search+e.hash).path},de=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,x).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",o=t(this,i).hasAttribute("data-center-scroll"),L=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),y=L?we.cssValueParser.parse(L):void 0,p=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),c=t(this,i).hasAttribute("data-keep-search-parameters"),E=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),st=t(this,i).getAttribute("data-scroll-behaviour"),A=(s=t(this,i).getAttribute("data-submorph")||t(this,i).getAttribute("data-submorph-append"))==null?void 0:s.split(",").map(w=>w.trim()),at=t(this,i).hasAttribute("data-clear-state");let q=t(this,D,it);if(t(this,i).hasAttribute("data-toggle-params")){const[w,G]=t(this,D,it).split("?"),kt=new URLSearchParams(G),F=new URLSearchParams(location.search),d=new URLSearchParams;for(const[R]of kt)(!F.has(R)||F.has(R)&&F.get(R)!==kt.get(R))&&d.append(R,kt.get(R));if(t(this,i).hasAttribute("data-merge-params"))for(const[R]of F)kt.has(R)||d.append(R,F.get(R));q=`${w}?${d.toString()}`}t(this,x).navigate(q,{historyAction:a,centerScroll:o,offsetScroll:y,revalidate:p,keepSearchParameters:c,submorph:A,clearState:at,keepScrollPosition:E,scrollBehaviour:st,submorphAppend:t(this,i).hasAttribute("data-submorph-append"),mergeParams:t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params"),detail:t(this,i).getAttribute("data-detail"),removeParams:t(this,i).getAttribute("data-remove-params")||void 0,scrollTo:t(this,i).getAttribute("data-scroll-to")||void 0})}},Et=new WeakMap,rt=new WeakMap;var C,nt,vt,Vt,Lt;class Pe{constructor(e){l(this,vt);l(this,C);l(this,nt,[]);l(this,Lt,()=>{g(this,vt,Vt).call(this)});n(this,C,e);for(const s in t(this,C).dataset){const a=le.camelToKebab(s);if(a.startsWith("param-")){const o=a.split("param-")[1],L=t(this,C).dataset[s];t(this,nt).push({name:o,value:L})}}document.addEventListener("morphURLParametersChange",t(this,Lt)),g(this,vt,Vt).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,Lt))}}C=new WeakMap,nt=new WeakMap,vt=new WeakSet,Vt=function(){const e=new URLSearchParams(location.search);let s=!!t(this,nt).find(o=>e.has(o.name)&&(e.get(o.name)===o.value||o.value==="*"||o.value==="all"||o.value==="any"||o.value==="vse"||e.get(o.name)==="*"||e.get(o.name)==="all"||e.get(o.name)==="any"||e.get(o.name)==="vse"));!s&&t(this,C).hasAttribute("data-match-no-params")&&(s=!t(this,nt).filter(o=>e.has(o.name)).length);const a=t(this,C).getAttribute("data-hide-class");s?a?t(this,C).classList.remove(a):t(this,C).style.display="":a?t(this,C).classList.add(a):t(this,C).style.display="none"},Lt=new WeakMap;const Ae=new DOMParser;var I,Q,H,V,Z,K,ot,_,Y,St,ht;class oe{constructor(e,s){l(this,I);l(this,Q);l(this,H,{x:0,y:0});l(this,V,null);l(this,Z,null);l(this,K,null);l(this,ot,null);l(this,_,null);l(this,Y,null);l(this,St);l(this,ht,!1);n(this,I,e),n(this,Q,s)}get pathname(){return t(this,Q)}get scrollState(){return t(this,H)}get document(){return t(this,K)}needRavalidation(){n(this,ht,!0)}setHeaders(e){n(this,St,e)}setInitialDocument(e){n(this,V,e.cloneNode(!0))}abort(){var e;return(e=t(this,_))==null?void 0:e.abort(`[${t(this,Q)}] page loading cancelled`)}fetch(e,s,a){return J(this,null,function*(){var o;if(!a&&!t(this,ht)){const p=((o=t(this,V))==null?void 0:o.documentElement.getAttribute("data-cache"))&&s!==e,c=t(this,V)&&t(this,I).isPopstateNavigation;if(t(this,Y)||p||c)return t(this,Y)}return n(this,Y,new Promise(L=>J(this,null,function*(){try{n(this,_,new AbortController);const p=yield(yield fetch(e,{signal:t(this,_).signal,headers:Tt({"X-MORPH":"true","X-MORPH-RAVALIDATE":a?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,St))})).text(),c=Ae.parseFromString(p,"text/html");this.setInitialDocument(c),n(this,ht,!1)}catch(y){console.warn(y)}finally{n(this,_,null),n(this,Y,null),L()}}))),t(this,Y)})}cloneDocument(){n(this,K,(t(this,Z)||t(this,V)).cloneNode(!0))}get title(){let e="";if(t(this,K).title)e=t(this,K).title;else{const s=t(this,K).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,Q)}return e}clearScrollState(){t(this,H).x=0,t(this,H).y=0}clearDocumentState(){n(this,Z,null)}saveScrollState(){t(this,V).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,H).x=0,t(this,H).y=0):(t(this,H).x=t(this,I).scrollValue.left,t(this,H).y=t(this,I).scrollValue.top)}restoreScrollPosition(){t(this,I).scrollElement.scroll({top:t(this,H).y,left:t(this,H).x,behavior:"instant"})}saveDocumentState(){t(this,V).documentElement.hasAttribute("data-no-page-restoration")?n(this,Z,null):n(this,Z,document.cloneNode(!0))}renewScrollPosition(){t(this,I).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){n(this,ot,e)}clearState(){const e=t(this,ot);return n(this,ot,null),e}}I=new WeakMap,Q=new WeakMap,H=new WeakMap,V=new WeakMap,Z=new WeakMap,K=new WeakMap,ot=new WeakMap,_=new WeakMap,Y=new WeakMap,St=new WeakMap,ht=new WeakMap;var N,lt,b,$,f,tt,W,j,M,yt,O,bt,et,ct,dt,wt,ut,Pt,m,Ot,At,pt,Ft,ue,Xt,Bt,Kt,Mt,Ut,mt;const gt=class gt{constructor(e){l(this,m);l(this,N,null);l(this,lt,null);l(this,b,[]);l(this,$);l(this,f,null);l(this,tt);l(this,W,[]);l(this,j,!1);l(this,M,null);l(this,yt,!1);l(this,O,new Map);l(this,bt,[]);l(this,et,null);l(this,ct,0);l(this,dt,0);l(this,wt);l(this,ut);l(this,Pt);l(this,At,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});l(this,Ut,e=>J(this,null,function*(){e.preventDefault(),n(this,j,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,ut)?void 0:t(this,wt),revalidate:t(this,ut),keepScrollPosition:t(this,Pt)}),n(this,j,!1)}));l(this,mt,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,dt),o=e-t(this,ct);n(this,dt,s),n(this,ct,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",o>0),document.documentElement.classList.toggle("scroll-x-backward",o<0),z.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(he.isBrowser&&!gt.instance){gt.instance=this,n(this,N,{base:ft.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),n(this,lt,g(this,m,Ft).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);n(this,f,s);const a=new oe(this,t(this,f).pathname);a.setInitialDocument(document),t(this,O).set(t(this,f).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,f).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Ut)),ft.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,et,new ce),g(this,m,Kt).call(this,document)}}get currentURL(){return t(this,f)}get previousURL(){return t(this,tt)}get links(){return t(this,b)}get scrollElement(){return t(this,M)}get isPopstateNavigation(){return t(this,j)}get scrollValue(){let e=0,s=0;return t(this,yt)?(e=window.scrollY,s=window.scrollX):(e=t(this,M).scrollTop,s=t(this,M).scrollLeft),{top:e,left:s}}get isNavigating(){return!!t(this,W).length}saveState(e){const s=t(this,O).get(t(this,f).path);s&&s.saveState(e)}getState(){const e=t(this,O).get(t(this,f).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return ft.splitPath(e,{base:t(this,N).base,trailingSlash:t(this,N).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:"",removeParams:s==null?void 0:s.removeParams})}prefetch(e,s){return J(this,null,function*(){var o;if(t(this,W).length)return;e=((o=this.pathnameModifier)==null?void 0:o.call(this,e))||e;const a=g(this,m,pt).call(this,e);a==null||a.fetch(e,t(this,f).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}needRavalidation(e){const s=this.normalizePath(e),a=g(this,m,pt).call(this,s.path);a==null||a.needRavalidation()}navigate(kt){return J(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:o,scrollBehaviour:L,revalidate:y,keepSearchParameters:p,submorph:c,submorphAppend:E,clearState:st,keepScrollPosition:A,mergeParams:at,removeParams:q,detail:w,scrollTo:G}={}){var R,Yt,$t,jt;if(t(this,W).length)return;n(this,wt,c),n(this,ut,y),n(this,Pt,A);const F=((R=this.pathnameModifier)==null?void 0:R.call(this,e))||e,d=this.normalizePath(F,{mergeParams:at,removeParams:q});if(!y&&(((Yt=t(this,$))==null?void 0:Yt.pathname)===d.pathname||t(this,f).pathname===d.pathname)){A||g(this,m,Mt).call(this,d.hash||0,{centerScroll:a,offsetScroll:o,behavior:"smooth"}),z.dispatchEvent(document,"morphSamePath",{detail:{detail:w}}),(($t=t(this,f))==null?void 0:$t.parameters)!==d.parameters&&(n(this,tt,t(this,f)),n(this,f,d),ft.changeHistory({action:((jt=t(this,f))==null?void 0:jt.hash)!==d.hash?"replace":s,pathname:d.pathname,searchParameters:d.parameters,hash:d.hash}),z.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,f),previousURL:t(this,tt),detail:w}})),t(this,b).forEach(X=>{X.checkCurrent(d.path)});return}else t(this,b).forEach(X=>{X.checkCurrent(d.path)});n(this,$,d);try{let X=!0;if(this.preprocessor)try{yield new Promise((r,P)=>{var T;(T=this.preprocessor)==null||T.call(this,{url:d,resolve:r,reject:P,submorph:c,detail:w})})}catch(r){r?console.error(r):console.log("Route change canceled"),X=!1}if(!X||t(this,$).pathname!==d.pathname){t(this,b).forEach(r=>{r.checkCurrent(t(this,f).path)});return}const Gt={url:d,submorph:c,detail:w};c?E||c.forEach(r=>{document.querySelectorAll(r).forEach(P=>{P.classList.add("out"),P.setAttribute("data-morph-out","")})}):t(this,lt).forEach(r=>{var P,T;(P=r.firstElementChild)==null||P.classList.add("out"),(T=r.firstElementChild)==null||T.setAttribute("data-morph-out","")}),z.dispatchEvent(document,"morphNavigation",{detail:Gt});const xt=g(this,m,pt).call(this,t(this,f).pathname),S=g(this,m,pt).call(this,d.pathname);if(t(this,O).forEach(r=>{r.pathname!==d.pathname&&r.abort()}),yield S==null?void 0:S.fetch(F,t(this,f).path,y),t(this,$).pathname!==d.pathname){t(this,b).forEach(r=>{r.checkCurrent(t(this,f).path)});return}xt.clearState(),xt.saveScrollState(),xt.saveDocumentState(),(!t(this,j)||y)&&(S.clearScrollState(),S.clearDocumentState()),st&&S.clearState(),S.cloneDocument(),t(this,et).textContent=S.title,document.body.appendChild(t(this,et));const Rt=qt(Tt({},Gt),{document:S.document});E||Rt.document.querySelectorAll("[data-morph-out]").forEach(r=>{r.classList.remove("out")}),z.dispatchEvent(document,"morphStart",{detail:Rt});const Jt=Array.from(document.head.children),Qt=Array.from(S.document.head.children),Zt=g(this,m,ue).call(this,Jt,Qt),me=g(this,m,Xt).call(this,Jt,Zt),Ct=g(this,m,Xt).call(this,Qt,Zt).filter(r=>!this.excludeHeadChild(r));Ct.forEach((r,P)=>{r.tagName==="SCRIPT"&&(Ct[P]=g(this,m,Ot).call(this,r))}),Ct.forEach(r=>{document.head.appendChild(r)});const Nt=Ct.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(g(this,m,Bt).call(this,r))return!0});t(this,N).waitForHeadToLoad&&Nt.length&&(yield new Promise(r=>J(this,null,function*(){let P=0;try{for(var T=re(Nt),pe,B,U;pe=!(B=yield T.next()).done;pe=!1){const Ht=B.value;Ht.onload=()=>{P++,P===Nt.length&&r()}}}catch(B){U=[B]}finally{try{pe&&(B=T.return)&&(yield B.call(T))}finally{if(U)throw U[0]}}}))),yield ne.wait(10);const _t=[];E||me.forEach(r=>{r.hasAttribute("data-permanent")||(g(this,m,Bt).call(this,r)?_t.push(r):r.remove())});const fe=g(this,m,Ft).call(this,S.document.body);!t(this,N).morphInsideScrollContainer&&!c&&g(this,m,Kt).call(this,S.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),ft.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(p?location.search:""),hash:d.hash}),t(this,et).remove(),n(this,tt,t(this,f)),n(this,f,d);const Dt=[];t(this,lt).forEach((r,P)=>{const T=fe[P],pe=getComputedStyle(r).getPropertyValue("--morph-duration");let B=[],U=[];c?(c.forEach(u=>{const v=r.querySelector(u),k=T.querySelector(u);v&&k&&(U.push(v),B.push(k))}),U.forEach(u=>{u.parentElement&&Dt.push(u.parentElement)})):(B.push(...T.childNodes),U.push(...r.childNodes),Dt.push(r));const Ht=[];E||U.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"),u.querySelectorAll("[data-morph-transfer]").forEach(k=>{const Ee=k.getAttribute("data-morph-transfer");Ht.push({element:k,selector:Ee})}))}),B.forEach(u=>{u instanceof HTMLElement&&(Ht.forEach(v=>{const k=u.querySelector(v.selector);k&&k.replaceWith(S.document.importNode(v.element,!0))}),this.findNewLinks(u),u.classList.add("new"))}),c?E?B.forEach((u,v)=>{U[v]instanceof HTMLElement&&U[v].append(...u.childNodes)}):B.forEach((u,v)=>{var k;(k=U[v].parentElement)==null||k.insertBefore(u,U[v])}):r.prepend(...B),setTimeout(()=>{E||U.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),B.forEach(u=>{var v;u instanceof HTMLElement&&((v=u.parentElement)==null||v.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})},0);const te=qt(Tt({},Rt),{morphElement:r});z.dispatchEvent(document,"morphNewChildrenAdded",{detail:te});const ge=new Promise(u=>{setTimeout(()=>{E||U.forEach(v=>{v.remove()}),B.forEach(v=>{var k;v instanceof HTMLElement&&((k=v.parentElement)==null||k.style.removeProperty("--new-content-height"),v.classList.remove("new-idle","new"))}),E||z.dispatchEvent(document,"morphOldChildrenRemoved",{detail:te}),u()},(parseFloat(pe)||0)*1e3+10)});t(this,W).push(ge)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-S.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),z.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:S.scrollState}),G?(S.clearScrollState(),g(this,m,Mt).call(this,G,{centerScroll:a,offsetScroll:o,behavior:L})):d.hash?(S.clearScrollState(),g(this,m,Mt).call(this,d.hash,{centerScroll:a,offsetScroll:o,behavior:L})):t(this,j)?S.restoreScrollPosition():A||S.renewScrollPosition(),yield Promise.all(t(this,W)),E||_t.forEach(r=>r.remove()),n(this,W,[]),Dt.forEach(r=>{r.querySelectorAll("script").forEach(T=>{T.replaceWith(g(this,m,Ot).call(this,T))})}),t(this,b).forEach(r=>{r.checkCurrent(t(this,f).path)}),this.findParamsDependent(),z.dispatchEvent(document,"morphComplete",{detail:Rt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}n(this,$,void 0)})}addLink(e){t(this,b).push(new It(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){n(this,b,t(this,b).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){n(this,b,t(this,b).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,At));t(this,b).push(...s.map(a=>new It(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,At));t(this,b).forEach(s=>s.destroy()),n(this,b,e.map(s=>new It(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,bt).forEach(s=>s.destroy()),n(this,bt,e.map(s=>new Pe(s)))}};N=new WeakMap,lt=new WeakMap,b=new WeakMap,$=new WeakMap,f=new WeakMap,tt=new WeakMap,W=new WeakMap,j=new WeakMap,M=new WeakMap,yt=new WeakMap,O=new WeakMap,bt=new WeakMap,et=new WeakMap,ct=new WeakMap,dt=new WeakMap,wt=new WeakMap,ut=new WeakMap,Pt=new WeakMap,m=new WeakSet,Ot=function(e){const s=document.createElement("script");for(let a=0;a<e.attributes.length;a++){const o=e.attributes[a];s.setAttribute(o.name,o.value)}return e.hasAttribute("src")||(s.innerHTML=e.innerHTML),s},At=new WeakMap,pt=function(e){const s=this.normalizePath(e);let a=t(this,O).get(s.pathname);return a||(a=new oe(this,s.pathname),t(this,O).set(s.pathname,a)),a},Ft=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},ue=function(e,s){return e.filter(a=>s.find(o=>o.outerHTML===a.outerHTML))},Xt=function(e,s){return e.filter(a=>!s.find(o=>o.outerHTML===a.outerHTML))},Bt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Kt=function(e){var s,a;(s=t(this,M))==null||s.removeEventListener("scroll",t(this,mt)),n(this,dt,0),n(this,ct,0),n(this,M,t(this,N).scrollSelector&&e.querySelector(t(this,N).scrollSelector)||window),n(this,yt,t(this,M)===window),(a=t(this,M))==null||a.addEventListener("scroll",t(this,mt)),t(this,mt).call(this)},Mt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ne.scrollToElement(a,{scrollElement:t(this,M),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Ut=new WeakMap,mt=new WeakMap,gt.instance=null;let Wt=gt;exports.Morph=Wt;
1
+ "use strict";var ge=Object.defineProperty,Ee=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var te=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var ee=(o,e)=>(e=Symbol[o])?e:Symbol.for("Symbol."+o),ae=o=>{throw TypeError(o)};var se=(o,e,s)=>e in o?ge(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,Ht=(o,e)=>{for(var s in e||(e={}))Le.call(e,s)&&se(o,s,e[s]);if(te)for(var s of te(e))Se.call(e,s)&&se(o,s,e[s]);return o},zt=(o,e)=>Ee(o,ve(e));var It=(o,e,s)=>e.has(o)||ae("Cannot "+s);var t=(o,e,s)=>(It(o,e,"read from private field"),s?s.call(o):e.get(o)),h=(o,e,s)=>e.has(o)?ae("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,s),r=(o,e,s,a)=>(It(o,e,"write to private field"),a?a.call(o,s):e.set(o,s),s),y=(o,e,s)=>(It(o,e,"access private method"),s);var J=(o,e,s)=>new Promise((a,l)=>{var v=c=>{try{f(s.next(c))}catch(p){l(p)}},S=c=>{try{f(s.throw(c))}catch(p){l(p)}},f=c=>c.done?a(c.value):Promise.resolve(c.value).then(v,S);f((s=s.apply(o,e)).next())});var ie=(o,e,s)=>(e=o[ee("asyncIterator")])?e.call(o):(o=o[ee("iterator")](),e={},s=(a,l)=>(l=o[a])&&(e[a]=v=>new Promise((S,f,c)=>(v=l.call(o,v),c=v.done,Promise.resolve(v.value).then(p=>S({value:p,done:c}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("../index-OE2INULi.cjs"),ft=require("../dom-CBLlqORw.cjs"),z=require("../events-KVanG9sR.cjs"),ne=require("../scroll-BA2WnUrb.cjs");require("construct-style-sheets-polyfill");const pt=require("../url-CHgcNwJ1.cjs"),ye=require("../css-value-parser/index.cjs"),he=require("../string-DUXXtU8v.cjs");class le extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}oe.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",le);var M,i,D,it,ce,vt,nt;class Vt{constructor(e,s){h(this,D);h(this,M);h(this,i);h(this,vt,e=>{e.preventDefault(),y(this,D,ce).call(this)});h(this,nt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,M).prefetch(t(this,D,it),e),t(this,i).removeEventListener("pointerenter",t(this,nt))});r(this,M,s),r(this,i,e),t(this,i).addEventListener("click",t(this,vt)),this.checkCurrent(location.href.replace(location.origin,"")),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,nt))}get element(){return t(this,i)}checkCurrent(e){var p,st;const s=t(this,M).normalizePath(e),a=t(this,M).normalizePath(t(this,D,it));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(p=t(this,i).getAttribute("data-associated-paths"))!=null&&p.split(",").find(A=>s.pathname.includes(A))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[l,v]=(st=t(this,D,it).split("#")[0])==null?void 0:st.split("?"),S=new URLSearchParams(v),f=new URLSearchParams(location.search);let c=0;for(const[A]of f)S.has(A)&&f.get(A)===S.get(A)&&c++;c?(t(this,i).classList.toggle("all-params-matched",f.size===c),t(this,i).classList.toggle("some-params-matched",f.size!==c)):!f.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const A in t(this,i).dataset){const at=he.camelToKebab(A);if(at.startsWith("match-param-")){const q=at.split("match-param-")[1],w=t(this,i).dataset[A],G=`param-${q}-matched`;f.has(q)&&f.get(q)===w||!f.has(q)&&(w===""||w==="*"||w==="all"||w==="any"||w==="vse")?t(this,i).classList.add(G):t(this,i).classList.remove(G)}}}destroy(){t(this,i).removeEventListener("click",t(this,vt)),t(this,i).removeEventListener("pointerenter",t(this,nt)),t(this,i).classList.remove("current","exact")}}M=new WeakMap,i=new WeakMap,D=new WeakSet,it=function(){const e=new URL(t(this,i).href);return t(this,M).normalizePath(e.pathname+e.search+e.hash).path},ce=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,M).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",l=t(this,i).hasAttribute("data-center-scroll"),v=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),S=v?ye.cssValueParser.parse(v):void 0,f=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),c=t(this,i).hasAttribute("data-keep-search-parameters"),p=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),st=t(this,i).getAttribute("data-scroll-behaviour"),A=(s=t(this,i).getAttribute("data-submorph")||t(this,i).getAttribute("data-submorph-append"))==null?void 0:s.split(",").map(w=>w.trim()),at=t(this,i).hasAttribute("data-clear-state");let q=t(this,D,it);if(t(this,i).hasAttribute("data-toggle-params")){const[w,G]=t(this,D,it).split("?"),Rt=new URLSearchParams(G),F=new URLSearchParams(location.search),d=new URLSearchParams;for(const[R]of Rt)(!F.has(R)||F.has(R)&&F.get(R)!==Rt.get(R))&&d.append(R,Rt.get(R));if(t(this,i).hasAttribute("data-merge-params"))for(const[R]of F)Rt.has(R)||d.append(R,F.get(R));q=`${w}?${d.toString()}`}t(this,M).navigate(q,{historyAction:a,centerScroll:l,offsetScroll:S,revalidate:f,keepSearchParameters:c,submorph:A,clearState:at,keepScrollPosition:p,scrollBehaviour:st,submorphAppend:t(this,i).hasAttribute("data-submorph-append"),mergeParams:t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params"),detail:t(this,i).getAttribute("data-detail"),removeParams:t(this,i).getAttribute("data-remove-params")||void 0,scrollTo:t(this,i).getAttribute("data-scroll-to")||void 0})}},vt=new WeakMap,nt=new WeakMap;var C,rt,Lt,Wt,St;class be{constructor(e){h(this,Lt);h(this,C);h(this,rt,[]);h(this,St,()=>{y(this,Lt,Wt).call(this)});r(this,C,e);for(const s in t(this,C).dataset){const a=he.camelToKebab(s);if(a.startsWith("param-")){const l=a.split("param-")[1],v=t(this,C).dataset[s];t(this,rt).push({name:l,value:v})}}document.addEventListener("morphURLParametersChange",t(this,St)),y(this,Lt,Wt).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,St))}}C=new WeakMap,rt=new WeakMap,Lt=new WeakSet,Wt=function(){const e=new URLSearchParams(location.search);let s=!!t(this,rt).find(l=>e.has(l.name)&&(e.get(l.name)===l.value||l.value==="*"||l.value==="all"||l.value==="any"||l.value==="vse"||e.get(l.name)==="*"||e.get(l.name)==="all"||e.get(l.name)==="any"||e.get(l.name)==="vse"));!s&&t(this,C).hasAttribute("data-match-no-params")&&(s=!t(this,rt).filter(l=>e.has(l.name)).length);const a=t(this,C).getAttribute("data-hide-class");s?a?t(this,C).classList.remove(a):t(this,C).style.display="":a?t(this,C).classList.add(a):t(this,C).style.display="none"},St=new WeakMap;const we=new DOMParser;var I,Q,U,V,Z,K,ot,_,Y,yt,ht;class re{constructor(e,s){h(this,I);h(this,Q);h(this,U,{x:0,y:0});h(this,V,null);h(this,Z,null);h(this,K,null);h(this,ot,null);h(this,_,null);h(this,Y,null);h(this,yt);h(this,ht,!1);r(this,I,e),r(this,Q,s)}get pathname(){return t(this,Q)}get scrollState(){return t(this,U)}get document(){return t(this,K)}needRavalidation(){r(this,ht,!0)}setHeaders(e){r(this,yt,e)}setInitialDocument(e){r(this,V,e.cloneNode(!0))}abort(){var e;return(e=t(this,_))==null?void 0:e.abort(`[${t(this,Q)}] page loading cancelled`)}fetch(e,s,a){return J(this,null,function*(){var l;if(!a&&!t(this,ht)){const f=((l=t(this,V))==null?void 0:l.documentElement.getAttribute("data-cache"))&&s!==e,c=t(this,V)&&t(this,I).isPopstateNavigation;if(t(this,Y)||f||c)return t(this,Y)}return r(this,Y,new Promise(v=>J(this,null,function*(){try{r(this,_,new AbortController);const f=yield(yield fetch(e,{signal:t(this,_).signal,headers:Ht({"X-MORPH":"true","X-MORPH-REVALIDATE":a?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,yt))})).text(),c=we.parseFromString(f,"text/html");this.setInitialDocument(c),r(this,ht,!1)}catch(S){console.warn(S)}finally{r(this,_,null),r(this,Y,null),v()}}))),t(this,Y)})}cloneDocument(){r(this,K,(t(this,Z)||t(this,V)).cloneNode(!0))}get title(){let e="";if(t(this,K).title)e=t(this,K).title;else{const s=t(this,K).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,Q)}return e}clearScrollState(){t(this,U).x=0,t(this,U).y=0}clearDocumentState(){r(this,Z,null)}saveScrollState(){t(this,V).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,U).x=0,t(this,U).y=0):(t(this,U).x=t(this,I).scrollValue.left,t(this,U).y=t(this,I).scrollValue.top)}restoreScrollPosition(){t(this,I).scrollElement.scroll({top:t(this,U).y,left:t(this,U).x,behavior:"instant"})}saveDocumentState(){t(this,V).documentElement.hasAttribute("data-no-page-restoration")?r(this,Z,null):r(this,Z,document.cloneNode(!0))}renewScrollPosition(){t(this,I).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){r(this,ot,e)}clearState(){const e=t(this,ot);return r(this,ot,null),e}}I=new WeakMap,Q=new WeakMap,U=new WeakMap,V=new WeakMap,Z=new WeakMap,K=new WeakMap,ot=new WeakMap,_=new WeakMap,Y=new WeakMap,yt=new WeakMap,ht=new WeakMap;var T,lt,b,$,m,tt,W,j,H,bt,O,wt,et,ct,dt,Pt,ut,At,kt,E,gt,Ft,Xt,Bt,Nt,Mt,mt;const Et=class Et{constructor(e){h(this,E);h(this,T,null);h(this,lt,null);h(this,b,[]);h(this,$);h(this,m,null);h(this,tt);h(this,W,[]);h(this,j,!1);h(this,H,null);h(this,bt,!1);h(this,O,new Map);h(this,wt,[]);h(this,et,null);h(this,ct,0);h(this,dt,0);h(this,Pt);h(this,ut);h(this,At);h(this,kt,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});h(this,Mt,e=>J(this,null,function*(){e.preventDefault(),r(this,j,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,ut)?void 0:t(this,Pt),revalidate:t(this,ut),keepScrollPosition:t(this,At)}),r(this,j,!1)}));h(this,mt,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,dt),l=e-t(this,ct);r(this,dt,s),r(this,ct,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",l>0),document.documentElement.classList.toggle("scroll-x-backward",l<0),z.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(oe.isBrowser&&!Et.instance){Et.instance=this,r(this,T,{base:pt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),r(this,lt,y(this,E,Ft).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);r(this,m,s);const a=new re(this,t(this,m).pathname);a.setInitialDocument(document),t(this,O).set(t(this,m).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Mt)),pt.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,et,new le),y(this,E,Bt).call(this,document)}}get currentURL(){return t(this,m)}get previousURL(){return t(this,tt)}get links(){return t(this,b)}get scrollElement(){return t(this,H)}get isPopstateNavigation(){return t(this,j)}get scrollValue(){let e=0,s=0;return t(this,bt)?(e=window.scrollY,s=window.scrollX):(e=t(this,H).scrollTop,s=t(this,H).scrollLeft),{top:e,left:s}}get isNavigating(){return!!t(this,W).length}saveState(e){const s=t(this,O).get(t(this,m).path);s&&s.saveState(e)}getState(){const e=t(this,O).get(t(this,m).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return pt.splitPath(e,{base:t(this,T).base,trailingSlash:t(this,T).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:"",removeParams:s==null?void 0:s.removeParams})}prefetch(e,s){return J(this,null,function*(){var l;if(t(this,W).length)return;e=((l=this.pathnameModifier)==null?void 0:l.call(this,e))||e;const a=y(this,E,gt).call(this,e);a==null||a.fetch(e,t(this,m).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}needRavalidation(e){const s=this.normalizePath(e),a=y(this,E,gt).call(this,s.path);a==null||a.needRavalidation()}navigate(Rt){return J(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:l,scrollBehaviour:v,revalidate:S,keepSearchParameters:f,submorph:c,submorphAppend:p,clearState:st,keepScrollPosition:A,mergeParams:at,removeParams:q,detail:w,scrollTo:G}={}){var R,Kt,Yt,$t;if(t(this,W).length)return;r(this,Pt,c),r(this,ut,S),r(this,At,A);const F=((R=this.pathnameModifier)==null?void 0:R.call(this,e))||e,d=this.normalizePath(F,{mergeParams:at,removeParams:q});if(!S&&(((Kt=t(this,$))==null?void 0:Kt.pathname)===d.pathname||t(this,m).pathname===d.pathname)){A||y(this,E,Nt).call(this,d.hash||0,{centerScroll:a,offsetScroll:l,behavior:"smooth"}),z.dispatchEvent(document,"morphSamePath",{detail:{detail:w}}),((Yt=t(this,m))==null?void 0:Yt.parameters)!==d.parameters&&(r(this,tt,t(this,m)),r(this,m,d),pt.changeHistory({action:(($t=t(this,m))==null?void 0:$t.hash)!==d.hash?"replace":s,pathname:d.pathname,searchParameters:d.parameters,hash:d.hash}),z.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,m),previousURL:t(this,tt),detail:w}})),t(this,b).forEach(X=>{X.checkCurrent(d.path)});return}else t(this,b).forEach(X=>{X.checkCurrent(d.path)});r(this,$,d);try{let X=!0;if(this.preprocessor)try{yield new Promise((n,P)=>{var x;(x=this.preprocessor)==null||x.call(this,{url:d,resolve:n,reject:P,submorph:c,detail:w})})}catch(n){n?console.error(n):console.log("Route change canceled"),X=!1}if(!X||t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}const jt={url:d,submorph:c,detail:w};c?p||c.forEach(n=>{document.querySelectorAll(n).forEach(P=>{P.classList.add("out"),P.setAttribute("data-morph-out","")})}):t(this,lt).forEach(n=>{var P,x;(P=n.firstElementChild)==null||P.classList.add("out"),(x=n.firstElementChild)==null||x.setAttribute("data-morph-out","")}),z.dispatchEvent(document,"morphNavigation",{detail:jt});const Tt=y(this,E,gt).call(this,t(this,m).pathname),L=y(this,E,gt).call(this,d.pathname);if(t(this,O).forEach(n=>{n.pathname!==d.pathname&&n.abort()}),yield L==null?void 0:L.fetch(F,t(this,m).path,S),t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}Tt.clearState(),Tt.saveScrollState(),Tt.saveDocumentState(),(!t(this,j)||S)&&(L.clearScrollState(),L.clearDocumentState()),st&&L.clearState(),L.cloneDocument(),t(this,et).textContent=L.title,document.body.appendChild(t(this,et));const Ct=zt(Ht({},jt),{document:L.document});p||Ct.document.querySelectorAll("[data-morph-out]").forEach(n=>{n.classList.remove("out")}),z.dispatchEvent(document,"morphStart",{detail:Ct});const Gt=Array.from(document.head.children),Jt=Array.from(L.document.head.children),Qt=ft.intersectElements(Gt,Jt),de=ft.excludeElements(Gt,Qt),Ut=ft.excludeElements(Jt,Qt).filter(n=>!this.excludeHeadChild(n));Ut.forEach((n,P)=>{n.tagName==="SCRIPT"&&(Ut[P]=ft.createScriptElement(n))}),Ut.forEach(n=>{document.head.appendChild(n)});const Dt=Ut.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(y(this,E,Xt).call(this,n))return!0});t(this,T).waitForHeadToLoad&&Dt.length&&(yield new Promise(n=>J(this,null,function*(){let P=0;try{for(var x=ie(Dt),me,B,N;me=!(B=yield x.next()).done;me=!1){const xt=B.value;xt.onload=()=>{P++,P===Dt.length&&n()}}}catch(B){N=[B]}finally{try{me&&(B=x.return)&&(yield B.call(x))}finally{if(N)throw N[0]}}}))),yield ne.wait(10);const Zt=[];p||de.forEach(n=>{n.hasAttribute("data-permanent")||(y(this,E,Xt).call(this,n)?Zt.push(n):n.remove())});const ue=y(this,E,Ft).call(this,L.document.body);!t(this,T).morphInsideScrollContainer&&!c&&y(this,E,Bt).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),pt.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(f?location.search:""),hash:d.hash}),t(this,et).remove(),r(this,tt,t(this,m)),r(this,m,d);const qt=[];t(this,lt).forEach((n,P)=>{const x=ue[P],me=getComputedStyle(n).getPropertyValue("--morph-duration");let B=[],N=[];c?(c.forEach(u=>{const g=n.querySelector(u),k=x.querySelector(u);g&&k&&(N.push(g),B.push(k))}),N.forEach(u=>{u.parentElement&&qt.push(u.parentElement)})):(B.push(...x.childNodes),N.push(...n.childNodes),qt.push(n));const xt=[];p||N.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"),u.querySelectorAll("[data-morph-transfer]").forEach(k=>{const pe=k.getAttribute("data-morph-transfer");xt.push({element:k,selector:pe})}))}),B.forEach(u=>{u instanceof HTMLElement&&(xt.forEach(g=>{const k=u.querySelector(g.selector);k&&k.replaceWith(L.document.importNode(g.element,!0))}),this.findNewLinks(u),u.classList.add("new"))}),c?p?B.forEach((u,g)=>{N[g]instanceof HTMLElement&&N[g].append(...u.childNodes)}):B.forEach((u,g)=>{var k;(k=N[g].parentElement)==null||k.insertBefore(u,N[g])}):n.prepend(...B),setTimeout(()=>{p||N.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),B.forEach(u=>{var g;u instanceof HTMLElement&&((g=u.parentElement)==null||g.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})},0);const _t=zt(Ht({},Ct),{morphElement:n});z.dispatchEvent(document,"morphNewChildrenAdded",{detail:_t});const fe=new Promise(u=>{setTimeout(()=>{p||N.forEach(g=>{g.remove()}),B.forEach(g=>{var k;g instanceof HTMLElement&&((k=g.parentElement)==null||k.style.removeProperty("--new-content-height"),g.classList.remove("new-idle","new"))}),p||z.dispatchEvent(document,"morphOldChildrenRemoved",{detail:_t}),u()},(parseFloat(me)||0)*1e3+10)});t(this,W).push(fe)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-L.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),z.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:L.scrollState}),G?(L.clearScrollState(),y(this,E,Nt).call(this,G,{centerScroll:a,offsetScroll:l,behavior:v})):d.hash?(L.clearScrollState(),y(this,E,Nt).call(this,d.hash,{centerScroll:a,offsetScroll:l,behavior:v})):t(this,j)?L.restoreScrollPosition():A||L.renewScrollPosition(),yield Promise.all(t(this,W)),p||Zt.forEach(n=>n.remove()),r(this,W,[]),qt.forEach(n=>{n.querySelectorAll("script").forEach(x=>{x.replaceWith(ft.createScriptElement(x))})}),t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)}),this.findParamsDependent(),z.dispatchEvent(document,"morphComplete",{detail:Ct}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}r(this,$,void 0)})}addLink(e){t(this,b).push(new Vt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){r(this,b,t(this,b).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){r(this,b,t(this,b).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,kt));t(this,b).push(...s.map(a=>new Vt(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,kt));t(this,b).forEach(s=>s.destroy()),r(this,b,e.map(s=>new Vt(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,wt).forEach(s=>s.destroy()),r(this,wt,e.map(s=>new be(s)))}};T=new WeakMap,lt=new WeakMap,b=new WeakMap,$=new WeakMap,m=new WeakMap,tt=new WeakMap,W=new WeakMap,j=new WeakMap,H=new WeakMap,bt=new WeakMap,O=new WeakMap,wt=new WeakMap,et=new WeakMap,ct=new WeakMap,dt=new WeakMap,Pt=new WeakMap,ut=new WeakMap,At=new WeakMap,kt=new WeakMap,E=new WeakSet,gt=function(e){const s=this.normalizePath(e);let a=t(this,O).get(s.pathname);return a||(a=new re(this,s.pathname),t(this,O).set(s.pathname,a)),a},Ft=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},Xt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Bt=function(e){var s,a;(s=t(this,H))==null||s.removeEventListener("scroll",t(this,mt)),r(this,dt,0),r(this,ct,0),r(this,H,t(this,T).scrollSelector&&e.querySelector(t(this,T).scrollSelector)||window),r(this,bt,t(this,H)===window),(a=t(this,H))==null||a.addEventListener("scroll",t(this,mt)),t(this,mt).call(this)},Nt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ne.scrollToElement(a,{scrollElement:t(this,H),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Mt=new WeakMap,mt=new WeakMap,Et.instance=null;let Ot=Et;exports.Morph=Ot;