Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-13 13:47:22 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-13 13:47:22 +0300
commitd49f875aecd040fef48a52edd60daf9d6ee89aec (patch)
treef10782aac5b2da3d4560c8f410f1e7cf31ceb9ea
parent25550c65b6af716693c24361a89f45713ca080a6 (diff)
Revert "alpinejs: Patch for mutator body removal"alpinejs/v3.401.201
That patch was a mistake. This reverts commit 25550c65b6af716693c24361a89f45713ca080a6.
-rw-r--r--alpinejs/packages/alpinejs/builds/cdn.js7
-rw-r--r--alpinejs/packages/alpinejs/builds/module.js3
-rw-r--r--alpinejs/packages/alpinejs/dist/cdn.js42
-rw-r--r--alpinejs/packages/alpinejs/dist/cdn.min.js4
-rw-r--r--alpinejs/packages/alpinejs/dist/dist/cdn.js2660
-rw-r--r--alpinejs/packages/alpinejs/dist/dist/cdn.min.js5
-rw-r--r--alpinejs/packages/alpinejs/dist/dist/module.cjs.js3245
-rw-r--r--alpinejs/packages/alpinejs/dist/dist/module.esm.js3238
-rw-r--r--alpinejs/packages/alpinejs/dist/module.cjs.js42
-rw-r--r--alpinejs/packages/alpinejs/dist/module.esm.js42
-rw-r--r--alpinejs/packages/alpinejs/package.json13
-rw-r--r--alpinejs/packages/alpinejs/src/alpine.js54
-rw-r--r--alpinejs/packages/alpinejs/src/clone.js65
-rw-r--r--alpinejs/packages/alpinejs/src/datas.js22
-rw-r--r--alpinejs/packages/alpinejs/src/directives.js179
-rw-r--r--alpinejs/packages/alpinejs/src/directives/index.js15
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-bind.js54
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-cloak.js4
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-data.js43
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-effect.js4
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-for.js262
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-html.js13
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-if.js43
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-ignore.js17
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-init.js14
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-model.js107
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-on.js16
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-ref.js16
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-show.js56
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-text.js14
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-transition.js325
-rw-r--r--alpinejs/packages/alpinejs/src/evaluator.js125
-rw-r--r--alpinejs/packages/alpinejs/src/index.js74
-rw-r--r--alpinejs/packages/alpinejs/src/interceptor.js77
-rw-r--r--alpinejs/packages/alpinejs/src/lifecycle.js75
-rw-r--r--alpinejs/packages/alpinejs/src/magics.js26
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$dispatch.js4
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$el.js3
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$nextTick.js4
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$refs.js25
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$root.js4
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$store.js4
-rw-r--r--alpinejs/packages/alpinejs/src/magics/$watch.js37
-rw-r--r--alpinejs/packages/alpinejs/src/magics/index.js7
-rw-r--r--alpinejs/packages/alpinejs/src/mutation.js195
-rw-r--r--alpinejs/packages/alpinejs/src/nextTick.js24
-rw-r--r--alpinejs/packages/alpinejs/src/plugin.js5
-rw-r--r--alpinejs/packages/alpinejs/src/reactivity.js62
-rw-r--r--alpinejs/packages/alpinejs/src/scheduler.js33
-rw-r--r--alpinejs/packages/alpinejs/src/scope.js105
-rw-r--r--alpinejs/packages/alpinejs/src/store.js20
-rw-r--r--alpinejs/packages/alpinejs/src/utils/bind.js129
-rw-r--r--alpinejs/packages/alpinejs/src/utils/classes.js58
-rw-r--r--alpinejs/packages/alpinejs/src/utils/debounce.js18
-rw-r--r--alpinejs/packages/alpinejs/src/utils/dispatch.js12
-rw-r--r--alpinejs/packages/alpinejs/src/utils/on.js163
-rw-r--r--alpinejs/packages/alpinejs/src/utils/once.js14
-rw-r--r--alpinejs/packages/alpinejs/src/utils/styles.js45
-rw-r--r--alpinejs/packages/alpinejs/src/utils/throttle.js16
-rw-r--r--alpinejs/packages/alpinejs/src/utils/walk.js38
-rw-r--r--alpinejs/packages/alpinejs/src/utils/warn.js4
-rw-r--r--alpinejs/packages/collapse/builds/cdn.js5
-rw-r--r--alpinejs/packages/collapse/builds/module.js3
-rw-r--r--alpinejs/packages/collapse/dist/dist/cdn.js74
-rw-r--r--alpinejs/packages/collapse/dist/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/collapse/dist/dist/module.cjs.js83
-rw-r--r--alpinejs/packages/collapse/dist/dist/module.esm.js73
-rw-r--r--alpinejs/packages/collapse/package.json11
-rw-r--r--alpinejs/packages/collapse/src/index.js73
-rw-r--r--alpinejs/packages/csp/builds/cdn.js7
-rw-r--r--alpinejs/packages/csp/builds/module.js3
-rw-r--r--alpinejs/packages/csp/dist/cdn.js42
-rw-r--r--alpinejs/packages/csp/dist/cdn.min.js4
-rw-r--r--alpinejs/packages/csp/dist/dist/cdn.js2676
-rw-r--r--alpinejs/packages/csp/dist/dist/cdn.min.js5
-rw-r--r--alpinejs/packages/csp/dist/dist/module.cjs.js3261
-rw-r--r--alpinejs/packages/csp/dist/dist/module.esm.js3254
-rw-r--r--alpinejs/packages/csp/dist/module.cjs.js42
-rw-r--r--alpinejs/packages/csp/dist/module.esm.js42
-rw-r--r--alpinejs/packages/csp/package.json12
-rw-r--r--alpinejs/packages/csp/src/index.js37
-rw-r--r--alpinejs/packages/docs/package.json7
-rw-r--r--alpinejs/packages/docs/src/en/advanced.md5
-rw-r--r--alpinejs/packages/docs/src/en/advanced/async.md40
-rw-r--r--alpinejs/packages/docs/src/en/advanced/csp.md72
-rw-r--r--alpinejs/packages/docs/src/en/advanced/extending.md360
-rw-r--r--alpinejs/packages/docs/src/en/advanced/reactivity.md101
-rw-r--r--alpinejs/packages/docs/src/en/directives.md7
-rw-r--r--alpinejs/packages/docs/src/en/directives/bind.md189
-rw-r--r--alpinejs/packages/docs/src/en/directives/cloak.md38
-rw-r--r--alpinejs/packages/docs/src/en/directives/data.md170
-rw-r--r--alpinejs/packages/docs/src/en/directives/effect.md20
-rw-r--r--alpinejs/packages/docs/src/en/directives/for.md87
-rw-r--r--alpinejs/packages/docs/src/en/directives/html.md29
-rw-r--r--alpinejs/packages/docs/src/en/directives/if.md20
-rw-r--r--alpinejs/packages/docs/src/en/directives/ignore.md20
-rw-r--r--alpinejs/packages/docs/src/en/directives/init.md74
-rw-r--r--alpinejs/packages/docs/src/en/directives/model.md338
-rw-r--r--alpinejs/packages/docs/src/en/directives/on.md276
-rw-r--r--alpinejs/packages/docs/src/en/directives/ref.md24
-rw-r--r--alpinejs/packages/docs/src/en/directives/show.md39
-rw-r--r--alpinejs/packages/docs/src/en/directives/text.md26
-rw-r--r--alpinejs/packages/docs/src/en/directives/transition.md175
-rw-r--r--alpinejs/packages/docs/src/en/essentials.md5
-rw-r--r--alpinejs/packages/docs/src/en/essentials/events.md101
-rw-r--r--alpinejs/packages/docs/src/en/essentials/installation.md68
-rw-r--r--alpinejs/packages/docs/src/en/essentials/lifecycle.md96
-rw-r--r--alpinejs/packages/docs/src/en/essentials/state.md133
-rw-r--r--alpinejs/packages/docs/src/en/essentials/templating.md368
-rw-r--r--alpinejs/packages/docs/src/en/globals.md7
-rw-r--r--alpinejs/packages/docs/src/en/globals/alpine-data.md136
-rw-r--r--alpinejs/packages/docs/src/en/globals/alpine-store.md115
-rw-r--r--alpinejs/packages/docs/src/en/magics.md7
-rw-r--r--alpinejs/packages/docs/src/en/magics/dispatch.md106
-rw-r--r--alpinejs/packages/docs/src/en/magics/el.md21
-rw-r--r--alpinejs/packages/docs/src/en/magics/nextTick.md23
-rw-r--r--alpinejs/packages/docs/src/en/magics/refs.md27
-rw-r--r--alpinejs/packages/docs/src/en/magics/root.md21
-rw-r--r--alpinejs/packages/docs/src/en/magics/store.md60
-rw-r--r--alpinejs/packages/docs/src/en/magics/watch.md37
-rw-r--r--alpinejs/packages/docs/src/en/plugins.md6
-rw-r--r--alpinejs/packages/docs/src/en/plugins/collapse.md109
-rw-r--r--alpinejs/packages/docs/src/en/plugins/intersect.md106
-rw-r--r--alpinejs/packages/docs/src/en/plugins/persist.md196
-rw-r--r--alpinejs/packages/docs/src/en/plugins/trap.md180
-rw-r--r--alpinejs/packages/docs/src/en/start-here.md326
-rw-r--r--alpinejs/packages/docs/src/en/upgrade-guide.md375
-rw-r--r--alpinejs/packages/history/builds/cdn.js5
-rw-r--r--alpinejs/packages/history/builds/module.js3
-rw-r--r--alpinejs/packages/history/dist/dist/cdn.js67
-rw-r--r--alpinejs/packages/history/dist/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/history/dist/dist/module.cjs.js76
-rw-r--r--alpinejs/packages/history/dist/dist/module.esm.js66
-rw-r--r--alpinejs/packages/history/package.json12
-rw-r--r--alpinejs/packages/history/src/index.js76
-rw-r--r--alpinejs/packages/history/src/url.js36
-rw-r--r--alpinejs/packages/intersect/builds/cdn.js5
-rw-r--r--alpinejs/packages/intersect/builds/module.js3
-rw-r--r--alpinejs/packages/intersect/dist/dist/cdn.js35
-rw-r--r--alpinejs/packages/intersect/dist/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/intersect/dist/dist/module.cjs.js44
-rw-r--r--alpinejs/packages/intersect/dist/dist/module.esm.js34
-rw-r--r--alpinejs/packages/intersect/package.json11
-rw-r--r--alpinejs/packages/intersect/src/index.js37
-rw-r--r--alpinejs/packages/morph/builds/cdn.js5
-rw-r--r--alpinejs/packages/morph/builds/module.js5
-rw-r--r--alpinejs/packages/morph/dist/dist/cdn.js219
-rw-r--r--alpinejs/packages/morph/dist/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/morph/dist/dist/module.cjs.js229
-rw-r--r--alpinejs/packages/morph/dist/dist/module.esm.js219
-rw-r--r--alpinejs/packages/morph/package.json12
-rw-r--r--alpinejs/packages/morph/src/index.js17
-rw-r--r--alpinejs/packages/morph/src/morph.js370
-rw-r--r--alpinejs/packages/persist/builds/cdn.js5
-rw-r--r--alpinejs/packages/persist/builds/module.js3
-rw-r--r--alpinejs/packages/persist/dist/dist/cdn.js42
-rw-r--r--alpinejs/packages/persist/dist/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/persist/dist/dist/module.cjs.js51
-rw-r--r--alpinejs/packages/persist/dist/dist/module.esm.js41
-rw-r--r--alpinejs/packages/persist/package.json11
-rw-r--r--alpinejs/packages/persist/src/index.js42
-rw-r--r--alpinejs/packages/trap/.gitignore0
-rw-r--r--alpinejs/packages/trap/builds/cdn.js5
-rw-r--r--alpinejs/packages/trap/builds/module.js3
-rw-r--r--alpinejs/packages/trap/dist/dist/cdn.js650
-rw-r--r--alpinejs/packages/trap/dist/dist/cdn.min.js9
-rw-r--r--alpinejs/packages/trap/dist/dist/module.cjs.js712
-rw-r--r--alpinejs/packages/trap/dist/dist/module.esm.js705
-rw-r--r--alpinejs/packages/trap/package.json13
-rw-r--r--alpinejs/packages/trap/src/index.js32
170 files changed, 106 insertions, 30292 deletions
diff --git a/alpinejs/packages/alpinejs/builds/cdn.js b/alpinejs/packages/alpinejs/builds/cdn.js
deleted file mode 100644
index a54e7e0..0000000
--- a/alpinejs/packages/alpinejs/builds/cdn.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Alpine from './../src/index'
-
-window.Alpine = Alpine
-
-queueMicrotask(() => {
- Alpine.start()
-})
diff --git a/alpinejs/packages/alpinejs/builds/module.js b/alpinejs/packages/alpinejs/builds/module.js
deleted file mode 100644
index 0382080..0000000
--- a/alpinejs/packages/alpinejs/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Alpine from './../src/index'
-
-export default Alpine
diff --git a/alpinejs/packages/alpinejs/dist/cdn.js b/alpinejs/packages/alpinejs/dist/cdn.js
index 90b1dc6..50d3328 100644
--- a/alpinejs/packages/alpinejs/dist/cdn.js
+++ b/alpinejs/packages/alpinejs/dist/cdn.js
@@ -77,23 +77,6 @@
}];
}
- // packages/alpinejs/src/utils/walk.js
- function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
- }
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -224,14 +207,6 @@
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -642,6 +617,23 @@ Expression: "${expression}"
isHolding = true;
}
+ // packages/alpinejs/src/utils/walk.js
+ function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+ }
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/alpinejs/dist/cdn.min.js b/alpinejs/packages/alpinejs/dist/cdn.min.js
index 0477350..c714f97 100644
--- a/alpinejs/packages/alpinejs/dist/cdn.min.js
+++ b/alpinejs/packages/alpinejs/dist/cdn.min.js
@@ -1,5 +1,5 @@
-(()=>{var Ke=!1,ze=!1,Z=[];function Tt(e){Vr(e)}function Vr(e){Z.includes(e)||Z.push(e),Br()}function Br(){!ze&&!Ke&&(Ke=!0,queueMicrotask(Hr))}function Hr(){Ke=!1,ze=!0;for(let e=0;e<Z.length;e++)Z[e]();Z.length=0,ze=!1}var v,L,V,Ve,Be=!0;function Rt(e){Be=!1,e(),Be=!0}function Ct(e){v=e.reactive,V=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Tt(r):r()}}),Ve=e.raw}function He(e){L=e}function me(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),V(i))}},()=>{t()}]}function S(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>S(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)S(n,t,!1),n=n.nextElementSibling}var Mt=[],qe=[],Nt=[];function kt(e){Nt.push(e)}function Dt(e){qe.push(e)}function Pt(e){Mt.push(e)}function B(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ue(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var Ge=new MutationObserver(We),Ye=!1;function Je(){Ge.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ye=!0}function Ze(){qr(),Ge.disconnect(),Ye=!1}var Q=[],Qe=!1;function qr(){Q=Q.concat(Ge.takeRecords()),Q.length&&!Qe&&(Qe=!0,queueMicrotask(()=>{Ur(),Qe=!1}))}function Ur(){We(Q),Q.length=0}function m(e){if(!Ye)return e();Ze();let t=e();return Je(),t}var Xe=!1,he=[];function It(){Xe=!0}function Lt(){Xe=!1,We(he),he=[]}function We(e){if(Xe){he=he.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Ue(s,o)}),n.forEach((o,s)=>{Mt.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||Nt.forEach(s=>s(o));for(let o of r)t.includes(o)||(qe.forEach(s=>s(o)),o.localName==="body"&&o.querySelectorAll("[x-data]").forEach(s=>{S(s,a=>{qe.forEach(c=>c(a)),a.remove()})}));t=null,r=null,n=null,i=null}function H(e,t,r){return e._x_dataStack=[t,...X(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function et(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function X(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?X(e.host):e.parentNode?X(e.parentNode):[]}function ee(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function $t(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function ge(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Wr(n,i),s=>tt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Wr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function tt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),tt(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function te(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:A,interceptor:ge})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return jt(...e)}var jt=rt;function Kt(e){jt=e}function rt(e,t){let r={},n=te(r,e).cleanup;B(e,"evaluator",n);let i=[r,...X(e)];if(typeof t=="function")return Gr(i,t);let o=Yr(i,t);return Jr.bind(null,e,t,o)}function Gr(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(ee([n,...e]),i);_e(r,o)}}var nt={};function Zr(e){if(nt[e])return nt[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return nt[e]=n,n}function Yr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=ee([i,...e]),a=r(r,s);r.finished?_e(n,r.result,s,o):a.then(c=>{_e(n,c,s,o)})}}function _e(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>_e(e,o,r,n)):e(i)}else e(t)}function Jr(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
+(()=>{var Ke=!1,ze=!1,Z=[];function Ot(e){Vr(e)}function Vr(e){Z.includes(e)||Z.push(e),Br()}function Br(){!ze&&!Ke&&(Ke=!0,queueMicrotask(Hr))}function Hr(){Ke=!1,ze=!0;for(let e=0;e<Z.length;e++)Z[e]();Z.length=0,ze=!1}var v,L,V,Ve,Be=!0;function Tt(e){Be=!1,e(),Be=!0}function Rt(e){v=e.reactive,V=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Ot(r):r()}}),Ve=e.raw}function He(e){L=e}function me(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),V(i))}},()=>{t()}]}var Ct=[],Mt=[],Nt=[];function kt(e){Nt.push(e)}function Dt(e){Mt.push(e)}function Pt(e){Ct.push(e)}function B(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function qe(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var We=new MutationObserver(Ue),Ge=!1;function Ye(){We.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ge=!0}function Je(){qr(),We.disconnect(),Ge=!1}var Q=[],Ze=!1;function qr(){Q=Q.concat(We.takeRecords()),Q.length&&!Ze&&(Ze=!0,queueMicrotask(()=>{Ur(),Ze=!1}))}function Ur(){Ue(Q),Q.length=0}function m(e){if(!Ge)return e();Je();let t=e();return Ye(),t}var Qe=!1,he=[];function It(){Qe=!0}function Lt(){Qe=!1,Ue(he),he=[]}function Ue(e){if(Qe){he=he.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{qe(s,o)}),n.forEach((o,s)=>{Ct.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||Nt.forEach(s=>s(o));for(let o of r)t.includes(o)||Mt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function H(e,t,r){return e._x_dataStack=[t,...X(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function Xe(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function X(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?X(e.host):e.parentNode?X(e.parentNode):[]}function ee(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function $t(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function ge(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Wr(n,i),s=>et(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Wr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function et(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),et(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function te(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:S,interceptor:ge})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return jt(...e)}var jt=tt;function Kt(e){jt=e}function tt(e,t){let r={},n=te(r,e).cleanup;B(e,"evaluator",n);let i=[r,...X(e)];if(typeof t=="function")return Gr(i,t);let o=Yr(i,t);return Jr.bind(null,e,t,o)}function Gr(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(ee([n,...e]),i);_e(r,o)}}var rt={};function Zr(e){if(rt[e])return rt[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return rt[e]=n,n}function Yr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=ee([i,...e]),a=r(r,s);r.finished?_e(n,r.result,s,o):a.then(c=>{_e(n,c,s,o)})}}function _e(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>_e(e,o,r,n)):e(i)}else e(t)}function Jr(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
Expression: "${t}"
-`,e),i}}var it="x-";function O(e=""){return it+e}function zt(e){it=e}var Vt={};function d(e,t){Vt[e]=t}function re(e,t,r){let n={};return Array.from(t).map(Bt((o,s)=>n[o]=s)).filter(Ht).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function qt(e){return Array.from(e).map(Bt()).filter(t=>!Ht(t))}var ot=!1,ne=new Map,Ut=Symbol();function Wt(e){ot=!0;let t=Symbol();Ut=t,ne.set(t,[]);let r=()=>{for(;ne.get(t).length;)ne.get(t).shift()();ne.delete(t)},n=()=>{ot=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Vt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=me(e);i.push(a);let c={Alpine:A,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());B(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),ot?ne.get(Ut).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Bt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Gt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Gt=[];function q(e){Gt.push(e)}function Ht({name:e}){return Yt().test(e)}var Yt=()=>new RegExp(`^${it}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Yt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var st="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",st,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?st:e.type,n=be.indexOf(t.type)===-1?st:t.type;return be.indexOf(r)-be.indexOf(n)}function $(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var at=[],ct=!1;function U(e){at.push(e),queueMicrotask(()=>{ct||setTimeout(()=>{ve()})})}function ve(){for(ct=!1;at.length;)at.shift()()}function Jt(){ct=!0}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Qt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),$(document,"alpine:init"),$(document,"alpine:initializing"),Je(),kt(t=>T(t,S)),Dt(t=>U(()=>lt(t))),Pt((t,r)=>{re(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Zt())).filter(e).forEach(t=>{T(t)}),$(document,"alpine:initialized")}var ut=[],Xt=[];function er(){return ut.map(e=>e())}function Zt(){return ut.concat(Xt).map(e=>e())}function Ee(e){ut.push(e)}function tr(e){Xt.push(e)}function N(e,t=!1){if(!e)return;if((t?Zt():er()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function rr(e){return er().some(t=>e.matches(t))}function T(e,t=S){Wt(()=>{t(e,(r,n)=>{re(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function lt(e){S(e,t=>Ue(t))}function ie(e,t){return Array.isArray(t)?nr(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?ie(e,t()):nr(e,t)}function nr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function F(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{F(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){ir(e,ie,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){ir(e,F);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?se(t,"scale",95)/100:1,p=se(t,"delay",0),E=se(t,"origin","center"),I="opacity, transform",K=se(t,"duration",150)/1e3,pe=se(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${K}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${pe}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function ir(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=or(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function or(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:or(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=oe(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:oe(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Jt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function se(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function sr(e){e(A)}var W={},ar=!1;function cr(e,t){if(ar||(W=v(W),ar=!0),t===void 0)return W[e];W[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&W[e].init()}function lr(){return W}var ft=!1;function G(e){return(...t)=>ft||e(...t)}function ur(e,t){t._x_dataStack=e._x_dataStack,ft=!0,un(()=>{ln(t)}),ft=!1}function ln(e){let t=!1;T(e,(n,i)=>{S(n,(o,s)=>{if(t&&rr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return V(i),()=>{}}),e(),He(t)}var fr={};function pr(e,t){fr[e]=t}function dr(e,t){return Object.entries(fr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return V},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:Lt,disableEffectScheduling:Rt,stopObservingMutations:Ze,setReactivityEngine:Ct,addRootSelector:Ee,deferMutations:It,mapAttributes:q,evaluateLater:h,setEvaluator:Kt,destroyTree:lt,closestRoot:N,interceptor:ge,transition:Se,setStyles:F,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:T,nextTick:U,prefix:zt,plugin:sr,magic:x,store:cr,start:Qt,clone:ur,data:pr},A=fn;function pt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var Oo={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},To={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Ro=pt(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var mr=Object.freeze({}),Co=Object.freeze([]);var dt=Object.assign;var dn=Object.prototype.hasOwnProperty,ae=(e,t)=>dn.call(e,t),k=Array.isArray,Y=e=>hr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",ce=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,hr=e=>hn.call(e),mt=e=>hr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,Mo=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,No=Ce(e=>e.replace(_n,"-$1").toLowerCase()),ht=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),ko=Ce(e=>e?`on${ht(e)}`:""),gt=(e,t)=>e!==t&&(e===e||t===t);var _t=new WeakMap,le=[],R,j=Symbol("iterate"),yt=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function gr(e,t=mr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function yr(e){e.active&&(_r(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!le.includes(r)){_r(r);try{return vn(),le.push(r),R=r,e()}finally{le.pop(),xr(),R=le[le.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function _r(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var J=!0,xt=[];function wn(){xt.push(J),J=!1}function vn(){xt.push(J),J=!0}function xr(){let e=xt.pop();J=e===void 0?!0:e}function w(e,t,r){if(!J||R===void 0)return;let n=_t.get(e);n||_t.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(R)||(i.add(R),R.deps.push(i),R.options.onTrack&&R.options.onTrack({effect:R,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=_t.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==R||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(j)),Y(e)&&c(s.get(yt)));break;case"delete":k(e)||(c(s.get(j)),Y(e)&&c(s.get(yt)));break;case"set":Y(e)&&c(s.get(j));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=pt("__proto__,__v_isRef,__isVue"),br=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return xr(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:wr:t?Rn:vr).get(n))return n;let s=k(n);if(!e&&s&&ae(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?br.has(i):En(i))||(e||w(n,"get",i),t)?a:bt(a)?!s||!Re(i)?a.value:a:ce(a)?e?Er(a):ke(a):a}}var Mn=Sr(),Nn=Sr(!0);function Sr(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&bt(s)&&!bt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ae(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?gt(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ae(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!br.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":j),Reflect.ownKeys(e)}var Ar={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Or={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Fo=dt({},Ar,{get:An,set:Nn}),jo=dt({},Or,{get:Tn}),vt=e=>ce(e)?ke(e):e,wt=e=>ce(e)?Er(e):e,Et=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?Et:r?wt:vt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",j),Reflect.get(e,"size",e)}function Tr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Cr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Rr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?gt(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Mr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Rr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function Nr(){let e=g(this),t=e.size!==0,r=Y(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?Et:e?wt:vt;return!e&&w(a,"iterate",j),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Fe(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=Y(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?Et:t?wt:vt;return!t&&w(o,"iterate",c?yt:j),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${ht(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var kr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!1)},Dr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!0)},Pr={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Ir={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{kr[e]=Fe(e,!1,!1),Pr[e]=Fe(e,!0,!1),Dr[e]=Fe(e,!1,!0),Ir[e]=Fe(e,!0,!0)});function je(e,t){let r=t?e?Ir:Dr:e?Pr:kr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ae(r,i)&&i in n?r:n,i,o)}var Ln={get:je(!1,!1)},Ko={get:je(!1,!0)},$n={get:je(!0,!1)},zo={get:je(!0,!0)};function Rr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=mt(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var vr=new WeakMap,Rn=new WeakMap,wr=new WeakMap,Cn=new WeakMap;function Fn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function jn(e){return e.__v_skip||!Object.isExtensible(e)?0:Fn(mt(e))}function ke(e){return e&&e.__v_isReadonly?e:Lr(e,!1,Ar,Ln,vr)}function Er(e){return Lr(e,!0,Or,$n,wr)}function Lr(e,t,r,n,i){if(!ce(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=jn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function bt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>U);x("dispatch",e=>$.bind($,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=me(e);B(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",lr);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=ee(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var $r=()=>{};$r.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",$r);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function ue(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ie(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=F(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function fe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function St(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,St((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&jr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&jr(e.key).includes(r[0]))}function jr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=fe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>ue(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?At(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return At(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?At(o):t.includes("trim")?o.trim():o}}})}function At(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(O("cloak")))));tr(()=>`[${O("init")}]`);d("init",G((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});q(ye(":",xe(O("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>ue(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));qt(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),re(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${O("data")}]`);d("data",G((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=te(n,e).cleanup,o={};dr(o,n);let s=b(e,t,{scope:o}),a=te(s,e).cleanup,c=v(s);$t(c);let l=H(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=oe(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=Kr(t,_,f,s);n(C=>u.push(C),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=Kr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],K=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let pe="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([pe,f]);else if(y!==f){let C=c.splice(f,1)[0],M=c.splice(y-1,1)[0];c.splice(f,0,M),c.splice(y,0,C),E.push([C,M])}else K.push(_);pe=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],C=a[_],M=a[y],z=document.createElement("div");m(()=>{M.after(z),C.after(M),z.before(C),z.remove()}),et(M,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],C=_==="template"?o:a[_],M=l[y],z=u[y],de=document.importNode(o.content,!0).firstElementChild;H(de,v(M),o),m(()=>{C.after(de),T(de)}),typeof z=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[z]=de}for(let f=0;f<K.length;f++)et(a[K[f]],l[u.indexOf(K[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function Kr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function zr(){}zr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",zr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return H(a,{},e),m(()=>{e.after(a),T(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});q(ye("@",xe(O("on:"))));d("on",G((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=fe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));A.setEvaluator(rt);A.setReactivityEngine({reactive:ke,effect:gr,release:yr,raw:g});var Ot=A;window.Alpine=Ot;queueMicrotask(()=>{Ot.start()});})();
+`,e),i}}var nt="x-";function A(e=""){return nt+e}function zt(e){nt=e}var Vt={};function d(e,t){Vt[e]=t}function re(e,t,r){let n={};return Array.from(t).map(Bt((o,s)=>n[o]=s)).filter(Ht).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function qt(e){return Array.from(e).map(Bt()).filter(t=>!Ht(t))}var it=!1,ne=new Map,Ut=Symbol();function Wt(e){it=!0;let t=Symbol();Ut=t,ne.set(t,[]);let r=()=>{for(;ne.get(t).length;)ne.get(t).shift()();ne.delete(t)},n=()=>{it=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Vt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=me(e);i.push(a);let c={Alpine:S,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());B(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),it?ne.get(Ut).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Bt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Gt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Gt=[];function q(e){Gt.push(e)}function Ht({name:e}){return Yt().test(e)}var Yt=()=>new RegExp(`^${nt}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Yt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var ot="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",ot,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?ot:e.type,n=be.indexOf(t.type)===-1?ot:t.type;return be.indexOf(r)-be.indexOf(n)}function $(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var st=[],at=!1;function U(e){st.push(e),queueMicrotask(()=>{at||setTimeout(()=>{ve()})})}function ve(){for(at=!1;st.length;)st.shift()()}function Jt(){at=!0}function M(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>M(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)M(n,t,!1),n=n.nextElementSibling}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Qt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),$(document,"alpine:init"),$(document,"alpine:initializing"),Ye(),kt(t=>O(t,M)),Dt(t=>U(()=>ct(t))),Pt((t,r)=>{re(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Zt())).filter(e).forEach(t=>{O(t)}),$(document,"alpine:initialized")}var lt=[],Xt=[];function er(){return lt.map(e=>e())}function Zt(){return lt.concat(Xt).map(e=>e())}function Ee(e){lt.push(e)}function tr(e){Xt.push(e)}function N(e,t=!1){if(!e)return;if((t?Zt():er()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function rr(e){return er().some(t=>e.matches(t))}function O(e,t=M){Wt(()=>{t(e,(r,n)=>{re(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function ct(e){M(e,t=>qe(t))}function ie(e,t){return Array.isArray(t)?nr(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?ie(e,t()):nr(e,t)}function nr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function F(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{F(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){ir(e,ie,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){ir(e,F);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?se(t,"scale",95)/100:1,p=se(t,"delay",0),E=se(t,"origin","center"),I="opacity, transform",K=se(t,"duration",150)/1e3,pe=se(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${K}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${pe}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function ir(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=or(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function or(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:or(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=oe(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:oe(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Jt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function se(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function sr(e){e(S)}var W={},ar=!1;function cr(e,t){if(ar||(W=v(W),ar=!0),t===void 0)return W[e];W[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&W[e].init()}function lr(){return W}var ut=!1;function G(e){return(...t)=>ut||e(...t)}function ur(e,t){t._x_dataStack=e._x_dataStack,ut=!0,un(()=>{ln(t)}),ut=!1}function ln(e){let t=!1;O(e,(n,i)=>{M(n,(o,s)=>{if(t&&rr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return V(i),()=>{}}),e(),He(t)}var fr={};function pr(e,t){fr[e]=t}function dr(e,t){return Object.entries(fr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return V},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:Lt,disableEffectScheduling:Tt,stopObservingMutations:Je,setReactivityEngine:Rt,addRootSelector:Ee,deferMutations:It,mapAttributes:q,evaluateLater:h,setEvaluator:Kt,destroyTree:ct,closestRoot:N,interceptor:ge,transition:Se,setStyles:F,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:O,nextTick:U,prefix:zt,plugin:sr,magic:x,store:cr,start:Qt,clone:ur,data:pr},S=fn;function ft(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var Ao={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},Oo={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var To=ft(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var mr=Object.freeze({}),Ro=Object.freeze([]);var pt=Object.assign;var dn=Object.prototype.hasOwnProperty,ae=(e,t)=>dn.call(e,t),k=Array.isArray,Y=e=>hr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",ce=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,hr=e=>hn.call(e),dt=e=>hr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,Co=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,Mo=Ce(e=>e.replace(_n,"-$1").toLowerCase()),mt=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),No=Ce(e=>e?`on${mt(e)}`:""),ht=(e,t)=>e!==t&&(e===e||t===t);var gt=new WeakMap,le=[],T,j=Symbol("iterate"),_t=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function gr(e,t=mr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function yr(e){e.active&&(_r(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!le.includes(r)){_r(r);try{return vn(),le.push(r),T=r,e()}finally{le.pop(),xr(),T=le[le.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function _r(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var J=!0,yt=[];function wn(){yt.push(J),J=!1}function vn(){yt.push(J),J=!0}function xr(){let e=yt.pop();J=e===void 0?!0:e}function w(e,t,r){if(!J||T===void 0)return;let n=gt.get(e);n||gt.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(T)||(i.add(T),T.deps.push(i),T.options.onTrack&&T.options.onTrack({effect:T,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=gt.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==T||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(j)),Y(e)&&c(s.get(_t)));break;case"delete":k(e)||(c(s.get(j)),Y(e)&&c(s.get(_t)));break;case"set":Y(e)&&c(s.get(j));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=ft("__proto__,__v_isRef,__isVue"),br=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return xr(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:wr:t?Rn:vr).get(n))return n;let s=k(n);if(!e&&s&&ae(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?br.has(i):En(i))||(e||w(n,"get",i),t)?a:xt(a)?!s||!Re(i)?a.value:a:ce(a)?e?Er(a):ke(a):a}}var Mn=Sr(),Nn=Sr(!0);function Sr(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&xt(s)&&!xt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ae(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?ht(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ae(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!br.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":j),Reflect.ownKeys(e)}var Ar={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Or={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},$o=pt({},Ar,{get:An,set:Nn}),Fo=pt({},Or,{get:Tn}),bt=e=>ce(e)?ke(e):e,vt=e=>ce(e)?Er(e):e,wt=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?wt:r?vt:bt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",j),Reflect.get(e,"size",e)}function Tr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Cr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Rr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?ht(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Mr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Rr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function Nr(){let e=g(this),t=e.size!==0,r=Y(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?wt:e?vt:bt;return!e&&w(a,"iterate",j),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Fe(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=Y(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?wt:t?vt:bt;return!t&&w(o,"iterate",c?_t:j),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${mt(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var kr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!1)},Dr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!0)},Pr={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Ir={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{kr[e]=Fe(e,!1,!1),Pr[e]=Fe(e,!0,!1),Dr[e]=Fe(e,!1,!0),Ir[e]=Fe(e,!0,!0)});function je(e,t){let r=t?e?Ir:Dr:e?Pr:kr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ae(r,i)&&i in n?r:n,i,o)}var Ln={get:je(!1,!1)},jo={get:je(!1,!0)},$n={get:je(!0,!1)},Ko={get:je(!0,!0)};function Rr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=dt(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var vr=new WeakMap,Rn=new WeakMap,wr=new WeakMap,Cn=new WeakMap;function Fn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function jn(e){return e.__v_skip||!Object.isExtensible(e)?0:Fn(dt(e))}function ke(e){return e&&e.__v_isReadonly?e:Lr(e,!1,Ar,Ln,vr)}function Er(e){return Lr(e,!0,Or,$n,wr)}function Lr(e,t,r,n,i){if(!ce(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=jn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function xt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>U);x("dispatch",e=>$.bind($,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=me(e);B(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",lr);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=ee(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var $r=()=>{};$r.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",$r);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function ue(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ie(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=F(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function fe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=Et(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=Et(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Et(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Et((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&jr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&jr(e.key).includes(r[0]))}function jr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=fe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>ue(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?St(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return St(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?St(o):t.includes("trim")?o.trim():o}}})}function St(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(A("cloak")))));tr(()=>`[${A("init")}]`);d("init",G((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});q(ye(":",xe(A("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>ue(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));qt(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),re(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${A("data")}]`);d("data",G((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=te(n,e).cleanup,o={};dr(o,n);let s=b(e,t,{scope:o}),a=te(s,e).cleanup,c=v(s);$t(c);let l=H(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=oe(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=Kr(t,_,f,s);n(R=>u.push(R),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=Kr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],K=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let pe="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([pe,f]);else if(y!==f){let R=c.splice(f,1)[0],C=c.splice(y-1,1)[0];c.splice(f,0,C),c.splice(y,0,R),E.push([R,C])}else K.push(_);pe=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],R=a[_],C=a[y],z=document.createElement("div");m(()=>{C.after(z),R.after(C),z.before(R),z.remove()}),Xe(C,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],R=_==="template"?o:a[_],C=l[y],z=u[y],de=document.importNode(o.content,!0).firstElementChild;H(de,v(C),o),m(()=>{R.after(de),O(de)}),typeof z=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[z]=de}for(let f=0;f<K.length;f++)Xe(a[K[f]],l[u.indexOf(K[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function Kr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function zr(){}zr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",zr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return H(a,{},e),m(()=>{e.after(a),O(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});q(ye("@",xe(A("on:"))));d("on",G((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=fe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));S.setEvaluator(tt);S.setReactivityEngine({reactive:ke,effect:gr,release:yr,raw:g});var At=S;window.Alpine=At;queueMicrotask(()=>{At.start()});})();
diff --git a/alpinejs/packages/alpinejs/dist/dist/cdn.js b/alpinejs/packages/alpinejs/dist/dist/cdn.js
deleted file mode 100644
index 90b1dc6..0000000
--- a/alpinejs/packages/alpinejs/dist/dist/cdn.js
+++ /dev/null
@@ -1,2660 +0,0 @@
-(() => {
- // packages/alpinejs/src/scheduler.js
- var flushPending = false;
- var flushing = false;
- var queue = [];
- function scheduler(callback) {
- queueJob(callback);
- }
- function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
- }
- function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
- }
- function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
- }
-
- // packages/alpinejs/src/reactivity.js
- var reactive;
- var effect;
- var release;
- var raw;
- var shouldSchedule = true;
- function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
- }
- function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
- }
- function overrideEffect(override) {
- effect = override;
- }
- function elementBoundEffect(el) {
- let cleanup2 = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup2 = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup2();
- }];
- }
-
- // packages/alpinejs/src/utils/walk.js
- function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
- }
-
- // packages/alpinejs/src/mutation.js
- var onAttributeAddeds = [];
- var onElRemoveds = [];
- var onElAddeds = [];
- function onElAdded(callback) {
- onElAddeds.push(callback);
- }
- function onElRemoved(callback) {
- onElRemoveds.push(callback);
- }
- function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
- }
- function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
- }
- function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
- }
- var observer = new MutationObserver(onMutate);
- var currentlyObserving = false;
- function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
- }
- function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
- }
- var recordQueue = [];
- var willProcessRecordQueue = false;
- function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
- }
- function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
- }
- function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
- }
- var isCollecting = false;
- var deferredMutations = [];
- function deferMutations() {
- isCollecting = true;
- }
- function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
- }
- function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add2 = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add2();
- } else if (el.hasAttribute(name)) {
- remove();
- add2();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
- }
-
- // packages/alpinejs/src/scope.js
- function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
- }
- function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
- }
- function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
- }
- function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
- }
-
- // packages/alpinejs/src/interceptor.js
- function initInterceptors(data2) {
- let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject2(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
- }
- function interceptor(callback, mutateObj = () => {
- }) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
- }
- function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
- }
- function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
- }
-
- // packages/alpinejs/src/magics.js
- var magics = {};
- function magic(name, callback) {
- magics[name] = callback;
- }
- function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
- }
-
- // packages/alpinejs/src/evaluator.js
- function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
- }
- function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
- }
- var theEvaluatorFunction = normalEvaluator;
- function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
- }
- function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup2 = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup2);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
- }
- function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
- }
- var evaluatorMemo = {};
- function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
- }
- function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
- }
- function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
- }
- function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
- }
-
- // packages/alpinejs/src/directives.js
- var prefixAsString = "x-";
- function prefix(subject = "") {
- return prefixAsString + subject;
- }
- function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
- }
- var directiveHandlers = {};
- function directive(name, callback) {
- directiveHandlers[name] = callback;
- }
- function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
- }
- function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
- }
- var isDeferringHandlers = false;
- var directiveHandlerStacks = new Map();
- var currentHandlerStackKey = Symbol();
- function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
- }
- function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup2 = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup: cleanup2,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
- }
- var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
- };
- var into = (i) => i;
- function toTransformedAttributes(callback = () => {
- }) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
- }
- var attributeTransformers = [];
- function mapAttributes(callback) {
- attributeTransformers.push(callback);
- }
- function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
- }
- var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
- function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
- }
- var DEFAULT = "DEFAULT";
- var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
- ];
- function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
- }
-
- // packages/alpinejs/src/utils/dispatch.js
- function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
- }
-
- // packages/alpinejs/src/nextTick.js
- var tickStack = [];
- var isHolding = false;
- function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
- }
- function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
- }
- function holdNextTicks() {
- isHolding = true;
- }
-
- // packages/alpinejs/src/utils/warn.js
- function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
- }
-
- // packages/alpinejs/src/lifecycle.js
- function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
- }
- var rootSelectorCallbacks = [];
- var initSelectorCallbacks = [];
- function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
- }
- function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
- }
- function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
- }
- function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
- }
- function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
- }
- function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
- }
- function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
- }
- function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
- }
-
- // packages/alpinejs/src/utils/classes.js
- function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
- }
- function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
- }
- function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
- }
-
- // packages/alpinejs/src/utils/styles.js
- function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
- }
- function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
- }
- function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
- }
- function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
- }
-
- // packages/alpinejs/src/utils/once.js
- function once(callback, fallback = () => {
- }) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
- }
-
- // packages/alpinejs/src/directives/x-transition.js
- directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
- });
- function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
- }
- function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
- }
- function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
- }
- window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
- };
- function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
- }
- function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
- }, after = () => {
- }) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
- }
- function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
- }
- function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
- }
-
- // packages/alpinejs/src/utils/debounce.js
- function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
- }
-
- // packages/alpinejs/src/utils/throttle.js
- function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
- }
-
- // packages/alpinejs/src/plugin.js
- function plugin(callback) {
- callback(alpine_default);
- }
-
- // packages/alpinejs/src/store.js
- var stores = {};
- var isReactive = false;
- function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
- }
- function getStores() {
- return stores;
- }
-
- // packages/alpinejs/src/clone.js
- var isCloning = false;
- function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
- }
- function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
- }
- function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
- }
- function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
- }
-
- // packages/alpinejs/src/datas.js
- var datas = {};
- function data(name, callback) {
- datas[name] = callback;
- }
- function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
- }
-
- // packages/alpinejs/src/alpine.js
- var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
- };
- var alpine_default = Alpine;
-
- // node_modules/@vue/shared/dist/shared.esm-bundler.js
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var EMPTY_OBJ = true ? Object.freeze({}) : {};
- var EMPTY_ARR = true ? Object.freeze([]) : [];
- var extend = Object.assign;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
-
- // node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol(true ? "iterate" : "");
- var MAP_KEY_ITERATE_KEY = Symbol(true ? "Map key iterate" : "");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect2(fn, options = EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect3 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect3();
- }
- return effect3;
- }
- function stop(effect3) {
- if (effect3.active) {
- cleanup(effect3);
- if (effect3.options.onStop) {
- effect3.options.onStop();
- }
- effect3.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect3 = function reactiveEffect() {
- if (!effect3.active) {
- return fn();
- }
- if (!effectStack.includes(effect3)) {
- cleanup(effect3);
- try {
- enableTracking();
- effectStack.push(effect3);
- activeEffect = effect3;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect3.id = uid++;
- effect3.allowRecurse = !!options.allowRecurse;
- effect3._isEffect = true;
- effect3.active = true;
- effect3.raw = fn;
- effect3.deps = [];
- effect3.options = options;
- return effect3;
- }
- function cleanup(effect3) {
- const {deps} = effect3;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect3);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect3) => {
- if (effect3 !== activeEffect || effect3.allowRecurse) {
- effects.add(effect3);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect3) => {
- if (effect3.options.onTrigger) {
- effect3.options.onTrigger({
- effect: effect3,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect3.options.scheduler) {
- effect3.options.scheduler(effect3);
- } else {
- effect3();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly;
- } else if (key === "__v_isReadonly") {
- return isReadonly;
- } else if (key === "__v_raw" && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = isArray(target);
- if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (isObject(res)) {
- return isReadonly ? readonly(res) : reactive2(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw(value);
- oldValue = toRaw(oldValue);
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- if (true) {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- if (true) {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => isObject(value) ? reactive2(value) : value;
- var toReadonly = (value) => isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (key !== rawKey) {
- !isReadonly && track(rawTarget, "get", key);
- }
- !isReadonly && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (key !== rawKey) {
- !isReadonly && track(rawTarget, "has", key);
- }
- !isReadonly && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly = false) {
- target = target["__v_raw"];
- !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw(value);
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw(value);
- const target = toRaw(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (true) {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (true) {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0;
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw(target);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- !isReadonly && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- if (true) {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly, shallow) {
- const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly;
- } else if (key === "__v_isReadonly") {
- return isReadonly;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
- }
- function reactive2(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject(target)) {
- if (true) {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function toRaw(observed) {
- return observed && toRaw(observed["__v_raw"]) || observed;
- }
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
-
- // packages/alpinejs/src/magics/$nextTick.js
- magic("nextTick", () => nextTick);
-
- // packages/alpinejs/src/magics/$dispatch.js
- magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
- // packages/alpinejs/src/magics/$watch.js
- magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
- });
-
- // packages/alpinejs/src/magics/$store.js
- magic("store", getStores);
-
- // packages/alpinejs/src/magics/$root.js
- magic("root", (el) => closestRoot(el));
-
- // packages/alpinejs/src/magics/$refs.js
- magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
- });
- function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
- }
-
- // packages/alpinejs/src/magics/$el.js
- magic("el", (el) => el);
-
- // packages/alpinejs/src/directives/x-ignore.js
- var handler = () => {
- };
- handler.inline = (el, {modifiers}, {cleanup: cleanup2}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup2(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
- };
- directive("ignore", handler);
-
- // packages/alpinejs/src/directives/x-effect.js
- directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
- // packages/alpinejs/src/utils/bind.js
- function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
- }
- function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
- }
- function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
- }
- function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
- }
- function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr2(name))
- value = name;
- setIfChanged(el, name, value);
- }
- }
- function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
- }
- function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
- }
- function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
- }
- function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
- }
- function isBooleanAttr2(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
- }
- function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
- }
-
- // packages/alpinejs/src/utils/on.js
- function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
- }
- function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
- }
- function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
- }
- function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
- function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
- }
- function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
- }
- function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
- }
- function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
- }
-
- // packages/alpinejs/src/directives/x-model.js
- directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup: cleanup2}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup2(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
- });
- function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
- }
- function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
- }
- function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
- }
- function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
-
- // packages/alpinejs/src/directives/x-cloak.js
- directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
- // packages/alpinejs/src/directives/x-init.js
- addInitSelector(() => `[${prefix("init")}]`);
- directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
- }));
-
- // packages/alpinejs/src/directives/x-text.js
- directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
- });
-
- // packages/alpinejs/src/directives/x-html.js
- directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
- });
-
- // packages/alpinejs/src/directives/x-bind.js
- mapAttributes(startingWith(":", into(prefix("bind:"))));
- directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
- });
- function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
- }
- function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
- }
-
- // packages/alpinejs/src/directives/x-data.js
- addRootSelector(() => `[${prefix("data")}]`);
- directive("data", skipDuringClone((el, {expression}, {cleanup: cleanup2}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup22 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup2(() => {
- undo();
- cleanup1();
- cleanup22();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
- }));
-
- // packages/alpinejs/src/directives/x-show.js
- directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
- });
-
- // packages/alpinejs/src/directives/x-for.js
- directive("for", (el, {expression}, {effect: effect3, cleanup: cleanup2}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup2(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
- });
- function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject2 = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject2(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
- }
- function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
- }
- function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
- }
- function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
-
- // packages/alpinejs/src/directives/x-ref.js
- function handler2() {
- }
- handler2.inline = (el, {expression}, {cleanup: cleanup2}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup2(() => delete root._x_refs[expression]);
- };
- directive("ref", handler2);
-
- // packages/alpinejs/src/directives/x-if.js
- directive("if", (el, {expression}, {effect: effect3, cleanup: cleanup2}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup2(() => el._x_undoIf && el._x_undoIf());
- });
-
- // packages/alpinejs/src/directives/x-on.js
- mapAttributes(startingWith("@", into(prefix("on:"))));
- directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup: cleanup2}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup2(() => removeListener());
- }));
-
- // packages/alpinejs/src/index.js
- alpine_default.setEvaluator(normalEvaluator);
- alpine_default.setReactivityEngine({reactive: reactive2, effect: effect2, release: stop, raw: toRaw});
- var src_default = alpine_default;
-
- // packages/alpinejs/builds/cdn.js
- window.Alpine = src_default;
- queueMicrotask(() => {
- src_default.start();
- });
-})();
diff --git a/alpinejs/packages/alpinejs/dist/dist/cdn.min.js b/alpinejs/packages/alpinejs/dist/dist/cdn.min.js
deleted file mode 100644
index 0477350..0000000
--- a/alpinejs/packages/alpinejs/dist/dist/cdn.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-(()=>{var Ke=!1,ze=!1,Z=[];function Tt(e){Vr(e)}function Vr(e){Z.includes(e)||Z.push(e),Br()}function Br(){!ze&&!Ke&&(Ke=!0,queueMicrotask(Hr))}function Hr(){Ke=!1,ze=!0;for(let e=0;e<Z.length;e++)Z[e]();Z.length=0,ze=!1}var v,L,V,Ve,Be=!0;function Rt(e){Be=!1,e(),Be=!0}function Ct(e){v=e.reactive,V=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Tt(r):r()}}),Ve=e.raw}function He(e){L=e}function me(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),V(i))}},()=>{t()}]}function S(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>S(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)S(n,t,!1),n=n.nextElementSibling}var Mt=[],qe=[],Nt=[];function kt(e){Nt.push(e)}function Dt(e){qe.push(e)}function Pt(e){Mt.push(e)}function B(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ue(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var Ge=new MutationObserver(We),Ye=!1;function Je(){Ge.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ye=!0}function Ze(){qr(),Ge.disconnect(),Ye=!1}var Q=[],Qe=!1;function qr(){Q=Q.concat(Ge.takeRecords()),Q.length&&!Qe&&(Qe=!0,queueMicrotask(()=>{Ur(),Qe=!1}))}function Ur(){We(Q),Q.length=0}function m(e){if(!Ye)return e();Ze();let t=e();return Je(),t}var Xe=!1,he=[];function It(){Xe=!0}function Lt(){Xe=!1,We(he),he=[]}function We(e){if(Xe){he=he.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Ue(s,o)}),n.forEach((o,s)=>{Mt.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||Nt.forEach(s=>s(o));for(let o of r)t.includes(o)||(qe.forEach(s=>s(o)),o.localName==="body"&&o.querySelectorAll("[x-data]").forEach(s=>{S(s,a=>{qe.forEach(c=>c(a)),a.remove()})}));t=null,r=null,n=null,i=null}function H(e,t,r){return e._x_dataStack=[t,...X(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function et(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function X(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?X(e.host):e.parentNode?X(e.parentNode):[]}function ee(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function $t(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function ge(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Wr(n,i),s=>tt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Wr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function tt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),tt(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function te(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:A,interceptor:ge})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return jt(...e)}var jt=rt;function Kt(e){jt=e}function rt(e,t){let r={},n=te(r,e).cleanup;B(e,"evaluator",n);let i=[r,...X(e)];if(typeof t=="function")return Gr(i,t);let o=Yr(i,t);return Jr.bind(null,e,t,o)}function Gr(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(ee([n,...e]),i);_e(r,o)}}var nt={};function Zr(e){if(nt[e])return nt[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return nt[e]=n,n}function Yr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=ee([i,...e]),a=r(r,s);r.finished?_e(n,r.result,s,o):a.then(c=>{_e(n,c,s,o)})}}function _e(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>_e(e,o,r,n)):e(i)}else e(t)}function Jr(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
-
-Expression: "${t}"
-
-`,e),i}}var it="x-";function O(e=""){return it+e}function zt(e){it=e}var Vt={};function d(e,t){Vt[e]=t}function re(e,t,r){let n={};return Array.from(t).map(Bt((o,s)=>n[o]=s)).filter(Ht).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function qt(e){return Array.from(e).map(Bt()).filter(t=>!Ht(t))}var ot=!1,ne=new Map,Ut=Symbol();function Wt(e){ot=!0;let t=Symbol();Ut=t,ne.set(t,[]);let r=()=>{for(;ne.get(t).length;)ne.get(t).shift()();ne.delete(t)},n=()=>{ot=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Vt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=me(e);i.push(a);let c={Alpine:A,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());B(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),ot?ne.get(Ut).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Bt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Gt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Gt=[];function q(e){Gt.push(e)}function Ht({name:e}){return Yt().test(e)}var Yt=()=>new RegExp(`^${it}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Yt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var st="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",st,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?st:e.type,n=be.indexOf(t.type)===-1?st:t.type;return be.indexOf(r)-be.indexOf(n)}function $(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var at=[],ct=!1;function U(e){at.push(e),queueMicrotask(()=>{ct||setTimeout(()=>{ve()})})}function ve(){for(ct=!1;at.length;)at.shift()()}function Jt(){ct=!0}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Qt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),$(document,"alpine:init"),$(document,"alpine:initializing"),Je(),kt(t=>T(t,S)),Dt(t=>U(()=>lt(t))),Pt((t,r)=>{re(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Zt())).filter(e).forEach(t=>{T(t)}),$(document,"alpine:initialized")}var ut=[],Xt=[];function er(){return ut.map(e=>e())}function Zt(){return ut.concat(Xt).map(e=>e())}function Ee(e){ut.push(e)}function tr(e){Xt.push(e)}function N(e,t=!1){if(!e)return;if((t?Zt():er()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function rr(e){return er().some(t=>e.matches(t))}function T(e,t=S){Wt(()=>{t(e,(r,n)=>{re(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function lt(e){S(e,t=>Ue(t))}function ie(e,t){return Array.isArray(t)?nr(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?ie(e,t()):nr(e,t)}function nr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function F(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{F(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function oe(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){ir(e,ie,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){ir(e,F);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?se(t,"scale",95)/100:1,p=se(t,"delay",0),E=se(t,"origin","center"),I="opacity, transform",K=se(t,"duration",150)/1e3,pe=se(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${K}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${pe}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function ir(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=or(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function or(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:or(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=oe(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:oe(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Jt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function se(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function sr(e){e(A)}var W={},ar=!1;function cr(e,t){if(ar||(W=v(W),ar=!0),t===void 0)return W[e];W[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&W[e].init()}function lr(){return W}var ft=!1;function G(e){return(...t)=>ft||e(...t)}function ur(e,t){t._x_dataStack=e._x_dataStack,ft=!0,un(()=>{ln(t)}),ft=!1}function ln(e){let t=!1;T(e,(n,i)=>{S(n,(o,s)=>{if(t&&rr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return V(i),()=>{}}),e(),He(t)}var fr={};function pr(e,t){fr[e]=t}function dr(e,t){return Object.entries(fr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return V},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:Lt,disableEffectScheduling:Rt,stopObservingMutations:Ze,setReactivityEngine:Ct,addRootSelector:Ee,deferMutations:It,mapAttributes:q,evaluateLater:h,setEvaluator:Kt,destroyTree:lt,closestRoot:N,interceptor:ge,transition:Se,setStyles:F,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:T,nextTick:U,prefix:zt,plugin:sr,magic:x,store:cr,start:Qt,clone:ur,data:pr},A=fn;function pt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var Oo={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},To={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Ro=pt(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var mr=Object.freeze({}),Co=Object.freeze([]);var dt=Object.assign;var dn=Object.prototype.hasOwnProperty,ae=(e,t)=>dn.call(e,t),k=Array.isArray,Y=e=>hr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",ce=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,hr=e=>hn.call(e),mt=e=>hr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,Mo=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,No=Ce(e=>e.replace(_n,"-$1").toLowerCase()),ht=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),ko=Ce(e=>e?`on${ht(e)}`:""),gt=(e,t)=>e!==t&&(e===e||t===t);var _t=new WeakMap,le=[],R,j=Symbol("iterate"),yt=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function gr(e,t=mr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function yr(e){e.active&&(_r(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!le.includes(r)){_r(r);try{return vn(),le.push(r),R=r,e()}finally{le.pop(),xr(),R=le[le.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function _r(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var J=!0,xt=[];function wn(){xt.push(J),J=!1}function vn(){xt.push(J),J=!0}function xr(){let e=xt.pop();J=e===void 0?!0:e}function w(e,t,r){if(!J||R===void 0)return;let n=_t.get(e);n||_t.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(R)||(i.add(R),R.deps.push(i),R.options.onTrack&&R.options.onTrack({effect:R,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=_t.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==R||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(j)),Y(e)&&c(s.get(yt)));break;case"delete":k(e)||(c(s.get(j)),Y(e)&&c(s.get(yt)));break;case"set":Y(e)&&c(s.get(j));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=pt("__proto__,__v_isRef,__isVue"),br=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return xr(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:wr:t?Rn:vr).get(n))return n;let s=k(n);if(!e&&s&&ae(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?br.has(i):En(i))||(e||w(n,"get",i),t)?a:bt(a)?!s||!Re(i)?a.value:a:ce(a)?e?Er(a):ke(a):a}}var Mn=Sr(),Nn=Sr(!0);function Sr(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&bt(s)&&!bt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ae(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?gt(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ae(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!br.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":j),Reflect.ownKeys(e)}var Ar={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Or={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Fo=dt({},Ar,{get:An,set:Nn}),jo=dt({},Or,{get:Tn}),vt=e=>ce(e)?ke(e):e,wt=e=>ce(e)?Er(e):e,Et=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?Et:r?wt:vt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",j),Reflect.get(e,"size",e)}function Tr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Cr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Rr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?gt(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Mr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Rr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function Nr(){let e=g(this),t=e.size!==0,r=Y(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?Et:e?wt:vt;return!e&&w(a,"iterate",j),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Fe(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=Y(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?Et:t?wt:vt;return!t&&w(o,"iterate",c?yt:j),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${ht(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var kr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!1)},Dr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Tr,set:Cr,delete:Mr,clear:Nr,forEach:$e(!1,!0)},Pr={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Ir={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{kr[e]=Fe(e,!1,!1),Pr[e]=Fe(e,!0,!1),Dr[e]=Fe(e,!1,!0),Ir[e]=Fe(e,!0,!0)});function je(e,t){let r=t?e?Ir:Dr:e?Pr:kr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ae(r,i)&&i in n?r:n,i,o)}var Ln={get:je(!1,!1)},Ko={get:je(!1,!0)},$n={get:je(!0,!1)},zo={get:je(!0,!0)};function Rr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=mt(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var vr=new WeakMap,Rn=new WeakMap,wr=new WeakMap,Cn=new WeakMap;function Fn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function jn(e){return e.__v_skip||!Object.isExtensible(e)?0:Fn(mt(e))}function ke(e){return e&&e.__v_isReadonly?e:Lr(e,!1,Ar,Ln,vr)}function Er(e){return Lr(e,!0,Or,$n,wr)}function Lr(e,t,r,n,i){if(!ce(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=jn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function bt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>U);x("dispatch",e=>$.bind($,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=me(e);B(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",lr);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=ee(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var $r=()=>{};$r.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",$r);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function ue(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ie(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=F(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function fe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function St(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,St((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&jr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&jr(e.key).includes(r[0]))}function jr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=fe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>ue(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?At(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return At(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?At(o):t.includes("trim")?o.trim():o}}})}function At(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(O("cloak")))));tr(()=>`[${O("init")}]`);d("init",G((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});q(ye(":",xe(O("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>ue(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));qt(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),re(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${O("data")}]`);d("data",G((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=te(n,e).cleanup,o={};dr(o,n);let s=b(e,t,{scope:o}),a=te(s,e).cleanup,c=v(s);$t(c);let l=H(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=oe(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=Kr(t,_,f,s);n(C=>u.push(C),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=Kr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],K=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let pe="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([pe,f]);else if(y!==f){let C=c.splice(f,1)[0],M=c.splice(y-1,1)[0];c.splice(f,0,M),c.splice(y,0,C),E.push([C,M])}else K.push(_);pe=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],C=a[_],M=a[y],z=document.createElement("div");m(()=>{M.after(z),C.after(M),z.before(C),z.remove()}),et(M,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],C=_==="template"?o:a[_],M=l[y],z=u[y],de=document.importNode(o.content,!0).firstElementChild;H(de,v(M),o),m(()=>{C.after(de),T(de)}),typeof z=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[z]=de}for(let f=0;f<K.length;f++)et(a[K[f]],l[u.indexOf(K[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function Kr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function zr(){}zr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",zr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return H(a,{},e),m(()=>{e.after(a),T(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});q(ye("@",xe(O("on:"))));d("on",G((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=fe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));A.setEvaluator(rt);A.setReactivityEngine({reactive:ke,effect:gr,release:yr,raw:g});var Ot=A;window.Alpine=Ot;queueMicrotask(()=>{Ot.start()});})();
diff --git a/alpinejs/packages/alpinejs/dist/dist/module.cjs.js b/alpinejs/packages/alpinejs/dist/dist/module.cjs.js
deleted file mode 100644
index b2382e7..0000000
--- a/alpinejs/packages/alpinejs/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,3245 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module2) => () => {
- if (!module2) {
- module2 = {exports: {}};
- callback(module2.exports, module2);
- }
- return module2.exports;
-};
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-var __exportStar = (target, module2, desc) => {
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
- for (let key of __getOwnPropNames(module2))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module2) => {
- return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
-};
-
-// node_modules/@vue/shared/dist/shared.cjs.js
-var require_shared_cjs = __commonJS((exports2) => {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
- var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
- var range = 2;
- function generateCodeFrame(source, start2 = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start2) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
- const lineLength = lines[j].length;
- if (j === i) {
- const pad = start2 - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start2);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
- var attrValidationCache = {};
- function isSSRSafeAttrName(name) {
- if (attrValidationCache.hasOwnProperty(name)) {
- return attrValidationCache[name];
- }
- const isUnsafe = unsafeAttrCharRE.test(name);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name}`);
- }
- return attrValidationCache[name] = !isUnsafe;
- }
- var propsToAttrMap = {
- acceptCharset: "accept-charset",
- className: "class",
- htmlFor: "for",
- httpEquiv: "http-equiv"
- };
- var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);
- var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`);
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isObject(value)) {
- return value;
- }
- }
- var listDelimiterRE = /;(?![^(]*\))/g;
- var propertyDelimiterRE = /:(.+)/;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- let ret = "";
- if (!styles) {
- return ret;
- }
- for (const key in styles) {
- const value = styles[key];
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) {
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
- var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
- var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
- var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
- var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
- var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
- var escapeRE = /["'&<>]/;
- function escapeHtml(string) {
- const str = "" + string;
- const match = escapeRE.exec(str);
- if (!match) {
- return str;
- }
- let html = "";
- let escaped;
- let index;
- let lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- escaped = "&quot;";
- break;
- case 38:
- escaped = "&amp;";
- break;
- case 39:
- escaped = "&#39;";
- break;
- case 60:
- escaped = "&lt;";
- break;
- case 62:
- escaped = "&gt;";
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escaped;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
- function escapeHtmlComment(src) {
- return src.replace(commentStripRE, "");
- }
- function looseCompareArrays(a, b) {
- if (a.length !== b.length)
- return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b)
- return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex((item) => looseEqual(item, val));
- }
- var toDisplayString = (val) => {
- return val == null ? "" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);
- };
- var replacer = (_key, val) => {
- if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
- entries[`${key} =>`] = val2;
- return entries;
- }, {})
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()]
- };
- } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
- return String(val);
- }
- return val;
- };
- var babelParserDefaultPlugins = [
- "bigInt",
- "optionalChaining",
- "nullishCoalescingOperator"
- ];
- var EMPTY_OBJ = Object.freeze({});
- var EMPTY_ARR = Object.freeze([]);
- var NOOP = () => {
- };
- var NO = () => false;
- var onRE = /^on[^a-z]/;
- var isOn = (key) => onRE.test(key);
- var isModelListener = (key) => key.startsWith("onUpdate:");
- var extend = Object.assign;
- var remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isSet = (val) => toTypeString(val) === "[object Set]";
- var isDate = (val) => val instanceof Date;
- var isFunction = (val) => typeof val === "function";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var isPromise = (val) => {
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
- };
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isPlainObject = (val) => toTypeString(val) === "[object Object]";
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
- var invokeArrayFns = (fns, arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](arg);
- }
- };
- var def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- var toNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- var _globalThis;
- var getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- exports2.EMPTY_ARR = EMPTY_ARR;
- exports2.EMPTY_OBJ = EMPTY_OBJ;
- exports2.NO = NO;
- exports2.NOOP = NOOP;
- exports2.PatchFlagNames = PatchFlagNames;
- exports2.babelParserDefaultPlugins = babelParserDefaultPlugins;
- exports2.camelize = camelize;
- exports2.capitalize = capitalize;
- exports2.def = def;
- exports2.escapeHtml = escapeHtml;
- exports2.escapeHtmlComment = escapeHtmlComment;
- exports2.extend = extend;
- exports2.generateCodeFrame = generateCodeFrame;
- exports2.getGlobalThis = getGlobalThis;
- exports2.hasChanged = hasChanged;
- exports2.hasOwn = hasOwn;
- exports2.hyphenate = hyphenate;
- exports2.invokeArrayFns = invokeArrayFns;
- exports2.isArray = isArray;
- exports2.isBooleanAttr = isBooleanAttr2;
- exports2.isDate = isDate;
- exports2.isFunction = isFunction;
- exports2.isGloballyWhitelisted = isGloballyWhitelisted;
- exports2.isHTMLTag = isHTMLTag;
- exports2.isIntegerKey = isIntegerKey;
- exports2.isKnownAttr = isKnownAttr;
- exports2.isMap = isMap;
- exports2.isModelListener = isModelListener;
- exports2.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;
- exports2.isObject = isObject;
- exports2.isOn = isOn;
- exports2.isPlainObject = isPlainObject;
- exports2.isPromise = isPromise;
- exports2.isReservedProp = isReservedProp;
- exports2.isSSRSafeAttrName = isSSRSafeAttrName;
- exports2.isSVGTag = isSVGTag;
- exports2.isSet = isSet;
- exports2.isSpecialBooleanAttr = isSpecialBooleanAttr;
- exports2.isString = isString;
- exports2.isSymbol = isSymbol;
- exports2.isVoidTag = isVoidTag;
- exports2.looseEqual = looseEqual;
- exports2.looseIndexOf = looseIndexOf;
- exports2.makeMap = makeMap;
- exports2.normalizeClass = normalizeClass;
- exports2.normalizeStyle = normalizeStyle;
- exports2.objectToString = objectToString;
- exports2.parseStringStyle = parseStringStyle;
- exports2.propsToAttrMap = propsToAttrMap;
- exports2.remove = remove;
- exports2.slotFlagsText = slotFlagsText;
- exports2.stringifyStyle = stringifyStyle;
- exports2.toDisplayString = toDisplayString;
- exports2.toHandlerKey = toHandlerKey;
- exports2.toNumber = toNumber;
- exports2.toRawType = toRawType;
- exports2.toTypeString = toTypeString;
-});
-
-// node_modules/@vue/shared/index.js
-var require_shared = __commonJS((exports2, module2) => {
- "use strict";
- if (false) {
- module2.exports = null;
- } else {
- module2.exports = require_shared_cjs();
- }
-});
-
-// node_modules/@vue/reactivity/dist/reactivity.cjs.js
-var require_reactivity_cjs = __commonJS((exports2) => {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- var shared = require_shared();
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol("iterate");
- var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect3(fn, options = shared.EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect4 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect4();
- }
- return effect4;
- }
- function stop2(effect4) {
- if (effect4.active) {
- cleanup(effect4);
- if (effect4.options.onStop) {
- effect4.options.onStop();
- }
- effect4.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect4 = function reactiveEffect() {
- if (!effect4.active) {
- return fn();
- }
- if (!effectStack.includes(effect4)) {
- cleanup(effect4);
- try {
- enableTracking();
- effectStack.push(effect4);
- activeEffect = effect4;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect4.id = uid++;
- effect4.allowRecurse = !!options.allowRecurse;
- effect4._isEffect = true;
- effect4.active = true;
- effect4.raw = fn;
- effect4.deps = [];
- effect4.options = options;
- return effect4;
- }
- function cleanup(effect4) {
- const {deps} = effect4;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect4);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect4) => {
- if (effect4 !== activeEffect || effect4.allowRecurse) {
- effects.add(effect4);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && shared.isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (shared.isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (shared.isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect4) => {
- if (effect4.options.onTrigger) {
- effect4.options.onTrigger({
- effect: effect4,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect4.options.scheduler) {
- effect4.options.scheduler(effect4);
- } else {
- effect4();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw2(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw2));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly2 = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = shared.isArray(target);
- if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (shared.isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive3(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw2(value);
- oldValue = toRaw2(oldValue);
- if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw2(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = shared.hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = shared.extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = shared.extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;
- var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly2 = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "get", key);
- }
- !isReadonly2 && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "has", key);
- }
- !isReadonly2 && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw2(this);
- const hadItems = target.size !== 0;
- const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly2, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw2(target);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const targetIsMap = shared.isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw2(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = shared.toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));
- }
- function reactive3(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function shallowReactive(target) {
- return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function shallowReadonly(target) {
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!shared.isObject(target)) {
- {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive2(value) {
- if (isReadonly(value)) {
- return isReactive2(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isProxy(value) {
- return isReactive2(value) || isReadonly(value);
- }
- function toRaw2(observed) {
- return observed && toRaw2(observed["__v_raw"]) || observed;
- }
- function markRaw(value) {
- shared.def(value, "__v_skip", true);
- return value;
- }
- var convert = (val) => shared.isObject(val) ? reactive3(val) : val;
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
- function ref(value) {
- return createRef(value);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- var RefImpl = class {
- constructor(_rawValue, _shallow = false) {
- this._rawValue = _rawValue;
- this._shallow = _shallow;
- this.__v_isRef = true;
- this._value = _shallow ? _rawValue : convert(_rawValue);
- }
- get value() {
- track(toRaw2(this), "get", "value");
- return this._value;
- }
- set value(newVal) {
- if (shared.hasChanged(toRaw2(newVal), this._rawValue)) {
- this._rawValue = newVal;
- this._value = this._shallow ? newVal : convert(newVal);
- trigger(toRaw2(this), "set", "value", newVal);
- }
- }
- };
- function createRef(rawValue, shallow = false) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- function triggerRef(ref2) {
- trigger(toRaw2(ref2), "set", "value", ref2.value);
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- var shallowUnwrapHandlers = {
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- var CustomRefImpl = class {
- constructor(factory) {
- this.__v_isRef = true;
- const {get: get3, set: set3} = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value"));
- this._get = get3;
- this._set = set3;
- }
- get value() {
- return this._get();
- }
- set value(newVal) {
- this._set(newVal);
- }
- };
- function customRef(factory) {
- return new CustomRefImpl(factory);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = shared.isArray(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = toRef(object, key);
- }
- return ret;
- }
- var ObjectRefImpl = class {
- constructor(_object, _key) {
- this._object = _object;
- this._key = _key;
- this.__v_isRef = true;
- }
- get value() {
- return this._object[this._key];
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- };
- function toRef(object, key) {
- return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);
- }
- var ComputedRefImpl = class {
- constructor(getter, _setter, isReadonly2) {
- this._setter = _setter;
- this._dirty = true;
- this.__v_isRef = true;
- this.effect = effect3(getter, {
- lazy: true,
- scheduler: () => {
- if (!this._dirty) {
- this._dirty = true;
- trigger(toRaw2(this), "set", "value");
- }
- }
- });
- this["__v_isReadonly"] = isReadonly2;
- }
- get value() {
- const self2 = toRaw2(this);
- if (self2._dirty) {
- self2._value = this.effect();
- self2._dirty = false;
- }
- track(self2, "get", "value");
- return self2._value;
- }
- set value(newValue) {
- this._setter(newValue);
- }
- };
- function computed(getterOrOptions) {
- let getter;
- let setter;
- if (shared.isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- setter = () => {
- console.warn("Write operation failed: computed value is readonly");
- };
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);
- }
- exports2.ITERATE_KEY = ITERATE_KEY;
- exports2.computed = computed;
- exports2.customRef = customRef;
- exports2.effect = effect3;
- exports2.enableTracking = enableTracking;
- exports2.isProxy = isProxy;
- exports2.isReactive = isReactive2;
- exports2.isReadonly = isReadonly;
- exports2.isRef = isRef;
- exports2.markRaw = markRaw;
- exports2.pauseTracking = pauseTracking;
- exports2.proxyRefs = proxyRefs;
- exports2.reactive = reactive3;
- exports2.readonly = readonly;
- exports2.ref = ref;
- exports2.resetTracking = resetTracking;
- exports2.shallowReactive = shallowReactive;
- exports2.shallowReadonly = shallowReadonly;
- exports2.shallowRef = shallowRef;
- exports2.stop = stop2;
- exports2.toRaw = toRaw2;
- exports2.toRef = toRef;
- exports2.toRefs = toRefs;
- exports2.track = track;
- exports2.trigger = trigger;
- exports2.triggerRef = triggerRef;
- exports2.unref = unref;
-});
-
-// node_modules/@vue/reactivity/index.js
-var require_reactivity = __commonJS((exports2, module2) => {
- "use strict";
- if (false) {
- module2.exports = null;
- } else {
- module2.exports = require_reactivity_cjs();
- }
-});
-
-// packages/alpinejs/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/alpinejs/src/scheduler.js
-var flushPending = false;
-var flushing = false;
-var queue = [];
-function scheduler(callback) {
- queueJob(callback);
-}
-function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
-}
-function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
-}
-function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
-}
-
-// packages/alpinejs/src/reactivity.js
-var reactive;
-var effect;
-var release;
-var raw;
-var shouldSchedule = true;
-function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
-}
-function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
-}
-function overrideEffect(override) {
- effect = override;
-}
-function elementBoundEffect(el) {
- let cleanup = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup();
- }];
-}
-
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
-// packages/alpinejs/src/mutation.js
-var onAttributeAddeds = [];
-var onElRemoveds = [];
-var onElAddeds = [];
-function onElAdded(callback) {
- onElAddeds.push(callback);
-}
-function onElRemoved(callback) {
- onElRemoveds.push(callback);
-}
-function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
-}
-function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
-}
-function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
-}
-var observer = new MutationObserver(onMutate);
-var currentlyObserving = false;
-function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
-}
-function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
-}
-var recordQueue = [];
-var willProcessRecordQueue = false;
-function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
-}
-function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
-}
-function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
-}
-var isCollecting = false;
-var deferredMutations = [];
-function deferMutations() {
- isCollecting = true;
-}
-function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
-}
-function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add();
- } else if (el.hasAttribute(name)) {
- remove();
- add();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
-}
-
-// packages/alpinejs/src/scope.js
-function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
-}
-function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
-}
-function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
-}
-function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
-}
-
-// packages/alpinejs/src/interceptor.js
-function initInterceptors(data2) {
- let isObject = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
-}
-function interceptor(callback, mutateObj = () => {
-}) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
-}
-function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
-}
-function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
-}
-
-// packages/alpinejs/src/magics.js
-var magics = {};
-function magic(name, callback) {
- magics[name] = callback;
-}
-function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
-}
-
-// packages/alpinejs/src/evaluator.js
-function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
-}
-function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
-}
-var theEvaluatorFunction = normalEvaluator;
-function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
-}
-function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
-}
-function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
-}
-var evaluatorMemo = {};
-function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
-}
-function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
-}
-function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
-}
-function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
-}
-
-// packages/alpinejs/src/directives.js
-var prefixAsString = "x-";
-function prefix(subject = "") {
- return prefixAsString + subject;
-}
-function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
-}
-var directiveHandlers = {};
-function directive(name, callback) {
- directiveHandlers[name] = callback;
-}
-function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
-}
-function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
-}
-var isDeferringHandlers = false;
-var directiveHandlerStacks = new Map();
-var currentHandlerStackKey = Symbol();
-function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
-}
-function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
-}
-var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
-};
-var into = (i) => i;
-function toTransformedAttributes(callback = () => {
-}) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
-}
-var attributeTransformers = [];
-function mapAttributes(callback) {
- attributeTransformers.push(callback);
-}
-function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
-}
-var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
-function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
-}
-var DEFAULT = "DEFAULT";
-var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
-];
-function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
-}
-
-// packages/alpinejs/src/utils/dispatch.js
-function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
-}
-
-// packages/alpinejs/src/nextTick.js
-var tickStack = [];
-var isHolding = false;
-function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
-}
-function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
-}
-function holdNextTicks() {
- isHolding = true;
-}
-
-// packages/alpinejs/src/utils/warn.js
-function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
-}
-
-// packages/alpinejs/src/lifecycle.js
-function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
-}
-var rootSelectorCallbacks = [];
-var initSelectorCallbacks = [];
-function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
-}
-function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
-}
-function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
-}
-function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
-}
-function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
-}
-function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
-}
-function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
-}
-function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
-}
-
-// packages/alpinejs/src/utils/classes.js
-function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
-}
-function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
-}
-function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
-}
-
-// packages/alpinejs/src/utils/styles.js
-function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
-}
-function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
-}
-function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
-}
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-// packages/alpinejs/src/utils/once.js
-function once(callback, fallback = () => {
-}) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
-}
-
-// packages/alpinejs/src/directives/x-transition.js
-directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
-});
-function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
-}
-function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
-}
-function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
-}
-window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
-};
-function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
-}
-function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
-}, after = () => {
-}) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
-}
-function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
-}
-
-// packages/alpinejs/src/utils/debounce.js
-function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
-}
-
-// packages/alpinejs/src/utils/throttle.js
-function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
-}
-
-// packages/alpinejs/src/plugin.js
-function plugin(callback) {
- callback(alpine_default);
-}
-
-// packages/alpinejs/src/store.js
-var stores = {};
-var isReactive = false;
-function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
-}
-function getStores() {
- return stores;
-}
-
-// packages/alpinejs/src/clone.js
-var isCloning = false;
-function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
-}
-function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
-}
-function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
-}
-function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
-}
-
-// packages/alpinejs/src/datas.js
-var datas = {};
-function data(name, callback) {
- datas[name] = callback;
-}
-function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
-}
-
-// packages/alpinejs/src/alpine.js
-var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
-};
-var alpine_default = Alpine;
-
-// packages/alpinejs/src/index.js
-var import_reactivity9 = __toModule(require_reactivity());
-
-// packages/alpinejs/src/magics/$nextTick.js
-magic("nextTick", () => nextTick);
-
-// packages/alpinejs/src/magics/$dispatch.js
-magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
-// packages/alpinejs/src/magics/$watch.js
-magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/magics/$store.js
-magic("store", getStores);
-
-// packages/alpinejs/src/magics/$root.js
-magic("root", (el) => closestRoot(el));
-
-// packages/alpinejs/src/magics/$refs.js
-magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
-});
-function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
-}
-
-// packages/alpinejs/src/magics/$el.js
-magic("el", (el) => el);
-
-// packages/alpinejs/src/directives/x-ignore.js
-var handler = () => {
-};
-handler.inline = (el, {modifiers}, {cleanup}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
-};
-directive("ignore", handler);
-
-// packages/alpinejs/src/directives/x-effect.js
-directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
-// packages/alpinejs/src/utils/bind.js
-function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
-}
-function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
-}
-function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
-}
-function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
-}
-function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr(name))
- value = name;
- setIfChanged(el, name, value);
- }
-}
-function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
-}
-function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
-}
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
-}
-function isBooleanAttr(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
-}
-function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
-}
-
-// packages/alpinejs/src/utils/on.js
-function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
-}
-function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
-}
-function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
-}
-function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
-}
-function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
-}
-function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
-}
-
-// packages/alpinejs/src/directives/x-model.js
-directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
-});
-function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
-}
-function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
-}
-function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
-}
-function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-cloak.js
-directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
-// packages/alpinejs/src/directives/x-init.js
-addInitSelector(() => `[${prefix("init")}]`);
-directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
-}));
-
-// packages/alpinejs/src/directives/x-text.js
-directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-html.js
-directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-bind.js
-mapAttributes(startingWith(":", into(prefix("bind:"))));
-directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
-});
-function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
-}
-function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
-}
-
-// packages/alpinejs/src/directives/x-data.js
-addRootSelector(() => `[${prefix("data")}]`);
-directive("data", skipDuringClone((el, {expression}, {cleanup}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup2 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup(() => {
- undo();
- cleanup1();
- cleanup2();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
-}));
-
-// packages/alpinejs/src/directives/x-show.js
-directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/directives/x-for.js
-directive("for", (el, {expression}, {effect: effect3, cleanup}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
-});
-function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
-}
-function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
-}
-function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
-}
-function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-ref.js
-function handler2() {
-}
-handler2.inline = (el, {expression}, {cleanup}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup(() => delete root._x_refs[expression]);
-};
-directive("ref", handler2);
-
-// packages/alpinejs/src/directives/x-if.js
-directive("if", (el, {expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup(() => el._x_undoIf && el._x_undoIf());
-});
-
-// packages/alpinejs/src/directives/x-on.js
-mapAttributes(startingWith("@", into(prefix("on:"))));
-directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup(() => removeListener());
-}));
-
-// packages/alpinejs/src/index.js
-alpine_default.setEvaluator(normalEvaluator);
-alpine_default.setReactivityEngine({reactive: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw});
-var src_default = alpine_default;
-
-// packages/alpinejs/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/alpinejs/dist/dist/module.esm.js b/alpinejs/packages/alpinejs/dist/dist/module.esm.js
deleted file mode 100644
index 13b4894..0000000
--- a/alpinejs/packages/alpinejs/dist/dist/module.esm.js
+++ /dev/null
@@ -1,3238 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module) => () => {
- if (!module) {
- module = {exports: {}};
- callback(module.exports, module);
- }
- return module.exports;
-};
-var __exportStar = (target, module, desc) => {
- if (module && typeof module === "object" || typeof module === "function") {
- for (let key of __getOwnPropNames(module))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module) => {
- return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: () => module.default, enumerable: true} : {value: module, enumerable: true})), module);
-};
-
-// node_modules/@vue/shared/dist/shared.cjs.js
-var require_shared_cjs = __commonJS((exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
- var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
- var range = 2;
- function generateCodeFrame(source, start2 = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start2) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
- const lineLength = lines[j].length;
- if (j === i) {
- const pad = start2 - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start2);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
- var attrValidationCache = {};
- function isSSRSafeAttrName(name) {
- if (attrValidationCache.hasOwnProperty(name)) {
- return attrValidationCache[name];
- }
- const isUnsafe = unsafeAttrCharRE.test(name);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name}`);
- }
- return attrValidationCache[name] = !isUnsafe;
- }
- var propsToAttrMap = {
- acceptCharset: "accept-charset",
- className: "class",
- htmlFor: "for",
- httpEquiv: "http-equiv"
- };
- var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);
- var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`);
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isObject(value)) {
- return value;
- }
- }
- var listDelimiterRE = /;(?![^(]*\))/g;
- var propertyDelimiterRE = /:(.+)/;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- let ret = "";
- if (!styles) {
- return ret;
- }
- for (const key in styles) {
- const value = styles[key];
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) {
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
- var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
- var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
- var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
- var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
- var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
- var escapeRE = /["'&<>]/;
- function escapeHtml(string) {
- const str = "" + string;
- const match = escapeRE.exec(str);
- if (!match) {
- return str;
- }
- let html = "";
- let escaped;
- let index;
- let lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- escaped = "&quot;";
- break;
- case 38:
- escaped = "&amp;";
- break;
- case 39:
- escaped = "&#39;";
- break;
- case 60:
- escaped = "&lt;";
- break;
- case 62:
- escaped = "&gt;";
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escaped;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
- function escapeHtmlComment(src) {
- return src.replace(commentStripRE, "");
- }
- function looseCompareArrays(a, b) {
- if (a.length !== b.length)
- return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b)
- return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex((item) => looseEqual(item, val));
- }
- var toDisplayString = (val) => {
- return val == null ? "" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);
- };
- var replacer = (_key, val) => {
- if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
- entries[`${key} =>`] = val2;
- return entries;
- }, {})
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()]
- };
- } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
- return String(val);
- }
- return val;
- };
- var babelParserDefaultPlugins = [
- "bigInt",
- "optionalChaining",
- "nullishCoalescingOperator"
- ];
- var EMPTY_OBJ = Object.freeze({});
- var EMPTY_ARR = Object.freeze([]);
- var NOOP = () => {
- };
- var NO = () => false;
- var onRE = /^on[^a-z]/;
- var isOn = (key) => onRE.test(key);
- var isModelListener = (key) => key.startsWith("onUpdate:");
- var extend = Object.assign;
- var remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isSet = (val) => toTypeString(val) === "[object Set]";
- var isDate = (val) => val instanceof Date;
- var isFunction = (val) => typeof val === "function";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var isPromise = (val) => {
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
- };
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isPlainObject = (val) => toTypeString(val) === "[object Object]";
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
- var invokeArrayFns = (fns, arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](arg);
- }
- };
- var def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- var toNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- var _globalThis;
- var getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- exports.EMPTY_ARR = EMPTY_ARR;
- exports.EMPTY_OBJ = EMPTY_OBJ;
- exports.NO = NO;
- exports.NOOP = NOOP;
- exports.PatchFlagNames = PatchFlagNames;
- exports.babelParserDefaultPlugins = babelParserDefaultPlugins;
- exports.camelize = camelize;
- exports.capitalize = capitalize;
- exports.def = def;
- exports.escapeHtml = escapeHtml;
- exports.escapeHtmlComment = escapeHtmlComment;
- exports.extend = extend;
- exports.generateCodeFrame = generateCodeFrame;
- exports.getGlobalThis = getGlobalThis;
- exports.hasChanged = hasChanged;
- exports.hasOwn = hasOwn;
- exports.hyphenate = hyphenate;
- exports.invokeArrayFns = invokeArrayFns;
- exports.isArray = isArray;
- exports.isBooleanAttr = isBooleanAttr2;
- exports.isDate = isDate;
- exports.isFunction = isFunction;
- exports.isGloballyWhitelisted = isGloballyWhitelisted;
- exports.isHTMLTag = isHTMLTag;
- exports.isIntegerKey = isIntegerKey;
- exports.isKnownAttr = isKnownAttr;
- exports.isMap = isMap;
- exports.isModelListener = isModelListener;
- exports.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;
- exports.isObject = isObject;
- exports.isOn = isOn;
- exports.isPlainObject = isPlainObject;
- exports.isPromise = isPromise;
- exports.isReservedProp = isReservedProp;
- exports.isSSRSafeAttrName = isSSRSafeAttrName;
- exports.isSVGTag = isSVGTag;
- exports.isSet = isSet;
- exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
- exports.isString = isString;
- exports.isSymbol = isSymbol;
- exports.isVoidTag = isVoidTag;
- exports.looseEqual = looseEqual;
- exports.looseIndexOf = looseIndexOf;
- exports.makeMap = makeMap;
- exports.normalizeClass = normalizeClass;
- exports.normalizeStyle = normalizeStyle;
- exports.objectToString = objectToString;
- exports.parseStringStyle = parseStringStyle;
- exports.propsToAttrMap = propsToAttrMap;
- exports.remove = remove;
- exports.slotFlagsText = slotFlagsText;
- exports.stringifyStyle = stringifyStyle;
- exports.toDisplayString = toDisplayString;
- exports.toHandlerKey = toHandlerKey;
- exports.toNumber = toNumber;
- exports.toRawType = toRawType;
- exports.toTypeString = toTypeString;
-});
-
-// node_modules/@vue/shared/index.js
-var require_shared = __commonJS((exports, module) => {
- "use strict";
- if (false) {
- module.exports = null;
- } else {
- module.exports = require_shared_cjs();
- }
-});
-
-// node_modules/@vue/reactivity/dist/reactivity.cjs.js
-var require_reactivity_cjs = __commonJS((exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- var shared = require_shared();
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol("iterate");
- var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect3(fn, options = shared.EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect4 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect4();
- }
- return effect4;
- }
- function stop2(effect4) {
- if (effect4.active) {
- cleanup(effect4);
- if (effect4.options.onStop) {
- effect4.options.onStop();
- }
- effect4.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect4 = function reactiveEffect() {
- if (!effect4.active) {
- return fn();
- }
- if (!effectStack.includes(effect4)) {
- cleanup(effect4);
- try {
- enableTracking();
- effectStack.push(effect4);
- activeEffect = effect4;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect4.id = uid++;
- effect4.allowRecurse = !!options.allowRecurse;
- effect4._isEffect = true;
- effect4.active = true;
- effect4.raw = fn;
- effect4.deps = [];
- effect4.options = options;
- return effect4;
- }
- function cleanup(effect4) {
- const {deps} = effect4;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect4);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect4) => {
- if (effect4 !== activeEffect || effect4.allowRecurse) {
- effects.add(effect4);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && shared.isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (shared.isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (shared.isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect4) => {
- if (effect4.options.onTrigger) {
- effect4.options.onTrigger({
- effect: effect4,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect4.options.scheduler) {
- effect4.options.scheduler(effect4);
- } else {
- effect4();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw2(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw2));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly2 = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = shared.isArray(target);
- if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (shared.isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive3(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw2(value);
- oldValue = toRaw2(oldValue);
- if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw2(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = shared.hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = shared.extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = shared.extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;
- var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly2 = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "get", key);
- }
- !isReadonly2 && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "has", key);
- }
- !isReadonly2 && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw2(this);
- const hadItems = target.size !== 0;
- const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly2, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw2(target);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const targetIsMap = shared.isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw2(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = shared.toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));
- }
- function reactive3(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function shallowReactive(target) {
- return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function shallowReadonly(target) {
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!shared.isObject(target)) {
- {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive2(value) {
- if (isReadonly(value)) {
- return isReactive2(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isProxy(value) {
- return isReactive2(value) || isReadonly(value);
- }
- function toRaw2(observed) {
- return observed && toRaw2(observed["__v_raw"]) || observed;
- }
- function markRaw(value) {
- shared.def(value, "__v_skip", true);
- return value;
- }
- var convert = (val) => shared.isObject(val) ? reactive3(val) : val;
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
- function ref(value) {
- return createRef(value);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- var RefImpl = class {
- constructor(_rawValue, _shallow = false) {
- this._rawValue = _rawValue;
- this._shallow = _shallow;
- this.__v_isRef = true;
- this._value = _shallow ? _rawValue : convert(_rawValue);
- }
- get value() {
- track(toRaw2(this), "get", "value");
- return this._value;
- }
- set value(newVal) {
- if (shared.hasChanged(toRaw2(newVal), this._rawValue)) {
- this._rawValue = newVal;
- this._value = this._shallow ? newVal : convert(newVal);
- trigger(toRaw2(this), "set", "value", newVal);
- }
- }
- };
- function createRef(rawValue, shallow = false) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- function triggerRef(ref2) {
- trigger(toRaw2(ref2), "set", "value", ref2.value);
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- var shallowUnwrapHandlers = {
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- var CustomRefImpl = class {
- constructor(factory) {
- this.__v_isRef = true;
- const {get: get3, set: set3} = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value"));
- this._get = get3;
- this._set = set3;
- }
- get value() {
- return this._get();
- }
- set value(newVal) {
- this._set(newVal);
- }
- };
- function customRef(factory) {
- return new CustomRefImpl(factory);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = shared.isArray(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = toRef(object, key);
- }
- return ret;
- }
- var ObjectRefImpl = class {
- constructor(_object, _key) {
- this._object = _object;
- this._key = _key;
- this.__v_isRef = true;
- }
- get value() {
- return this._object[this._key];
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- };
- function toRef(object, key) {
- return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);
- }
- var ComputedRefImpl = class {
- constructor(getter, _setter, isReadonly2) {
- this._setter = _setter;
- this._dirty = true;
- this.__v_isRef = true;
- this.effect = effect3(getter, {
- lazy: true,
- scheduler: () => {
- if (!this._dirty) {
- this._dirty = true;
- trigger(toRaw2(this), "set", "value");
- }
- }
- });
- this["__v_isReadonly"] = isReadonly2;
- }
- get value() {
- const self2 = toRaw2(this);
- if (self2._dirty) {
- self2._value = this.effect();
- self2._dirty = false;
- }
- track(self2, "get", "value");
- return self2._value;
- }
- set value(newValue) {
- this._setter(newValue);
- }
- };
- function computed(getterOrOptions) {
- let getter;
- let setter;
- if (shared.isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- setter = () => {
- console.warn("Write operation failed: computed value is readonly");
- };
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);
- }
- exports.ITERATE_KEY = ITERATE_KEY;
- exports.computed = computed;
- exports.customRef = customRef;
- exports.effect = effect3;
- exports.enableTracking = enableTracking;
- exports.isProxy = isProxy;
- exports.isReactive = isReactive2;
- exports.isReadonly = isReadonly;
- exports.isRef = isRef;
- exports.markRaw = markRaw;
- exports.pauseTracking = pauseTracking;
- exports.proxyRefs = proxyRefs;
- exports.reactive = reactive3;
- exports.readonly = readonly;
- exports.ref = ref;
- exports.resetTracking = resetTracking;
- exports.shallowReactive = shallowReactive;
- exports.shallowReadonly = shallowReadonly;
- exports.shallowRef = shallowRef;
- exports.stop = stop2;
- exports.toRaw = toRaw2;
- exports.toRef = toRef;
- exports.toRefs = toRefs;
- exports.track = track;
- exports.trigger = trigger;
- exports.triggerRef = triggerRef;
- exports.unref = unref;
-});
-
-// node_modules/@vue/reactivity/index.js
-var require_reactivity = __commonJS((exports, module) => {
- "use strict";
- if (false) {
- module.exports = null;
- } else {
- module.exports = require_reactivity_cjs();
- }
-});
-
-// packages/alpinejs/src/scheduler.js
-var flushPending = false;
-var flushing = false;
-var queue = [];
-function scheduler(callback) {
- queueJob(callback);
-}
-function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
-}
-function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
-}
-function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
-}
-
-// packages/alpinejs/src/reactivity.js
-var reactive;
-var effect;
-var release;
-var raw;
-var shouldSchedule = true;
-function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
-}
-function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
-}
-function overrideEffect(override) {
- effect = override;
-}
-function elementBoundEffect(el) {
- let cleanup = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup();
- }];
-}
-
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
-// packages/alpinejs/src/mutation.js
-var onAttributeAddeds = [];
-var onElRemoveds = [];
-var onElAddeds = [];
-function onElAdded(callback) {
- onElAddeds.push(callback);
-}
-function onElRemoved(callback) {
- onElRemoveds.push(callback);
-}
-function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
-}
-function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
-}
-function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
-}
-var observer = new MutationObserver(onMutate);
-var currentlyObserving = false;
-function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
-}
-function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
-}
-var recordQueue = [];
-var willProcessRecordQueue = false;
-function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
-}
-function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
-}
-function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
-}
-var isCollecting = false;
-var deferredMutations = [];
-function deferMutations() {
- isCollecting = true;
-}
-function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
-}
-function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add();
- } else if (el.hasAttribute(name)) {
- remove();
- add();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
-}
-
-// packages/alpinejs/src/scope.js
-function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
-}
-function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
-}
-function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
-}
-function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
-}
-
-// packages/alpinejs/src/interceptor.js
-function initInterceptors(data2) {
- let isObject = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
-}
-function interceptor(callback, mutateObj = () => {
-}) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
-}
-function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
-}
-function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
-}
-
-// packages/alpinejs/src/magics.js
-var magics = {};
-function magic(name, callback) {
- magics[name] = callback;
-}
-function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
-}
-
-// packages/alpinejs/src/evaluator.js
-function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
-}
-function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
-}
-var theEvaluatorFunction = normalEvaluator;
-function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
-}
-function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
-}
-function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
-}
-var evaluatorMemo = {};
-function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
-}
-function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
-}
-function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
-}
-function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
-}
-
-// packages/alpinejs/src/directives.js
-var prefixAsString = "x-";
-function prefix(subject = "") {
- return prefixAsString + subject;
-}
-function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
-}
-var directiveHandlers = {};
-function directive(name, callback) {
- directiveHandlers[name] = callback;
-}
-function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
-}
-function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
-}
-var isDeferringHandlers = false;
-var directiveHandlerStacks = new Map();
-var currentHandlerStackKey = Symbol();
-function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
-}
-function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
-}
-var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
-};
-var into = (i) => i;
-function toTransformedAttributes(callback = () => {
-}) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
-}
-var attributeTransformers = [];
-function mapAttributes(callback) {
- attributeTransformers.push(callback);
-}
-function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
-}
-var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
-function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
-}
-var DEFAULT = "DEFAULT";
-var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
-];
-function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
-}
-
-// packages/alpinejs/src/utils/dispatch.js
-function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
-}
-
-// packages/alpinejs/src/nextTick.js
-var tickStack = [];
-var isHolding = false;
-function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
-}
-function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
-}
-function holdNextTicks() {
- isHolding = true;
-}
-
-// packages/alpinejs/src/utils/warn.js
-function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
-}
-
-// packages/alpinejs/src/lifecycle.js
-function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
-}
-var rootSelectorCallbacks = [];
-var initSelectorCallbacks = [];
-function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
-}
-function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
-}
-function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
-}
-function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
-}
-function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
-}
-function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
-}
-function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
-}
-function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
-}
-
-// packages/alpinejs/src/utils/classes.js
-function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
-}
-function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
-}
-function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
-}
-
-// packages/alpinejs/src/utils/styles.js
-function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
-}
-function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
-}
-function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
-}
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-// packages/alpinejs/src/utils/once.js
-function once(callback, fallback = () => {
-}) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
-}
-
-// packages/alpinejs/src/directives/x-transition.js
-directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
-});
-function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
-}
-function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
-}
-function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
-}
-window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
-};
-function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
-}
-function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
-}, after = () => {
-}) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
-}
-function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
-}
-
-// packages/alpinejs/src/utils/debounce.js
-function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
-}
-
-// packages/alpinejs/src/utils/throttle.js
-function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
-}
-
-// packages/alpinejs/src/plugin.js
-function plugin(callback) {
- callback(alpine_default);
-}
-
-// packages/alpinejs/src/store.js
-var stores = {};
-var isReactive = false;
-function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
-}
-function getStores() {
- return stores;
-}
-
-// packages/alpinejs/src/clone.js
-var isCloning = false;
-function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
-}
-function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
-}
-function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
-}
-function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
-}
-
-// packages/alpinejs/src/datas.js
-var datas = {};
-function data(name, callback) {
- datas[name] = callback;
-}
-function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
-}
-
-// packages/alpinejs/src/alpine.js
-var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
-};
-var alpine_default = Alpine;
-
-// packages/alpinejs/src/index.js
-var import_reactivity9 = __toModule(require_reactivity());
-
-// packages/alpinejs/src/magics/$nextTick.js
-magic("nextTick", () => nextTick);
-
-// packages/alpinejs/src/magics/$dispatch.js
-magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
-// packages/alpinejs/src/magics/$watch.js
-magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/magics/$store.js
-magic("store", getStores);
-
-// packages/alpinejs/src/magics/$root.js
-magic("root", (el) => closestRoot(el));
-
-// packages/alpinejs/src/magics/$refs.js
-magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
-});
-function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
-}
-
-// packages/alpinejs/src/magics/$el.js
-magic("el", (el) => el);
-
-// packages/alpinejs/src/directives/x-ignore.js
-var handler = () => {
-};
-handler.inline = (el, {modifiers}, {cleanup}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
-};
-directive("ignore", handler);
-
-// packages/alpinejs/src/directives/x-effect.js
-directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
-// packages/alpinejs/src/utils/bind.js
-function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
-}
-function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
-}
-function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
-}
-function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
-}
-function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr(name))
- value = name;
- setIfChanged(el, name, value);
- }
-}
-function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
-}
-function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
-}
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
-}
-function isBooleanAttr(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
-}
-function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
-}
-
-// packages/alpinejs/src/utils/on.js
-function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
-}
-function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
-}
-function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
-}
-function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
-}
-function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
-}
-function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
-}
-
-// packages/alpinejs/src/directives/x-model.js
-directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
-});
-function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
-}
-function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
-}
-function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
-}
-function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-cloak.js
-directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
-// packages/alpinejs/src/directives/x-init.js
-addInitSelector(() => `[${prefix("init")}]`);
-directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
-}));
-
-// packages/alpinejs/src/directives/x-text.js
-directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-html.js
-directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-bind.js
-mapAttributes(startingWith(":", into(prefix("bind:"))));
-directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
-});
-function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
-}
-function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
-}
-
-// packages/alpinejs/src/directives/x-data.js
-addRootSelector(() => `[${prefix("data")}]`);
-directive("data", skipDuringClone((el, {expression}, {cleanup}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup2 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup(() => {
- undo();
- cleanup1();
- cleanup2();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
-}));
-
-// packages/alpinejs/src/directives/x-show.js
-directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/directives/x-for.js
-directive("for", (el, {expression}, {effect: effect3, cleanup}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
-});
-function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
-}
-function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
-}
-function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
-}
-function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-ref.js
-function handler2() {
-}
-handler2.inline = (el, {expression}, {cleanup}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup(() => delete root._x_refs[expression]);
-};
-directive("ref", handler2);
-
-// packages/alpinejs/src/directives/x-if.js
-directive("if", (el, {expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup(() => el._x_undoIf && el._x_undoIf());
-});
-
-// packages/alpinejs/src/directives/x-on.js
-mapAttributes(startingWith("@", into(prefix("on:"))));
-directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup(() => removeListener());
-}));
-
-// packages/alpinejs/src/index.js
-alpine_default.setEvaluator(normalEvaluator);
-alpine_default.setReactivityEngine({reactive: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw});
-var src_default = alpine_default;
-
-// packages/alpinejs/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/alpinejs/dist/module.cjs.js b/alpinejs/packages/alpinejs/dist/module.cjs.js
index b2382e7..d77e293 100644
--- a/alpinejs/packages/alpinejs/dist/module.cjs.js
+++ b/alpinejs/packages/alpinejs/dist/module.cjs.js
@@ -1342,23 +1342,6 @@ function elementBoundEffect(el) {
}];
}
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -1489,14 +1472,6 @@ function onMutate(mutations) {
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -1907,6 +1882,23 @@ function holdNextTicks() {
isHolding = true;
}
+// packages/alpinejs/src/utils/walk.js
+function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+}
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/alpinejs/dist/module.esm.js b/alpinejs/packages/alpinejs/dist/module.esm.js
index 13b4894..beb9e1e 100644
--- a/alpinejs/packages/alpinejs/dist/module.esm.js
+++ b/alpinejs/packages/alpinejs/dist/module.esm.js
@@ -1332,23 +1332,6 @@ function elementBoundEffect(el) {
}];
}
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -1479,14 +1462,6 @@ function onMutate(mutations) {
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -1897,6 +1872,23 @@ function holdNextTicks() {
isHolding = true;
}
+// packages/alpinejs/src/utils/walk.js
+function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+}
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/alpinejs/package.json b/alpinejs/packages/alpinejs/package.json
deleted file mode 100644
index 904baed..0000000
--- a/alpinejs/packages/alpinejs/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "alpinejs",
- "version": "3.4.2",
- "description": "The rugged, minimal JavaScript framework",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "unpkg": "dist/cdn.min.js",
- "dependencies": {
- "@vue/reactivity": "~3.1.1"
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/alpine.js b/alpinejs/packages/alpinejs/src/alpine.js
deleted file mode 100644
index 0d5505c..0000000
--- a/alpinejs/packages/alpinejs/src/alpine.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import { setReactivityEngine, disableEffectScheduling, reactive, effect, release, raw } from './reactivity'
-import { mutateDom, deferMutations, flushAndStopDeferringMutations, stopObservingMutations } from './mutation'
-import { mapAttributes, directive, setPrefix as prefix } from './directives'
-import { start, addRootSelector, closestRoot, initTree, destroyTree } from './lifecycle'
-import { setEvaluator, evaluate, evaluateLater } from './evaluator'
-import { transition } from './directives/x-transition'
-import { interceptor } from './interceptor'
-import { setStyles } from './utils/styles'
-import { debounce } from './utils/debounce'
-import { throttle } from './utils/throttle'
-import { nextTick } from './nextTick'
-import { plugin } from './plugin'
-import { magic } from './magics'
-import { store } from './store'
-import { clone } from './clone'
-import { data } from './datas'
-
-let Alpine = {
- get reactive() { return reactive },
- get release() { return release },
- get effect() { return effect },
- get raw() { return raw },
- version: ALPINE_VERSION,
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor, // INTERNAL: not public API and is subject to change without major release.
- transition, // INTERNAL
- setStyles, // INTERNAL
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data,
-}
-
-export default Alpine
diff --git a/alpinejs/packages/alpinejs/src/clone.js b/alpinejs/packages/alpinejs/src/clone.js
deleted file mode 100644
index 0f37d05..0000000
--- a/alpinejs/packages/alpinejs/src/clone.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import { effect, release, overrideEffect } from "./reactivity"
-import { initTree, isRoot } from "./lifecycle"
-import { walk } from "./utils/walk"
-
-let isCloning = false
-
-export function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args)
-}
-
-export function onlyDuringClone(callback) {
- return (...args) => isCloning && callback(...args)
-}
-
-export function skipWalkingSubClone(callback) {
- return (...args) => isCloning || callback(...args)
-}
-
-export function interuptCrawl(callback) {
- return (...args) => isCloning || callback(...args)
-}
-
-export function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack
-
- isCloning = true
-
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl)
- })
-
- isCloning = false
-}
-
-export function cloneTree(el) {
- let hasRunThroughFirstEl = false
-
- let shallowWalker = (el, callback) => {
- walk(el, (el, skip) => {
- if (hasRunThroughFirstEl && isRoot(el)) return skip()
-
- hasRunThroughFirstEl = true
-
- callback(el, skip)
- })
- }
-
- initTree(el, shallowWalker)
-}
-
-function dontRegisterReactiveSideEffects(callback) {
- let cache = effect
-
- overrideEffect((callback, el) => {
- let storedEffect = cache(callback)
-
- release(storedEffect)
-
- return () => {}
- })
-
- callback()
-
- overrideEffect(cache)
-}
diff --git a/alpinejs/packages/alpinejs/src/datas.js b/alpinejs/packages/alpinejs/src/datas.js
deleted file mode 100644
index 9706581..0000000
--- a/alpinejs/packages/alpinejs/src/datas.js
+++ /dev/null
@@ -1,22 +0,0 @@
-
-let datas = {}
-
-export function data(name, callback) {
- datas[name] = callback
-}
-
-export function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args)
- }
- },
-
- enumerable: false,
- })
- })
-
- return obj
-}
diff --git a/alpinejs/packages/alpinejs/src/directives.js b/alpinejs/packages/alpinejs/src/directives.js
deleted file mode 100644
index 906822f..0000000
--- a/alpinejs/packages/alpinejs/src/directives.js
+++ /dev/null
@@ -1,179 +0,0 @@
-import { onAttributeRemoved, onElRemoved } from './mutation'
-import { evaluate, evaluateLater } from './evaluator'
-import { elementBoundEffect } from './reactivity'
-import Alpine from './alpine'
-
-let prefixAsString = 'x-'
-
-export function prefix(subject = '') {
- return prefixAsString + subject
-}
-
-export function setPrefix(newPrefix) {
- prefixAsString = newPrefix
-}
-
-let directiveHandlers = {}
-
-export function directive(name, callback) {
- directiveHandlers[name] = callback
-}
-
-export function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {}
-
- let directives = Array.from(attributes)
- .map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName))
- .filter(outNonAlpineAttributes)
- .map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride))
- .sort(byPriority)
-
- return directives.map(directive => {
- return getDirectiveHandler(el, directive)
- })
-}
-
-export function attributesOnly(attributes) {
- return Array.from(attributes)
- .map(toTransformedAttributes())
- .filter(attr => ! outNonAlpineAttributes(attr))
-}
-
-let isDeferringHandlers = false
-let directiveHandlerStacks = new Map
-let currentHandlerStackKey = Symbol()
-
-export function deferHandlingDirectives(callback) {
- isDeferringHandlers = true
-
- let key = Symbol()
-
- currentHandlerStackKey = key
-
- directiveHandlerStacks.set(key, [])
-
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length) directiveHandlerStacks.get(key).shift()()
-
- directiveHandlerStacks.delete(key)
- }
-
- let stopDeferring = () => { isDeferringHandlers = false; flushHandlers() }
-
- callback(flushHandlers)
-
- stopDeferring()
-}
-
-export function getDirectiveHandler(el, directive) {
- let noop = () => {}
-
- let handler = directiveHandlers[directive.type] || noop
-
- let cleanups = []
-
- let cleanup = callback => cleanups.push(callback)
-
- let [effect, cleanupEffect] = elementBoundEffect(el)
-
- cleanups.push(cleanupEffect)
-
- let utilities = {
- Alpine,
- effect,
- cleanup,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el),
- }
-
- let doCleanup = () => cleanups.forEach(i => i())
-
- onAttributeRemoved(el, directive.original, doCleanup)
-
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf) return
-
- handler.inline && handler.inline(el, directive, utilities)
-
- handler = handler.bind(handler, el, directive, utilities)
-
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler) : handler()
- }
-
- fullHandler.runCleanups = doCleanup
-
- return fullHandler
-}
-
-export let startingWith = (subject, replacement) => ({ name, value }) => {
- if (name.startsWith(subject)) name = name.replace(subject, replacement)
-
- return { name, value }
-}
-
-export let into = i => i
-
-function toTransformedAttributes(callback = () => {}) {
- return ({ name, value }) => {
- let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => {
- return transform(carry)
- }, { name, value })
-
- if (newName !== name) callback(newName, name)
-
- return { name: newName, value: newValue }
- }
-}
-
-let attributeTransformers = []
-
-export function mapAttributes(callback) {
- attributeTransformers.push(callback)
-}
-
-function outNonAlpineAttributes({ name }) {
- return alpineAttributeRegex().test(name)
-}
-
-let alpineAttributeRegex = () => (new RegExp(`^${prefixAsString}([^:^.]+)\\b`))
-
-function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({ name, value }) => {
- let typeMatch = name.match(alpineAttributeRegex())
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/)
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []
- let original = originalAttributeOverride || transformedAttributeMap[name] || name
-
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map(i => i.replace('.', '')),
- expression: value,
- original,
- }
- }
-}
-
-const DEFAULT = 'DEFAULT'
-
-let directiveOrder = [
- 'ignore',
- 'ref',
- 'data',
- 'bind',
- 'init',
- 'for',
- 'model',
- 'transition',
- 'show',
- 'if',
- DEFAULT,
- 'element',
-]
-
-function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type
-
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB)
-}
diff --git a/alpinejs/packages/alpinejs/src/directives/index.js b/alpinejs/packages/alpinejs/src/directives/index.js
deleted file mode 100644
index e9e05c7..0000000
--- a/alpinejs/packages/alpinejs/src/directives/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import './x-transition'
-import './x-ignore'
-import './x-effect'
-import './x-model'
-import './x-cloak'
-import './x-init'
-import './x-text'
-import './x-html'
-import './x-bind'
-import './x-data'
-import './x-show'
-import './x-for'
-import './x-ref'
-import './x-if'
-import './x-on'
diff --git a/alpinejs/packages/alpinejs/src/directives/x-bind.js b/alpinejs/packages/alpinejs/src/directives/x-bind.js
deleted file mode 100644
index 3f8611b..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-bind.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import { attributesOnly, directive, directives, into, mapAttributes, prefix, startingWith } from '../directives'
-import { evaluateLater } from '../evaluator'
-import { mutateDom } from '../mutation'
-import bind from '../utils/bind'
-
-mapAttributes(startingWith(':', into(prefix('bind:'))))
-
-directive('bind', (el, { value, modifiers, expression, original }, { effect }) => {
- if (! value) return applyBindingsObject(el, expression, original, effect)
-
- if (value === 'key') return storeKeyForXFor(el, expression)
-
- let evaluate = evaluateLater(el, expression)
-
- effect(() => evaluate(result => {
- // If nested object key is undefined, set the default value to empty string.
- if (result === undefined && expression.match(/\./)) result = ''
-
- mutateDom(() => bind(el, value, result, modifiers))
- }))
-})
-
-function applyBindingsObject(el, expression, original, effect) {
- let getBindings = evaluateLater(el, expression)
-
- let cleanupRunners = []
-
- effect(() => {
- while (cleanupRunners.length) cleanupRunners.pop()()
-
- getBindings(bindings => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({ name, value }))
-
- // Handle binding normal HTML attributes (non-Alpine directives).
- attributesOnly(attributes).forEach(({ name, value }, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`,
- }
- })
-
- directives(el, attributes, original).map(handle => {
- cleanupRunners.push(handle.runCleanups)
-
- handle()
- })
- })
-
- })
-}
-
-function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression
-}
diff --git a/alpinejs/packages/alpinejs/src/directives/x-cloak.js b/alpinejs/packages/alpinejs/src/directives/x-cloak.js
deleted file mode 100644
index 84639f0..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-cloak.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { directive, prefix } from '../directives'
-import { mutateDom } from '../mutation'
-
-directive('cloak', el => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix('cloak')))))
diff --git a/alpinejs/packages/alpinejs/src/directives/x-data.js b/alpinejs/packages/alpinejs/src/directives/x-data.js
deleted file mode 100644
index e88802c..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-data.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { directive, prefix } from '../directives'
-import { initInterceptors } from '../interceptor'
-import { injectDataProviders } from '../datas'
-import { addRootSelector } from '../lifecycle'
-import { skipDuringClone } from '../clone'
-import { addScopeToNode } from '../scope'
-import { injectMagics, magic } from '../magics'
-import { reactive } from '../reactivity'
-import { evaluate } from '../evaluator'
-
-addRootSelector(() => `[${prefix('data')}]`)
-
-directive('data', skipDuringClone((el, { expression }, { cleanup }) => {
- expression = expression === '' ? '{}' : expression
-
- let magicContext = {}
- let cleanup1 = injectMagics(magicContext, el).cleanup
-
- let dataProviderContext = {}
- injectDataProviders(dataProviderContext, magicContext)
-
- let data = evaluate(el, expression, { scope: dataProviderContext })
-
- let cleanup2 = injectMagics(data, el).cleanup
-
- let reactiveData = reactive(data)
-
- initInterceptors(reactiveData)
-
- let undo = addScopeToNode(el, reactiveData)
-
- reactiveData['init'] && evaluate(el, reactiveData['init'])
-
- cleanup(() => {
- undo()
-
- // MemLeak1: Issue #2140
- cleanup1()
- cleanup2()
-
- reactiveData['destroy'] && evaluate(el, reactiveData['destroy'])
- })
-}))
diff --git a/alpinejs/packages/alpinejs/src/directives/x-effect.js b/alpinejs/packages/alpinejs/src/directives/x-effect.js
deleted file mode 100644
index c421417..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-effect.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { directive } from '../directives'
-import { evaluateLater } from '../evaluator'
-
-directive('effect', (el, { expression }, { effect }) => effect(evaluateLater(el, expression)))
diff --git a/alpinejs/packages/alpinejs/src/directives/x-for.js b/alpinejs/packages/alpinejs/src/directives/x-for.js
deleted file mode 100644
index 504306d..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-for.js
+++ /dev/null
@@ -1,262 +0,0 @@
-import { addScopeToNode, refreshScope } from '../scope'
-import { evaluateLater } from '../evaluator'
-import { directive } from '../directives'
-import { reactive } from '../reactivity'
-import { initTree } from '../lifecycle'
-import { mutateDom } from '../mutation'
-import { flushJobs } from '../scheduler'
-import { warn } from '../utils/warn'
-
-directive('for', (el, { expression }, { effect, cleanup }) => {
- let iteratorNames = parseForExpression(expression)
-
- let evaluateItems = evaluateLater(el, iteratorNames.items)
- let evaluateKey = evaluateLater(el,
- // the x-bind:key expression is stored for our use instead of evaluated.
- el._x_keyExpression || 'index'
- )
-
- el._x_prevKeys = []
- el._x_lookup = {}
-
- effect(() => loop(el, iteratorNames, evaluateItems, evaluateKey))
-
- cleanup(() => {
- Object.values(el._x_lookup).forEach(el => el.remove())
-
- delete el._x_prevKeys
- delete el._x_lookup
- })
-})
-
-let shouldFastRender = true
-
-function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject = i => typeof i === 'object' && ! Array.isArray(i)
- let templateEl = el
-
- evaluateItems(items => {
- // Prepare yourself. There's a lot going on here. Take heart,
- // every bit of complexity in this function was added for
- // the purpose of making Alpine fast with large datas.
-
- // Support number literals. Ex: x-for="i in 100"
- if (isNumeric(items) && items >= 0) {
- items = Array.from(Array(items).keys(), i => i + 1)
- }
-
- if (items === undefined) items = []
-
- let lookup = el._x_lookup
- let prevKeys = el._x_prevKeys
- let scopes = []
- let keys = []
-
- // In order to preserve DOM elements (move instead of replace)
- // we need to generate all the keys for every iteration up
- // front. These will be our source of truth for diffing.
- if (isObject(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items)
-
- evaluateKey(value => keys.push(value), { scope: { index: key, ...scope} })
-
- scopes.push(scope)
- })
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items)
-
- evaluateKey(value => keys.push(value), { scope: { index: i, ...scope} })
-
- scopes.push(scope)
- }
- }
-
- // Rather than making DOM manipulations inside one large loop, we'll
- // instead track which mutations need to be made in the following
- // arrays. After we're finished, we can batch them at the end.
- let adds = []
- let moves = []
- let removes = []
- let sames = []
-
- // First, we track elements that will need to be removed.
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i]
-
- if (keys.indexOf(key) === -1) removes.push(key)
- }
-
- // Notice we're mutating prevKeys as we go. This makes it
- // so that we can efficiently make incremental comparisons.
- prevKeys = prevKeys.filter(key => ! removes.includes(key))
-
- let lastKey = 'template'
-
- // This is the important part of the diffing algo. Identifying
- // which keys (future DOM elements) are new, which ones have
- // or haven't moved (noting where they moved to / from).
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i]
-
- let prevIndex = prevKeys.indexOf(key)
-
- if (prevIndex === -1) {
- // New key found.
- prevKeys.splice(i, 0, key)
-
- adds.push([lastKey, i])
- } else if (prevIndex !== i) {
- // A key has moved.
- let keyInSpot = prevKeys.splice(i, 1)[0]
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0]
-
- prevKeys.splice(i, 0, keyForSpot)
- prevKeys.splice(prevIndex, 0, keyInSpot)
-
- moves.push([keyInSpot, keyForSpot])
- } else {
- // This key hasn't moved, but we'll still keep track
- // so that we can refresh it later on.
- sames.push(key)
- }
-
- lastKey = key
- }
-
- // Now that we've done the diffing work, we can apply the mutations
- // in batches for both separating types work and optimizing
- // for browser performance.
-
- // We'll remove all the nodes that need to be removed,
- // letting the mutation observer pick them up and
- // clean up any side effects they had.
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i]
-
- lookup[key].remove()
-
- lookup[key] = null
- delete lookup[key]
- }
-
- // Here we'll move elements around, skipping
- // mutation observer triggers by using "mutateDom".
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i]
-
- let elInSpot = lookup[keyInSpot]
- let elForSpot = lookup[keyForSpot]
-
- let marker = document.createElement('div')
-
- mutateDom(() => {
- elForSpot.after(marker)
- elInSpot.after(elForSpot)
- marker.before(elInSpot)
- marker.remove()
- })
-
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)])
- }
-
- // We can now create and add new elements.
- for (let i = 0; i < adds.length; i++) {
- let [lastKey, index] = adds[i]
-
- let lastEl = (lastKey === 'template') ? templateEl : lookup[lastKey]
-
- let scope = scopes[index]
- let key = keys[index]
-
- let clone = document.importNode(templateEl.content, true).firstElementChild
-
- addScopeToNode(clone, reactive(scope), templateEl)
-
- mutateDom(() => {
- lastEl.after(clone)
-
- initTree(clone)
- })
-
- if (typeof key === 'object') {
- warn('x-for key cannot be an object, it must be a string or an integer', templateEl)
- }
-
- lookup[key] = clone
- }
-
- // If an element hasn't changed, we still want to "refresh" the
- // data it depends on in case the data has changed in an
- // "unobservable" way.
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])])
- }
-
- // Now we'll log the keys (and the order they're in) for comparing
- // against next time.
- templateEl._x_prevKeys = keys
- })
-}
-
-// This was taken from VueJS 2.* core. Thanks Vue!
-function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
- let stripParensRE = /^\s*\(|\)\s*$/g
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
- let inMatch = expression.match(forAliasRE)
-
- if (! inMatch) return
-
- let res = {}
- res.items = inMatch[2].trim()
- let item = inMatch[1].replace(stripParensRE, '').trim()
- let iteratorMatch = item.match(forIteratorRE)
-
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, '').trim()
- res.index = iteratorMatch[1].trim()
-
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim()
- }
- } else {
- res.item = item
- }
-
- return res
-}
-
-function getIterationScopeVariables(iteratorNames, item, index, items) {
- // We must create a new object, so each iteration has a new scope
- let scopeVariables = {}
-
- // Support array destructuring ([foo, bar]).
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace('[', '').replace(']', '').split(',').map(i => i.trim())
-
- names.forEach((name, i) => {
- scopeVariables[name] = item[i]
- })
- // Support object destructuring ({ foo: 'oof', bar: 'rab' }).
- } else if (/^\{.*\}$/.test(iteratorNames.item) && ! Array.isArray(item) && typeof item === 'object') {
- let names = iteratorNames.item.replace('{', '').replace('}', '').split(',').map(i => i.trim())
-
- names.forEach(name => {
- scopeVariables[name] = item[name]
- })
- } else {
- scopeVariables[iteratorNames.item] = item
- }
-
- if (iteratorNames.index) scopeVariables[iteratorNames.index] = index
-
- if (iteratorNames.collection) scopeVariables[iteratorNames.collection] = items
-
- return scopeVariables
-}
-
-function isNumeric(subject){
- return ! Array.isArray(subject) && ! isNaN(subject)
-}
diff --git a/alpinejs/packages/alpinejs/src/directives/x-html.js b/alpinejs/packages/alpinejs/src/directives/x-html.js
deleted file mode 100644
index b4977d3..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-html.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { evaluateLater } from '../evaluator'
-import { directive } from '../directives'
-import { mutateDom } from '../mutation'
-
-directive('html', (el, { expression }, { effect, evaluateLater }) => {
- let evaluate = evaluateLater(expression)
-
- effect(() => {
- evaluate(value => {
- el.innerHTML = value
- })
- })
-})
diff --git a/alpinejs/packages/alpinejs/src/directives/x-if.js b/alpinejs/packages/alpinejs/src/directives/x-if.js
deleted file mode 100644
index 8cbb030..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-if.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { evaluateLater } from '../evaluator'
-import { addScopeToNode } from '../scope'
-import { directive } from '../directives'
-import { initTree } from '../lifecycle'
-import { mutateDom } from '../mutation'
-
-directive('if', (el, { expression }, { effect, cleanup }) => {
- let evaluate = evaluateLater(el, expression)
-
- let show = () => {
- if (el._x_currentIfEl) return el._x_currentIfEl
-
- let clone = el.content.cloneNode(true).firstElementChild
-
- addScopeToNode(clone, {}, el)
-
- mutateDom(() => {
- el.after(clone)
-
- initTree(clone)
- })
-
- el._x_currentIfEl = clone
-
- el._x_undoIf = () => { clone.remove(); delete el._x_currentIfEl }
-
- return clone
- }
-
- let hide = () => {
- if (! el._x_undoIf) return
-
- el._x_undoIf()
-
- delete el._x_undoIf
- }
-
- effect(() => evaluate(value => {
- value ? show() : hide()
- }))
-
- cleanup(() => el._x_undoIf && el._x_undoIf())
-})
diff --git a/alpinejs/packages/alpinejs/src/directives/x-ignore.js b/alpinejs/packages/alpinejs/src/directives/x-ignore.js
deleted file mode 100644
index 2f21de3..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-ignore.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { directive } from "../directives"
-
-let handler = () => {}
-
-handler.inline = (el, { modifiers }, { cleanup }) => {
- modifiers.includes('self')
- ? el._x_ignoreSelf = true
- : el._x_ignore = true
-
- cleanup(() => {
- modifiers.includes('self')
- ? delete el._x_ignoreSelf
- : delete el._x_ignore
- })
-}
-
-directive('ignore', handler)
diff --git a/alpinejs/packages/alpinejs/src/directives/x-init.js b/alpinejs/packages/alpinejs/src/directives/x-init.js
deleted file mode 100644
index a11cb04..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-init.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import { directive, prefix } from "../directives";
-import { addInitSelector } from "../lifecycle";
-import { skipDuringClone } from "../clone";
-import { evaluate } from "../evaluator";
-
-addInitSelector(() => `[${prefix('init')}]`)
-
-directive('init', skipDuringClone((el, { expression }) => {
- if (typeof expression === 'string') {
- return !! expression.trim() && evaluate(el, expression, {}, false)
- }
-
- return evaluate(el, expression, {}, false)
-}))
diff --git a/alpinejs/packages/alpinejs/src/directives/x-model.js b/alpinejs/packages/alpinejs/src/directives/x-model.js
deleted file mode 100644
index 12ee3d8..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-model.js
+++ /dev/null
@@ -1,107 +0,0 @@
-import { evaluateLater } from '../evaluator'
-import { directive } from '../directives'
-import { mutateDom } from '../mutation'
-import bind from '../utils/bind'
-import on from '../utils/on'
-
-directive('model', (el, { modifiers, expression }, { effect, cleanup }) => {
- let evaluate = evaluateLater(el, expression)
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`
- let evaluateAssignment = evaluateLater(el, assignmentExpression)
-
- // If the element we are binding to is a select, a radio, or checkbox
- // we'll listen for the change event instead of the "input" event.
- var event = (el.tagName.toLowerCase() === 'select')
- || ['checkbox', 'radio'].includes(el.type)
- || modifiers.includes('lazy')
- ? 'change' : 'input'
-
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression)
-
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {}, { scope: {
- '$event': e,
- rightSideOfExpression: assigmentFunction
- }})
- })
-
- cleanup(() => removeListener())
-
- el._x_forceModelUpdate = () => {
- evaluate(value => {
- // If nested model key is undefined, set the default value to empty string.
- if (value === undefined && expression.match(/\./)) value = ''
-
- // @todo: This is nasty
- window.fromModel = true
- mutateDom(() => bind(el, 'value', value))
- delete window.fromModel
- })
- }
-
- effect(() => {
- // Don't modify the value of the input if it's focused.
- if (modifiers.includes('unintrusive') && document.activeElement.isSameNode(el)) return
-
- el._x_forceModelUpdate()
- })
-})
-
-function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === 'radio') {
- // Radio buttons only work properly when they share a name attribute.
- // People might assume we take care of that for them, because
- // they already set a shared "x-model" attribute.
- mutateDom(() => {
- if (! el.hasAttribute('name')) el.setAttribute('name', expression)
- })
- }
-
- return (event, currentValue) => {
- return mutateDom(() => {
- // Check for event.detail due to an issue where IE11 handles other events as a CustomEvent.
- // Safari autofill triggers event as CustomEvent and assigns value to target
- // so we return event.target.value instead of event.detail
- if (event instanceof CustomEvent && event.detail !== undefined) {
- return event.detail || event.target.value
- } else if (el.type === 'checkbox') {
- // If the data we are binding to is an array, toggle its value inside the array.
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes('number') ? safeParseNumber(event.target.value) : event.target.value
-
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter(el => ! checkedAttrLooseCompare(el, newValue))
- } else {
- return event.target.checked
- }
- } else if (el.tagName.toLowerCase() === 'select' && el.multiple) {
- return modifiers.includes('number')
- ? Array.from(event.target.selectedOptions).map(option => {
- let rawValue = option.value || option.text
- return safeParseNumber(rawValue)
- })
- : Array.from(event.target.selectedOptions).map(option => {
- return option.value || option.text
- })
- } else {
- let rawValue = event.target.value
- return modifiers.includes('number')
- ? safeParseNumber(rawValue)
- : (modifiers.includes('trim') ? rawValue.trim() : rawValue)
- }
- })
- }
-}
-
-function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null
-
- return isNumeric(number) ? number : rawValue
-}
-
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB
-}
-
-function isNumeric(subject){
- return ! Array.isArray(subject) && ! isNaN(subject)
-}
diff --git a/alpinejs/packages/alpinejs/src/directives/x-on.js b/alpinejs/packages/alpinejs/src/directives/x-on.js
deleted file mode 100644
index 91c6d89..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-on.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { directive, into, mapAttributes, prefix, startingWith } from '../directives'
-import { evaluateLater } from '../evaluator'
-import { skipDuringClone } from '../clone'
-import on from '../utils/on'
-
-mapAttributes(startingWith('@', into(prefix('on:'))))
-
-directive('on', skipDuringClone((el, { value, modifiers, expression }, { cleanup }) => {
- let evaluate = expression ? evaluateLater(el, expression) : () => {}
-
- let removeListener = on(el, value, modifiers, e => {
- evaluate(() => {}, { scope: { '$event': e }, params: [e] })
- })
-
- cleanup(() => removeListener())
-}))
diff --git a/alpinejs/packages/alpinejs/src/directives/x-ref.js b/alpinejs/packages/alpinejs/src/directives/x-ref.js
deleted file mode 100644
index 9d6bbf6..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-ref.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { closestRoot } from '../lifecycle'
-import { directive } from '../directives'
-
-function handler () {}
-
-handler.inline = (el, { expression }, { cleanup }) => {
- let root = closestRoot(el)
-
- if (! root._x_refs) root._x_refs = {}
-
- root._x_refs[expression] = el
-
- cleanup(() => delete root._x_refs[expression])
-}
-
-directive('ref', handler)
diff --git a/alpinejs/packages/alpinejs/src/directives/x-show.js b/alpinejs/packages/alpinejs/src/directives/x-show.js
deleted file mode 100644
index b9619b5..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-show.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import { evaluateLater } from '../evaluator'
-import { directive } from '../directives'
-import { mutateDom } from '../mutation'
-import { once } from '../utils/once'
-
-directive('show', (el, { modifiers, expression }, { effect }) => {
- let evaluate = evaluateLater(el, expression)
-
- let hide = () => mutateDom(() => {
- el.style.display = 'none'
-
- el._x_isShown = false
- })
-
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === 'none') {
- el.removeAttribute('style')
- } else {
- el.style.removeProperty('display')
- }
-
- el._x_isShown = true
- })
-
- // We are wrapping this function in a setTimeout here to prevent
- // a race condition from happening where elements that have a
- // @click.away always view themselves as shown on the page.
- let clickAwayCompatibleShow = () => setTimeout(show)
-
- let toggle = once(
- value => value ? show() : hide(),
- value => {
- if (typeof el._x_toggleAndCascadeWithTransitions === 'function') {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide)
- } else {
- value ? clickAwayCompatibleShow() : hide()
- }
- }
- )
-
- let oldValue
- let firstTime = true
-
- effect(() => evaluate(value => {
- // Let's make sure we only call this effect if the value changed.
- // This prevents "blip" transitions. (1 tick out, then in)
- if (! firstTime && value === oldValue) return
-
- if (modifiers.includes('immediate')) value ? clickAwayCompatibleShow() : hide()
-
- toggle(value)
-
- oldValue = value
- firstTime = false
- }))
-})
diff --git a/alpinejs/packages/alpinejs/src/directives/x-text.js b/alpinejs/packages/alpinejs/src/directives/x-text.js
deleted file mode 100644
index 74be109..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-text.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import { directive } from '../directives'
-import { mutateDom } from '../mutation'
-
-directive('text', (el, { expression }, { effect, evaluateLater }) => {
- let evaluate = evaluateLater(expression)
-
- effect(() => {
- evaluate(value => {
- mutateDom(() => {
- el.textContent = value
- })
- })
- })
-})
diff --git a/alpinejs/packages/alpinejs/src/directives/x-transition.js b/alpinejs/packages/alpinejs/src/directives/x-transition.js
deleted file mode 100644
index 7e82a78..0000000
--- a/alpinejs/packages/alpinejs/src/directives/x-transition.js
+++ /dev/null
@@ -1,325 +0,0 @@
-import { releaseNextTicks, holdNextTicks } from '../nextTick'
-import { setClasses } from '../utils/classes'
-import { setStyles } from '../utils/styles'
-import { directive } from '../directives'
-import { mutateDom } from '../mutation'
-import { once } from '../utils/once'
-
-directive('transition', (el, { value, modifiers, expression }, { evaluate }) => {
- if (typeof expression === 'function') expression = evaluate(expression)
-
- if (! expression) {
- registerTransitionsFromHelper(el, modifiers, value)
- } else {
- registerTransitionsFromClassString(el, expression, value)
- }
-})
-
-function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, '')
-
- let directiveStorageMap = {
- 'enter': (classes) => { el._x_transition.enter.during = classes },
- 'enter-start': (classes) => { el._x_transition.enter.start = classes },
- 'enter-end': (classes) => { el._x_transition.enter.end = classes },
- 'leave': (classes) => { el._x_transition.leave.during = classes },
- 'leave-start': (classes) => { el._x_transition.leave.start = classes },
- 'leave-end': (classes) => { el._x_transition.leave.end = classes },
- }
-
- directiveStorageMap[stage](classString)
-}
-
-function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles)
-
- let doesntSpecify = (! modifiers.includes('in') && ! modifiers.includes('out')) && ! stage
- let transitioningIn = doesntSpecify || modifiers.includes('in') || ['enter'].includes(stage)
- let transitioningOut = doesntSpecify || modifiers.includes('out') || ['leave'].includes(stage)
-
- if (modifiers.includes('in') && ! doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf('out'))
- }
-
- if (modifiers.includes('out') && ! doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf('out'))
- }
-
- let wantsAll = ! modifiers.includes('opacity') && ! modifiers.includes('scale')
- let wantsOpacity = wantsAll || modifiers.includes('opacity')
- let wantsScale = wantsAll || modifiers.includes('scale')
- let opacityValue = wantsOpacity ? 0 : 1
- let scaleValue = wantsScale ? modifierValue(modifiers, 'scale', 95) / 100 : 1
- let delay = modifierValue(modifiers, 'delay', 0)
- let origin = modifierValue(modifiers, 'origin', 'center')
- let property = 'opacity, transform'
- let durationIn = modifierValue(modifiers, 'duration', 150) / 1000
- let durationOut = modifierValue(modifiers, 'duration', 75) / 1000
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`
-
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing,
- }
-
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`,
- }
-
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`,
- }
- }
-
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing,
- }
-
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`,
- }
-
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`,
- }
- }
-}
-
-function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (! el._x_transition) el._x_transition = {
- enter: { during: defaultValue, start: defaultValue, end: defaultValue },
-
- leave: { during: defaultValue, start: defaultValue, end: defaultValue },
-
- in(before = () => {}, after = () => {}) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end,
- }, before, after)
- },
-
- out(before = () => {}, after = () => {}) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end,
- }, before, after)
- },
- }
-}
-
-window.Element.prototype._x_toggleAndCascadeWithTransitions = function (el, value, show, hide) {
- // We are running this function after one tick to prevent
- // a race condition from happening where elements that have a
- // @click.away always view themselves as shown on the page.
- // If the tab is active, we prioritise requestAnimationFrame which plays
- // nicely with nested animations otherwise we use setTimeout to make sure
- // it keeps running in background. setTimeout has a lower priority in the
- // event loop so it would skip nested transitions but when the tab is
- // hidden, it's not relevant.
- let clickAwayCompatibleShow = () => {document.visibilityState === 'visible' ? requestAnimationFrame(show) : setTimeout(show)}
-
- if (value) {
- el._x_transition
- ? el._x_transition.in(show)
- : clickAwayCompatibleShow()
-
- return
- }
-
- // Livewire depends on el._x_hidePromise.
- el._x_hidePromise = el._x_transition
- ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {}, () => resolve(hide))
-
- el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true }))
- })
- : Promise.resolve(hide)
-
- queueMicrotask(() => {
- let closest = closestHide(el)
-
- if (closest) {
- if (! closest._x_hideChildren) closest._x_hideChildren = []
-
- closest._x_hideChildren.push(el)
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = el => {
- let carry = Promise.all([
- el._x_hidePromise,
- ...(el._x_hideChildren || []).map(hideAfterChildren),
- ]).then(([i]) => i())
-
- delete el._x_hidePromise
- delete el._x_hideChildren
-
- return carry
- }
-
- hideAfterChildren(el).catch((e) => {
- if (! e.isFromCancelledTransition) throw e
- })
- })
- }
- })
-}
-
-function closestHide(el) {
- let parent = el.parentNode
-
- if (! parent) return
-
- return parent._x_hidePromise ? parent : closestHide(parent)
-}
-
-export function transition(el, setFunction, { during, start, end } = {}, before = () => {}, after = () => {}) {
- if (el._x_transitioning) el._x_transitioning.cancel()
-
- if (Object.keys(during).length === 0 && Object.keys(start).length === 0 && Object.keys(end).length === 0) {
- // Execute right away if there is no transition.
- before(); after()
- return
- }
-
- let undoStart, undoDuring, undoEnd
-
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start)
- },
- during() {
- undoDuring = setFunction(el, during)
- },
- before,
- end() {
- undoStart()
-
- undoEnd = setFunction(el, end)
- },
- after,
- cleanup() {
- undoDuring()
- undoEnd()
- },
- })
-}
-
-export function performTransition(el, stages) {
- // All transitions need to be truly "cancellable". Meaning we need to
- // account for interruptions at ALL stages of the transitions and
- // immediately run the rest of the transition.
- let interrupted, reachedBefore, reachedEnd
-
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true
-
- if (! reachedBefore) stages.before()
-
- if (! reachedEnd) {
- stages.end()
-
- releaseNextTicks()
- }
-
- stages.after()
-
- // Adding an "isConnected" check, in case the callback removed the element from the DOM.
- if (el.isConnected) stages.cleanup()
-
- delete el._x_transitioning
- })
- })
-
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) { this.beforeCancels.push(callback) },
- cancel: once(function () { while (this.beforeCancels.length) { this.beforeCancels.shift()() }; finish(); }),
- finish,
- }
-
- mutateDom(() => {
- stages.start()
- stages.during()
- })
-
- holdNextTicks()
-
- requestAnimationFrame(() => {
- if (interrupted) return
-
- // Note: Safari's transitionDuration property will list out comma separated transition durations
- // for every single transition property. Let's grab the first one and call it a day.
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, '').replace('s', '')) * 1000
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, '').replace('s', '')) * 1000
-
- if (duration === 0) duration = Number(getComputedStyle(el).animationDuration.replace('s', '')) * 1000
-
- mutateDom(() => {
- stages.before()
- })
-
- reachedBefore = true
-
- requestAnimationFrame(() => {
- if (interrupted) return
-
- mutateDom(() => {
- stages.end()
- })
-
- releaseNextTicks()
-
- setTimeout(el._x_transitioning.finish, duration + delay)
-
- reachedEnd = true
- })
- })
-}
-
-export function modifierValue(modifiers, key, fallback) {
- // If the modifier isn't present, use the default.
- if (modifiers.indexOf(key) === -1) return fallback
-
- // If it IS present, grab the value after it: x-show.transition.duration.500ms
- const rawValue = modifiers[modifiers.indexOf(key) + 1]
-
- if (! rawValue) return fallback
-
- if (key === 'scale') {
- // Check if the very next value is NOT a number and return the fallback.
- // If x-show.transition.scale, we'll use the default scale value.
- // That is how a user opts out of the opacity transition.
- if (isNaN(rawValue)) return fallback
- }
-
- if (key === 'duration') {
- // Support x-transition.duration.500ms && duration.500
- let match = rawValue.match(/([0-9]+)ms/)
- if (match) return match[1]
- }
-
- if (key === 'origin') {
- // Support chaining origin directions: x-show.transition.top.right
- if (['top', 'right', 'left', 'center', 'bottom'].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(' ')
- }
- }
-
- return rawValue
-}
diff --git a/alpinejs/packages/alpinejs/src/evaluator.js b/alpinejs/packages/alpinejs/src/evaluator.js
deleted file mode 100644
index 2bb4d11..0000000
--- a/alpinejs/packages/alpinejs/src/evaluator.js
+++ /dev/null
@@ -1,125 +0,0 @@
-import { closestDataStack, mergeProxies } from './scope'
-import { injectMagics } from './magics'
-import { onAttributeRemoved } from './mutation'
-
-export function evaluate(el, expression, extras = {}) {
- let result
-
- evaluateLater(el, expression)(value => result = value, extras)
-
- return result
-}
-
-export function evaluateLater(...args) {
- return theEvaluatorFunction(...args)
-}
-
-let theEvaluatorFunction = normalEvaluator
-
-export function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator
-}
-
-export function normalEvaluator(el, expression) {
- let overriddenMagics = {}
-
- let cleanup = injectMagics(overriddenMagics, el).cleanup
-
- // MemLeak1: Issue #2140 (note: there are other uses of injectMagics)
- onAttributeRemoved(el, "evaluator", cleanup)
-
- let dataStack = [overriddenMagics, ...closestDataStack(el)]
-
- if (typeof expression === 'function') {
- return generateEvaluatorFromFunction(dataStack, expression)
- }
-
- let evaluator = generateEvaluatorFromString(dataStack, expression)
-
- return tryCatch.bind(null, el, expression, evaluator)
-}
-
-export function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {}, { scope = {}, params = [] } = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params)
-
- runIfTypeOfFunction(receiver, result)
- }
-}
-
-let evaluatorMemo = {}
-
-function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression]
- }
-
- let AsyncFunction = Object.getPrototypeOf(async function(){}).constructor
-
- // Some expressions that are useful in Alpine are not valid as the right side of an expression.
- // Here we'll detect if the expression isn't valid for an assignement and wrap it in a self-
- // calling function so that we don't throw an error AND a "return" statement can b e used.
- let rightSideSafeExpression = 0
- // Support expressions starting with "if" statements like: "if (...) doSomething()"
- || /^[\n\s]*if.*\(.*\)/.test(expression)
- // Support expressions starting with "let/const" like: "let foo = 'bar'"
- || /^(let|const)/.test(expression)
- ? `(() => { ${expression} })()`
- : expression
-
- let func = new AsyncFunction(['__self', 'scope'], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`)
-
- evaluatorMemo[expression] = func
-
- return func
-}
-
-function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression)
-
- return (receiver = () => {}, { scope = {}, params = [] } = {}) => {
- func.result = undefined
- func.finished = false
-
- // Run the function.
-
- let completeScope = mergeProxies([ scope, ...dataStack ])
-
- let promise = func(func, completeScope)
-
- // Check if the function ran synchronously,
- if (func.finished) {
- // Return the immediate result.
- runIfTypeOfFunction(receiver, func.result, completeScope, params)
- } else {
- // If not, return the result when the promise resolves.
- promise.then(result => {
- runIfTypeOfFunction(receiver, result, completeScope, params)
- })
- }
- }
-}
-
-export function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === 'function') {
- let result = value.apply(scope, params)
-
- if (result instanceof Promise) {
- result.then(i => runIfTypeOfFunction(receiver, i, scope, params))
- } else {
- receiver(result)
- }
- } else {
- receiver(value)
- }
-}
-
-export function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args)
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}\n\nExpression: "${expression}"\n\n`, el)
-
- throw e
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/index.js b/alpinejs/packages/alpinejs/src/index.js
deleted file mode 100644
index b0ea550..0000000
--- a/alpinejs/packages/alpinejs/src/index.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * _
- * /\ | | (_) (_)
- * / \ | |_ __ _ _ __ ___ _ ___
- * / /\ \ | | '_ \| | '_ \ / _ \ | / __|
- * / ____ \| | |_) | | | | | __/_| \__ \
- * /_/ \_\_| .__/|_|_| |_|\___(_) |___/
- * | | _/ |
- * |_| |__/
- *
- * Let's build Alpine together. It's easier than you think.
- * For starters, we'll import Alpine's core. This is the
- * object that will expose all of Alpine's public API.
- */
-import Alpine from './alpine'
-
-/**
- * _______________________________________________________
- * The Evaluator
- * -------------------------------------------------------
- *
- * Now we're ready to bootstrap Alpine's evaluation system.
- * It's the function that converts raw JavaScript string
- * expressions like @click="toggle()", into actual JS.
- */
-import { normalEvaluator } from './evaluator'
-
-Alpine.setEvaluator(normalEvaluator)
-
-/**
- * _______________________________________________________
- * The Reactivity Engine
- * -------------------------------------------------------
- *
- * This is the reactivity core of Alpine. It's the part of
- * Alpine that triggers an element with x-text="message"
- * to update its inner text when "message" is changed.
- */
-import { reactive, effect, stop, toRaw } from '@vue/reactivity'
-
-Alpine.setReactivityEngine({ reactive, effect, release: stop, raw: toRaw })
-
-/**
- * _______________________________________________________
- * The Magics
- * -------------------------------------------------------
- *
- * Yeah, we're calling them magics here like they're nouns.
- * These are the properties that are magically available
- * to all the Alpine expressions, within your web app.
- */
-import './magics/index'
-
-/**
- * _______________________________________________________
- * The Directives
- * -------------------------------------------------------
- *
- * Now that the core is all set up, we can register Alpine
- * directives like x-text or x-on that form the basis of
- * how Alpine adds behavior to an app's static markup.
- */
-import './directives/index'
-
-/**
- * _______________________________________________________
- * The Alpine Global
- * -------------------------------------------------------
- *
- * Now that we have set everything up internally, anything
- * Alpine-related that will need to be accessed on-going
- * will be made available through the "Alpine" global.
- */
-export default Alpine
diff --git a/alpinejs/packages/alpinejs/src/interceptor.js b/alpinejs/packages/alpinejs/src/interceptor.js
deleted file mode 100644
index 0f9f557..0000000
--- a/alpinejs/packages/alpinejs/src/interceptor.js
+++ /dev/null
@@ -1,77 +0,0 @@
-// Warning: The concept of "interceptors" in Alpine is not public API and is subject to change
-// without tagging a major release.
-
-export function initInterceptors(data) {
- let isObject = val => typeof val === 'object' && !Array.isArray(val) && val !== null
-
- let recurse = (obj, basePath = '') => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {
- // Skip getters.
- if (enumerable === false || value === undefined) return
-
- let path = basePath === '' ? key : `${basePath}.${key}`
-
- if (typeof value === 'object' && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data, path, key)
- } else {
- if (isObject(value) && value !== obj && ! (value instanceof Element)) {
- recurse(value, path)
- }
- }
- })
- }
-
- return recurse(data)
-}
-
-export function interceptor(callback, mutateObj = () => {}) {
- let obj = {
- initialValue: undefined,
-
- _x_interceptor: true,
-
- initialize(data, path, key) {
- return callback(this.initialValue, () => get(data, path), (value) => set(data, path, value), path, key)
- }
- }
-
- mutateObj(obj)
-
- return initialValue => {
- if (typeof initialValue === 'object' && initialValue !== null && initialValue._x_interceptor) {
- // Support nesting interceptors.
- let initialize = obj.initialize.bind(obj)
-
- obj.initialize = (data, path, key) => {
- let innerValue = initialValue.initialize(data, path, key)
-
- obj.initialValue = innerValue
-
- return initialize(data, path, key)
- }
- } else {
- obj.initialValue = initialValue
- }
-
- return obj
- }
-}
-
-function get(obj, path) {
- return path.split('.').reduce((carry, segment) => carry[segment], obj)
-}
-
-function set(obj, path, value) {
- if (typeof path === 'string') path = path.split('.')
-
- if (path.length === 1) obj[path[0]] = value;
- else if (path.length === 0) throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/lifecycle.js b/alpinejs/packages/alpinejs/src/lifecycle.js
deleted file mode 100644
index cbf079f..0000000
--- a/alpinejs/packages/alpinejs/src/lifecycle.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import { startObservingMutations, onAttributesAdded, onElAdded, onElRemoved, cleanupAttributes } from "./mutation"
-import { deferHandlingDirectives, directives } from "./directives"
-import { dispatch } from './utils/dispatch'
-import { nextTick } from "./nextTick"
-import { walk } from "./utils/walk"
-import { warn } from './utils/warn'
-
-export function start() {
- if (! document.body) warn('Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine\'s `<script>` tag?')
-
- dispatch(document, 'alpine:init')
- dispatch(document, 'alpine:initializing')
-
- startObservingMutations()
-
- onElAdded(el => initTree(el, walk))
- onElRemoved(el => nextTick(() => destroyTree(el)))
-
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach(handle => handle())
- })
-
- let outNestedComponents = el => ! closestRoot(el.parentElement, true)
- Array.from(document.querySelectorAll(allSelectors()))
- .filter(outNestedComponents)
- .forEach(el => {
- initTree(el)
- })
-
- dispatch(document, 'alpine:initialized')
-}
-
-let rootSelectorCallbacks = []
-let initSelectorCallbacks = []
-
-export function rootSelectors() {
- return rootSelectorCallbacks.map(fn => fn())
-}
-
-export function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map(fn => fn())
-}
-
-export function addRootSelector(selectorCallback) { rootSelectorCallbacks.push(selectorCallback) }
-export function addInitSelector(selectorCallback) { initSelectorCallbacks.push(selectorCallback) }
-
-export function closestRoot(el, includeInitSelectors = false) {
- if (!el) return
-
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors()
-
- if (selectors.some(selector => el.matches(selector))) return el
-
- if (! el.parentElement) return
-
- return closestRoot(el.parentElement, includeInitSelectors)
-}
-
-export function isRoot(el) {
- return rootSelectors().some(selector => el.matches(selector))
-}
-
-export function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el, skip) => {
- directives(el, el.attributes).forEach(handle => handle())
-
- el._x_ignore && skip()
- })
- })
-}
-
-export function destroyTree(root) {
- walk(root, el => cleanupAttributes(el))
-}
diff --git a/alpinejs/packages/alpinejs/src/magics.js b/alpinejs/packages/alpinejs/src/magics.js
deleted file mode 100644
index b24515c..0000000
--- a/alpinejs/packages/alpinejs/src/magics.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import Alpine from './alpine'
-import { interceptor } from './interceptor'
-
-let magics = {}
-
-export function magic(name, callback) {
- magics[name] = callback
-}
-
-export function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() { return callback(el, { Alpine, interceptor }) },
-
- enumerable: false,
- })
- })
-
- return {
- obj,
- cleanup: () => {
- // MemLeak1: Issue #2140
- el = null;
- }
- };
-}
diff --git a/alpinejs/packages/alpinejs/src/magics/$dispatch.js b/alpinejs/packages/alpinejs/src/magics/$dispatch.js
deleted file mode 100644
index 6eb878d..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$dispatch.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { dispatch } from '../utils/dispatch'
-import { magic } from '../magics'
-
-magic('dispatch', el => dispatch.bind(dispatch, el))
diff --git a/alpinejs/packages/alpinejs/src/magics/$el.js b/alpinejs/packages/alpinejs/src/magics/$el.js
deleted file mode 100644
index 10b9f49..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$el.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { magic } from "../magics";
-
-magic('el', el => el)
diff --git a/alpinejs/packages/alpinejs/src/magics/$nextTick.js b/alpinejs/packages/alpinejs/src/magics/$nextTick.js
deleted file mode 100644
index 8318cc6..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$nextTick.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { nextTick } from '../nextTick'
-import { magic } from '../magics'
-
-magic('nextTick', () => nextTick)
diff --git a/alpinejs/packages/alpinejs/src/magics/$refs.js b/alpinejs/packages/alpinejs/src/magics/$refs.js
deleted file mode 100644
index afd48ed..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$refs.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { closestRoot } from '../lifecycle'
-import { mergeProxies } from '../scope'
-import { magic } from '../magics'
-
-magic('refs', el => {
- if (el._x_refs_proxy) return el._x_refs_proxy
-
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el))
-
- return el._x_refs_proxy
-})
-
-function getArrayOfRefObject(el) {
- let refObjects = []
-
- let currentEl = el
-
- while (currentEl) {
- if (currentEl._x_refs) refObjects.push(currentEl._x_refs)
-
- currentEl = currentEl.parentNode
- }
-
- return refObjects
-}
diff --git a/alpinejs/packages/alpinejs/src/magics/$root.js b/alpinejs/packages/alpinejs/src/magics/$root.js
deleted file mode 100644
index 140eece..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$root.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { closestRoot } from "../lifecycle";
-import { magic } from "../magics";
-
-magic('root', el => closestRoot(el))
diff --git a/alpinejs/packages/alpinejs/src/magics/$store.js b/alpinejs/packages/alpinejs/src/magics/$store.js
deleted file mode 100644
index a14d40d..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$store.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { getStores } from '../store'
-import { magic } from '../magics'
-
-magic('store', getStores)
diff --git a/alpinejs/packages/alpinejs/src/magics/$watch.js b/alpinejs/packages/alpinejs/src/magics/$watch.js
deleted file mode 100644
index 865e2db..0000000
--- a/alpinejs/packages/alpinejs/src/magics/$watch.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import { evaluateLater } from '../evaluator'
-import { elementBoundEffect } from '../reactivity'
-import { magic } from '../magics'
-import { onAttributeRemoved } from '../mutation'
-
-magic('watch', el => (key, callback) => {
- let evaluate = evaluateLater(el, key)
-
- let firstTime = true
-
- let oldValue
-
- let [effect, cleanupEffect] = elementBoundEffect(el)
-
- // MemLeak1: Issue #2140
- onAttributeRemoved(el, key, cleanupEffect)
-
- effect(() => evaluate(value => {
- // This is a hack to force deep reactivity for things like "items.push()".
- let div = document.createElement('div')
- div.dataset.throwAway = value
-
- if (! firstTime) {
- // We have to queue this watcher as a microtask so that
- // the watcher doesn't pick up its own dependencies.
- queueMicrotask(() => {
- callback(value, oldValue)
-
- oldValue = value
- })
- } else {
- oldValue = value
- }
-
- firstTime = false
- }))
-})
diff --git a/alpinejs/packages/alpinejs/src/magics/index.js b/alpinejs/packages/alpinejs/src/magics/index.js
deleted file mode 100644
index 1e1089c..0000000
--- a/alpinejs/packages/alpinejs/src/magics/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import './$nextTick'
-import './$dispatch'
-import './$watch'
-import './$store'
-import './$root'
-import './$refs'
-import './$el'
diff --git a/alpinejs/packages/alpinejs/src/mutation.js b/alpinejs/packages/alpinejs/src/mutation.js
deleted file mode 100644
index 409a096..0000000
--- a/alpinejs/packages/alpinejs/src/mutation.js
+++ /dev/null
@@ -1,195 +0,0 @@
-import { walk } from './utils/walk';
-
-let onAttributeAddeds = []
-let onElRemoveds = []
-let onElAddeds = []
-
-export function onElAdded(callback) {
- onElAddeds.push(callback)
-}
-
-export function onElRemoved(callback) {
- onElRemoveds.push(callback)
-}
-
-export function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback)
-}
-
-export function onAttributeRemoved(el, name, callback) {
- if (! el._x_attributeCleanups) el._x_attributeCleanups = {}
- if (! el._x_attributeCleanups[name]) el._x_attributeCleanups[name] = []
-
- el._x_attributeCleanups[name].push(callback)
-}
-
-export function cleanupAttributes(el, names) {
- if (! el._x_attributeCleanups) return
-
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === undefined || names.includes(name)) {
- value.forEach(i => i())
-
- delete el._x_attributeCleanups[name]
- }
- })
-}
-
-let observer = new MutationObserver(onMutate)
-
-let currentlyObserving = false
-
-export function startObservingMutations() {
- observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true })
-
- currentlyObserving = true
-}
-
-export function stopObservingMutations() {
- flushObserver()
-
- observer.disconnect()
-
- currentlyObserving = false
-}
-
-let recordQueue = []
-let willProcessRecordQueue = false
-
-export function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords())
-
- if (recordQueue.length && ! willProcessRecordQueue) {
- willProcessRecordQueue = true
-
- queueMicrotask(() => {
- processRecordQueue()
-
- willProcessRecordQueue = false
- })
- }
-}
-
-function processRecordQueue() {
- onMutate(recordQueue)
-
- recordQueue.length = 0
-}
-
-export function mutateDom(callback) {
- if (! currentlyObserving) return callback()
-
- stopObservingMutations()
-
- let result = callback()
-
- startObservingMutations()
-
- return result
-}
-
-let isCollecting = false
-let deferredMutations = []
-
-export function deferMutations() {
- isCollecting = true
-}
-
-export function flushAndStopDeferringMutations() {
- isCollecting = false
-
- onMutate(deferredMutations)
-
- deferredMutations = []
-}
-
-function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations)
-
- return
- }
-
- let addedNodes = []
- let removedNodes = []
- let addedAttributes = new Map
- let removedAttributes = new Map
-
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver) continue
-
- if (mutations[i].type === 'childList') {
- mutations[i].addedNodes.forEach(node => node.nodeType === 1 && addedNodes.push(node))
- mutations[i].removedNodes.forEach(node => node.nodeType === 1 && removedNodes.push(node))
- }
-
- if (mutations[i].type === 'attributes') {
- let el = mutations[i].target
- let name = mutations[i].attributeName
- let oldValue = mutations[i].oldValue
-
- let add = () => {
- if (! addedAttributes.has(el)) addedAttributes.set(el, [])
-
- addedAttributes.get(el).push({ name, value: el.getAttribute(name) })
- }
-
- let remove = () => {
- if (! removedAttributes.has(el)) removedAttributes.set(el, [])
-
- removedAttributes.get(el).push(name)
- }
-
- // New attribute.
- if (el.hasAttribute(name) && oldValue === null) {
- add()
- // Changed atttribute.
- } else if (el.hasAttribute(name)) {
- remove()
- add()
- // Removed atttribute.
- } else {
- remove()
- }
- }
- }
-
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs)
- })
-
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach(i => i(el, attrs))
- })
-
- for (let node of addedNodes) {
- // If an element gets moved on a page, it's registered
- // as both an "add" and "remove", so we want to skip those.
- if (removedNodes.includes(node)) continue
-
- onElAddeds.forEach(i => i(node))
- }
-
- for (let node of removedNodes) {
- // If an element gets moved on a page, it's registered
- // as both an "add" and "remove", so we want to skip those.
- if (addedNodes.includes(node)) continue
-
- onElRemoveds.forEach(i => i(node))
-
- // Mem leak patch, see https://github.com/alpinejs/alpine/issues/2126#issuecomment-940942921
- if (node.localName === 'body') {
- node.querySelectorAll('[x-data]').forEach((el) => {
- walk(el, (el) => {
- onElRemoveds.forEach((i) => i(el));
- el.remove();
- });
- });
- }
- }
-
- addedNodes = null
- removedNodes = null
- addedAttributes = null
- removedAttributes = null
-}
diff --git a/alpinejs/packages/alpinejs/src/nextTick.js b/alpinejs/packages/alpinejs/src/nextTick.js
deleted file mode 100644
index e5c0d88..0000000
--- a/alpinejs/packages/alpinejs/src/nextTick.js
+++ /dev/null
@@ -1,24 +0,0 @@
-
-let tickStack = []
-
-let isHolding = false
-
-export function nextTick(callback) {
- tickStack.push(callback)
-
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks()
- })
- })
-}
-
-export function releaseNextTicks() {
- isHolding = false
-
- while (tickStack.length) tickStack.shift()()
-}
-
-export function holdNextTicks() {
- isHolding = true
-}
diff --git a/alpinejs/packages/alpinejs/src/plugin.js b/alpinejs/packages/alpinejs/src/plugin.js
deleted file mode 100644
index 98a547b..0000000
--- a/alpinejs/packages/alpinejs/src/plugin.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import Alpine from './alpine'
-
-export function plugin(callback) {
- callback(Alpine)
-}
diff --git a/alpinejs/packages/alpinejs/src/reactivity.js b/alpinejs/packages/alpinejs/src/reactivity.js
deleted file mode 100644
index b233d06..0000000
--- a/alpinejs/packages/alpinejs/src/reactivity.js
+++ /dev/null
@@ -1,62 +0,0 @@
-
-import { scheduler } from './scheduler'
-
-let reactive, effect, release, raw
-
-let shouldSchedule = true
-export function disableEffectScheduling(callback) {
- shouldSchedule = false
-
- callback()
-
- shouldSchedule = true
-}
-
-export function setReactivityEngine(engine) {
- reactive = engine.reactive
- release = engine.release
- effect = (callback) => engine.effect(callback, { scheduler: task => {
- if (shouldSchedule) {
- scheduler(task)
- } else {
- task()
- }
- } })
- raw = engine.raw
-}
-
-export function overrideEffect(override) { effect = override }
-
-export function elementBoundEffect(el) {
- let cleanup = () => {}
-
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback)
-
- if (! el._x_effects) {
- el._x_effects = new Set
-
- // Livewire depends on el._x_runEffects.
- el._x_runEffects = () => { el._x_effects.forEach(i => i()) }
- }
-
- el._x_effects.add(effectReference)
-
- cleanup = () => {
- if (effectReference === undefined) return
-
- el._x_effects.delete(effectReference)
-
- release(effectReference)
- }
- }
-
- return [wrappedEffect, () => { cleanup() }]
-}
-
-export {
- release,
- reactive,
- effect,
- raw,
-}
diff --git a/alpinejs/packages/alpinejs/src/scheduler.js b/alpinejs/packages/alpinejs/src/scheduler.js
deleted file mode 100644
index 622e453..0000000
--- a/alpinejs/packages/alpinejs/src/scheduler.js
+++ /dev/null
@@ -1,33 +0,0 @@
-
-let flushPending = false
-let flushing = false
-let queue = []
-
-export function scheduler (callback) { queueJob(callback) }
-
-function queueJob(job) {
- if (! queue.includes(job)) queue.push(job)
-
- queueFlush()
-}
-
-function queueFlush() {
- if (! flushing && ! flushPending) {
- flushPending = true
-
- queueMicrotask(flushJobs)
- }
-}
-
-export function flushJobs() {
- flushPending = false
- flushing = true
-
- for (let i = 0; i < queue.length; i++) {
- queue[i]()
- }
-
- queue.length = 0
-
- flushing = false
-}
diff --git a/alpinejs/packages/alpinejs/src/scope.js b/alpinejs/packages/alpinejs/src/scope.js
deleted file mode 100644
index abceae6..0000000
--- a/alpinejs/packages/alpinejs/src/scope.js
+++ /dev/null
@@ -1,105 +0,0 @@
-
-export function scope(node) {
- return mergeProxies(closestDataStack(node))
-}
-
-export function addScopeToNode(node, data, referenceNode) {
- node._x_dataStack = [data, ...closestDataStack(referenceNode || node)]
-
- return () => {
- node._x_dataStack = node._x_dataStack.filter(i => i !== data)
- }
-}
-
-export function hasScope(node) {
- return !! node._x_dataStack
-}
-
-export function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0]
-
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value
- })
-}
-
-export function closestDataStack(node) {
- if (node._x_dataStack) return node._x_dataStack
-
- if (typeof ShadowRoot === 'function' && node instanceof ShadowRoot) {
- return closestDataStack(node.host)
- }
-
- if (! node.parentNode) {
- return []
- }
-
- return closestDataStack(node.parentNode)
-}
-
-export function closestDataProxy(el) {
- return mergeProxies(closestDataStack(el))
-}
-
-export function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap(i => Object.keys(i))))
- },
-
- has: (target, name) => {
- return objects.some(obj => obj.hasOwnProperty(name))
- },
-
- get: (target, name) => {
- return (objects.find(obj => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name)
-
- // If we already bound this getter, don't rebind.
- if ((descriptor.get && descriptor.get._x_alreadyBound) || (descriptor.set && descriptor.set._x_alreadyBound)) {
- return true
- }
-
- // Properly bind getters and setters to this wrapper Proxy.
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- // Only bind user-defined getters, not our magic properties.
- let getter = descriptor.get
- let setter = descriptor.set
- let property = descriptor
-
- getter = getter && getter.bind(thisProxy)
- setter = setter && setter.bind(thisProxy)
-
- if (getter) getter._x_alreadyBound = true
- if (setter) setter._x_alreadyBound = true
-
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter,
- })
- }
-
- return true
- }
-
- return false
- }) || {})[name]
- },
-
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find(obj => obj.hasOwnProperty(name))
-
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value
- } else {
- objects[objects.length - 1][name] = value
- }
-
- return true
- },
- })
-
- return thisProxy
-}
diff --git a/alpinejs/packages/alpinejs/src/store.js b/alpinejs/packages/alpinejs/src/store.js
deleted file mode 100644
index 9c1f18f..0000000
--- a/alpinejs/packages/alpinejs/src/store.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { reactive } from "./reactivity"
-
-let stores = {}
-let isReactive = false
-
-export function store(name, value) {
- if (! isReactive) { stores = reactive(stores); isReactive = true; }
-
- if (value === undefined) {
- return stores[name]
- }
-
- stores[name] = value
-
- if (typeof value === 'object' && value !== null && value.hasOwnProperty('init') && typeof value.init === 'function') {
- stores[name].init()
- }
-}
-
-export function getStores() { return stores }
diff --git a/alpinejs/packages/alpinejs/src/utils/bind.js b/alpinejs/packages/alpinejs/src/utils/bind.js
deleted file mode 100644
index 4d53dfc..0000000
--- a/alpinejs/packages/alpinejs/src/utils/bind.js
+++ /dev/null
@@ -1,129 +0,0 @@
-import { reactive } from '../reactivity'
-import { setClasses } from './classes'
-import { setStyles } from './styles'
-
-export default function bind(el, name, value, modifiers = []) {
- // Register bound data as pure observable data for other APIs to use.
- if (! el._x_bindings) el._x_bindings = reactive({})
-
- el._x_bindings[name] = value
-
- name = modifiers.includes('camel') ? camelCase(name) : name
-
- switch (name) {
- case 'value':
- bindInputValue(el, value)
- break;
-
- case 'style':
- bindStyles(el, value)
- break;
-
- case 'class':
- bindClasses(el, value)
- break;
-
- default:
- bindAttribute(el, name, value)
- break;
- }
-}
-
-function bindInputValue(el, value) {
- if (el.type === 'radio') {
- // Set radio value from x-bind:value, if no "value" attribute exists.
- // If there are any initial state values, radio will have a correct
- // "checked" value since x-bind:value is processed before x-model.
- if (el.attributes.value === undefined) {
- el.value = value
- }
-
- // @todo: yuck
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value)
- }
- } else if (el.type === 'checkbox') {
- // If we are explicitly binding a string to the :value, set the string,
- // If the value is a boolean/array/number/null/undefined, leave it alone, it will be set to "on"
- // automatically.
- if (Number.isInteger(value)) {
- el.value = value
- } else if (! Number.isInteger(value) && ! Array.isArray(value) && typeof value !== 'boolean' && ! [null, undefined].includes(value)) {
- el.value = String(value)
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some(val => checkedAttrLooseCompare(val, el.value))
- } else {
- el.checked = !!value
- }
- }
- } else if (el.tagName === 'SELECT') {
- updateSelect(el, value)
- } else {
- if (el.value === value) return
-
- el.value = value
- }
-}
-
-function bindClasses(el, value) {
- if (el._x_undoAddedClasses) el._x_undoAddedClasses()
-
- el._x_undoAddedClasses = setClasses(el, value)
-}
-
-function bindStyles(el, value) {
- if (el._x_undoAddedStyles) el._x_undoAddedStyles()
-
- el._x_undoAddedStyles = setStyles(el, value)
-}
-
-function bindAttribute(el, name, value) {
- if ([null, undefined, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name)
- } else {
- if (isBooleanAttr(name)) value = name
-
- setIfChanged(el, name, value)
- }
-}
-
-function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value)
- }
-}
-
-function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map(value => { return value + '' })
-
- Array.from(el.options).forEach(option => {
- option.selected = arrayWrappedValue.includes(option.value)
- })
-}
-
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase())
-}
-
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB
-}
-
-function isBooleanAttr(attrName) {
- // As per HTML spec table https://html.spec.whatwg.org/multipage/indices.html#attributes-3:boolean-attribute
- // Array roughly ordered by estimated usage
- const booleanAttributes = [
- 'disabled','checked','required','readonly','hidden','open', 'selected',
- 'autofocus', 'itemscope', 'multiple', 'novalidate','allowfullscreen',
- 'allowpaymentrequest', 'formnovalidate', 'autoplay', 'controls', 'loop',
- 'muted', 'playsinline', 'default', 'ismap', 'reversed', 'async', 'defer',
- 'nomodule'
- ]
-
- return booleanAttributes.includes(attrName)
-}
-
-function attributeShouldntBePreservedIfFalsy(name) {
- return ! ['aria-pressed', 'aria-checked', 'aria-expanded'].includes(name)
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/classes.js b/alpinejs/packages/alpinejs/src/utils/classes.js
deleted file mode 100644
index 0fd02aa..0000000
--- a/alpinejs/packages/alpinejs/src/utils/classes.js
+++ /dev/null
@@ -1,58 +0,0 @@
-
-export function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(' '))
- } else if (typeof value === 'object' && value !== null) {
- return setClassesFromObject(el, value)
- } else if (typeof value === 'function') {
- return setClasses(el, value())
- }
-
- return setClassesFromString(el, value)
-}
-
-function setClassesFromString(el, classString) {
- let split = classString => classString.split(' ').filter(Boolean)
-
- let missingClasses = classString => classString.split(' ').filter(i => ! el.classList.contains(i)).filter(Boolean)
-
- let addClassesAndReturnUndo = classes => {
- el.classList.add(...classes)
-
- return () => { el.classList.remove(...classes) }
- }
-
- // This is to allow short-circuit expressions like: :class="show || 'hidden'" && "show && 'block'"
- classString = (classString === true) ? classString = '' : (classString || '')
-
- return addClassesAndReturnUndo(missingClasses(classString))
-}
-
-function setClassesFromObject(el, classObject) {
- let split = classString => classString.split(' ').filter(Boolean)
-
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean)
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => ! bool ? split(classString) : false).filter(Boolean)
-
- let added = []
- let removed = []
-
- forRemove.forEach(i => {
- if (el.classList.contains(i)) {
- el.classList.remove(i)
- removed.push(i)
- }
- })
-
- forAdd.forEach(i => {
- if (! el.classList.contains(i)) {
- el.classList.add(i)
- added.push(i)
- }
- })
-
- return () => {
- removed.forEach(i => el.classList.add(i))
- added.forEach(i => el.classList.remove(i))
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/debounce.js b/alpinejs/packages/alpinejs/src/utils/debounce.js
deleted file mode 100644
index 850a3b1..0000000
--- a/alpinejs/packages/alpinejs/src/utils/debounce.js
+++ /dev/null
@@ -1,18 +0,0 @@
-
-export function debounce(func, wait) {
- var timeout
-
- return function() {
- var context = this, args = arguments
-
- var later = function () {
- timeout = null
-
- func.apply(context, args)
- }
-
- clearTimeout(timeout)
-
- timeout = setTimeout(later, wait)
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/dispatch.js b/alpinejs/packages/alpinejs/src/utils/dispatch.js
deleted file mode 100644
index 26f198a..0000000
--- a/alpinejs/packages/alpinejs/src/utils/dispatch.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-export function dispatch(el, name, detail = {}) {
- el.dispatchEvent(
- new CustomEvent(name, {
- detail,
- bubbles: true,
- // Allows events to pass the shadow DOM barrier.
- composed: true,
- cancelable: true,
- })
- )
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/on.js b/alpinejs/packages/alpinejs/src/utils/on.js
deleted file mode 100644
index e053560..0000000
--- a/alpinejs/packages/alpinejs/src/utils/on.js
+++ /dev/null
@@ -1,163 +0,0 @@
-import { debounce } from './debounce'
-import { throttle } from './throttle'
-
-export default function on (el, event, modifiers, callback) {
- let listenerTarget = el
-
- let handler = e => callback(e)
-
- let options = {}
-
- // This little helper allows us to add functionality to the listener's
- // handler more flexibly in a "middleware" style.
- let wrapHandler = (callback, wrapper) => (e) => wrapper(callback, e)
-
- if (modifiers.includes("dot")) event = dotSyntax(event)
- if (modifiers.includes('camel')) event = camelCase(event)
- if (modifiers.includes('passive')) options.passive = true
- if (modifiers.includes('capture')) options.capture = true
- if (modifiers.includes('window')) listenerTarget = window
- if (modifiers.includes('document')) listenerTarget = document
- if (modifiers.includes('prevent')) handler = wrapHandler(handler, (next, e) => { e.preventDefault(); next(e) })
- if (modifiers.includes('stop')) handler = wrapHandler(handler, (next, e) => { e.stopPropagation(); next(e) })
- if (modifiers.includes('self')) handler = wrapHandler(handler, (next, e) => { e.target === el && next(e) })
-
- if (modifiers.includes('away') || modifiers.includes('outside')) {
- listenerTarget = document
-
- handler = wrapHandler(handler, (next, e) => {
- if (el.contains(e.target)) return
-
- if (el.offsetWidth < 1 && el.offsetHeight < 1) return
-
- next(e)
- })
- }
-
- // Handle :keydown and :keyup listeners.
- handler = wrapHandler(handler, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return
- }
- }
-
- next(e)
- })
-
- if (modifiers.includes('debounce')) {
- let nextModifier = modifiers[modifiers.indexOf('debounce')+1] || 'invalid-wait'
- let wait = isNumeric(nextModifier.split('ms')[0]) ? Number(nextModifier.split('ms')[0]) : 250
-
- handler = debounce(handler, wait)
- }
-
- if (modifiers.includes('throttle')) {
- let nextModifier = modifiers[modifiers.indexOf('throttle')+1] || 'invalid-wait'
- let wait = isNumeric(nextModifier.split('ms')[0]) ? Number(nextModifier.split('ms')[0]) : 250
-
- handler = throttle(handler, wait)
- }
-
- if (modifiers.includes('once')) {
- handler = wrapHandler(handler, (next, e) => {
- next(e)
-
- listenerTarget.removeEventListener(event, handler, options)
- })
- }
-
- listenerTarget.addEventListener(event, handler, options)
-
- return () => {
- listenerTarget.removeEventListener(event, handler, options)
- }
-}
-
-function dotSyntax(subject) {
- return subject.replace(/-/g, ".")
-}
-
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase())
-}
-
-function isNumeric(subject){
- return ! Array.isArray(subject) && ! isNaN(subject)
-}
-
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[_\s]/, '-').toLowerCase()
-}
-
-function isKeyEvent(event) {
- return ['keydown', 'keyup'].includes(event)
-}
-
-function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter(i => {
- return ! ['window', 'document', 'prevent', 'stop', 'once'].includes(i)
- })
-
- if (keyModifiers.includes('debounce')) {
- let debounceIndex = keyModifiers.indexOf('debounce')
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex+1] || 'invalid-wait').split('ms')[0]) ? 2 : 1)
- }
-
- // If no modifier is specified, we'll call it a press.
- if (keyModifiers.length === 0) return false
-
- // If one is passed, AND it matches the key pressed, we'll call it a press.
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0])) return false
-
- // The user is listening for key combinations.
- const systemKeyModifiers = ['ctrl', 'shift', 'alt', 'meta', 'cmd', 'super']
- const selectedSystemKeyModifiers = systemKeyModifiers.filter(modifier => keyModifiers.includes(modifier))
-
- keyModifiers = keyModifiers.filter(i => ! selectedSystemKeyModifiers.includes(i))
-
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter(modifier => {
- // Alias "cmd" and "super" to "meta"
- if (modifier === 'cmd' || modifier === 'super') modifier = 'meta'
-
- return e[`${modifier}Key`]
- })
-
- // If all the modifiers selected are pressed, ...
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- // AND the remaining key is pressed as well. It's a press.
- if (keyToModifiers(e.key).includes(keyModifiers[0])) return false
- }
- }
-
- // We'll call it NOT a valid keypress.
- return true
-}
-
-function keyToModifiers(key) {
- if (! key) return []
-
- key = kebabCase(key)
-
- let modifierToKeyMap = {
- 'ctrl': 'control',
- 'slash': '/',
- 'space': '-',
- 'spacebar': '-',
- 'cmd': 'meta',
- 'esc': 'escape',
- 'up': 'arrow-up',
- 'down': 'arrow-down',
- 'left': 'arrow-left',
- 'right': 'arrow-right',
- 'period': '.',
- 'equal': '=',
- }
-
- modifierToKeyMap[key] = key
-
- return Object.keys(modifierToKeyMap).map(modifier => {
- if (modifierToKeyMap[modifier] === key) return modifier
- }).filter(modifier => modifier)
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/once.js b/alpinejs/packages/alpinejs/src/utils/once.js
deleted file mode 100644
index 643ee6f..0000000
--- a/alpinejs/packages/alpinejs/src/utils/once.js
+++ /dev/null
@@ -1,14 +0,0 @@
-
-export function once(callback, fallback = () => {}) {
- let called = false
-
- return function () {
- if (! called) {
- called = true
-
- callback.apply(this, arguments)
- } else {
- fallback.apply(this, arguments)
- }
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/styles.js b/alpinejs/packages/alpinejs/src/utils/styles.js
deleted file mode 100644
index 0761d7b..0000000
--- a/alpinejs/packages/alpinejs/src/utils/styles.js
+++ /dev/null
@@ -1,45 +0,0 @@
-
-export function setStyles(el, value) {
- if (typeof value === 'object' && value !== null) {
- return setStylesFromObject(el, value)
- }
-
- return setStylesFromString(el, value)
-}
-
-function setStylesFromObject(el, value) {
- let previousStyles = {}
-
- Object.entries(value).forEach(([key, value]) => {
- previousStyles[key] = el.style[key]
-
- // When we use javascript object, css properties use the camelCase
- // syntax but when we use setProperty, we need the css format
- // so we need to convert camelCase to kebab-case
- el.style.setProperty(kebabCase(key), value)
- })
-
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute('style')
- }
- })
-
- return () => {
- setStyles(el, previousStyles)
- }
-}
-
-function setStylesFromString(el, value) {
- let cache = el.getAttribute('style', value)
-
- el.setAttribute('style', value)
-
- return () => {
- el.setAttribute('style', cache)
- }
-}
-
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/throttle.js b/alpinejs/packages/alpinejs/src/utils/throttle.js
deleted file mode 100644
index c49108b..0000000
--- a/alpinejs/packages/alpinejs/src/utils/throttle.js
+++ /dev/null
@@ -1,16 +0,0 @@
-
-export function throttle(func, limit) {
- let inThrottle
-
- return function() {
- let context = this, args = arguments
-
- if (! inThrottle) {
- func.apply(context, args)
-
- inThrottle = true
-
- setTimeout(() => inThrottle = false, limit)
- }
- }
-}
diff --git a/alpinejs/packages/alpinejs/src/utils/walk.js b/alpinejs/packages/alpinejs/src/utils/walk.js
deleted file mode 100644
index 909df1a..0000000
--- a/alpinejs/packages/alpinejs/src/utils/walk.js
+++ /dev/null
@@ -1,38 +0,0 @@
-export function walk(el, callback) {
- if (typeof ShadowRoot === 'function' && el instanceof ShadowRoot) {
- Array.from(el.children).forEach(el => walk(el, callback))
-
- return
- }
-
- let skip = false
-
- callback(el, () => skip = true)
-
- if (skip) return
-
- let node = el.firstElementChild
-
- while (node) {
- walk(node, callback, false)
-
- node = node.nextElementSibling
- }
-}
-// export function walk(el, callback) {
-// if (el instanceof ShadowRoot || el instanceof DocumentFragment) {
-// Array.from(el.children).forEach(el => walk(el, callback))
-
-// return
-// }
-
-// callback(el, () => {
-// let node = el.firstElementChild
-
-// while (node) {
-// walk(node, callback)
-
-// node = node.nextElementSibling
-// }
-// })
-// }
diff --git a/alpinejs/packages/alpinejs/src/utils/warn.js b/alpinejs/packages/alpinejs/src/utils/warn.js
deleted file mode 100644
index b01f80b..0000000
--- a/alpinejs/packages/alpinejs/src/utils/warn.js
+++ /dev/null
@@ -1,4 +0,0 @@
-
-export function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args)
-}
diff --git a/alpinejs/packages/collapse/builds/cdn.js b/alpinejs/packages/collapse/builds/cdn.js
deleted file mode 100644
index a7b9ee5..0000000
--- a/alpinejs/packages/collapse/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import collapse from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(collapse)
-})
diff --git a/alpinejs/packages/collapse/builds/module.js b/alpinejs/packages/collapse/builds/module.js
deleted file mode 100644
index 594d9fa..0000000
--- a/alpinejs/packages/collapse/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import collapse from '../src/index.js'
-
-export default collapse
diff --git a/alpinejs/packages/collapse/dist/dist/cdn.js b/alpinejs/packages/collapse/dist/dist/cdn.js
deleted file mode 100644
index 21cf4be..0000000
--- a/alpinejs/packages/collapse/dist/dist/cdn.js
+++ /dev/null
@@ -1,74 +0,0 @@
-(() => {
- // packages/collapse/src/index.js
- function src_default(Alpine) {
- Alpine.directive("collapse", (el, {expression, modifiers}, {effect, evaluateLater}) => {
- let duration = modifierValue(modifiers, "duration", 250) / 1e3;
- let floor = 0;
- el.style.overflow = "hidden";
- if (!el._x_isShown)
- el.style.height = `${floor}px`;
- if (!el._x_isShown)
- el.style.removeProperty("display");
- let setFunction = (el2, styles) => {
- let revertFunction = Alpine.setStyles(el2, styles);
- return styles.height ? () => {
- } : revertFunction;
- };
- let transitionStyles = {
- overflow: "hidden",
- transitionProperty: "height",
- transitionDuration: `${duration}s`,
- transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
- };
- el._x_transition = {
- in(before = () => {
- }, after = () => {
- }) {
- let current = el.getBoundingClientRect().height;
- Alpine.setStyles(el, {
- height: "auto"
- });
- let full = el.getBoundingClientRect().height;
- if (current === full) {
- current = floor;
- }
- Alpine.transition(el, Alpine.setStyles, {
- during: transitionStyles,
- start: {height: current + "px"},
- end: {height: full + "px"}
- }, () => el._x_isShown = true, () => {
- });
- },
- out(before = () => {
- }, after = () => {
- }) {
- let full = el.getBoundingClientRect().height;
- Alpine.transition(el, setFunction, {
- during: transitionStyles,
- start: {height: full + "px"},
- end: {height: floor + "px"}
- }, () => {
- }, () => el._x_isShown = false);
- }
- };
- });
- }
- function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- return rawValue;
- }
-
- // packages/collapse/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(src_default);
- });
-})();
diff --git a/alpinejs/packages/collapse/dist/dist/cdn.min.js b/alpinejs/packages/collapse/dist/dist/cdn.min.js
deleted file mode 100644
index 097d3f0..0000000
--- a/alpinejs/packages/collapse/dist/dist/cdn.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{function f(e){e.directive("collapse",(t,{expression:o,modifiers:n},{effect:s,evaluateLater:x})=>{let g=l(n,"duration",250)/1e3,u=0;t.style.overflow="hidden",t._x_isShown||(t.style.height=`${u}px`),t._x_isShown||t.style.removeProperty("display");let c=(h,r)=>{let i=e.setStyles(h,r);return r.height?()=>{}:i},a={overflow:"hidden",transitionProperty:"height",transitionDuration:`${g}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(h=()=>{},r=()=>{}){let i=t.getBoundingClientRect().height;e.setStyles(t,{height:"auto"});let d=t.getBoundingClientRect().height;i===d&&(i=u),e.transition(t,e.setStyles,{during:a,start:{height:i+"px"},end:{height:d+"px"}},()=>t._x_isShown=!0,()=>{})},out(h=()=>{},r=()=>{}){let i=t.getBoundingClientRect().height;e.transition(t,c,{during:a,start:{height:i+"px"},end:{height:u+"px"}},()=>{},()=>t._x_isShown=!1)}}})}function l(e,t,o){if(e.indexOf(t)===-1)return o;let n=e[e.indexOf(t)+1];if(!n)return o;if(t==="duration"){let s=n.match(/([0-9]+)ms/);if(s)return s[1]}return n}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(f)});})();
diff --git a/alpinejs/packages/collapse/dist/dist/module.cjs.js b/alpinejs/packages/collapse/dist/dist/module.cjs.js
deleted file mode 100644
index 6aee128..0000000
--- a/alpinejs/packages/collapse/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var __defProp = Object.defineProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-
-// packages/collapse/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/collapse/src/index.js
-function src_default(Alpine) {
- Alpine.directive("collapse", (el, {expression, modifiers}, {effect, evaluateLater}) => {
- let duration = modifierValue(modifiers, "duration", 250) / 1e3;
- let floor = 0;
- el.style.overflow = "hidden";
- if (!el._x_isShown)
- el.style.height = `${floor}px`;
- if (!el._x_isShown)
- el.style.removeProperty("display");
- let setFunction = (el2, styles) => {
- let revertFunction = Alpine.setStyles(el2, styles);
- return styles.height ? () => {
- } : revertFunction;
- };
- let transitionStyles = {
- overflow: "hidden",
- transitionProperty: "height",
- transitionDuration: `${duration}s`,
- transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
- };
- el._x_transition = {
- in(before = () => {
- }, after = () => {
- }) {
- let current = el.getBoundingClientRect().height;
- Alpine.setStyles(el, {
- height: "auto"
- });
- let full = el.getBoundingClientRect().height;
- if (current === full) {
- current = floor;
- }
- Alpine.transition(el, Alpine.setStyles, {
- during: transitionStyles,
- start: {height: current + "px"},
- end: {height: full + "px"}
- }, () => el._x_isShown = true, () => {
- });
- },
- out(before = () => {
- }, after = () => {
- }) {
- let full = el.getBoundingClientRect().height;
- Alpine.transition(el, setFunction, {
- during: transitionStyles,
- start: {height: full + "px"},
- end: {height: floor + "px"}
- }, () => {
- }, () => el._x_isShown = false);
- }
- };
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- return rawValue;
-}
-
-// packages/collapse/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/collapse/dist/dist/module.esm.js b/alpinejs/packages/collapse/dist/dist/module.esm.js
deleted file mode 100644
index 9e20729..0000000
--- a/alpinejs/packages/collapse/dist/dist/module.esm.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// packages/collapse/src/index.js
-function src_default(Alpine) {
- Alpine.directive("collapse", (el, {expression, modifiers}, {effect, evaluateLater}) => {
- let duration = modifierValue(modifiers, "duration", 250) / 1e3;
- let floor = 0;
- el.style.overflow = "hidden";
- if (!el._x_isShown)
- el.style.height = `${floor}px`;
- if (!el._x_isShown)
- el.style.removeProperty("display");
- let setFunction = (el2, styles) => {
- let revertFunction = Alpine.setStyles(el2, styles);
- return styles.height ? () => {
- } : revertFunction;
- };
- let transitionStyles = {
- overflow: "hidden",
- transitionProperty: "height",
- transitionDuration: `${duration}s`,
- transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)"
- };
- el._x_transition = {
- in(before = () => {
- }, after = () => {
- }) {
- let current = el.getBoundingClientRect().height;
- Alpine.setStyles(el, {
- height: "auto"
- });
- let full = el.getBoundingClientRect().height;
- if (current === full) {
- current = floor;
- }
- Alpine.transition(el, Alpine.setStyles, {
- during: transitionStyles,
- start: {height: current + "px"},
- end: {height: full + "px"}
- }, () => el._x_isShown = true, () => {
- });
- },
- out(before = () => {
- }, after = () => {
- }) {
- let full = el.getBoundingClientRect().height;
- Alpine.transition(el, setFunction, {
- during: transitionStyles,
- start: {height: full + "px"},
- end: {height: floor + "px"}
- }, () => {
- }, () => el._x_isShown = false);
- }
- };
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- return rawValue;
-}
-
-// packages/collapse/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/collapse/package.json b/alpinejs/packages/collapse/package.json
deleted file mode 100644
index 585023b..0000000
--- a/alpinejs/packages/collapse/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "@alpinejs/collapse",
- "version": "3.4.2",
- "description": "Collapse and expand elements with robust animations",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "unpkg": "dist/cdn.min.js",
- "dependencies": {}
-}
diff --git a/alpinejs/packages/collapse/src/index.js b/alpinejs/packages/collapse/src/index.js
deleted file mode 100644
index d6165fe..0000000
--- a/alpinejs/packages/collapse/src/index.js
+++ /dev/null
@@ -1,73 +0,0 @@
-export default function (Alpine) {
- Alpine.directive('collapse', (el, { expression, modifiers }, { effect, evaluateLater }) => {
- let duration = modifierValue(modifiers, 'duration', 250) / 1000
- let floor = 0
-
- el.style.overflow = 'hidden'
- if (! el._x_isShown) el.style.height = `${floor}px`
- if (! el._x_isShown) el.style.removeProperty('display')
-
- // Override the setStyles function with one that won't
- // revert updates to the height style.
- let setFunction = (el, styles) => {
- let revertFunction = Alpine.setStyles(el, styles);
-
- return styles.height ? () => {} : revertFunction
- }
-
- let transitionStyles = {
- overflow: 'hidden',
- transitionProperty: 'height',
- transitionDuration: `${duration}s`,
- transitionTimingFunction: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
- }
-
- el._x_transition = {
- in(before = () => {}, after = () => {}) {
- let current = el.getBoundingClientRect().height
-
- Alpine.setStyles(el, {
- height: 'auto'
- })
-
- let full = el.getBoundingClientRect().height
-
- if (current === full) { current = floor }
-
- Alpine.transition(el, Alpine.setStyles, {
- during: transitionStyles,
- start: { height: current+'px' },
- end: { height: full+'px' },
- }, () => el._x_isShown = true, () => {})
- },
-
- out(before = () => {}, after = () => {}) {
- let full = el.getBoundingClientRect().height
-
- Alpine.transition(el, setFunction, {
- during: transitionStyles,
- start: { height: full+'px' },
- end: { height: floor+'px' },
- }, () => {}, () => el._x_isShown = false)
- },
- }
- })
-}
-
-function modifierValue(modifiers, key, fallback) {
- // If the modifier isn't present, use the default.
- if (modifiers.indexOf(key) === -1) return fallback
-
- // If it IS present, grab the value after it: x-show.transition.duration.500ms
- const rawValue = modifiers[modifiers.indexOf(key) + 1]
-
- if (! rawValue) return fallback
-
- if (key === 'duration') {
- // Support x-collapse.duration.500ms && duration.500
- let match = rawValue.match(/([0-9]+)ms/)
- if (match) return match[1]
- }
-
- return rawValue
-}
diff --git a/alpinejs/packages/csp/builds/cdn.js b/alpinejs/packages/csp/builds/cdn.js
deleted file mode 100644
index a54e7e0..0000000
--- a/alpinejs/packages/csp/builds/cdn.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Alpine from './../src/index'
-
-window.Alpine = Alpine
-
-queueMicrotask(() => {
- Alpine.start()
-})
diff --git a/alpinejs/packages/csp/builds/module.js b/alpinejs/packages/csp/builds/module.js
deleted file mode 100644
index 0382080..0000000
--- a/alpinejs/packages/csp/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Alpine from './../src/index'
-
-export default Alpine
diff --git a/alpinejs/packages/csp/dist/cdn.js b/alpinejs/packages/csp/dist/cdn.js
index eb1dd85..643dd65 100644
--- a/alpinejs/packages/csp/dist/cdn.js
+++ b/alpinejs/packages/csp/dist/cdn.js
@@ -77,23 +77,6 @@
}];
}
- // packages/alpinejs/src/utils/walk.js
- function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
- }
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -224,14 +207,6 @@
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -642,6 +617,23 @@ Expression: "${expression}"
isHolding = true;
}
+ // packages/alpinejs/src/utils/walk.js
+ function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+ }
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/csp/dist/cdn.min.js b/alpinejs/packages/csp/dist/cdn.min.js
index b86de2a..6bf7117 100644
--- a/alpinejs/packages/csp/dist/cdn.min.js
+++ b/alpinejs/packages/csp/dist/cdn.min.js
@@ -1,5 +1,5 @@
-(()=>{var Ke=!1,ze=!1,te=[];function Rt(e){Br(e)}function Br(e){te.includes(e)||te.push(e),Hr()}function Hr(){!ze&&!Ke&&(Ke=!0,queueMicrotask(qr))}function qr(){Ke=!1,ze=!0;for(let e=0;e<te.length;e++)te[e]();te.length=0,ze=!1}var v,L,q,Ve,Be=!0;function Ct(e){Be=!1,e(),Be=!0}function Mt(e){v=e.reactive,q=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Rt(r):r()}}),Ve=e.raw}function He(e){L=e}function he(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),q(i))}},()=>{t()}]}function S(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>S(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)S(n,t,!1),n=n.nextElementSibling}var Nt=[],qe=[],kt=[];function Dt(e){kt.push(e)}function Pt(e){qe.push(e)}function It(e){Nt.push(e)}function U(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ue(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var Ge=new MutationObserver(We),Ye=!1;function Je(){Ge.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ye=!0}function Ze(){Ur(),Ge.disconnect(),Ye=!1}var re=[],Qe=!1;function Ur(){re=re.concat(Ge.takeRecords()),re.length&&!Qe&&(Qe=!0,queueMicrotask(()=>{Wr(),Qe=!1}))}function Wr(){We(re),re.length=0}function m(e){if(!Ye)return e();Ze();let t=e();return Je(),t}var Xe=!1,ge=[];function Lt(){Xe=!0}function $t(){Xe=!1,We(ge),ge=[]}function We(e){if(Xe){ge=ge.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Ue(s,o)}),n.forEach((o,s)=>{Nt.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||kt.forEach(s=>s(o));for(let o of r)t.includes(o)||(qe.forEach(s=>s(o)),o.localName==="body"&&o.querySelectorAll("[x-data]").forEach(s=>{S(s,a=>{qe.forEach(c=>c(a)),a.remove()})}));t=null,r=null,n=null,i=null}function W(e,t,r){return e._x_dataStack=[t,...$(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function et(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function $(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?$(e.host):e.parentNode?$(e.parentNode):[]}function j(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function jt(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function _e(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Gr(n,i),s=>tt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Gr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function tt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),tt(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function F(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:A,interceptor:_e})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return Kt(...e)}var Kt=Yr;function zt(e){Kt=e}function Yr(e,t){let r={},n=F(r,e).cleanup;U(e,"evaluator",n);let i=[r,...$(e)];if(typeof t=="function")return rt(i,t);let o=Jr(i,t);return nt.bind(null,e,t,o)}function rt(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(j([n,...e]),i);G(r,o)}}var it={};function Zr(e){if(it[e])return it[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return it[e]=n,n}function Jr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=j([i,...e]),a=r(r,s);r.finished?G(n,r.result,s,o):a.then(c=>{G(n,c,s,o)})}}function G(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>G(e,o,r,n)):e(i)}else e(t)}function nt(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
+(()=>{var Ke=!1,ze=!1,te=[];function Tt(e){Br(e)}function Br(e){te.includes(e)||te.push(e),Hr()}function Hr(){!ze&&!Ke&&(Ke=!0,queueMicrotask(qr))}function qr(){Ke=!1,ze=!0;for(let e=0;e<te.length;e++)te[e]();te.length=0,ze=!1}var v,L,q,Ve,Be=!0;function Rt(e){Be=!1,e(),Be=!0}function Ct(e){v=e.reactive,q=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Tt(r):r()}}),Ve=e.raw}function He(e){L=e}function he(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),q(i))}},()=>{t()}]}var Mt=[],Nt=[],kt=[];function Dt(e){kt.push(e)}function Pt(e){Nt.push(e)}function It(e){Mt.push(e)}function U(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function qe(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var We=new MutationObserver(Ue),Ge=!1;function Ye(){We.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ge=!0}function Je(){Ur(),We.disconnect(),Ge=!1}var re=[],Ze=!1;function Ur(){re=re.concat(We.takeRecords()),re.length&&!Ze&&(Ze=!0,queueMicrotask(()=>{Wr(),Ze=!1}))}function Wr(){Ue(re),re.length=0}function m(e){if(!Ge)return e();Je();let t=e();return Ye(),t}var Qe=!1,ge=[];function Lt(){Qe=!0}function $t(){Qe=!1,Ue(ge),ge=[]}function Ue(e){if(Qe){ge=ge.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{qe(s,o)}),n.forEach((o,s)=>{Mt.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||kt.forEach(s=>s(o));for(let o of r)t.includes(o)||Nt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function W(e,t,r){return e._x_dataStack=[t,...$(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function Xe(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function $(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?$(e.host):e.parentNode?$(e.parentNode):[]}function j(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function jt(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function _e(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Gr(n,i),s=>et(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Gr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function et(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),et(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function F(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:S,interceptor:_e})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return Kt(...e)}var Kt=Yr;function zt(e){Kt=e}function Yr(e,t){let r={},n=F(r,e).cleanup;U(e,"evaluator",n);let i=[r,...$(e)];if(typeof t=="function")return tt(i,t);let o=Jr(i,t);return rt.bind(null,e,t,o)}function tt(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(j([n,...e]),i);G(r,o)}}var nt={};function Zr(e){if(nt[e])return nt[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return nt[e]=n,n}function Jr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=j([i,...e]),a=r(r,s);r.finished?G(n,r.result,s,o):a.then(c=>{G(n,c,s,o)})}}function G(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>G(e,o,r,n)):e(i)}else e(t)}function rt(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
Expression: "${t}"
-`,e),i}}var ot="x-";function O(e=""){return ot+e}function Vt(e){ot=e}var Bt={};function d(e,t){Bt[e]=t}function ne(e,t,r){let n={};return Array.from(t).map(Ht((o,s)=>n[o]=s)).filter(qt).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function Ut(e){return Array.from(e).map(Ht()).filter(t=>!qt(t))}var st=!1,ie=new Map,Wt=Symbol();function Gt(e){st=!0;let t=Symbol();Wt=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{st=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Bt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=he(e);i.push(a);let c={Alpine:A,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());U(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),st?ie.get(Wt).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Ht(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Yt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Yt=[];function Y(e){Yt.push(e)}function qt({name:e}){return Jt().test(e)}var Jt=()=>new RegExp(`^${ot}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Jt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var at="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",at,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?at:e.type,n=be.indexOf(t.type)===-1?at:t.type;return be.indexOf(r)-be.indexOf(n)}function K(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var ct=[],lt=!1;function J(e){ct.push(e),queueMicrotask(()=>{lt||setTimeout(()=>{ve()})})}function ve(){for(lt=!1;ct.length;)ct.shift()()}function Zt(){lt=!0}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Xt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),K(document,"alpine:init"),K(document,"alpine:initializing"),Je(),Dt(t=>T(t,S)),Pt(t=>J(()=>ut(t))),It((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Qt())).filter(e).forEach(t=>{T(t)}),K(document,"alpine:initialized")}var ft=[],er=[];function tr(){return ft.map(e=>e())}function Qt(){return ft.concat(er).map(e=>e())}function Ee(e){ft.push(e)}function rr(e){er.push(e)}function N(e,t=!1){if(!e)return;if((t?Qt():tr()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function nr(e){return tr().some(t=>e.matches(t))}function T(e,t=S){Gt(()=>{t(e,(r,n)=>{ne(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function ut(e){S(e,t=>Ue(t))}function oe(e,t){return Array.isArray(t)?ir(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?oe(e,t()):ir(e,t)}function ir(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function z(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{z(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){or(e,oe,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){or(e,z);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ae(t,"scale",95)/100:1,p=ae(t,"delay",0),E=ae(t,"origin","center"),I="opacity, transform",B=ae(t,"duration",150)/1e3,de=ae(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${B}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${de}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function or(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=sr(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function sr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:sr(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=se(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:se(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Zt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ae(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function ar(e){e(A)}var Z={},cr=!1;function lr(e,t){if(cr||(Z=v(Z),cr=!0),t===void 0)return Z[e];Z[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&Z[e].init()}function ur(){return Z}var pt=!1;function Q(e){return(...t)=>pt||e(...t)}function fr(e,t){t._x_dataStack=e._x_dataStack,pt=!0,un(()=>{ln(t)}),pt=!1}function ln(e){let t=!1;T(e,(n,i)=>{S(n,(o,s)=>{if(t&&nr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return q(i),()=>{}}),e(),He(t)}var pr={};function dr(e,t){pr[e]=t}function mr(e,t){return Object.entries(pr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return q},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:$t,disableEffectScheduling:Ct,stopObservingMutations:Ze,setReactivityEngine:Mt,addRootSelector:Ee,deferMutations:Lt,mapAttributes:Y,evaluateLater:h,setEvaluator:zt,destroyTree:ut,closestRoot:N,interceptor:_e,transition:Se,setStyles:z,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:T,nextTick:J,prefix:Vt,plugin:ar,magic:x,store:lr,start:Xt,clone:fr,data:dr},A=fn;function dt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var To={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},Ro={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Co=dt(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var hr=Object.freeze({}),Mo=Object.freeze([]);var mt=Object.assign;var dn=Object.prototype.hasOwnProperty,ce=(e,t)=>dn.call(e,t),k=Array.isArray,X=e=>gr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",le=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,gr=e=>hn.call(e),ht=e=>gr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,No=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,ko=Ce(e=>e.replace(_n,"-$1").toLowerCase()),gt=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),Do=Ce(e=>e?`on${gt(e)}`:""),_t=(e,t)=>e!==t&&(e===e||t===t);var yt=new WeakMap,ue=[],R,V=Symbol("iterate"),xt=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function _r(e,t=hr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function xr(e){e.active&&(yr(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!ue.includes(r)){yr(r);try{return vn(),ue.push(r),R=r,e()}finally{ue.pop(),br(),R=ue[ue.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function yr(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var ee=!0,bt=[];function wn(){bt.push(ee),ee=!1}function vn(){bt.push(ee),ee=!0}function br(){let e=bt.pop();ee=e===void 0?!0:e}function w(e,t,r){if(!ee||R===void 0)return;let n=yt.get(e);n||yt.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(R)||(i.add(R),R.deps.push(i),R.options.onTrack&&R.options.onTrack({effect:R,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=yt.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==R||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(V)),X(e)&&c(s.get(xt)));break;case"delete":k(e)||(c(s.get(V)),X(e)&&c(s.get(xt)));break;case"set":X(e)&&c(s.get(V));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=dt("__proto__,__v_isRef,__isVue"),vr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return br(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:Er:t?Rn:wr).get(n))return n;let s=k(n);if(!e&&s&&ce(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?vr.has(i):En(i))||(e||w(n,"get",i),t)?a:vt(a)?!s||!Re(i)?a.value:a:le(a)?e?Sr(a):ke(a):a}}var Mn=Ar(),Nn=Ar(!0);function Ar(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&vt(s)&&!vt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ce(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?_t(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ce(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!vr.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":V),Reflect.ownKeys(e)}var Or={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Tr={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Fo=mt({},Or,{get:An,set:Nn}),Ko=mt({},Tr,{get:Tn}),wt=e=>le(e)?ke(e):e,Et=e=>le(e)?Sr(e):e,St=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?St:r?Et:wt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",V),Reflect.get(e,"size",e)}function Rr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Mr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Cr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?_t(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Nr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Cr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function kr(){let e=g(this),t=e.size!==0,r=X(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?St:e?Et:wt;return!e&&w(a,"iterate",V),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function je(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=X(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?St:t?Et:wt;return!t&&w(o,"iterate",c?xt:V),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${gt(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var Dr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!1)},Pr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!0)},Ir={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Lr={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{Dr[e]=je(e,!1,!1),Ir[e]=je(e,!0,!1),Pr[e]=je(e,!1,!0),Lr[e]=je(e,!0,!0)});function Fe(e,t){let r=t?e?Lr:Pr:e?Ir:Dr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ce(r,i)&&i in n?r:n,i,o)}var Ln={get:Fe(!1,!1)},zo={get:Fe(!1,!0)},$n={get:Fe(!0,!1)},Vo={get:Fe(!0,!0)};function Cr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=ht(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var wr=new WeakMap,Rn=new WeakMap,Er=new WeakMap,Cn=new WeakMap;function jn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fn(e){return e.__v_skip||!Object.isExtensible(e)?0:jn(ht(e))}function ke(e){return e&&e.__v_isReadonly?e:$r(e,!1,Or,Ln,wr)}function Sr(e){return $r(e,!0,Tr,$n,Er)}function $r(e,t,r,n,i){if(!le(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=Fn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function vt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>J);x("dispatch",e=>K.bind(K,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=he(e);U(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",ur);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=j(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var jr=()=>{};jr.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",jr);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function fe(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=oe(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=z(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function pe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=At(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=At(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function At(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,At((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&Kr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&Kr(e.key).includes(r[0]))}function Kr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=pe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>fe(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?Ot(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return Ot(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?Ot(o):t.includes("trim")?o.trim():o}}})}function Ot(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(O("cloak")))));rr(()=>`[${O("init")}]`);d("init",Q((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});Y(ye(":",xe(O("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>fe(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));Ut(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),ne(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${O("data")}]`);d("data",Q((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=F(n,e).cleanup,o={};mr(o,n);let s=b(e,t,{scope:o}),a=F(s,e).cleanup,c=v(s);jt(c);let l=W(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=se(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=zr(t,_,f,s);n(C=>u.push(C),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=zr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],B=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let de="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([de,f]);else if(y!==f){let C=c.splice(f,1)[0],M=c.splice(y-1,1)[0];c.splice(f,0,M),c.splice(y,0,C),E.push([C,M])}else B.push(_);de=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],C=a[_],M=a[y],H=document.createElement("div");m(()=>{M.after(H),C.after(M),H.before(C),H.remove()}),et(M,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],C=_==="template"?o:a[_],M=l[y],H=u[y],me=document.importNode(o.content,!0).firstElementChild;W(me,v(M),o),m(()=>{C.after(me),T(me)}),typeof H=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[H]=me}for(let f=0;f<B.length;f++)et(a[B[f]],l[u.indexOf(B[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function zr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function Vr(){}Vr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",Vr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return W(a,{},e),m(()=>{e.after(a),T(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});Y(ye("@",xe(O("on:"))));d("on",Q((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=pe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));A.setEvaluator(li);A.setReactivityEngine({reactive:ke,effect:_r,release:xr,raw:g});function li(e,t){let r={};F(r,e);let n=[r,...$(e)];if(typeof t=="function")return rt(n,t);let i=(o=()=>{},{scope:s={},params:a=[]}={})=>{let c=j([s,...n]);c[t]!==void 0&&G(o,c[t],c,a)};return nt.bind(null,e,t,i)}var Tt=A;window.Alpine=Tt;queueMicrotask(()=>{Tt.start()});})();
+`,e),i}}var it="x-";function A(e=""){return it+e}function Vt(e){it=e}var Bt={};function d(e,t){Bt[e]=t}function ne(e,t,r){let n={};return Array.from(t).map(Ht((o,s)=>n[o]=s)).filter(qt).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function Ut(e){return Array.from(e).map(Ht()).filter(t=>!qt(t))}var ot=!1,ie=new Map,Wt=Symbol();function Gt(e){ot=!0;let t=Symbol();Wt=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{ot=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Bt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=he(e);i.push(a);let c={Alpine:S,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());U(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),ot?ie.get(Wt).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Ht(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Yt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Yt=[];function Y(e){Yt.push(e)}function qt({name:e}){return Jt().test(e)}var Jt=()=>new RegExp(`^${it}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Jt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var st="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",st,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?st:e.type,n=be.indexOf(t.type)===-1?st:t.type;return be.indexOf(r)-be.indexOf(n)}function K(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var at=[],ct=!1;function J(e){at.push(e),queueMicrotask(()=>{ct||setTimeout(()=>{ve()})})}function ve(){for(ct=!1;at.length;)at.shift()()}function Zt(){ct=!0}function M(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>M(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)M(n,t,!1),n=n.nextElementSibling}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Xt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),K(document,"alpine:init"),K(document,"alpine:initializing"),Ye(),Dt(t=>O(t,M)),Pt(t=>J(()=>lt(t))),It((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Qt())).filter(e).forEach(t=>{O(t)}),K(document,"alpine:initialized")}var ut=[],er=[];function tr(){return ut.map(e=>e())}function Qt(){return ut.concat(er).map(e=>e())}function Ee(e){ut.push(e)}function rr(e){er.push(e)}function N(e,t=!1){if(!e)return;if((t?Qt():tr()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function nr(e){return tr().some(t=>e.matches(t))}function O(e,t=M){Gt(()=>{t(e,(r,n)=>{ne(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function lt(e){M(e,t=>qe(t))}function oe(e,t){return Array.isArray(t)?ir(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?oe(e,t()):ir(e,t)}function ir(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function z(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{z(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){or(e,oe,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){or(e,z);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ae(t,"scale",95)/100:1,p=ae(t,"delay",0),E=ae(t,"origin","center"),I="opacity, transform",B=ae(t,"duration",150)/1e3,de=ae(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${B}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${de}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function or(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=sr(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function sr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:sr(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=se(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:se(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Zt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ae(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function ar(e){e(S)}var Z={},cr=!1;function lr(e,t){if(cr||(Z=v(Z),cr=!0),t===void 0)return Z[e];Z[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&Z[e].init()}function ur(){return Z}var ft=!1;function Q(e){return(...t)=>ft||e(...t)}function fr(e,t){t._x_dataStack=e._x_dataStack,ft=!0,un(()=>{ln(t)}),ft=!1}function ln(e){let t=!1;O(e,(n,i)=>{M(n,(o,s)=>{if(t&&nr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return q(i),()=>{}}),e(),He(t)}var pr={};function dr(e,t){pr[e]=t}function mr(e,t){return Object.entries(pr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return q},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:$t,disableEffectScheduling:Rt,stopObservingMutations:Je,setReactivityEngine:Ct,addRootSelector:Ee,deferMutations:Lt,mapAttributes:Y,evaluateLater:h,setEvaluator:zt,destroyTree:lt,closestRoot:N,interceptor:_e,transition:Se,setStyles:z,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:O,nextTick:J,prefix:Vt,plugin:ar,magic:x,store:lr,start:Xt,clone:fr,data:dr},S=fn;function pt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var Oo={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},To={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Ro=pt(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var hr=Object.freeze({}),Co=Object.freeze([]);var dt=Object.assign;var dn=Object.prototype.hasOwnProperty,ce=(e,t)=>dn.call(e,t),k=Array.isArray,X=e=>gr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",le=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,gr=e=>hn.call(e),mt=e=>gr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,Mo=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,No=Ce(e=>e.replace(_n,"-$1").toLowerCase()),ht=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),ko=Ce(e=>e?`on${ht(e)}`:""),gt=(e,t)=>e!==t&&(e===e||t===t);var _t=new WeakMap,ue=[],T,V=Symbol("iterate"),yt=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function _r(e,t=hr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function xr(e){e.active&&(yr(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!ue.includes(r)){yr(r);try{return vn(),ue.push(r),T=r,e()}finally{ue.pop(),br(),T=ue[ue.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function yr(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var ee=!0,xt=[];function wn(){xt.push(ee),ee=!1}function vn(){xt.push(ee),ee=!0}function br(){let e=xt.pop();ee=e===void 0?!0:e}function w(e,t,r){if(!ee||T===void 0)return;let n=_t.get(e);n||_t.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(T)||(i.add(T),T.deps.push(i),T.options.onTrack&&T.options.onTrack({effect:T,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=_t.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==T||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(V)),X(e)&&c(s.get(yt)));break;case"delete":k(e)||(c(s.get(V)),X(e)&&c(s.get(yt)));break;case"set":X(e)&&c(s.get(V));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=pt("__proto__,__v_isRef,__isVue"),vr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return br(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:Er:t?Rn:wr).get(n))return n;let s=k(n);if(!e&&s&&ce(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?vr.has(i):En(i))||(e||w(n,"get",i),t)?a:bt(a)?!s||!Re(i)?a.value:a:le(a)?e?Sr(a):ke(a):a}}var Mn=Ar(),Nn=Ar(!0);function Ar(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&bt(s)&&!bt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ce(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?gt(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ce(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!vr.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":V),Reflect.ownKeys(e)}var Or={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Tr={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},jo=dt({},Or,{get:An,set:Nn}),Fo=dt({},Tr,{get:Tn}),vt=e=>le(e)?ke(e):e,wt=e=>le(e)?Sr(e):e,Et=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?Et:r?wt:vt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",V),Reflect.get(e,"size",e)}function Rr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Mr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Cr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?gt(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Nr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Cr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function kr(){let e=g(this),t=e.size!==0,r=X(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?Et:e?wt:vt;return!e&&w(a,"iterate",V),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function je(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=X(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?Et:t?wt:vt;return!t&&w(o,"iterate",c?yt:V),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${ht(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var Dr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!1)},Pr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!0)},Ir={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Lr={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{Dr[e]=je(e,!1,!1),Ir[e]=je(e,!0,!1),Pr[e]=je(e,!1,!0),Lr[e]=je(e,!0,!0)});function Fe(e,t){let r=t?e?Lr:Pr:e?Ir:Dr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ce(r,i)&&i in n?r:n,i,o)}var Ln={get:Fe(!1,!1)},Ko={get:Fe(!1,!0)},$n={get:Fe(!0,!1)},zo={get:Fe(!0,!0)};function Cr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=mt(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var wr=new WeakMap,Rn=new WeakMap,Er=new WeakMap,Cn=new WeakMap;function jn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fn(e){return e.__v_skip||!Object.isExtensible(e)?0:jn(mt(e))}function ke(e){return e&&e.__v_isReadonly?e:$r(e,!1,Or,Ln,wr)}function Sr(e){return $r(e,!0,Tr,$n,Er)}function $r(e,t,r,n,i){if(!le(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=Fn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function bt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>J);x("dispatch",e=>K.bind(K,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=he(e);U(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",ur);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=j(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var jr=()=>{};jr.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",jr);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function fe(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=oe(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=z(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function pe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=St(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function St(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,St((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&Kr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&Kr(e.key).includes(r[0]))}function Kr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=pe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>fe(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?At(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return At(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?At(o):t.includes("trim")?o.trim():o}}})}function At(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(A("cloak")))));rr(()=>`[${A("init")}]`);d("init",Q((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});Y(ye(":",xe(A("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>fe(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));Ut(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),ne(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${A("data")}]`);d("data",Q((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=F(n,e).cleanup,o={};mr(o,n);let s=b(e,t,{scope:o}),a=F(s,e).cleanup,c=v(s);jt(c);let l=W(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=se(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=zr(t,_,f,s);n(R=>u.push(R),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=zr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],B=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let de="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([de,f]);else if(y!==f){let R=c.splice(f,1)[0],C=c.splice(y-1,1)[0];c.splice(f,0,C),c.splice(y,0,R),E.push([R,C])}else B.push(_);de=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],R=a[_],C=a[y],H=document.createElement("div");m(()=>{C.after(H),R.after(C),H.before(R),H.remove()}),Xe(C,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],R=_==="template"?o:a[_],C=l[y],H=u[y],me=document.importNode(o.content,!0).firstElementChild;W(me,v(C),o),m(()=>{R.after(me),O(me)}),typeof H=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[H]=me}for(let f=0;f<B.length;f++)Xe(a[B[f]],l[u.indexOf(B[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function zr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function Vr(){}Vr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",Vr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return W(a,{},e),m(()=>{e.after(a),O(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});Y(ye("@",xe(A("on:"))));d("on",Q((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=pe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));S.setEvaluator(li);S.setReactivityEngine({reactive:ke,effect:_r,release:xr,raw:g});function li(e,t){let r={};F(r,e);let n=[r,...$(e)];if(typeof t=="function")return tt(n,t);let i=(o=()=>{},{scope:s={},params:a=[]}={})=>{let c=j([s,...n]);c[t]!==void 0&&G(o,c[t],c,a)};return rt.bind(null,e,t,i)}var Ot=S;window.Alpine=Ot;queueMicrotask(()=>{Ot.start()});})();
diff --git a/alpinejs/packages/csp/dist/dist/cdn.js b/alpinejs/packages/csp/dist/dist/cdn.js
deleted file mode 100644
index eb1dd85..0000000
--- a/alpinejs/packages/csp/dist/dist/cdn.js
+++ /dev/null
@@ -1,2676 +0,0 @@
-(() => {
- // packages/alpinejs/src/scheduler.js
- var flushPending = false;
- var flushing = false;
- var queue = [];
- function scheduler(callback) {
- queueJob(callback);
- }
- function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
- }
- function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
- }
- function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
- }
-
- // packages/alpinejs/src/reactivity.js
- var reactive;
- var effect;
- var release;
- var raw;
- var shouldSchedule = true;
- function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
- }
- function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
- }
- function overrideEffect(override) {
- effect = override;
- }
- function elementBoundEffect(el) {
- let cleanup2 = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup2 = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup2();
- }];
- }
-
- // packages/alpinejs/src/utils/walk.js
- function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
- }
-
- // packages/alpinejs/src/mutation.js
- var onAttributeAddeds = [];
- var onElRemoveds = [];
- var onElAddeds = [];
- function onElAdded(callback) {
- onElAddeds.push(callback);
- }
- function onElRemoved(callback) {
- onElRemoveds.push(callback);
- }
- function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
- }
- function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
- }
- function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
- }
- var observer = new MutationObserver(onMutate);
- var currentlyObserving = false;
- function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
- }
- function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
- }
- var recordQueue = [];
- var willProcessRecordQueue = false;
- function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
- }
- function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
- }
- function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
- }
- var isCollecting = false;
- var deferredMutations = [];
- function deferMutations() {
- isCollecting = true;
- }
- function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
- }
- function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add2 = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add2();
- } else if (el.hasAttribute(name)) {
- remove();
- add2();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
- }
-
- // packages/alpinejs/src/scope.js
- function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
- }
- function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
- }
- function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
- }
- function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
- }
-
- // packages/alpinejs/src/interceptor.js
- function initInterceptors(data2) {
- let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject2(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
- }
- function interceptor(callback, mutateObj = () => {
- }) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
- }
- function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
- }
- function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
- }
-
- // packages/alpinejs/src/magics.js
- var magics = {};
- function magic(name, callback) {
- magics[name] = callback;
- }
- function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
- }
-
- // packages/alpinejs/src/evaluator.js
- function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
- }
- function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
- }
- var theEvaluatorFunction = normalEvaluator;
- function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
- }
- function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup2 = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup2);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
- }
- function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
- }
- var evaluatorMemo = {};
- function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
- }
- function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
- }
- function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
- }
- function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
- }
-
- // packages/alpinejs/src/directives.js
- var prefixAsString = "x-";
- function prefix(subject = "") {
- return prefixAsString + subject;
- }
- function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
- }
- var directiveHandlers = {};
- function directive(name, callback) {
- directiveHandlers[name] = callback;
- }
- function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
- }
- function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
- }
- var isDeferringHandlers = false;
- var directiveHandlerStacks = new Map();
- var currentHandlerStackKey = Symbol();
- function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
- }
- function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup2 = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup: cleanup2,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
- }
- var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
- };
- var into = (i) => i;
- function toTransformedAttributes(callback = () => {
- }) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
- }
- var attributeTransformers = [];
- function mapAttributes(callback) {
- attributeTransformers.push(callback);
- }
- function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
- }
- var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
- function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
- }
- var DEFAULT = "DEFAULT";
- var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
- ];
- function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
- }
-
- // packages/alpinejs/src/utils/dispatch.js
- function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
- }
-
- // packages/alpinejs/src/nextTick.js
- var tickStack = [];
- var isHolding = false;
- function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
- }
- function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
- }
- function holdNextTicks() {
- isHolding = true;
- }
-
- // packages/alpinejs/src/utils/warn.js
- function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
- }
-
- // packages/alpinejs/src/lifecycle.js
- function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
- }
- var rootSelectorCallbacks = [];
- var initSelectorCallbacks = [];
- function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
- }
- function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
- }
- function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
- }
- function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
- }
- function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
- }
- function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
- }
- function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
- }
- function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
- }
-
- // packages/alpinejs/src/utils/classes.js
- function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
- }
- function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
- }
- function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
- }
-
- // packages/alpinejs/src/utils/styles.js
- function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
- }
- function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
- }
- function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
- }
- function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
- }
-
- // packages/alpinejs/src/utils/once.js
- function once(callback, fallback = () => {
- }) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
- }
-
- // packages/alpinejs/src/directives/x-transition.js
- directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
- });
- function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
- }
- function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
- }
- function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
- }
- window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
- };
- function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
- }
- function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
- }, after = () => {
- }) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
- }
- function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
- }
- function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
- }
-
- // packages/alpinejs/src/utils/debounce.js
- function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
- }
-
- // packages/alpinejs/src/utils/throttle.js
- function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
- }
-
- // packages/alpinejs/src/plugin.js
- function plugin(callback) {
- callback(alpine_default);
- }
-
- // packages/alpinejs/src/store.js
- var stores = {};
- var isReactive = false;
- function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
- }
- function getStores() {
- return stores;
- }
-
- // packages/alpinejs/src/clone.js
- var isCloning = false;
- function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
- }
- function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
- }
- function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
- }
- function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
- }
-
- // packages/alpinejs/src/datas.js
- var datas = {};
- function data(name, callback) {
- datas[name] = callback;
- }
- function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
- }
-
- // packages/alpinejs/src/alpine.js
- var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
- };
- var alpine_default = Alpine;
-
- // node_modules/@vue/shared/dist/shared.esm-bundler.js
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var EMPTY_OBJ = true ? Object.freeze({}) : {};
- var EMPTY_ARR = true ? Object.freeze([]) : [];
- var extend = Object.assign;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
-
- // node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol(true ? "iterate" : "");
- var MAP_KEY_ITERATE_KEY = Symbol(true ? "Map key iterate" : "");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect2(fn, options = EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect3 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect3();
- }
- return effect3;
- }
- function stop(effect3) {
- if (effect3.active) {
- cleanup(effect3);
- if (effect3.options.onStop) {
- effect3.options.onStop();
- }
- effect3.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect3 = function reactiveEffect() {
- if (!effect3.active) {
- return fn();
- }
- if (!effectStack.includes(effect3)) {
- cleanup(effect3);
- try {
- enableTracking();
- effectStack.push(effect3);
- activeEffect = effect3;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect3.id = uid++;
- effect3.allowRecurse = !!options.allowRecurse;
- effect3._isEffect = true;
- effect3.active = true;
- effect3.raw = fn;
- effect3.deps = [];
- effect3.options = options;
- return effect3;
- }
- function cleanup(effect3) {
- const {deps} = effect3;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect3);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect3) => {
- if (effect3 !== activeEffect || effect3.allowRecurse) {
- effects.add(effect3);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect3) => {
- if (effect3.options.onTrigger) {
- effect3.options.onTrigger({
- effect: effect3,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect3.options.scheduler) {
- effect3.options.scheduler(effect3);
- } else {
- effect3();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly;
- } else if (key === "__v_isReadonly") {
- return isReadonly;
- } else if (key === "__v_raw" && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = isArray(target);
- if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (isObject(res)) {
- return isReadonly ? readonly(res) : reactive2(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw(value);
- oldValue = toRaw(oldValue);
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- if (true) {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- if (true) {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => isObject(value) ? reactive2(value) : value;
- var toReadonly = (value) => isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (key !== rawKey) {
- !isReadonly && track(rawTarget, "get", key);
- }
- !isReadonly && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (key !== rawKey) {
- !isReadonly && track(rawTarget, "has", key);
- }
- !isReadonly && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly = false) {
- target = target["__v_raw"];
- !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw(value);
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw(value);
- const target = toRaw(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (true) {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (true) {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0;
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw(target);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
- !isReadonly && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- if (true) {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly, shallow) {
- const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly;
- } else if (key === "__v_isReadonly") {
- return isReadonly;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
- }
- function reactive2(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject(target)) {
- if (true) {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function toRaw(observed) {
- return observed && toRaw(observed["__v_raw"]) || observed;
- }
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
-
- // packages/alpinejs/src/magics/$nextTick.js
- magic("nextTick", () => nextTick);
-
- // packages/alpinejs/src/magics/$dispatch.js
- magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
- // packages/alpinejs/src/magics/$watch.js
- magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
- });
-
- // packages/alpinejs/src/magics/$store.js
- magic("store", getStores);
-
- // packages/alpinejs/src/magics/$root.js
- magic("root", (el) => closestRoot(el));
-
- // packages/alpinejs/src/magics/$refs.js
- magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
- });
- function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
- }
-
- // packages/alpinejs/src/magics/$el.js
- magic("el", (el) => el);
-
- // packages/alpinejs/src/directives/x-ignore.js
- var handler = () => {
- };
- handler.inline = (el, {modifiers}, {cleanup: cleanup2}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup2(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
- };
- directive("ignore", handler);
-
- // packages/alpinejs/src/directives/x-effect.js
- directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
- // packages/alpinejs/src/utils/bind.js
- function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
- }
- function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
- }
- function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
- }
- function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
- }
- function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr2(name))
- value = name;
- setIfChanged(el, name, value);
- }
- }
- function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
- }
- function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
- }
- function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
- }
- function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
- }
- function isBooleanAttr2(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
- }
- function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
- }
-
- // packages/alpinejs/src/utils/on.js
- function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
- }
- function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
- }
- function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
- }
- function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
- function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
- }
- function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
- }
- function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
- }
- function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
- }
-
- // packages/alpinejs/src/directives/x-model.js
- directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup: cleanup2}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup2(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
- });
- function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
- }
- function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
- }
- function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
- }
- function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
-
- // packages/alpinejs/src/directives/x-cloak.js
- directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
- // packages/alpinejs/src/directives/x-init.js
- addInitSelector(() => `[${prefix("init")}]`);
- directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
- }));
-
- // packages/alpinejs/src/directives/x-text.js
- directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
- });
-
- // packages/alpinejs/src/directives/x-html.js
- directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
- });
-
- // packages/alpinejs/src/directives/x-bind.js
- mapAttributes(startingWith(":", into(prefix("bind:"))));
- directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
- });
- function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
- }
- function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
- }
-
- // packages/alpinejs/src/directives/x-data.js
- addRootSelector(() => `[${prefix("data")}]`);
- directive("data", skipDuringClone((el, {expression}, {cleanup: cleanup2}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup22 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup2(() => {
- undo();
- cleanup1();
- cleanup22();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
- }));
-
- // packages/alpinejs/src/directives/x-show.js
- directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
- });
-
- // packages/alpinejs/src/directives/x-for.js
- directive("for", (el, {expression}, {effect: effect3, cleanup: cleanup2}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup2(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
- });
- function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject2 = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject2(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
- }
- function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
- }
- function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
- }
- function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
- }
-
- // packages/alpinejs/src/directives/x-ref.js
- function handler2() {
- }
- handler2.inline = (el, {expression}, {cleanup: cleanup2}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup2(() => delete root._x_refs[expression]);
- };
- directive("ref", handler2);
-
- // packages/alpinejs/src/directives/x-if.js
- directive("if", (el, {expression}, {effect: effect3, cleanup: cleanup2}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup2(() => el._x_undoIf && el._x_undoIf());
- });
-
- // packages/alpinejs/src/directives/x-on.js
- mapAttributes(startingWith("@", into(prefix("on:"))));
- directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup: cleanup2}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup2(() => removeListener());
- }));
-
- // packages/csp/src/index.js
- alpine_default.setEvaluator(cspCompliantEvaluator);
- alpine_default.setReactivityEngine({reactive: reactive2, effect: effect2, release: stop, raw: toRaw});
- function cspCompliantEvaluator(el, expression) {
- let overriddenMagics = {};
- injectMagics(overriddenMagics, el);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let completeScope = mergeProxies([scope, ...dataStack]);
- if (completeScope[expression] !== void 0) {
- runIfTypeOfFunction(receiver, completeScope[expression], completeScope, params);
- }
- };
- return tryCatch.bind(null, el, expression, evaluator);
- }
- var src_default = alpine_default;
-
- // packages/csp/builds/cdn.js
- window.Alpine = src_default;
- queueMicrotask(() => {
- src_default.start();
- });
-})();
diff --git a/alpinejs/packages/csp/dist/dist/cdn.min.js b/alpinejs/packages/csp/dist/dist/cdn.min.js
deleted file mode 100644
index b86de2a..0000000
--- a/alpinejs/packages/csp/dist/dist/cdn.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-(()=>{var Ke=!1,ze=!1,te=[];function Rt(e){Br(e)}function Br(e){te.includes(e)||te.push(e),Hr()}function Hr(){!ze&&!Ke&&(Ke=!0,queueMicrotask(qr))}function qr(){Ke=!1,ze=!0;for(let e=0;e<te.length;e++)te[e]();te.length=0,ze=!1}var v,L,q,Ve,Be=!0;function Ct(e){Be=!1,e(),Be=!0}function Mt(e){v=e.reactive,q=e.release,L=t=>e.effect(t,{scheduler:r=>{Be?Rt(r):r()}}),Ve=e.raw}function He(e){L=e}function he(e){let t=()=>{};return[n=>{let i=L(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),q(i))}},()=>{t()}]}function S(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>S(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)S(n,t,!1),n=n.nextElementSibling}var Nt=[],qe=[],kt=[];function Dt(e){kt.push(e)}function Pt(e){qe.push(e)}function It(e){Nt.push(e)}function U(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ue(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var Ge=new MutationObserver(We),Ye=!1;function Je(){Ge.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ye=!0}function Ze(){Ur(),Ge.disconnect(),Ye=!1}var re=[],Qe=!1;function Ur(){re=re.concat(Ge.takeRecords()),re.length&&!Qe&&(Qe=!0,queueMicrotask(()=>{Wr(),Qe=!1}))}function Wr(){We(re),re.length=0}function m(e){if(!Ye)return e();Ze();let t=e();return Je(),t}var Xe=!1,ge=[];function Lt(){Xe=!0}function $t(){Xe=!1,We(ge),ge=[]}function We(e){if(Xe){ge=ge.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Ue(s,o)}),n.forEach((o,s)=>{Nt.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||kt.forEach(s=>s(o));for(let o of r)t.includes(o)||(qe.forEach(s=>s(o)),o.localName==="body"&&o.querySelectorAll("[x-data]").forEach(s=>{S(s,a=>{qe.forEach(c=>c(a)),a.remove()})}));t=null,r=null,n=null,i=null}function W(e,t,r){return e._x_dataStack=[t,...$(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function et(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function $(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?$(e.host):e.parentNode?$(e.parentNode):[]}function j(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function jt(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function _e(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Gr(n,i),s=>tt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Gr(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function tt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),tt(e[t[0]],t.slice(1),r)}}var Ft={};function x(e,t){Ft[e]=t}function F(e,t){return Object.entries(Ft).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:A,interceptor:_e})},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return Kt(...e)}var Kt=Yr;function zt(e){Kt=e}function Yr(e,t){let r={},n=F(r,e).cleanup;U(e,"evaluator",n);let i=[r,...$(e)];if(typeof t=="function")return rt(i,t);let o=Jr(i,t);return nt.bind(null,e,t,o)}function rt(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(j([n,...e]),i);G(r,o)}}var it={};function Zr(e){if(it[e])return it[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return it[e]=n,n}function Jr(e,t){let r=Zr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=j([i,...e]),a=r(r,s);r.finished?G(n,r.result,s,o):a.then(c=>{G(n,c,s,o)})}}function G(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>G(e,o,r,n)):e(i)}else e(t)}function nt(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message}
-
-Expression: "${t}"
-
-`,e),i}}var ot="x-";function O(e=""){return ot+e}function Vt(e){ot=e}var Bt={};function d(e,t){Bt[e]=t}function ne(e,t,r){let n={};return Array.from(t).map(Ht((o,s)=>n[o]=s)).filter(qt).map(Xr(n,r)).sort(en).map(o=>Qr(e,o))}function Ut(e){return Array.from(e).map(Ht()).filter(t=>!qt(t))}var st=!1,ie=new Map,Wt=Symbol();function Gt(e){st=!0;let t=Symbol();Wt=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{st=!1,r()};e(r),n()}function Qr(e,t){let r=()=>{},n=Bt[t.type]||r,i=[],o=p=>i.push(p),[s,a]=he(e);i.push(a);let c={Alpine:A,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(p=>p());U(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),st?ie.get(Wt).push(n):n())};return u.runCleanups=l,u}var ye=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),xe=e=>e;function Ht(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Yt.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Yt=[];function Y(e){Yt.push(e)}function qt({name:e}){return Jt().test(e)}var Jt=()=>new RegExp(`^${ot}([^:^.]+)\\b`);function Xr(e,t){return({name:r,value:n})=>{let i=r.match(Jt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var at="DEFAULT",be=["ignore","ref","data","bind","init","for","model","transition","show","if",at,"element"];function en(e,t){let r=be.indexOf(e.type)===-1?at:e.type,n=be.indexOf(t.type)===-1?at:t.type;return be.indexOf(r)-be.indexOf(n)}function K(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var ct=[],lt=!1;function J(e){ct.push(e),queueMicrotask(()=>{lt||setTimeout(()=>{ve()})})}function ve(){for(lt=!1;ct.length;)ct.shift()()}function Zt(){lt=!0}function we(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Xt(){document.body||we("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),K(document,"alpine:init"),K(document,"alpine:initializing"),Je(),Dt(t=>T(t,S)),Pt(t=>J(()=>ut(t))),It((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!N(t.parentElement,!0);Array.from(document.querySelectorAll(Qt())).filter(e).forEach(t=>{T(t)}),K(document,"alpine:initialized")}var ft=[],er=[];function tr(){return ft.map(e=>e())}function Qt(){return ft.concat(er).map(e=>e())}function Ee(e){ft.push(e)}function rr(e){er.push(e)}function N(e,t=!1){if(!e)return;if((t?Qt():tr()).some(n=>e.matches(n)))return e;if(!!e.parentElement)return N(e.parentElement,t)}function nr(e){return tr().some(t=>e.matches(t))}function T(e,t=S){Gt(()=>{t(e,(r,n)=>{ne(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function ut(e){S(e,t=>Ue(t))}function oe(e,t){return Array.isArray(t)?ir(e,t.join(" ")):typeof t=="object"&&t!==null?tn(e,t):typeof t=="function"?oe(e,t()):ir(e,t)}function ir(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function tn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function z(e,t){return typeof t=="object"&&t!==null?rn(e,t):nn(e,t)}function rn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],e.style.setProperty(on(n),i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{z(e,r)}}function nn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r)}}function on(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?sn(e,n,t):an(e,r,t)});function sn(e,t,r){or(e,oe,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function an(e,t,r){or(e,z);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((_,y)=>y<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((_,y)=>y>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ae(t,"scale",95)/100:1,p=ae(t,"delay",0),E=ae(t,"origin","center"),I="opacity, transform",B=ae(t,"duration",150)/1e3,de=ae(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${B}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:E,transitionDelay:p,transitionProperty:I,transitionDuration:`${de}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function or(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Se(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Se(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=sr(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function sr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:sr(t)}function Se(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;cn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function cn(e,t){let r,n,i,o=se(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),ve()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:se(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),Zt(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),ve(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ae(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}function Ae(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Oe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function ar(e){e(A)}var Z={},cr=!1;function lr(e,t){if(cr||(Z=v(Z),cr=!0),t===void 0)return Z[e];Z[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&Z[e].init()}function ur(){return Z}var pt=!1;function Q(e){return(...t)=>pt||e(...t)}function fr(e,t){t._x_dataStack=e._x_dataStack,pt=!0,un(()=>{ln(t)}),pt=!1}function ln(e){let t=!1;T(e,(n,i)=>{S(n,(o,s)=>{if(t&&nr(o))return s();t=!0,i(o,s)})})}function un(e){let t=L;He((r,n)=>{let i=t(r);return q(i),()=>{}}),e(),He(t)}var pr={};function dr(e,t){pr[e]=t}function mr(e,t){return Object.entries(pr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var fn={get reactive(){return v},get release(){return q},get effect(){return L},get raw(){return Ve},version:"3.4.2",flushAndStopDeferringMutations:$t,disableEffectScheduling:Ct,stopObservingMutations:Ze,setReactivityEngine:Mt,addRootSelector:Ee,deferMutations:Lt,mapAttributes:Y,evaluateLater:h,setEvaluator:zt,destroyTree:ut,closestRoot:N,interceptor:_e,transition:Se,setStyles:z,mutateDom:m,directive:d,throttle:Oe,debounce:Ae,evaluate:b,initTree:T,nextTick:J,prefix:Vt,plugin:ar,magic:x,store:lr,start:Xt,clone:fr,data:dr},A=fn;function dt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var To={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},Ro={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var pn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Co=dt(pn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var hr=Object.freeze({}),Mo=Object.freeze([]);var mt=Object.assign;var dn=Object.prototype.hasOwnProperty,ce=(e,t)=>dn.call(e,t),k=Array.isArray,X=e=>gr(e)==="[object Map]";var mn=e=>typeof e=="string",Te=e=>typeof e=="symbol",le=e=>e!==null&&typeof e=="object";var hn=Object.prototype.toString,gr=e=>hn.call(e),ht=e=>gr(e).slice(8,-1);var Re=e=>mn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Ce=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},gn=/-(\w)/g,No=Ce(e=>e.replace(gn,(t,r)=>r?r.toUpperCase():"")),_n=/\B([A-Z])/g,ko=Ce(e=>e.replace(_n,"-$1").toLowerCase()),gt=Ce(e=>e.charAt(0).toUpperCase()+e.slice(1)),Do=Ce(e=>e?`on${gt(e)}`:""),_t=(e,t)=>e!==t&&(e===e||t===t);var yt=new WeakMap,ue=[],R,V=Symbol("iterate"),xt=Symbol("Map key iterate");function yn(e){return e&&e._isEffect===!0}function _r(e,t=hr){yn(e)&&(e=e.raw);let r=xn(e,t);return t.lazy||r(),r}function xr(e){e.active&&(yr(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var bn=0;function xn(e,t){let r=function(){if(!r.active)return e();if(!ue.includes(r)){yr(r);try{return vn(),ue.push(r),R=r,e()}finally{ue.pop(),br(),R=ue[ue.length-1]}}};return r.id=bn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function yr(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var ee=!0,bt=[];function wn(){bt.push(ee),ee=!1}function vn(){bt.push(ee),ee=!0}function br(){let e=bt.pop();ee=e===void 0?!0:e}function w(e,t,r){if(!ee||R===void 0)return;let n=yt.get(e);n||yt.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(R)||(i.add(R),R.deps.push(i),R.options.onTrack&&R.options.onTrack({effect:R,target:e,type:t,key:r}))}function D(e,t,r,n,i,o){let s=yt.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==R||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&k(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":k(e)?Re(r)&&c(s.get("length")):(c(s.get(V)),X(e)&&c(s.get(xt)));break;case"delete":k(e)||(c(s.get(V)),X(e)&&c(s.get(xt)));break;case"set":X(e)&&c(s.get(V));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var En=dt("__proto__,__v_isRef,__isVue"),vr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Te)),Sn=Me(),An=Me(!1,!0),On=Me(!0),Tn=Me(!0,!0),Ne={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)w(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(g)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Ne[e]=function(...r){wn();let n=t.apply(this,r);return br(),n}});function Me(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?Cn:Er:t?Rn:wr).get(n))return n;let s=k(n);if(!e&&s&&ce(Ne,i))return Reflect.get(Ne,i,o);let a=Reflect.get(n,i,o);return(Te(i)?vr.has(i):En(i))||(e||w(n,"get",i),t)?a:vt(a)?!s||!Re(i)?a.value:a:le(a)?e?Sr(a):ke(a):a}}var Mn=Ar(),Nn=Ar(!0);function Ar(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=g(i),s=g(s),!k(r)&&vt(s)&&!vt(i)))return s.value=i,!0;let a=k(r)&&Re(n)?Number(n)<r.length:ce(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?_t(i,s)&&D(r,"set",n,i,s):D(r,"add",n,i)),c}}function kn(e,t){let r=ce(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&D(e,"delete",t,void 0,n),i}function Dn(e,t){let r=Reflect.has(e,t);return(!Te(t)||!vr.has(t))&&w(e,"has",t),r}function Pn(e){return w(e,"iterate",k(e)?"length":V),Reflect.ownKeys(e)}var Or={get:Sn,set:Mn,deleteProperty:kn,has:Dn,ownKeys:Pn},Tr={get:On,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Fo=mt({},Or,{get:An,set:Nn}),Ko=mt({},Tr,{get:Tn}),wt=e=>le(e)?ke(e):e,Et=e=>le(e)?Sr(e):e,St=e=>e,De=e=>Reflect.getPrototypeOf(e);function Pe(e,t,r=!1,n=!1){e=e.__v_raw;let i=g(e),o=g(t);t!==o&&!r&&w(i,"get",t),!r&&w(i,"get",o);let{has:s}=De(i),a=n?St:r?Et:wt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ie(e,t=!1){let r=this.__v_raw,n=g(r),i=g(e);return e!==i&&!t&&w(n,"has",e),!t&&w(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Le(e,t=!1){return e=e.__v_raw,!t&&w(g(e),"iterate",V),Reflect.get(e,"size",e)}function Rr(e){e=g(e);let t=g(this);return De(t).has.call(t,e)||(t.add(e),D(t,"add",e,e)),this}function Mr(e,t){t=g(t);let r=g(this),{has:n,get:i}=De(r),o=n.call(r,e);o?Cr(r,n,e):(e=g(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?_t(t,s)&&D(r,"set",e,t,s):D(r,"add",e,t),this}function Nr(e){let t=g(this),{has:r,get:n}=De(t),i=r.call(t,e);i?Cr(t,r,e):(e=g(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&D(t,"delete",e,void 0,o),s}function kr(){let e=g(this),t=e.size!==0,r=X(e)?new Map(e):new Set(e),n=e.clear();return t&&D(e,"clear",void 0,void 0,r),n}function $e(e,t){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=t?St:e?Et:wt;return!e&&w(a,"iterate",V),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function je(e,t,r){return function(...n){let i=this.__v_raw,o=g(i),s=X(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?St:t?Et:wt;return!t&&w(o,"iterate",c?xt:V),{next(){let{value:p,done:E}=l.next();return E?{value:p,done:E}:{value:a?[u(p[0]),u(p[1])]:u(p),done:E}},[Symbol.iterator](){return this}}}}function P(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${gt(e)} operation ${r}failed: target is readonly.`,g(this))}return e==="delete"?!1:this}}var Dr={get(e){return Pe(this,e)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!1)},Pr={get(e){return Pe(this,e,!1,!0)},get size(){return Le(this)},has:Ie,add:Rr,set:Mr,delete:Nr,clear:kr,forEach:$e(!1,!0)},Ir={get(e){return Pe(this,e,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!1)},Lr={get(e){return Pe(this,e,!0,!0)},get size(){return Le(this,!0)},has(e){return Ie.call(this,e,!0)},add:P("add"),set:P("set"),delete:P("delete"),clear:P("clear"),forEach:$e(!0,!0)},In=["keys","values","entries",Symbol.iterator];In.forEach(e=>{Dr[e]=je(e,!1,!1),Ir[e]=je(e,!0,!1),Pr[e]=je(e,!1,!0),Lr[e]=je(e,!0,!0)});function Fe(e,t){let r=t?e?Lr:Pr:e?Ir:Dr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ce(r,i)&&i in n?r:n,i,o)}var Ln={get:Fe(!1,!1)},zo={get:Fe(!1,!0)},$n={get:Fe(!0,!1)},Vo={get:Fe(!0,!0)};function Cr(e,t,r){let n=g(r);if(n!==r&&t.call(e,n)){let i=ht(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var wr=new WeakMap,Rn=new WeakMap,Er=new WeakMap,Cn=new WeakMap;function jn(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fn(e){return e.__v_skip||!Object.isExtensible(e)?0:jn(ht(e))}function ke(e){return e&&e.__v_isReadonly?e:$r(e,!1,Or,Ln,wr)}function Sr(e){return $r(e,!0,Tr,$n,Er)}function $r(e,t,r,n,i){if(!le(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=Fn(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function g(e){return e&&g(e.__v_raw)||e}function vt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>J);x("dispatch",e=>K.bind(K,e));x("watch",e=>(t,r)=>{let n=h(e,t),i=!0,o,[s,a]=he(e);U(e,t,a),s(()=>n(c=>{let l=document.createElement("div");l.dataset.throwAway=c,i?o=c:queueMicrotask(()=>{r(c,o),o=c}),i=!1}))});x("store",ur);x("root",e=>N(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=j(Kn(e))),e._x_refs_proxy));function Kn(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}x("el",e=>e);var jr=()=>{};jr.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",jr);d("effect",(e,{expression:t},{effect:r})=>r(h(e,t)));function fe(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=v({})),e._x_bindings[t]=r,t=n.includes("camel")?qn(t):t,t){case"value":zn(e,r);break;case"style":Bn(e,r);break;case"class":Vn(e,r);break;default:Hn(e,t,r);break}}function zn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=Fr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>Fr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Un(e,t);else{if(e.value===t)return;e.value=t}}function Vn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=oe(e,t)}function Bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=z(e,t)}function Hn(e,t,r){[null,void 0,!1].includes(r)&&Yn(t)?e.removeAttribute(t):(Gn(t)&&(r=t),Wn(e,t,r))}function Wn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function Un(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function qn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Fr(e,t){return e==t}function Gn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Yn(e){return!["aria-pressed","aria-checked","aria-expanded"].includes(e)}function pe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=Jn(t)),r.includes("camel")&&(t=Zn(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||e.offsetWidth<1&&e.offsetHeight<1||c(l)})),o=a(o,(c,l)=>{Qn(t)&&Xn(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=At(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ae(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=At(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Oe(o,l)}return r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Jn(e){return e.replace(/-/g,".")}function Zn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function At(e){return!Array.isArray(e)&&!isNaN(e)}function ei(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qn(e){return["keydown","keyup"].includes(e)}function Xn(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,At((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&Kr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&Kr(e.key).includes(r[0]))}function Kr(e){if(!e)return[];e=ei(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=h(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=h(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=ti(e,t,r),u=pe(e,c,t,p=>{a(()=>{},{scope:{$event:p,rightSideOfExpression:l}})});i(()=>u()),e._x_forceModelUpdate=()=>{o(p=>{p===void 0&&r.match(/\./)&&(p=""),window.fromModel=!0,m(()=>fe(e,"value",p)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function ti(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?Ot(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!ri(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return Ot(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?Ot(o):t.includes("trim")?o.trim():o}}})}function Ot(e){let t=e?parseFloat(e):null;return ni(t)?t:e}function ri(e,t){return e==t}function ni(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(O("cloak")))));rr(()=>`[${O("init")}]`);d("init",Q((e,{expression:t})=>typeof t=="string"?!!t.trim()&&b(e,t,{},!1):b(e,t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{e.innerHTML=o})})});Y(ye(":",xe(O("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return ii(e,n,i,o);if(t==="key")return oi(e,n);let s=h(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>fe(e,t,a,r))}))});function ii(e,t,r,n){let i=h(e,t),o=[];n(()=>{for(;o.length;)o.pop()();i(s=>{let a=Object.entries(s).map(([c,l])=>({name:c,value:l}));Ut(a).forEach(({name:c,value:l},u)=>{a[u]={name:`x-bind:${c}`,value:`"${l}"`}}),ne(e,a,r).map(c=>{o.push(c.runCleanups),c()})})})}function oi(e,t){e._x_keyExpression=t}Ee(()=>`[${O("data")}]`);d("data",Q((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=F(n,e).cleanup,o={};mr(o,n);let s=b(e,t,{scope:o}),a=F(s,e).cleanup,c=v(s);jt(c);let l=W(e,c);c.init&&b(e,c.init),r(()=>{l(),i(),a(),c.destroy&&b(e,c.destroy)})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=h(e,r),o=()=>m(()=>{e.style.display="none",e._x_isShown=!1}),s=()=>m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display"),e._x_isShown=!0}),a=()=>setTimeout(s),c=se(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=ai(t),o=h(e,i.items),s=h(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>si(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function si(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{ci(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,_])=>{let y=zr(t,_,f,s);n(C=>u.push(C),{scope:{index:f,...y}}),l.push(y)});else for(let f=0;f<s.length;f++){let _=zr(t,s[f],f,s);n(y=>u.push(y),{scope:{index:f,..._}}),l.push(_)}let p=[],E=[],I=[],B=[];for(let f=0;f<c.length;f++){let _=c[f];u.indexOf(_)===-1&&I.push(_)}c=c.filter(f=>!I.includes(f));let de="template";for(let f=0;f<u.length;f++){let _=u[f],y=c.indexOf(_);if(y===-1)c.splice(f,0,_),p.push([de,f]);else if(y!==f){let C=c.splice(f,1)[0],M=c.splice(y-1,1)[0];c.splice(f,0,M),c.splice(y,0,C),E.push([C,M])}else B.push(_);de=_}for(let f=0;f<I.length;f++){let _=I[f];a[_].remove(),a[_]=null,delete a[_]}for(let f=0;f<E.length;f++){let[_,y]=E[f],C=a[_],M=a[y],H=document.createElement("div");m(()=>{M.after(H),C.after(M),H.before(C),H.remove()}),et(M,l[u.indexOf(y)])}for(let f=0;f<p.length;f++){let[_,y]=p[f],C=_==="template"?o:a[_],M=l[y],H=u[y],me=document.importNode(o.content,!0).firstElementChild;W(me,v(M),o),m(()=>{C.after(me),T(me)}),typeof H=="object"&&we("x-for key cannot be an object, it must be a string or an integer",o),a[H]=me}for(let f=0;f<B.length;f++)et(a[B[f]],l[u.indexOf(B[f])]);o._x_prevKeys=u})}function ai(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function zr(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function ci(e){return!Array.isArray(e)&&!isNaN(e)}function Vr(){}Vr.inline=(e,{expression:t},{cleanup:r})=>{let n=N(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",Vr);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=h(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return W(a,{},e),m(()=>{e.after(a),T(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});Y(ye("@",xe(O("on:"))));d("on",Q((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?h(e,n):()=>{},s=pe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));A.setEvaluator(li);A.setReactivityEngine({reactive:ke,effect:_r,release:xr,raw:g});function li(e,t){let r={};F(r,e);let n=[r,...$(e)];if(typeof t=="function")return rt(n,t);let i=(o=()=>{},{scope:s={},params:a=[]}={})=>{let c=j([s,...n]);c[t]!==void 0&&G(o,c[t],c,a)};return nt.bind(null,e,t,i)}var Tt=A;window.Alpine=Tt;queueMicrotask(()=>{Tt.start()});})();
diff --git a/alpinejs/packages/csp/dist/dist/module.cjs.js b/alpinejs/packages/csp/dist/dist/module.cjs.js
deleted file mode 100644
index 14b08ff..0000000
--- a/alpinejs/packages/csp/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,3261 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module2) => () => {
- if (!module2) {
- module2 = {exports: {}};
- callback(module2.exports, module2);
- }
- return module2.exports;
-};
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-var __exportStar = (target, module2, desc) => {
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
- for (let key of __getOwnPropNames(module2))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module2) => {
- return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
-};
-
-// node_modules/@vue/shared/dist/shared.cjs.js
-var require_shared_cjs = __commonJS((exports2) => {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
- var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
- var range = 2;
- function generateCodeFrame(source, start2 = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start2) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
- const lineLength = lines[j].length;
- if (j === i) {
- const pad = start2 - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start2);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
- var attrValidationCache = {};
- function isSSRSafeAttrName(name) {
- if (attrValidationCache.hasOwnProperty(name)) {
- return attrValidationCache[name];
- }
- const isUnsafe = unsafeAttrCharRE.test(name);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name}`);
- }
- return attrValidationCache[name] = !isUnsafe;
- }
- var propsToAttrMap = {
- acceptCharset: "accept-charset",
- className: "class",
- htmlFor: "for",
- httpEquiv: "http-equiv"
- };
- var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);
- var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`);
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isObject(value)) {
- return value;
- }
- }
- var listDelimiterRE = /;(?![^(]*\))/g;
- var propertyDelimiterRE = /:(.+)/;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- let ret = "";
- if (!styles) {
- return ret;
- }
- for (const key in styles) {
- const value = styles[key];
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) {
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
- var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
- var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
- var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
- var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
- var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
- var escapeRE = /["'&<>]/;
- function escapeHtml(string) {
- const str = "" + string;
- const match = escapeRE.exec(str);
- if (!match) {
- return str;
- }
- let html = "";
- let escaped;
- let index;
- let lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- escaped = "&quot;";
- break;
- case 38:
- escaped = "&amp;";
- break;
- case 39:
- escaped = "&#39;";
- break;
- case 60:
- escaped = "&lt;";
- break;
- case 62:
- escaped = "&gt;";
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escaped;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
- function escapeHtmlComment(src) {
- return src.replace(commentStripRE, "");
- }
- function looseCompareArrays(a, b) {
- if (a.length !== b.length)
- return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b)
- return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex((item) => looseEqual(item, val));
- }
- var toDisplayString = (val) => {
- return val == null ? "" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);
- };
- var replacer = (_key, val) => {
- if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
- entries[`${key} =>`] = val2;
- return entries;
- }, {})
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()]
- };
- } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
- return String(val);
- }
- return val;
- };
- var babelParserDefaultPlugins = [
- "bigInt",
- "optionalChaining",
- "nullishCoalescingOperator"
- ];
- var EMPTY_OBJ = Object.freeze({});
- var EMPTY_ARR = Object.freeze([]);
- var NOOP = () => {
- };
- var NO = () => false;
- var onRE = /^on[^a-z]/;
- var isOn = (key) => onRE.test(key);
- var isModelListener = (key) => key.startsWith("onUpdate:");
- var extend = Object.assign;
- var remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isSet = (val) => toTypeString(val) === "[object Set]";
- var isDate = (val) => val instanceof Date;
- var isFunction = (val) => typeof val === "function";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var isPromise = (val) => {
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
- };
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isPlainObject = (val) => toTypeString(val) === "[object Object]";
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
- var invokeArrayFns = (fns, arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](arg);
- }
- };
- var def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- var toNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- var _globalThis;
- var getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- exports2.EMPTY_ARR = EMPTY_ARR;
- exports2.EMPTY_OBJ = EMPTY_OBJ;
- exports2.NO = NO;
- exports2.NOOP = NOOP;
- exports2.PatchFlagNames = PatchFlagNames;
- exports2.babelParserDefaultPlugins = babelParserDefaultPlugins;
- exports2.camelize = camelize;
- exports2.capitalize = capitalize;
- exports2.def = def;
- exports2.escapeHtml = escapeHtml;
- exports2.escapeHtmlComment = escapeHtmlComment;
- exports2.extend = extend;
- exports2.generateCodeFrame = generateCodeFrame;
- exports2.getGlobalThis = getGlobalThis;
- exports2.hasChanged = hasChanged;
- exports2.hasOwn = hasOwn;
- exports2.hyphenate = hyphenate;
- exports2.invokeArrayFns = invokeArrayFns;
- exports2.isArray = isArray;
- exports2.isBooleanAttr = isBooleanAttr2;
- exports2.isDate = isDate;
- exports2.isFunction = isFunction;
- exports2.isGloballyWhitelisted = isGloballyWhitelisted;
- exports2.isHTMLTag = isHTMLTag;
- exports2.isIntegerKey = isIntegerKey;
- exports2.isKnownAttr = isKnownAttr;
- exports2.isMap = isMap;
- exports2.isModelListener = isModelListener;
- exports2.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;
- exports2.isObject = isObject;
- exports2.isOn = isOn;
- exports2.isPlainObject = isPlainObject;
- exports2.isPromise = isPromise;
- exports2.isReservedProp = isReservedProp;
- exports2.isSSRSafeAttrName = isSSRSafeAttrName;
- exports2.isSVGTag = isSVGTag;
- exports2.isSet = isSet;
- exports2.isSpecialBooleanAttr = isSpecialBooleanAttr;
- exports2.isString = isString;
- exports2.isSymbol = isSymbol;
- exports2.isVoidTag = isVoidTag;
- exports2.looseEqual = looseEqual;
- exports2.looseIndexOf = looseIndexOf;
- exports2.makeMap = makeMap;
- exports2.normalizeClass = normalizeClass;
- exports2.normalizeStyle = normalizeStyle;
- exports2.objectToString = objectToString;
- exports2.parseStringStyle = parseStringStyle;
- exports2.propsToAttrMap = propsToAttrMap;
- exports2.remove = remove;
- exports2.slotFlagsText = slotFlagsText;
- exports2.stringifyStyle = stringifyStyle;
- exports2.toDisplayString = toDisplayString;
- exports2.toHandlerKey = toHandlerKey;
- exports2.toNumber = toNumber;
- exports2.toRawType = toRawType;
- exports2.toTypeString = toTypeString;
-});
-
-// node_modules/@vue/shared/index.js
-var require_shared = __commonJS((exports2, module2) => {
- "use strict";
- if (false) {
- module2.exports = null;
- } else {
- module2.exports = require_shared_cjs();
- }
-});
-
-// node_modules/@vue/reactivity/dist/reactivity.cjs.js
-var require_reactivity_cjs = __commonJS((exports2) => {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- var shared = require_shared();
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol("iterate");
- var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect3(fn, options = shared.EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect4 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect4();
- }
- return effect4;
- }
- function stop2(effect4) {
- if (effect4.active) {
- cleanup(effect4);
- if (effect4.options.onStop) {
- effect4.options.onStop();
- }
- effect4.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect4 = function reactiveEffect() {
- if (!effect4.active) {
- return fn();
- }
- if (!effectStack.includes(effect4)) {
- cleanup(effect4);
- try {
- enableTracking();
- effectStack.push(effect4);
- activeEffect = effect4;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect4.id = uid++;
- effect4.allowRecurse = !!options.allowRecurse;
- effect4._isEffect = true;
- effect4.active = true;
- effect4.raw = fn;
- effect4.deps = [];
- effect4.options = options;
- return effect4;
- }
- function cleanup(effect4) {
- const {deps} = effect4;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect4);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect4) => {
- if (effect4 !== activeEffect || effect4.allowRecurse) {
- effects.add(effect4);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && shared.isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (shared.isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (shared.isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect4) => {
- if (effect4.options.onTrigger) {
- effect4.options.onTrigger({
- effect: effect4,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect4.options.scheduler) {
- effect4.options.scheduler(effect4);
- } else {
- effect4();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw2(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw2));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly2 = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = shared.isArray(target);
- if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (shared.isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive3(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw2(value);
- oldValue = toRaw2(oldValue);
- if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw2(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = shared.hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = shared.extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = shared.extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;
- var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly2 = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "get", key);
- }
- !isReadonly2 && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "has", key);
- }
- !isReadonly2 && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw2(this);
- const hadItems = target.size !== 0;
- const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly2, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw2(target);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const targetIsMap = shared.isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw2(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = shared.toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));
- }
- function reactive3(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function shallowReactive(target) {
- return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function shallowReadonly(target) {
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!shared.isObject(target)) {
- {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive2(value) {
- if (isReadonly(value)) {
- return isReactive2(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isProxy(value) {
- return isReactive2(value) || isReadonly(value);
- }
- function toRaw2(observed) {
- return observed && toRaw2(observed["__v_raw"]) || observed;
- }
- function markRaw(value) {
- shared.def(value, "__v_skip", true);
- return value;
- }
- var convert = (val) => shared.isObject(val) ? reactive3(val) : val;
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
- function ref(value) {
- return createRef(value);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- var RefImpl = class {
- constructor(_rawValue, _shallow = false) {
- this._rawValue = _rawValue;
- this._shallow = _shallow;
- this.__v_isRef = true;
- this._value = _shallow ? _rawValue : convert(_rawValue);
- }
- get value() {
- track(toRaw2(this), "get", "value");
- return this._value;
- }
- set value(newVal) {
- if (shared.hasChanged(toRaw2(newVal), this._rawValue)) {
- this._rawValue = newVal;
- this._value = this._shallow ? newVal : convert(newVal);
- trigger(toRaw2(this), "set", "value", newVal);
- }
- }
- };
- function createRef(rawValue, shallow = false) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- function triggerRef(ref2) {
- trigger(toRaw2(ref2), "set", "value", ref2.value);
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- var shallowUnwrapHandlers = {
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- var CustomRefImpl = class {
- constructor(factory) {
- this.__v_isRef = true;
- const {get: get3, set: set3} = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value"));
- this._get = get3;
- this._set = set3;
- }
- get value() {
- return this._get();
- }
- set value(newVal) {
- this._set(newVal);
- }
- };
- function customRef(factory) {
- return new CustomRefImpl(factory);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = shared.isArray(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = toRef(object, key);
- }
- return ret;
- }
- var ObjectRefImpl = class {
- constructor(_object, _key) {
- this._object = _object;
- this._key = _key;
- this.__v_isRef = true;
- }
- get value() {
- return this._object[this._key];
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- };
- function toRef(object, key) {
- return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);
- }
- var ComputedRefImpl = class {
- constructor(getter, _setter, isReadonly2) {
- this._setter = _setter;
- this._dirty = true;
- this.__v_isRef = true;
- this.effect = effect3(getter, {
- lazy: true,
- scheduler: () => {
- if (!this._dirty) {
- this._dirty = true;
- trigger(toRaw2(this), "set", "value");
- }
- }
- });
- this["__v_isReadonly"] = isReadonly2;
- }
- get value() {
- const self2 = toRaw2(this);
- if (self2._dirty) {
- self2._value = this.effect();
- self2._dirty = false;
- }
- track(self2, "get", "value");
- return self2._value;
- }
- set value(newValue) {
- this._setter(newValue);
- }
- };
- function computed(getterOrOptions) {
- let getter;
- let setter;
- if (shared.isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- setter = () => {
- console.warn("Write operation failed: computed value is readonly");
- };
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);
- }
- exports2.ITERATE_KEY = ITERATE_KEY;
- exports2.computed = computed;
- exports2.customRef = customRef;
- exports2.effect = effect3;
- exports2.enableTracking = enableTracking;
- exports2.isProxy = isProxy;
- exports2.isReactive = isReactive2;
- exports2.isReadonly = isReadonly;
- exports2.isRef = isRef;
- exports2.markRaw = markRaw;
- exports2.pauseTracking = pauseTracking;
- exports2.proxyRefs = proxyRefs;
- exports2.reactive = reactive3;
- exports2.readonly = readonly;
- exports2.ref = ref;
- exports2.resetTracking = resetTracking;
- exports2.shallowReactive = shallowReactive;
- exports2.shallowReadonly = shallowReadonly;
- exports2.shallowRef = shallowRef;
- exports2.stop = stop2;
- exports2.toRaw = toRaw2;
- exports2.toRef = toRef;
- exports2.toRefs = toRefs;
- exports2.track = track;
- exports2.trigger = trigger;
- exports2.triggerRef = triggerRef;
- exports2.unref = unref;
-});
-
-// node_modules/@vue/reactivity/index.js
-var require_reactivity = __commonJS((exports2, module2) => {
- "use strict";
- if (false) {
- module2.exports = null;
- } else {
- module2.exports = require_reactivity_cjs();
- }
-});
-
-// packages/csp/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/alpinejs/src/scheduler.js
-var flushPending = false;
-var flushing = false;
-var queue = [];
-function scheduler(callback) {
- queueJob(callback);
-}
-function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
-}
-function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
-}
-function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
-}
-
-// packages/alpinejs/src/reactivity.js
-var reactive;
-var effect;
-var release;
-var raw;
-var shouldSchedule = true;
-function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
-}
-function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
-}
-function overrideEffect(override) {
- effect = override;
-}
-function elementBoundEffect(el) {
- let cleanup = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup();
- }];
-}
-
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
-// packages/alpinejs/src/mutation.js
-var onAttributeAddeds = [];
-var onElRemoveds = [];
-var onElAddeds = [];
-function onElAdded(callback) {
- onElAddeds.push(callback);
-}
-function onElRemoved(callback) {
- onElRemoveds.push(callback);
-}
-function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
-}
-function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
-}
-function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
-}
-var observer = new MutationObserver(onMutate);
-var currentlyObserving = false;
-function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
-}
-function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
-}
-var recordQueue = [];
-var willProcessRecordQueue = false;
-function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
-}
-function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
-}
-function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
-}
-var isCollecting = false;
-var deferredMutations = [];
-function deferMutations() {
- isCollecting = true;
-}
-function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
-}
-function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add();
- } else if (el.hasAttribute(name)) {
- remove();
- add();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
-}
-
-// packages/alpinejs/src/scope.js
-function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
-}
-function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
-}
-function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
-}
-function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
-}
-
-// packages/alpinejs/src/interceptor.js
-function initInterceptors(data2) {
- let isObject = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
-}
-function interceptor(callback, mutateObj = () => {
-}) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
-}
-function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
-}
-function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
-}
-
-// packages/alpinejs/src/magics.js
-var magics = {};
-function magic(name, callback) {
- magics[name] = callback;
-}
-function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
-}
-
-// packages/alpinejs/src/evaluator.js
-function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
-}
-function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
-}
-var theEvaluatorFunction = normalEvaluator;
-function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
-}
-function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
-}
-function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
-}
-var evaluatorMemo = {};
-function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
-}
-function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
-}
-function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
-}
-function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
-}
-
-// packages/alpinejs/src/directives.js
-var prefixAsString = "x-";
-function prefix(subject = "") {
- return prefixAsString + subject;
-}
-function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
-}
-var directiveHandlers = {};
-function directive(name, callback) {
- directiveHandlers[name] = callback;
-}
-function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
-}
-function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
-}
-var isDeferringHandlers = false;
-var directiveHandlerStacks = new Map();
-var currentHandlerStackKey = Symbol();
-function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
-}
-function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
-}
-var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
-};
-var into = (i) => i;
-function toTransformedAttributes(callback = () => {
-}) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
-}
-var attributeTransformers = [];
-function mapAttributes(callback) {
- attributeTransformers.push(callback);
-}
-function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
-}
-var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
-function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
-}
-var DEFAULT = "DEFAULT";
-var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
-];
-function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
-}
-
-// packages/alpinejs/src/utils/dispatch.js
-function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
-}
-
-// packages/alpinejs/src/nextTick.js
-var tickStack = [];
-var isHolding = false;
-function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
-}
-function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
-}
-function holdNextTicks() {
- isHolding = true;
-}
-
-// packages/alpinejs/src/utils/warn.js
-function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
-}
-
-// packages/alpinejs/src/lifecycle.js
-function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
-}
-var rootSelectorCallbacks = [];
-var initSelectorCallbacks = [];
-function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
-}
-function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
-}
-function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
-}
-function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
-}
-function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
-}
-function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
-}
-function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
-}
-function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
-}
-
-// packages/alpinejs/src/utils/classes.js
-function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
-}
-function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
-}
-function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
-}
-
-// packages/alpinejs/src/utils/styles.js
-function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
-}
-function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
-}
-function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
-}
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-// packages/alpinejs/src/utils/once.js
-function once(callback, fallback = () => {
-}) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
-}
-
-// packages/alpinejs/src/directives/x-transition.js
-directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
-});
-function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
-}
-function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
-}
-function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
-}
-window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
-};
-function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
-}
-function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
-}, after = () => {
-}) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
-}
-function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
-}
-
-// packages/alpinejs/src/utils/debounce.js
-function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
-}
-
-// packages/alpinejs/src/utils/throttle.js
-function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
-}
-
-// packages/alpinejs/src/plugin.js
-function plugin(callback) {
- callback(alpine_default);
-}
-
-// packages/alpinejs/src/store.js
-var stores = {};
-var isReactive = false;
-function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
-}
-function getStores() {
- return stores;
-}
-
-// packages/alpinejs/src/clone.js
-var isCloning = false;
-function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
-}
-function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
-}
-function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
-}
-function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
-}
-
-// packages/alpinejs/src/datas.js
-var datas = {};
-function data(name, callback) {
- datas[name] = callback;
-}
-function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
-}
-
-// packages/alpinejs/src/alpine.js
-var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
-};
-var alpine_default = Alpine;
-
-// packages/csp/src/index.js
-var import_reactivity9 = __toModule(require_reactivity());
-
-// packages/alpinejs/src/magics/$nextTick.js
-magic("nextTick", () => nextTick);
-
-// packages/alpinejs/src/magics/$dispatch.js
-magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
-// packages/alpinejs/src/magics/$watch.js
-magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/magics/$store.js
-magic("store", getStores);
-
-// packages/alpinejs/src/magics/$root.js
-magic("root", (el) => closestRoot(el));
-
-// packages/alpinejs/src/magics/$refs.js
-magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
-});
-function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
-}
-
-// packages/alpinejs/src/magics/$el.js
-magic("el", (el) => el);
-
-// packages/alpinejs/src/directives/x-ignore.js
-var handler = () => {
-};
-handler.inline = (el, {modifiers}, {cleanup}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
-};
-directive("ignore", handler);
-
-// packages/alpinejs/src/directives/x-effect.js
-directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
-// packages/alpinejs/src/utils/bind.js
-function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
-}
-function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
-}
-function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
-}
-function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
-}
-function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr(name))
- value = name;
- setIfChanged(el, name, value);
- }
-}
-function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
-}
-function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
-}
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
-}
-function isBooleanAttr(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
-}
-function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
-}
-
-// packages/alpinejs/src/utils/on.js
-function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
-}
-function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
-}
-function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
-}
-function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
-}
-function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
-}
-function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
-}
-
-// packages/alpinejs/src/directives/x-model.js
-directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
-});
-function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
-}
-function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
-}
-function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
-}
-function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-cloak.js
-directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
-// packages/alpinejs/src/directives/x-init.js
-addInitSelector(() => `[${prefix("init")}]`);
-directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
-}));
-
-// packages/alpinejs/src/directives/x-text.js
-directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-html.js
-directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-bind.js
-mapAttributes(startingWith(":", into(prefix("bind:"))));
-directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
-});
-function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
-}
-function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
-}
-
-// packages/alpinejs/src/directives/x-data.js
-addRootSelector(() => `[${prefix("data")}]`);
-directive("data", skipDuringClone((el, {expression}, {cleanup}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup2 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup(() => {
- undo();
- cleanup1();
- cleanup2();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
-}));
-
-// packages/alpinejs/src/directives/x-show.js
-directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/directives/x-for.js
-directive("for", (el, {expression}, {effect: effect3, cleanup}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
-});
-function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
-}
-function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
-}
-function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
-}
-function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-ref.js
-function handler2() {
-}
-handler2.inline = (el, {expression}, {cleanup}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup(() => delete root._x_refs[expression]);
-};
-directive("ref", handler2);
-
-// packages/alpinejs/src/directives/x-if.js
-directive("if", (el, {expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup(() => el._x_undoIf && el._x_undoIf());
-});
-
-// packages/alpinejs/src/directives/x-on.js
-mapAttributes(startingWith("@", into(prefix("on:"))));
-directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup(() => removeListener());
-}));
-
-// packages/csp/src/index.js
-alpine_default.setEvaluator(cspCompliantEvaluator);
-alpine_default.setReactivityEngine({reactive: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw});
-function cspCompliantEvaluator(el, expression) {
- let overriddenMagics = {};
- injectMagics(overriddenMagics, el);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let completeScope = mergeProxies([scope, ...dataStack]);
- if (completeScope[expression] !== void 0) {
- runIfTypeOfFunction(receiver, completeScope[expression], completeScope, params);
- }
- };
- return tryCatch.bind(null, el, expression, evaluator);
-}
-var src_default = alpine_default;
-
-// packages/csp/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/csp/dist/dist/module.esm.js b/alpinejs/packages/csp/dist/dist/module.esm.js
deleted file mode 100644
index 252351b..0000000
--- a/alpinejs/packages/csp/dist/dist/module.esm.js
+++ /dev/null
@@ -1,3254 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module) => () => {
- if (!module) {
- module = {exports: {}};
- callback(module.exports, module);
- }
- return module.exports;
-};
-var __exportStar = (target, module, desc) => {
- if (module && typeof module === "object" || typeof module === "function") {
- for (let key of __getOwnPropNames(module))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module) => {
- return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: () => module.default, enumerable: true} : {value: module, enumerable: true})), module);
-};
-
-// node_modules/@vue/shared/dist/shared.cjs.js
-var require_shared_cjs = __commonJS((exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(",");
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
- }
- var PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `HYDRATE_EVENTS`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
- var slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
- var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
- var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
- var range = 2;
- function generateCodeFrame(source, start2 = 0, end = source.length) {
- const lines = source.split(/\r?\n/);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start2) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
- const lineLength = lines[j].length;
- if (j === i) {
- const pad = start2 - (count - lineLength) + 1;
- const length = Math.max(1, end > count ? lineLength - pad : end - start2);
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + 1;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
- var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
- var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
- var attrValidationCache = {};
- function isSSRSafeAttrName(name) {
- if (attrValidationCache.hasOwnProperty(name)) {
- return attrValidationCache[name];
- }
- const isUnsafe = unsafeAttrCharRE.test(name);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name}`);
- }
- return attrValidationCache[name] = !isUnsafe;
- }
- var propsToAttrMap = {
- acceptCharset: "accept-charset",
- className: "class",
- htmlFor: "for",
- httpEquiv: "http-equiv"
- };
- var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);
- var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`);
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isObject(value)) {
- return value;
- }
- }
- var listDelimiterRE = /;(?![^(]*\))/g;
- var propertyDelimiterRE = /:(.+)/;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- let ret = "";
- if (!styles) {
- return ret;
- }
- for (const key in styles) {
- const value = styles[key];
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) {
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
- var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
- var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
- var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
- var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
- var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
- var escapeRE = /["'&<>]/;
- function escapeHtml(string) {
- const str = "" + string;
- const match = escapeRE.exec(str);
- if (!match) {
- return str;
- }
- let html = "";
- let escaped;
- let index;
- let lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- escaped = "&quot;";
- break;
- case 38:
- escaped = "&amp;";
- break;
- case 39:
- escaped = "&#39;";
- break;
- case 60:
- escaped = "&lt;";
- break;
- case 62:
- escaped = "&gt;";
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escaped;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
- function escapeHtmlComment(src) {
- return src.replace(commentStripRE, "");
- }
- function looseCompareArrays(a, b) {
- if (a.length !== b.length)
- return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b)
- return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex((item) => looseEqual(item, val));
- }
- var toDisplayString = (val) => {
- return val == null ? "" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);
- };
- var replacer = (_key, val) => {
- if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
- entries[`${key} =>`] = val2;
- return entries;
- }, {})
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()]
- };
- } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
- return String(val);
- }
- return val;
- };
- var babelParserDefaultPlugins = [
- "bigInt",
- "optionalChaining",
- "nullishCoalescingOperator"
- ];
- var EMPTY_OBJ = Object.freeze({});
- var EMPTY_ARR = Object.freeze([]);
- var NOOP = () => {
- };
- var NO = () => false;
- var onRE = /^on[^a-z]/;
- var isOn = (key) => onRE.test(key);
- var isModelListener = (key) => key.startsWith("onUpdate:");
- var extend = Object.assign;
- var remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
- var isArray = Array.isArray;
- var isMap = (val) => toTypeString(val) === "[object Map]";
- var isSet = (val) => toTypeString(val) === "[object Set]";
- var isDate = (val) => val instanceof Date;
- var isFunction = (val) => typeof val === "function";
- var isString = (val) => typeof val === "string";
- var isSymbol = (val) => typeof val === "symbol";
- var isObject = (val) => val !== null && typeof val === "object";
- var isPromise = (val) => {
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
- };
- var objectToString = Object.prototype.toString;
- var toTypeString = (value) => objectToString.call(value);
- var toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- var isPlainObject = (val) => toTypeString(val) === "[object Object]";
- var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- var isReservedProp = /* @__PURE__ */ makeMap(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
- var cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- var camelizeRE = /-(\w)/g;
- var camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- });
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
- var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
- var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
- var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
- var invokeArrayFns = (fns, arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](arg);
- }
- };
- var def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- var toNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- var _globalThis;
- var getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- exports.EMPTY_ARR = EMPTY_ARR;
- exports.EMPTY_OBJ = EMPTY_OBJ;
- exports.NO = NO;
- exports.NOOP = NOOP;
- exports.PatchFlagNames = PatchFlagNames;
- exports.babelParserDefaultPlugins = babelParserDefaultPlugins;
- exports.camelize = camelize;
- exports.capitalize = capitalize;
- exports.def = def;
- exports.escapeHtml = escapeHtml;
- exports.escapeHtmlComment = escapeHtmlComment;
- exports.extend = extend;
- exports.generateCodeFrame = generateCodeFrame;
- exports.getGlobalThis = getGlobalThis;
- exports.hasChanged = hasChanged;
- exports.hasOwn = hasOwn;
- exports.hyphenate = hyphenate;
- exports.invokeArrayFns = invokeArrayFns;
- exports.isArray = isArray;
- exports.isBooleanAttr = isBooleanAttr2;
- exports.isDate = isDate;
- exports.isFunction = isFunction;
- exports.isGloballyWhitelisted = isGloballyWhitelisted;
- exports.isHTMLTag = isHTMLTag;
- exports.isIntegerKey = isIntegerKey;
- exports.isKnownAttr = isKnownAttr;
- exports.isMap = isMap;
- exports.isModelListener = isModelListener;
- exports.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;
- exports.isObject = isObject;
- exports.isOn = isOn;
- exports.isPlainObject = isPlainObject;
- exports.isPromise = isPromise;
- exports.isReservedProp = isReservedProp;
- exports.isSSRSafeAttrName = isSSRSafeAttrName;
- exports.isSVGTag = isSVGTag;
- exports.isSet = isSet;
- exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
- exports.isString = isString;
- exports.isSymbol = isSymbol;
- exports.isVoidTag = isVoidTag;
- exports.looseEqual = looseEqual;
- exports.looseIndexOf = looseIndexOf;
- exports.makeMap = makeMap;
- exports.normalizeClass = normalizeClass;
- exports.normalizeStyle = normalizeStyle;
- exports.objectToString = objectToString;
- exports.parseStringStyle = parseStringStyle;
- exports.propsToAttrMap = propsToAttrMap;
- exports.remove = remove;
- exports.slotFlagsText = slotFlagsText;
- exports.stringifyStyle = stringifyStyle;
- exports.toDisplayString = toDisplayString;
- exports.toHandlerKey = toHandlerKey;
- exports.toNumber = toNumber;
- exports.toRawType = toRawType;
- exports.toTypeString = toTypeString;
-});
-
-// node_modules/@vue/shared/index.js
-var require_shared = __commonJS((exports, module) => {
- "use strict";
- if (false) {
- module.exports = null;
- } else {
- module.exports = require_shared_cjs();
- }
-});
-
-// node_modules/@vue/reactivity/dist/reactivity.cjs.js
-var require_reactivity_cjs = __commonJS((exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- var shared = require_shared();
- var targetMap = new WeakMap();
- var effectStack = [];
- var activeEffect;
- var ITERATE_KEY = Symbol("iterate");
- var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
- function isEffect(fn) {
- return fn && fn._isEffect === true;
- }
- function effect3(fn, options = shared.EMPTY_OBJ) {
- if (isEffect(fn)) {
- fn = fn.raw;
- }
- const effect4 = createReactiveEffect(fn, options);
- if (!options.lazy) {
- effect4();
- }
- return effect4;
- }
- function stop2(effect4) {
- if (effect4.active) {
- cleanup(effect4);
- if (effect4.options.onStop) {
- effect4.options.onStop();
- }
- effect4.active = false;
- }
- }
- var uid = 0;
- function createReactiveEffect(fn, options) {
- const effect4 = function reactiveEffect() {
- if (!effect4.active) {
- return fn();
- }
- if (!effectStack.includes(effect4)) {
- cleanup(effect4);
- try {
- enableTracking();
- effectStack.push(effect4);
- activeEffect = effect4;
- return fn();
- } finally {
- effectStack.pop();
- resetTracking();
- activeEffect = effectStack[effectStack.length - 1];
- }
- }
- };
- effect4.id = uid++;
- effect4.allowRecurse = !!options.allowRecurse;
- effect4._isEffect = true;
- effect4.active = true;
- effect4.raw = fn;
- effect4.deps = [];
- effect4.options = options;
- return effect4;
- }
- function cleanup(effect4) {
- const {deps} = effect4;
- if (deps.length) {
- for (let i = 0; i < deps.length; i++) {
- deps[i].delete(effect4);
- }
- deps.length = 0;
- }
- }
- var shouldTrack = true;
- var trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function track(target, type, key) {
- if (!shouldTrack || activeEffect === void 0) {
- return;
- }
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Set());
- }
- if (!dep.has(activeEffect)) {
- dep.add(activeEffect);
- activeEffect.deps.push(dep);
- if (activeEffect.options.onTrack) {
- activeEffect.options.onTrack({
- effect: activeEffect,
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- return;
- }
- const effects = new Set();
- const add2 = (effectsToAdd) => {
- if (effectsToAdd) {
- effectsToAdd.forEach((effect4) => {
- if (effect4 !== activeEffect || effect4.allowRecurse) {
- effects.add(effect4);
- }
- });
- }
- };
- if (type === "clear") {
- depsMap.forEach(add2);
- } else if (key === "length" && shared.isArray(target)) {
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 >= newValue) {
- add2(dep);
- }
- });
- } else {
- if (key !== void 0) {
- add2(depsMap.get(key));
- }
- switch (type) {
- case "add":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (shared.isIntegerKey(key)) {
- add2(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!shared.isArray(target)) {
- add2(depsMap.get(ITERATE_KEY));
- if (shared.isMap(target)) {
- add2(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (shared.isMap(target)) {
- add2(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- const run = (effect4) => {
- if (effect4.options.onTrigger) {
- effect4.options.onTrigger({
- effect: effect4,
- target,
- key,
- type,
- newValue,
- oldValue,
- oldTarget
- });
- }
- if (effect4.options.scheduler) {
- effect4.options.scheduler(effect4);
- } else {
- effect4();
- }
- };
- effects.forEach(run);
- }
- var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);
- var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));
- var get2 = /* @__PURE__ */ createGetter();
- var shallowGet = /* @__PURE__ */ createGetter(false, true);
- var readonlyGet = /* @__PURE__ */ createGetter(true);
- var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
- var arrayInstrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- const arr = toRaw2(this);
- for (let i = 0, l = this.length; i < l; i++) {
- track(arr, "get", i + "");
- }
- const res = method.apply(arr, args);
- if (res === -1 || res === false) {
- return method.apply(arr, args.map(toRaw2));
- } else {
- return res;
- }
- };
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- const method = Array.prototype[key];
- arrayInstrumentations[key] = function(...args) {
- pauseTracking();
- const res = method.apply(this, args);
- resetTracking();
- return res;
- };
- });
- function createGetter(isReadonly2 = false, shallow = false) {
- return function get3(target, key, receiver) {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
- return target;
- }
- const targetIsArray = shared.isArray(target);
- if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- const res = Reflect.get(target, key, receiver);
- if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (shallow) {
- return res;
- }
- if (isRef(res)) {
- const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);
- return shouldUnwrap ? res.value : res;
- }
- if (shared.isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive3(res);
- }
- return res;
- };
- }
- var set2 = /* @__PURE__ */ createSetter();
- var shallowSet = /* @__PURE__ */ createSetter(true);
- function createSetter(shallow = false) {
- return function set3(target, key, value, receiver) {
- let oldValue = target[key];
- if (!shallow) {
- value = toRaw2(value);
- oldValue = toRaw2(oldValue);
- if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- }
- }
- const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);
- const result = Reflect.set(target, key, value, receiver);
- if (target === toRaw2(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- };
- }
- function deleteProperty(target, key) {
- const hadKey = shared.hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function has(target, key) {
- const result = Reflect.has(target, key);
- if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- function ownKeys(target) {
- track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY);
- return Reflect.ownKeys(target);
- }
- var mutableHandlers = {
- get: get2,
- set: set2,
- deleteProperty,
- has,
- ownKeys
- };
- var readonlyHandlers = {
- get: readonlyGet,
- set(target, key) {
- {
- console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- },
- deleteProperty(target, key) {
- {
- console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
- }
- return true;
- }
- };
- var shallowReactiveHandlers = shared.extend({}, mutableHandlers, {
- get: shallowGet,
- set: shallowSet
- });
- var shallowReadonlyHandlers = shared.extend({}, readonlyHandlers, {
- get: shallowReadonlyGet
- });
- var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;
- var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;
- var toShallow = (value) => value;
- var getProto = (v) => Reflect.getPrototypeOf(v);
- function get$1(target, key, isReadonly2 = false, isShallow = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "get", key);
- }
- !isReadonly2 && track(rawTarget, "get", rawKey);
- const {has: has2} = getProto(rawTarget);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has$1(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const rawKey = toRaw2(key);
- if (key !== rawKey) {
- !isReadonly2 && track(rawTarget, "has", key);
- }
- !isReadonly2 && track(rawTarget, "has", rawKey);
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set$1(key, value) {
- value = toRaw2(value);
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (shared.hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw2(this);
- const {has: has2, get: get3} = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw2(key);
- hadKey = has2.call(target, key);
- } else {
- checkIdentityKeys(target, has2, key);
- }
- const oldValue = get3 ? get3.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- function clear() {
- const target = toRaw2(this);
- const hadItems = target.size !== 0;
- const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
- }
- return result;
- }
- function createForEach(isReadonly2, isShallow) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw2(target);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw2(target);
- const targetIsMap = shared.isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
- return {
- next() {
- const {value, done} = innerIterator.next();
- return done ? {value, done} : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));
- }
- return type === "delete" ? false : this;
- };
- }
- var mutableInstrumentations = {
- get(key) {
- return get$1(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- var shallowInstrumentations = {
- get(key) {
- return get$1(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add,
- set: set$1,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- var readonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- var shallowReadonlyInstrumentations = {
- get(key) {
- return get$1(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- var iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations[method] = createIterableMethod(method, true, false);
- shallowInstrumentations[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);
- });
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
- };
- }
- var mutableCollectionHandlers = {
- get: createInstrumentationGetter(false, false)
- };
- var shallowCollectionHandlers = {
- get: createInstrumentationGetter(false, true)
- };
- var readonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, false)
- };
- var shallowReadonlyCollectionHandlers = {
- get: createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw2(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = shared.toRawType(target);
- console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
- }
- }
- var reactiveMap = new WeakMap();
- var shallowReactiveMap = new WeakMap();
- var readonlyMap = new WeakMap();
- var shallowReadonlyMap = new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));
- }
- function reactive3(target) {
- if (target && target["__v_isReadonly"]) {
- return target;
- }
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
- }
- function shallowReactive(target) {
- return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
- }
- function readonly(target) {
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
- }
- function shallowReadonly(target) {
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!shared.isObject(target)) {
- {
- console.warn(`value cannot be made reactive: ${String(target)}`);
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive2(value) {
- if (isReadonly(value)) {
- return isReactive2(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isProxy(value) {
- return isReactive2(value) || isReadonly(value);
- }
- function toRaw2(observed) {
- return observed && toRaw2(observed["__v_raw"]) || observed;
- }
- function markRaw(value) {
- shared.def(value, "__v_skip", true);
- return value;
- }
- var convert = (val) => shared.isObject(val) ? reactive3(val) : val;
- function isRef(r) {
- return Boolean(r && r.__v_isRef === true);
- }
- function ref(value) {
- return createRef(value);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- var RefImpl = class {
- constructor(_rawValue, _shallow = false) {
- this._rawValue = _rawValue;
- this._shallow = _shallow;
- this.__v_isRef = true;
- this._value = _shallow ? _rawValue : convert(_rawValue);
- }
- get value() {
- track(toRaw2(this), "get", "value");
- return this._value;
- }
- set value(newVal) {
- if (shared.hasChanged(toRaw2(newVal), this._rawValue)) {
- this._rawValue = newVal;
- this._value = this._shallow ? newVal : convert(newVal);
- trigger(toRaw2(this), "set", "value", newVal);
- }
- }
- };
- function createRef(rawValue, shallow = false) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- function triggerRef(ref2) {
- trigger(toRaw2(ref2), "set", "value", ref2.value);
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- var shallowUnwrapHandlers = {
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- var CustomRefImpl = class {
- constructor(factory) {
- this.__v_isRef = true;
- const {get: get3, set: set3} = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value"));
- this._get = get3;
- this._set = set3;
- }
- get value() {
- return this._get();
- }
- set value(newVal) {
- this._set(newVal);
- }
- };
- function customRef(factory) {
- return new CustomRefImpl(factory);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- console.warn(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = shared.isArray(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = toRef(object, key);
- }
- return ret;
- }
- var ObjectRefImpl = class {
- constructor(_object, _key) {
- this._object = _object;
- this._key = _key;
- this.__v_isRef = true;
- }
- get value() {
- return this._object[this._key];
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- };
- function toRef(object, key) {
- return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);
- }
- var ComputedRefImpl = class {
- constructor(getter, _setter, isReadonly2) {
- this._setter = _setter;
- this._dirty = true;
- this.__v_isRef = true;
- this.effect = effect3(getter, {
- lazy: true,
- scheduler: () => {
- if (!this._dirty) {
- this._dirty = true;
- trigger(toRaw2(this), "set", "value");
- }
- }
- });
- this["__v_isReadonly"] = isReadonly2;
- }
- get value() {
- const self2 = toRaw2(this);
- if (self2._dirty) {
- self2._value = this.effect();
- self2._dirty = false;
- }
- track(self2, "get", "value");
- return self2._value;
- }
- set value(newValue) {
- this._setter(newValue);
- }
- };
- function computed(getterOrOptions) {
- let getter;
- let setter;
- if (shared.isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- setter = () => {
- console.warn("Write operation failed: computed value is readonly");
- };
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);
- }
- exports.ITERATE_KEY = ITERATE_KEY;
- exports.computed = computed;
- exports.customRef = customRef;
- exports.effect = effect3;
- exports.enableTracking = enableTracking;
- exports.isProxy = isProxy;
- exports.isReactive = isReactive2;
- exports.isReadonly = isReadonly;
- exports.isRef = isRef;
- exports.markRaw = markRaw;
- exports.pauseTracking = pauseTracking;
- exports.proxyRefs = proxyRefs;
- exports.reactive = reactive3;
- exports.readonly = readonly;
- exports.ref = ref;
- exports.resetTracking = resetTracking;
- exports.shallowReactive = shallowReactive;
- exports.shallowReadonly = shallowReadonly;
- exports.shallowRef = shallowRef;
- exports.stop = stop2;
- exports.toRaw = toRaw2;
- exports.toRef = toRef;
- exports.toRefs = toRefs;
- exports.track = track;
- exports.trigger = trigger;
- exports.triggerRef = triggerRef;
- exports.unref = unref;
-});
-
-// node_modules/@vue/reactivity/index.js
-var require_reactivity = __commonJS((exports, module) => {
- "use strict";
- if (false) {
- module.exports = null;
- } else {
- module.exports = require_reactivity_cjs();
- }
-});
-
-// packages/alpinejs/src/scheduler.js
-var flushPending = false;
-var flushing = false;
-var queue = [];
-function scheduler(callback) {
- queueJob(callback);
-}
-function queueJob(job) {
- if (!queue.includes(job))
- queue.push(job);
- queueFlush();
-}
-function queueFlush() {
- if (!flushing && !flushPending) {
- flushPending = true;
- queueMicrotask(flushJobs);
- }
-}
-function flushJobs() {
- flushPending = false;
- flushing = true;
- for (let i = 0; i < queue.length; i++) {
- queue[i]();
- }
- queue.length = 0;
- flushing = false;
-}
-
-// packages/alpinejs/src/reactivity.js
-var reactive;
-var effect;
-var release;
-var raw;
-var shouldSchedule = true;
-function disableEffectScheduling(callback) {
- shouldSchedule = false;
- callback();
- shouldSchedule = true;
-}
-function setReactivityEngine(engine) {
- reactive = engine.reactive;
- release = engine.release;
- effect = (callback) => engine.effect(callback, {scheduler: (task) => {
- if (shouldSchedule) {
- scheduler(task);
- } else {
- task();
- }
- }});
- raw = engine.raw;
-}
-function overrideEffect(override) {
- effect = override;
-}
-function elementBoundEffect(el) {
- let cleanup = () => {
- };
- let wrappedEffect = (callback) => {
- let effectReference = effect(callback);
- if (!el._x_effects) {
- el._x_effects = new Set();
- el._x_runEffects = () => {
- el._x_effects.forEach((i) => i());
- };
- }
- el._x_effects.add(effectReference);
- cleanup = () => {
- if (effectReference === void 0)
- return;
- el._x_effects.delete(effectReference);
- release(effectReference);
- };
- };
- return [wrappedEffect, () => {
- cleanup();
- }];
-}
-
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
-// packages/alpinejs/src/mutation.js
-var onAttributeAddeds = [];
-var onElRemoveds = [];
-var onElAddeds = [];
-function onElAdded(callback) {
- onElAddeds.push(callback);
-}
-function onElRemoved(callback) {
- onElRemoveds.push(callback);
-}
-function onAttributesAdded(callback) {
- onAttributeAddeds.push(callback);
-}
-function onAttributeRemoved(el, name, callback) {
- if (!el._x_attributeCleanups)
- el._x_attributeCleanups = {};
- if (!el._x_attributeCleanups[name])
- el._x_attributeCleanups[name] = [];
- el._x_attributeCleanups[name].push(callback);
-}
-function cleanupAttributes(el, names) {
- if (!el._x_attributeCleanups)
- return;
- Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {
- if (names === void 0 || names.includes(name)) {
- value.forEach((i) => i());
- delete el._x_attributeCleanups[name];
- }
- });
-}
-var observer = new MutationObserver(onMutate);
-var currentlyObserving = false;
-function startObservingMutations() {
- observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});
- currentlyObserving = true;
-}
-function stopObservingMutations() {
- flushObserver();
- observer.disconnect();
- currentlyObserving = false;
-}
-var recordQueue = [];
-var willProcessRecordQueue = false;
-function flushObserver() {
- recordQueue = recordQueue.concat(observer.takeRecords());
- if (recordQueue.length && !willProcessRecordQueue) {
- willProcessRecordQueue = true;
- queueMicrotask(() => {
- processRecordQueue();
- willProcessRecordQueue = false;
- });
- }
-}
-function processRecordQueue() {
- onMutate(recordQueue);
- recordQueue.length = 0;
-}
-function mutateDom(callback) {
- if (!currentlyObserving)
- return callback();
- stopObservingMutations();
- let result = callback();
- startObservingMutations();
- return result;
-}
-var isCollecting = false;
-var deferredMutations = [];
-function deferMutations() {
- isCollecting = true;
-}
-function flushAndStopDeferringMutations() {
- isCollecting = false;
- onMutate(deferredMutations);
- deferredMutations = [];
-}
-function onMutate(mutations) {
- if (isCollecting) {
- deferredMutations = deferredMutations.concat(mutations);
- return;
- }
- let addedNodes = [];
- let removedNodes = [];
- let addedAttributes = new Map();
- let removedAttributes = new Map();
- for (let i = 0; i < mutations.length; i++) {
- if (mutations[i].target._x_ignoreMutationObserver)
- continue;
- if (mutations[i].type === "childList") {
- mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));
- mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));
- }
- if (mutations[i].type === "attributes") {
- let el = mutations[i].target;
- let name = mutations[i].attributeName;
- let oldValue = mutations[i].oldValue;
- let add = () => {
- if (!addedAttributes.has(el))
- addedAttributes.set(el, []);
- addedAttributes.get(el).push({name, value: el.getAttribute(name)});
- };
- let remove = () => {
- if (!removedAttributes.has(el))
- removedAttributes.set(el, []);
- removedAttributes.get(el).push(name);
- };
- if (el.hasAttribute(name) && oldValue === null) {
- add();
- } else if (el.hasAttribute(name)) {
- remove();
- add();
- } else {
- remove();
- }
- }
- }
- removedAttributes.forEach((attrs, el) => {
- cleanupAttributes(el, attrs);
- });
- addedAttributes.forEach((attrs, el) => {
- onAttributeAddeds.forEach((i) => i(el, attrs));
- });
- for (let node of addedNodes) {
- if (removedNodes.includes(node))
- continue;
- onElAddeds.forEach((i) => i(node));
- }
- for (let node of removedNodes) {
- if (addedNodes.includes(node))
- continue;
- onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
- }
- addedNodes = null;
- removedNodes = null;
- addedAttributes = null;
- removedAttributes = null;
-}
-
-// packages/alpinejs/src/scope.js
-function addScopeToNode(node, data2, referenceNode) {
- node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];
- return () => {
- node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);
- };
-}
-function refreshScope(element, scope) {
- let existingScope = element._x_dataStack[0];
- Object.entries(scope).forEach(([key, value]) => {
- existingScope[key] = value;
- });
-}
-function closestDataStack(node) {
- if (node._x_dataStack)
- return node._x_dataStack;
- if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) {
- return closestDataStack(node.host);
- }
- if (!node.parentNode) {
- return [];
- }
- return closestDataStack(node.parentNode);
-}
-function mergeProxies(objects) {
- let thisProxy = new Proxy({}, {
- ownKeys: () => {
- return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));
- },
- has: (target, name) => {
- return objects.some((obj) => obj.hasOwnProperty(name));
- },
- get: (target, name) => {
- return (objects.find((obj) => {
- if (obj.hasOwnProperty(name)) {
- let descriptor = Object.getOwnPropertyDescriptor(obj, name);
- if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {
- return true;
- }
- if ((descriptor.get || descriptor.set) && descriptor.enumerable) {
- let getter = descriptor.get;
- let setter = descriptor.set;
- let property = descriptor;
- getter = getter && getter.bind(thisProxy);
- setter = setter && setter.bind(thisProxy);
- if (getter)
- getter._x_alreadyBound = true;
- if (setter)
- setter._x_alreadyBound = true;
- Object.defineProperty(obj, name, {
- ...property,
- get: getter,
- set: setter
- });
- }
- return true;
- }
- return false;
- }) || {})[name];
- },
- set: (target, name, value) => {
- let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));
- if (closestObjectWithKey) {
- closestObjectWithKey[name] = value;
- } else {
- objects[objects.length - 1][name] = value;
- }
- return true;
- }
- });
- return thisProxy;
-}
-
-// packages/alpinejs/src/interceptor.js
-function initInterceptors(data2) {
- let isObject = (val) => typeof val === "object" && !Array.isArray(val) && val !== null;
- let recurse = (obj, basePath = "") => {
- Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {
- if (enumerable === false || value === void 0)
- return;
- let path = basePath === "" ? key : `${basePath}.${key}`;
- if (typeof value === "object" && value !== null && value._x_interceptor) {
- obj[key] = value.initialize(data2, path, key);
- } else {
- if (isObject(value) && value !== obj && !(value instanceof Element)) {
- recurse(value, path);
- }
- }
- });
- };
- return recurse(data2);
-}
-function interceptor(callback, mutateObj = () => {
-}) {
- let obj = {
- initialValue: void 0,
- _x_interceptor: true,
- initialize(data2, path, key) {
- return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);
- }
- };
- mutateObj(obj);
- return (initialValue) => {
- if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) {
- let initialize = obj.initialize.bind(obj);
- obj.initialize = (data2, path, key) => {
- let innerValue = initialValue.initialize(data2, path, key);
- obj.initialValue = innerValue;
- return initialize(data2, path, key);
- };
- } else {
- obj.initialValue = initialValue;
- }
- return obj;
- };
-}
-function get(obj, path) {
- return path.split(".").reduce((carry, segment) => carry[segment], obj);
-}
-function set(obj, path, value) {
- if (typeof path === "string")
- path = path.split(".");
- if (path.length === 1)
- obj[path[0]] = value;
- else if (path.length === 0)
- throw error;
- else {
- if (obj[path[0]])
- return set(obj[path[0]], path.slice(1), value);
- else {
- obj[path[0]] = {};
- return set(obj[path[0]], path.slice(1), value);
- }
- }
-}
-
-// packages/alpinejs/src/magics.js
-var magics = {};
-function magic(name, callback) {
- magics[name] = callback;
-}
-function injectMagics(obj, el) {
- Object.entries(magics).forEach(([name, callback]) => {
- Object.defineProperty(obj, `$${name}`, {
- get() {
- return callback(el, {Alpine: alpine_default, interceptor});
- },
- enumerable: false
- });
- });
- return {
- obj,
- cleanup: () => {
- el = null;
- }
- };
-}
-
-// packages/alpinejs/src/evaluator.js
-function evaluate(el, expression, extras = {}) {
- let result;
- evaluateLater(el, expression)((value) => result = value, extras);
- return result;
-}
-function evaluateLater(...args) {
- return theEvaluatorFunction(...args);
-}
-var theEvaluatorFunction = normalEvaluator;
-function setEvaluator(newEvaluator) {
- theEvaluatorFunction = newEvaluator;
-}
-function normalEvaluator(el, expression) {
- let overriddenMagics = {};
- let cleanup = injectMagics(overriddenMagics, el).cleanup;
- onAttributeRemoved(el, "evaluator", cleanup);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = generateEvaluatorFromString(dataStack, expression);
- return tryCatch.bind(null, el, expression, evaluator);
-}
-function generateEvaluatorFromFunction(dataStack, func) {
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let result = func.apply(mergeProxies([scope, ...dataStack]), params);
- runIfTypeOfFunction(receiver, result);
- };
-}
-var evaluatorMemo = {};
-function generateFunctionFromString(expression) {
- if (evaluatorMemo[expression]) {
- return evaluatorMemo[expression];
- }
- let AsyncFunction = Object.getPrototypeOf(async function() {
- }).constructor;
- let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression) || /^(let|const)/.test(expression) ? `(() => { ${expression} })()` : expression;
- let func = new AsyncFunction(["__self", "scope"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);
- evaluatorMemo[expression] = func;
- return func;
-}
-function generateEvaluatorFromString(dataStack, expression) {
- let func = generateFunctionFromString(expression);
- return (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- func.result = void 0;
- func.finished = false;
- let completeScope = mergeProxies([scope, ...dataStack]);
- let promise = func(func, completeScope);
- if (func.finished) {
- runIfTypeOfFunction(receiver, func.result, completeScope, params);
- } else {
- promise.then((result) => {
- runIfTypeOfFunction(receiver, result, completeScope, params);
- });
- }
- };
-}
-function runIfTypeOfFunction(receiver, value, scope, params) {
- if (typeof value === "function") {
- let result = value.apply(scope, params);
- if (result instanceof Promise) {
- result.then((i) => runIfTypeOfFunction(receiver, i, scope, params));
- } else {
- receiver(result);
- }
- } else {
- receiver(value);
- }
-}
-function tryCatch(el, expression, callback, ...args) {
- try {
- return callback(...args);
- } catch (e) {
- console.warn(`Alpine Expression Error: ${e.message}
-
-Expression: "${expression}"
-
-`, el);
- throw e;
- }
-}
-
-// packages/alpinejs/src/directives.js
-var prefixAsString = "x-";
-function prefix(subject = "") {
- return prefixAsString + subject;
-}
-function setPrefix(newPrefix) {
- prefixAsString = newPrefix;
-}
-var directiveHandlers = {};
-function directive(name, callback) {
- directiveHandlers[name] = callback;
-}
-function directives(el, attributes, originalAttributeOverride) {
- let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
- return directives2.map((directive2) => {
- return getDirectiveHandler(el, directive2);
- });
-}
-function attributesOnly(attributes) {
- return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));
-}
-var isDeferringHandlers = false;
-var directiveHandlerStacks = new Map();
-var currentHandlerStackKey = Symbol();
-function deferHandlingDirectives(callback) {
- isDeferringHandlers = true;
- let key = Symbol();
- currentHandlerStackKey = key;
- directiveHandlerStacks.set(key, []);
- let flushHandlers = () => {
- while (directiveHandlerStacks.get(key).length)
- directiveHandlerStacks.get(key).shift()();
- directiveHandlerStacks.delete(key);
- };
- let stopDeferring = () => {
- isDeferringHandlers = false;
- flushHandlers();
- };
- callback(flushHandlers);
- stopDeferring();
-}
-function getDirectiveHandler(el, directive2) {
- let noop = () => {
- };
- let handler3 = directiveHandlers[directive2.type] || noop;
- let cleanups = [];
- let cleanup = (callback) => cleanups.push(callback);
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- cleanups.push(cleanupEffect);
- let utilities = {
- Alpine: alpine_default,
- effect: effect3,
- cleanup,
- evaluateLater: evaluateLater.bind(evaluateLater, el),
- evaluate: evaluate.bind(evaluate, el)
- };
- let doCleanup = () => cleanups.forEach((i) => i());
- onAttributeRemoved(el, directive2.original, doCleanup);
- let fullHandler = () => {
- if (el._x_ignore || el._x_ignoreSelf)
- return;
- handler3.inline && handler3.inline(el, directive2, utilities);
- handler3 = handler3.bind(handler3, el, directive2, utilities);
- isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();
- };
- fullHandler.runCleanups = doCleanup;
- return fullHandler;
-}
-var startingWith = (subject, replacement) => ({name, value}) => {
- if (name.startsWith(subject))
- name = name.replace(subject, replacement);
- return {name, value};
-};
-var into = (i) => i;
-function toTransformedAttributes(callback = () => {
-}) {
- return ({name, value}) => {
- let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {
- return transform(carry);
- }, {name, value});
- if (newName !== name)
- callback(newName, name);
- return {name: newName, value: newValue};
- };
-}
-var attributeTransformers = [];
-function mapAttributes(callback) {
- attributeTransformers.push(callback);
-}
-function outNonAlpineAttributes({name}) {
- return alpineAttributeRegex().test(name);
-}
-var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
-function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {
- return ({name, value}) => {
- let typeMatch = name.match(alpineAttributeRegex());
- let valueMatch = name.match(/:([a-zA-Z0-9\-:]+)/);
- let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || [];
- let original = originalAttributeOverride || transformedAttributeMap[name] || name;
- return {
- type: typeMatch ? typeMatch[1] : null,
- value: valueMatch ? valueMatch[1] : null,
- modifiers: modifiers.map((i) => i.replace(".", "")),
- expression: value,
- original
- };
- };
-}
-var DEFAULT = "DEFAULT";
-var directiveOrder = [
- "ignore",
- "ref",
- "data",
- "bind",
- "init",
- "for",
- "model",
- "transition",
- "show",
- "if",
- DEFAULT,
- "element"
-];
-function byPriority(a, b) {
- let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
- let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;
- return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);
-}
-
-// packages/alpinejs/src/utils/dispatch.js
-function dispatch(el, name, detail = {}) {
- el.dispatchEvent(new CustomEvent(name, {
- detail,
- bubbles: true,
- composed: true,
- cancelable: true
- }));
-}
-
-// packages/alpinejs/src/nextTick.js
-var tickStack = [];
-var isHolding = false;
-function nextTick(callback) {
- tickStack.push(callback);
- queueMicrotask(() => {
- isHolding || setTimeout(() => {
- releaseNextTicks();
- });
- });
-}
-function releaseNextTicks() {
- isHolding = false;
- while (tickStack.length)
- tickStack.shift()();
-}
-function holdNextTicks() {
- isHolding = true;
-}
-
-// packages/alpinejs/src/utils/warn.js
-function warn(message, ...args) {
- console.warn(`Alpine Warning: ${message}`, ...args);
-}
-
-// packages/alpinejs/src/lifecycle.js
-function start() {
- if (!document.body)
- warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");
- dispatch(document, "alpine:init");
- dispatch(document, "alpine:initializing");
- startObservingMutations();
- onElAdded((el) => initTree(el, walk));
- onElRemoved((el) => nextTick(() => destroyTree(el)));
- onAttributesAdded((el, attrs) => {
- directives(el, attrs).forEach((handle) => handle());
- });
- let outNestedComponents = (el) => !closestRoot(el.parentElement, true);
- Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {
- initTree(el);
- });
- dispatch(document, "alpine:initialized");
-}
-var rootSelectorCallbacks = [];
-var initSelectorCallbacks = [];
-function rootSelectors() {
- return rootSelectorCallbacks.map((fn) => fn());
-}
-function allSelectors() {
- return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());
-}
-function addRootSelector(selectorCallback) {
- rootSelectorCallbacks.push(selectorCallback);
-}
-function addInitSelector(selectorCallback) {
- initSelectorCallbacks.push(selectorCallback);
-}
-function closestRoot(el, includeInitSelectors = false) {
- if (!el)
- return;
- const selectors = includeInitSelectors ? allSelectors() : rootSelectors();
- if (selectors.some((selector) => el.matches(selector)))
- return el;
- if (!el.parentElement)
- return;
- return closestRoot(el.parentElement, includeInitSelectors);
-}
-function isRoot(el) {
- return rootSelectors().some((selector) => el.matches(selector));
-}
-function initTree(el, walker = walk) {
- deferHandlingDirectives(() => {
- walker(el, (el2, skip) => {
- directives(el2, el2.attributes).forEach((handle) => handle());
- el2._x_ignore && skip();
- });
- });
-}
-function destroyTree(root) {
- walk(root, (el) => cleanupAttributes(el));
-}
-
-// packages/alpinejs/src/utils/classes.js
-function setClasses(el, value) {
- if (Array.isArray(value)) {
- return setClassesFromString(el, value.join(" "));
- } else if (typeof value === "object" && value !== null) {
- return setClassesFromObject(el, value);
- } else if (typeof value === "function") {
- return setClasses(el, value());
- }
- return setClassesFromString(el, value);
-}
-function setClassesFromString(el, classString) {
- let split = (classString2) => classString2.split(" ").filter(Boolean);
- let missingClasses = (classString2) => classString2.split(" ").filter((i) => !el.classList.contains(i)).filter(Boolean);
- let addClassesAndReturnUndo = (classes) => {
- el.classList.add(...classes);
- return () => {
- el.classList.remove(...classes);
- };
- };
- classString = classString === true ? classString = "" : classString || "";
- return addClassesAndReturnUndo(missingClasses(classString));
-}
-function setClassesFromObject(el, classObject) {
- let split = (classString) => classString.split(" ").filter(Boolean);
- let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);
- let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);
- let added = [];
- let removed = [];
- forRemove.forEach((i) => {
- if (el.classList.contains(i)) {
- el.classList.remove(i);
- removed.push(i);
- }
- });
- forAdd.forEach((i) => {
- if (!el.classList.contains(i)) {
- el.classList.add(i);
- added.push(i);
- }
- });
- return () => {
- removed.forEach((i) => el.classList.add(i));
- added.forEach((i) => el.classList.remove(i));
- };
-}
-
-// packages/alpinejs/src/utils/styles.js
-function setStyles(el, value) {
- if (typeof value === "object" && value !== null) {
- return setStylesFromObject(el, value);
- }
- return setStylesFromString(el, value);
-}
-function setStylesFromObject(el, value) {
- let previousStyles = {};
- Object.entries(value).forEach(([key, value2]) => {
- previousStyles[key] = el.style[key];
- el.style.setProperty(kebabCase(key), value2);
- });
- setTimeout(() => {
- if (el.style.length === 0) {
- el.removeAttribute("style");
- }
- });
- return () => {
- setStyles(el, previousStyles);
- };
-}
-function setStylesFromString(el, value) {
- let cache = el.getAttribute("style", value);
- el.setAttribute("style", value);
- return () => {
- el.setAttribute("style", cache);
- };
-}
-function kebabCase(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-// packages/alpinejs/src/utils/once.js
-function once(callback, fallback = () => {
-}) {
- let called = false;
- return function() {
- if (!called) {
- called = true;
- callback.apply(this, arguments);
- } else {
- fallback.apply(this, arguments);
- }
- };
-}
-
-// packages/alpinejs/src/directives/x-transition.js
-directive("transition", (el, {value, modifiers, expression}, {evaluate: evaluate2}) => {
- if (typeof expression === "function")
- expression = evaluate2(expression);
- if (!expression) {
- registerTransitionsFromHelper(el, modifiers, value);
- } else {
- registerTransitionsFromClassString(el, expression, value);
- }
-});
-function registerTransitionsFromClassString(el, classString, stage) {
- registerTransitionObject(el, setClasses, "");
- let directiveStorageMap = {
- enter: (classes) => {
- el._x_transition.enter.during = classes;
- },
- "enter-start": (classes) => {
- el._x_transition.enter.start = classes;
- },
- "enter-end": (classes) => {
- el._x_transition.enter.end = classes;
- },
- leave: (classes) => {
- el._x_transition.leave.during = classes;
- },
- "leave-start": (classes) => {
- el._x_transition.leave.start = classes;
- },
- "leave-end": (classes) => {
- el._x_transition.leave.end = classes;
- }
- };
- directiveStorageMap[stage](classString);
-}
-function registerTransitionsFromHelper(el, modifiers, stage) {
- registerTransitionObject(el, setStyles);
- let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage;
- let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage);
- let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage);
- if (modifiers.includes("in") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index < modifiers.indexOf("out"));
- }
- if (modifiers.includes("out") && !doesntSpecify) {
- modifiers = modifiers.filter((i, index) => index > modifiers.indexOf("out"));
- }
- let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale");
- let wantsOpacity = wantsAll || modifiers.includes("opacity");
- let wantsScale = wantsAll || modifiers.includes("scale");
- let opacityValue = wantsOpacity ? 0 : 1;
- let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1;
- let delay = modifierValue(modifiers, "delay", 0);
- let origin = modifierValue(modifiers, "origin", "center");
- let property = "opacity, transform";
- let durationIn = modifierValue(modifiers, "duration", 150) / 1e3;
- let durationOut = modifierValue(modifiers, "duration", 75) / 1e3;
- let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;
- if (transitioningIn) {
- el._x_transition.enter.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationIn}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.enter.start = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- el._x_transition.enter.end = {
- opacity: 1,
- transform: `scale(1)`
- };
- }
- if (transitioningOut) {
- el._x_transition.leave.during = {
- transformOrigin: origin,
- transitionDelay: delay,
- transitionProperty: property,
- transitionDuration: `${durationOut}s`,
- transitionTimingFunction: easing
- };
- el._x_transition.leave.start = {
- opacity: 1,
- transform: `scale(1)`
- };
- el._x_transition.leave.end = {
- opacity: opacityValue,
- transform: `scale(${scaleValue})`
- };
- }
-}
-function registerTransitionObject(el, setFunction, defaultValue = {}) {
- if (!el._x_transition)
- el._x_transition = {
- enter: {during: defaultValue, start: defaultValue, end: defaultValue},
- leave: {during: defaultValue, start: defaultValue, end: defaultValue},
- in(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.enter.during,
- start: this.enter.start,
- end: this.enter.end
- }, before, after);
- },
- out(before = () => {
- }, after = () => {
- }) {
- transition(el, setFunction, {
- during: this.leave.during,
- start: this.leave.start,
- end: this.leave.end
- }, before, after);
- }
- };
-}
-window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
- if (value) {
- el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();
- return;
- }
- el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {
- el._x_transition.out(() => {
- }, () => resolve(hide));
- el._x_transitioning.beforeCancel(() => reject({isFromCancelledTransition: true}));
- }) : Promise.resolve(hide);
- queueMicrotask(() => {
- let closest = closestHide(el);
- if (closest) {
- if (!closest._x_hideChildren)
- closest._x_hideChildren = [];
- closest._x_hideChildren.push(el);
- } else {
- queueMicrotask(() => {
- let hideAfterChildren = (el2) => {
- let carry = Promise.all([
- el2._x_hidePromise,
- ...(el2._x_hideChildren || []).map(hideAfterChildren)
- ]).then(([i]) => i());
- delete el2._x_hidePromise;
- delete el2._x_hideChildren;
- return carry;
- };
- hideAfterChildren(el).catch((e) => {
- if (!e.isFromCancelledTransition)
- throw e;
- });
- });
- }
- });
-};
-function closestHide(el) {
- let parent = el.parentNode;
- if (!parent)
- return;
- return parent._x_hidePromise ? parent : closestHide(parent);
-}
-function transition(el, setFunction, {during, start: start2, end} = {}, before = () => {
-}, after = () => {
-}) {
- if (el._x_transitioning)
- el._x_transitioning.cancel();
- if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {
- before();
- after();
- return;
- }
- let undoStart, undoDuring, undoEnd;
- performTransition(el, {
- start() {
- undoStart = setFunction(el, start2);
- },
- during() {
- undoDuring = setFunction(el, during);
- },
- before,
- end() {
- undoStart();
- undoEnd = setFunction(el, end);
- },
- after,
- cleanup() {
- undoDuring();
- undoEnd();
- }
- });
-}
-function performTransition(el, stages) {
- let interrupted, reachedBefore, reachedEnd;
- let finish = once(() => {
- mutateDom(() => {
- interrupted = true;
- if (!reachedBefore)
- stages.before();
- if (!reachedEnd) {
- stages.end();
- releaseNextTicks();
- }
- stages.after();
- if (el.isConnected)
- stages.cleanup();
- delete el._x_transitioning;
- });
- });
- el._x_transitioning = {
- beforeCancels: [],
- beforeCancel(callback) {
- this.beforeCancels.push(callback);
- },
- cancel: once(function() {
- while (this.beforeCancels.length) {
- this.beforeCancels.shift()();
- }
- ;
- finish();
- }),
- finish
- };
- mutateDom(() => {
- stages.start();
- stages.during();
- });
- holdNextTicks();
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3;
- let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3;
- if (duration === 0)
- duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3;
- mutateDom(() => {
- stages.before();
- });
- reachedBefore = true;
- requestAnimationFrame(() => {
- if (interrupted)
- return;
- mutateDom(() => {
- stages.end();
- });
- releaseNextTicks();
- setTimeout(el._x_transitioning.finish, duration + delay);
- reachedEnd = true;
- });
- });
-}
-function modifierValue(modifiers, key, fallback) {
- if (modifiers.indexOf(key) === -1)
- return fallback;
- const rawValue = modifiers[modifiers.indexOf(key) + 1];
- if (!rawValue)
- return fallback;
- if (key === "scale") {
- if (isNaN(rawValue))
- return fallback;
- }
- if (key === "duration") {
- let match = rawValue.match(/([0-9]+)ms/);
- if (match)
- return match[1];
- }
- if (key === "origin") {
- if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) {
- return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" ");
- }
- }
- return rawValue;
-}
-
-// packages/alpinejs/src/utils/debounce.js
-function debounce(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
-}
-
-// packages/alpinejs/src/utils/throttle.js
-function throttle(func, limit) {
- let inThrottle;
- return function() {
- let context = this, args = arguments;
- if (!inThrottle) {
- func.apply(context, args);
- inThrottle = true;
- setTimeout(() => inThrottle = false, limit);
- }
- };
-}
-
-// packages/alpinejs/src/plugin.js
-function plugin(callback) {
- callback(alpine_default);
-}
-
-// packages/alpinejs/src/store.js
-var stores = {};
-var isReactive = false;
-function store(name, value) {
- if (!isReactive) {
- stores = reactive(stores);
- isReactive = true;
- }
- if (value === void 0) {
- return stores[name];
- }
- stores[name] = value;
- if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") {
- stores[name].init();
- }
-}
-function getStores() {
- return stores;
-}
-
-// packages/alpinejs/src/clone.js
-var isCloning = false;
-function skipDuringClone(callback) {
- return (...args) => isCloning || callback(...args);
-}
-function clone(oldEl, newEl) {
- newEl._x_dataStack = oldEl._x_dataStack;
- isCloning = true;
- dontRegisterReactiveSideEffects(() => {
- cloneTree(newEl);
- });
- isCloning = false;
-}
-function cloneTree(el) {
- let hasRunThroughFirstEl = false;
- let shallowWalker = (el2, callback) => {
- walk(el2, (el3, skip) => {
- if (hasRunThroughFirstEl && isRoot(el3))
- return skip();
- hasRunThroughFirstEl = true;
- callback(el3, skip);
- });
- };
- initTree(el, shallowWalker);
-}
-function dontRegisterReactiveSideEffects(callback) {
- let cache = effect;
- overrideEffect((callback2, el) => {
- let storedEffect = cache(callback2);
- release(storedEffect);
- return () => {
- };
- });
- callback();
- overrideEffect(cache);
-}
-
-// packages/alpinejs/src/datas.js
-var datas = {};
-function data(name, callback) {
- datas[name] = callback;
-}
-function injectDataProviders(obj, context) {
- Object.entries(datas).forEach(([name, callback]) => {
- Object.defineProperty(obj, name, {
- get() {
- return (...args) => {
- return callback.bind(context)(...args);
- };
- },
- enumerable: false
- });
- });
- return obj;
-}
-
-// packages/alpinejs/src/alpine.js
-var Alpine = {
- get reactive() {
- return reactive;
- },
- get release() {
- return release;
- },
- get effect() {
- return effect;
- },
- get raw() {
- return raw;
- },
- version: "3.4.2",
- flushAndStopDeferringMutations,
- disableEffectScheduling,
- stopObservingMutations,
- setReactivityEngine,
- addRootSelector,
- deferMutations,
- mapAttributes,
- evaluateLater,
- setEvaluator,
- destroyTree,
- closestRoot,
- interceptor,
- transition,
- setStyles,
- mutateDom,
- directive,
- throttle,
- debounce,
- evaluate,
- initTree,
- nextTick,
- prefix: setPrefix,
- plugin,
- magic,
- store,
- start,
- clone,
- data
-};
-var alpine_default = Alpine;
-
-// packages/csp/src/index.js
-var import_reactivity9 = __toModule(require_reactivity());
-
-// packages/alpinejs/src/magics/$nextTick.js
-magic("nextTick", () => nextTick);
-
-// packages/alpinejs/src/magics/$dispatch.js
-magic("dispatch", (el) => dispatch.bind(dispatch, el));
-
-// packages/alpinejs/src/magics/$watch.js
-magic("watch", (el) => (key, callback) => {
- let evaluate2 = evaluateLater(el, key);
- let firstTime = true;
- let oldValue;
- let [effect3, cleanupEffect] = elementBoundEffect(el);
- onAttributeRemoved(el, key, cleanupEffect);
- effect3(() => evaluate2((value) => {
- let div = document.createElement("div");
- div.dataset.throwAway = value;
- if (!firstTime) {
- queueMicrotask(() => {
- callback(value, oldValue);
- oldValue = value;
- });
- } else {
- oldValue = value;
- }
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/magics/$store.js
-magic("store", getStores);
-
-// packages/alpinejs/src/magics/$root.js
-magic("root", (el) => closestRoot(el));
-
-// packages/alpinejs/src/magics/$refs.js
-magic("refs", (el) => {
- if (el._x_refs_proxy)
- return el._x_refs_proxy;
- el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));
- return el._x_refs_proxy;
-});
-function getArrayOfRefObject(el) {
- let refObjects = [];
- let currentEl = el;
- while (currentEl) {
- if (currentEl._x_refs)
- refObjects.push(currentEl._x_refs);
- currentEl = currentEl.parentNode;
- }
- return refObjects;
-}
-
-// packages/alpinejs/src/magics/$el.js
-magic("el", (el) => el);
-
-// packages/alpinejs/src/directives/x-ignore.js
-var handler = () => {
-};
-handler.inline = (el, {modifiers}, {cleanup}) => {
- modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true;
- cleanup(() => {
- modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore;
- });
-};
-directive("ignore", handler);
-
-// packages/alpinejs/src/directives/x-effect.js
-directive("effect", (el, {expression}, {effect: effect3}) => effect3(evaluateLater(el, expression)));
-
-// packages/alpinejs/src/utils/bind.js
-function bind(el, name, value, modifiers = []) {
- if (!el._x_bindings)
- el._x_bindings = reactive({});
- el._x_bindings[name] = value;
- name = modifiers.includes("camel") ? camelCase(name) : name;
- switch (name) {
- case "value":
- bindInputValue(el, value);
- break;
- case "style":
- bindStyles(el, value);
- break;
- case "class":
- bindClasses(el, value);
- break;
- default:
- bindAttribute(el, name, value);
- break;
- }
-}
-function bindInputValue(el, value) {
- if (el.type === "radio") {
- if (el.attributes.value === void 0) {
- el.value = value;
- }
- if (window.fromModel) {
- el.checked = checkedAttrLooseCompare(el.value, value);
- }
- } else if (el.type === "checkbox") {
- if (Number.isInteger(value)) {
- el.value = value;
- } else if (!Number.isInteger(value) && !Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) {
- el.value = String(value);
- } else {
- if (Array.isArray(value)) {
- el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));
- } else {
- el.checked = !!value;
- }
- }
- } else if (el.tagName === "SELECT") {
- updateSelect(el, value);
- } else {
- if (el.value === value)
- return;
- el.value = value;
- }
-}
-function bindClasses(el, value) {
- if (el._x_undoAddedClasses)
- el._x_undoAddedClasses();
- el._x_undoAddedClasses = setClasses(el, value);
-}
-function bindStyles(el, value) {
- if (el._x_undoAddedStyles)
- el._x_undoAddedStyles();
- el._x_undoAddedStyles = setStyles(el, value);
-}
-function bindAttribute(el, name, value) {
- if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {
- el.removeAttribute(name);
- } else {
- if (isBooleanAttr(name))
- value = name;
- setIfChanged(el, name, value);
- }
-}
-function setIfChanged(el, attrName, value) {
- if (el.getAttribute(attrName) != value) {
- el.setAttribute(attrName, value);
- }
-}
-function updateSelect(el, value) {
- const arrayWrappedValue = [].concat(value).map((value2) => {
- return value2 + "";
- });
- Array.from(el.options).forEach((option) => {
- option.selected = arrayWrappedValue.includes(option.value);
- });
-}
-function camelCase(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function checkedAttrLooseCompare(valueA, valueB) {
- return valueA == valueB;
-}
-function isBooleanAttr(attrName) {
- const booleanAttributes = [
- "disabled",
- "checked",
- "required",
- "readonly",
- "hidden",
- "open",
- "selected",
- "autofocus",
- "itemscope",
- "multiple",
- "novalidate",
- "allowfullscreen",
- "allowpaymentrequest",
- "formnovalidate",
- "autoplay",
- "controls",
- "loop",
- "muted",
- "playsinline",
- "default",
- "ismap",
- "reversed",
- "async",
- "defer",
- "nomodule"
- ];
- return booleanAttributes.includes(attrName);
-}
-function attributeShouldntBePreservedIfFalsy(name) {
- return !["aria-pressed", "aria-checked", "aria-expanded"].includes(name);
-}
-
-// packages/alpinejs/src/utils/on.js
-function on(el, event, modifiers, callback) {
- let listenerTarget = el;
- let handler3 = (e) => callback(e);
- let options = {};
- let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);
- if (modifiers.includes("dot"))
- event = dotSyntax(event);
- if (modifiers.includes("camel"))
- event = camelCase2(event);
- if (modifiers.includes("passive"))
- options.passive = true;
- if (modifiers.includes("capture"))
- options.capture = true;
- if (modifiers.includes("window"))
- listenerTarget = window;
- if (modifiers.includes("document"))
- listenerTarget = document;
- if (modifiers.includes("prevent"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.preventDefault();
- next(e);
- });
- if (modifiers.includes("stop"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.stopPropagation();
- next(e);
- });
- if (modifiers.includes("self"))
- handler3 = wrapHandler(handler3, (next, e) => {
- e.target === el && next(e);
- });
- if (modifiers.includes("away") || modifiers.includes("outside")) {
- listenerTarget = document;
- handler3 = wrapHandler(handler3, (next, e) => {
- if (el.contains(e.target))
- return;
- if (el.offsetWidth < 1 && el.offsetHeight < 1)
- return;
- next(e);
- });
- }
- handler3 = wrapHandler(handler3, (next, e) => {
- if (isKeyEvent(event)) {
- if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
- return;
- }
- }
- next(e);
- });
- if (modifiers.includes("debounce")) {
- let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = debounce(handler3, wait);
- }
- if (modifiers.includes("throttle")) {
- let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait";
- let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250;
- handler3 = throttle(handler3, wait);
- }
- if (modifiers.includes("once")) {
- handler3 = wrapHandler(handler3, (next, e) => {
- next(e);
- listenerTarget.removeEventListener(event, handler3, options);
- });
- }
- listenerTarget.addEventListener(event, handler3, options);
- return () => {
- listenerTarget.removeEventListener(event, handler3, options);
- };
-}
-function dotSyntax(subject) {
- return subject.replace(/-/g, ".");
-}
-function camelCase2(subject) {
- return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase());
-}
-function isNumeric(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-function kebabCase2(subject) {
- return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
-}
-function isKeyEvent(event) {
- return ["keydown", "keyup"].includes(event);
-}
-function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
- let keyModifiers = modifiers.filter((i) => {
- return !["window", "document", "prevent", "stop", "once"].includes(i);
- });
- if (keyModifiers.includes("debounce")) {
- let debounceIndex = keyModifiers.indexOf("debounce");
- keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
- }
- if (keyModifiers.length === 0)
- return false;
- if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"];
- const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));
- keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));
- if (selectedSystemKeyModifiers.length > 0) {
- const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {
- if (modifier === "cmd" || modifier === "super")
- modifier = "meta";
- return e[`${modifier}Key`];
- });
- if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
- if (keyToModifiers(e.key).includes(keyModifiers[0]))
- return false;
- }
- }
- return true;
-}
-function keyToModifiers(key) {
- if (!key)
- return [];
- key = kebabCase2(key);
- let modifierToKeyMap = {
- ctrl: "control",
- slash: "/",
- space: "-",
- spacebar: "-",
- cmd: "meta",
- esc: "escape",
- up: "arrow-up",
- down: "arrow-down",
- left: "arrow-left",
- right: "arrow-right",
- period: ".",
- equal: "="
- };
- modifierToKeyMap[key] = key;
- return Object.keys(modifierToKeyMap).map((modifier) => {
- if (modifierToKeyMap[modifier] === key)
- return modifier;
- }).filter((modifier) => modifier);
-}
-
-// packages/alpinejs/src/directives/x-model.js
-directive("model", (el, {modifiers, expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let assignmentExpression = `${expression} = rightSideOfExpression($event, ${expression})`;
- let evaluateAssignment = evaluateLater(el, assignmentExpression);
- var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
- let assigmentFunction = generateAssignmentFunction(el, modifiers, expression);
- let removeListener = on(el, event, modifiers, (e) => {
- evaluateAssignment(() => {
- }, {scope: {
- $event: e,
- rightSideOfExpression: assigmentFunction
- }});
- });
- cleanup(() => removeListener());
- el._x_forceModelUpdate = () => {
- evaluate2((value) => {
- if (value === void 0 && expression.match(/\./))
- value = "";
- window.fromModel = true;
- mutateDom(() => bind(el, "value", value));
- delete window.fromModel;
- });
- };
- effect3(() => {
- if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el))
- return;
- el._x_forceModelUpdate();
- });
-});
-function generateAssignmentFunction(el, modifiers, expression) {
- if (el.type === "radio") {
- mutateDom(() => {
- if (!el.hasAttribute("name"))
- el.setAttribute("name", expression);
- });
- }
- return (event, currentValue) => {
- return mutateDom(() => {
- if (event instanceof CustomEvent && event.detail !== void 0) {
- return event.detail || event.target.value;
- } else if (el.type === "checkbox") {
- if (Array.isArray(currentValue)) {
- let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
- return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
- } else {
- return event.target.checked;
- }
- } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
- return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
- let rawValue = option.value || option.text;
- return safeParseNumber(rawValue);
- }) : Array.from(event.target.selectedOptions).map((option) => {
- return option.value || option.text;
- });
- } else {
- let rawValue = event.target.value;
- return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
- }
- });
- };
-}
-function safeParseNumber(rawValue) {
- let number = rawValue ? parseFloat(rawValue) : null;
- return isNumeric2(number) ? number : rawValue;
-}
-function checkedAttrLooseCompare2(valueA, valueB) {
- return valueA == valueB;
-}
-function isNumeric2(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-cloak.js
-directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak")))));
-
-// packages/alpinejs/src/directives/x-init.js
-addInitSelector(() => `[${prefix("init")}]`);
-directive("init", skipDuringClone((el, {expression}) => {
- if (typeof expression === "string") {
- return !!expression.trim() && evaluate(el, expression, {}, false);
- }
- return evaluate(el, expression, {}, false);
-}));
-
-// packages/alpinejs/src/directives/x-text.js
-directive("text", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- mutateDom(() => {
- el.textContent = value;
- });
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-html.js
-directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLater2}) => {
- let evaluate2 = evaluateLater2(expression);
- effect3(() => {
- evaluate2((value) => {
- el.innerHTML = value;
- });
- });
-});
-
-// packages/alpinejs/src/directives/x-bind.js
-mapAttributes(startingWith(":", into(prefix("bind:"))));
-directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
- if (!value)
- return applyBindingsObject(el, expression, original, effect3);
- if (value === "key")
- return storeKeyForXFor(el, expression);
- let evaluate2 = evaluateLater(el, expression);
- effect3(() => evaluate2((result) => {
- if (result === void 0 && expression.match(/\./))
- result = "";
- mutateDom(() => bind(el, value, result, modifiers));
- }));
-});
-function applyBindingsObject(el, expression, original, effect3) {
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- effect3(() => {
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- attributesOnly(attributes).forEach(({name, value}, index) => {
- attributes[index] = {
- name: `x-bind:${name}`,
- value: `"${value}"`
- };
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- });
- });
-}
-function storeKeyForXFor(el, expression) {
- el._x_keyExpression = expression;
-}
-
-// packages/alpinejs/src/directives/x-data.js
-addRootSelector(() => `[${prefix("data")}]`);
-directive("data", skipDuringClone((el, {expression}, {cleanup}) => {
- expression = expression === "" ? "{}" : expression;
- let magicContext = {};
- let cleanup1 = injectMagics(magicContext, el).cleanup;
- let dataProviderContext = {};
- injectDataProviders(dataProviderContext, magicContext);
- let data2 = evaluate(el, expression, {scope: dataProviderContext});
- let cleanup2 = injectMagics(data2, el).cleanup;
- let reactiveData = reactive(data2);
- initInterceptors(reactiveData);
- let undo = addScopeToNode(el, reactiveData);
- reactiveData["init"] && evaluate(el, reactiveData["init"]);
- cleanup(() => {
- undo();
- cleanup1();
- cleanup2();
- reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]);
- });
-}));
-
-// packages/alpinejs/src/directives/x-show.js
-directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
- let evaluate2 = evaluateLater(el, expression);
- let hide = () => mutateDom(() => {
- el.style.display = "none";
- el._x_isShown = false;
- });
- let show = () => mutateDom(() => {
- if (el.style.length === 1 && el.style.display === "none") {
- el.removeAttribute("style");
- } else {
- el.style.removeProperty("display");
- }
- el._x_isShown = true;
- });
- let clickAwayCompatibleShow = () => setTimeout(show);
- let toggle = once((value) => value ? show() : hide(), (value) => {
- if (typeof el._x_toggleAndCascadeWithTransitions === "function") {
- el._x_toggleAndCascadeWithTransitions(el, value, show, hide);
- } else {
- value ? clickAwayCompatibleShow() : hide();
- }
- });
- let oldValue;
- let firstTime = true;
- effect3(() => evaluate2((value) => {
- if (!firstTime && value === oldValue)
- return;
- if (modifiers.includes("immediate"))
- value ? clickAwayCompatibleShow() : hide();
- toggle(value);
- oldValue = value;
- firstTime = false;
- }));
-});
-
-// packages/alpinejs/src/directives/x-for.js
-directive("for", (el, {expression}, {effect: effect3, cleanup}) => {
- let iteratorNames = parseForExpression(expression);
- let evaluateItems = evaluateLater(el, iteratorNames.items);
- let evaluateKey = evaluateLater(el, el._x_keyExpression || "index");
- el._x_prevKeys = [];
- el._x_lookup = {};
- effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));
- cleanup(() => {
- Object.values(el._x_lookup).forEach((el2) => el2.remove());
- delete el._x_prevKeys;
- delete el._x_lookup;
- });
-});
-function loop(el, iteratorNames, evaluateItems, evaluateKey) {
- let isObject = (i) => typeof i === "object" && !Array.isArray(i);
- let templateEl = el;
- evaluateItems((items) => {
- if (isNumeric3(items) && items >= 0) {
- items = Array.from(Array(items).keys(), (i) => i + 1);
- }
- if (items === void 0)
- items = [];
- let lookup = el._x_lookup;
- let prevKeys = el._x_prevKeys;
- let scopes = [];
- let keys = [];
- if (isObject(items)) {
- items = Object.entries(items).map(([key, value]) => {
- let scope = getIterationScopeVariables(iteratorNames, value, key, items);
- evaluateKey((value2) => keys.push(value2), {scope: {index: key, ...scope}});
- scopes.push(scope);
- });
- } else {
- for (let i = 0; i < items.length; i++) {
- let scope = getIterationScopeVariables(iteratorNames, items[i], i, items);
- evaluateKey((value) => keys.push(value), {scope: {index: i, ...scope}});
- scopes.push(scope);
- }
- }
- let adds = [];
- let moves = [];
- let removes = [];
- let sames = [];
- for (let i = 0; i < prevKeys.length; i++) {
- let key = prevKeys[i];
- if (keys.indexOf(key) === -1)
- removes.push(key);
- }
- prevKeys = prevKeys.filter((key) => !removes.includes(key));
- let lastKey = "template";
- for (let i = 0; i < keys.length; i++) {
- let key = keys[i];
- let prevIndex = prevKeys.indexOf(key);
- if (prevIndex === -1) {
- prevKeys.splice(i, 0, key);
- adds.push([lastKey, i]);
- } else if (prevIndex !== i) {
- let keyInSpot = prevKeys.splice(i, 1)[0];
- let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];
- prevKeys.splice(i, 0, keyForSpot);
- prevKeys.splice(prevIndex, 0, keyInSpot);
- moves.push([keyInSpot, keyForSpot]);
- } else {
- sames.push(key);
- }
- lastKey = key;
- }
- for (let i = 0; i < removes.length; i++) {
- let key = removes[i];
- lookup[key].remove();
- lookup[key] = null;
- delete lookup[key];
- }
- for (let i = 0; i < moves.length; i++) {
- let [keyInSpot, keyForSpot] = moves[i];
- let elInSpot = lookup[keyInSpot];
- let elForSpot = lookup[keyForSpot];
- let marker = document.createElement("div");
- mutateDom(() => {
- elForSpot.after(marker);
- elInSpot.after(elForSpot);
- marker.before(elInSpot);
- marker.remove();
- });
- refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]);
- }
- for (let i = 0; i < adds.length; i++) {
- let [lastKey2, index] = adds[i];
- let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2];
- let scope = scopes[index];
- let key = keys[index];
- let clone2 = document.importNode(templateEl.content, true).firstElementChild;
- addScopeToNode(clone2, reactive(scope), templateEl);
- mutateDom(() => {
- lastEl.after(clone2);
- initTree(clone2);
- });
- if (typeof key === "object") {
- warn("x-for key cannot be an object, it must be a string or an integer", templateEl);
- }
- lookup[key] = clone2;
- }
- for (let i = 0; i < sames.length; i++) {
- refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]);
- }
- templateEl._x_prevKeys = keys;
- });
-}
-function parseForExpression(expression) {
- let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- let stripParensRE = /^\s*\(|\)\s*$/g;
- let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- let inMatch = expression.match(forAliasRE);
- if (!inMatch)
- return;
- let res = {};
- res.items = inMatch[2].trim();
- let item = inMatch[1].replace(stripParensRE, "").trim();
- let iteratorMatch = item.match(forIteratorRE);
- if (iteratorMatch) {
- res.item = item.replace(forIteratorRE, "").trim();
- res.index = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.collection = iteratorMatch[2].trim();
- }
- } else {
- res.item = item;
- }
- return res;
-}
-function getIterationScopeVariables(iteratorNames, item, index, items) {
- let scopeVariables = {};
- if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) {
- let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i) => i.trim());
- names.forEach((name, i) => {
- scopeVariables[name] = item[i];
- });
- } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") {
- let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i) => i.trim());
- names.forEach((name) => {
- scopeVariables[name] = item[name];
- });
- } else {
- scopeVariables[iteratorNames.item] = item;
- }
- if (iteratorNames.index)
- scopeVariables[iteratorNames.index] = index;
- if (iteratorNames.collection)
- scopeVariables[iteratorNames.collection] = items;
- return scopeVariables;
-}
-function isNumeric3(subject) {
- return !Array.isArray(subject) && !isNaN(subject);
-}
-
-// packages/alpinejs/src/directives/x-ref.js
-function handler2() {
-}
-handler2.inline = (el, {expression}, {cleanup}) => {
- let root = closestRoot(el);
- if (!root._x_refs)
- root._x_refs = {};
- root._x_refs[expression] = el;
- cleanup(() => delete root._x_refs[expression]);
-};
-directive("ref", handler2);
-
-// packages/alpinejs/src/directives/x-if.js
-directive("if", (el, {expression}, {effect: effect3, cleanup}) => {
- let evaluate2 = evaluateLater(el, expression);
- let show = () => {
- if (el._x_currentIfEl)
- return el._x_currentIfEl;
- let clone2 = el.content.cloneNode(true).firstElementChild;
- addScopeToNode(clone2, {}, el);
- mutateDom(() => {
- el.after(clone2);
- initTree(clone2);
- });
- el._x_currentIfEl = clone2;
- el._x_undoIf = () => {
- clone2.remove();
- delete el._x_currentIfEl;
- };
- return clone2;
- };
- let hide = () => {
- if (!el._x_undoIf)
- return;
- el._x_undoIf();
- delete el._x_undoIf;
- };
- effect3(() => evaluate2((value) => {
- value ? show() : hide();
- }));
- cleanup(() => el._x_undoIf && el._x_undoIf());
-});
-
-// packages/alpinejs/src/directives/x-on.js
-mapAttributes(startingWith("@", into(prefix("on:"))));
-directive("on", skipDuringClone((el, {value, modifiers, expression}, {cleanup}) => {
- let evaluate2 = expression ? evaluateLater(el, expression) : () => {
- };
- let removeListener = on(el, value, modifiers, (e) => {
- evaluate2(() => {
- }, {scope: {$event: e}, params: [e]});
- });
- cleanup(() => removeListener());
-}));
-
-// packages/csp/src/index.js
-alpine_default.setEvaluator(cspCompliantEvaluator);
-alpine_default.setReactivityEngine({reactive: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw});
-function cspCompliantEvaluator(el, expression) {
- let overriddenMagics = {};
- injectMagics(overriddenMagics, el);
- let dataStack = [overriddenMagics, ...closestDataStack(el)];
- if (typeof expression === "function") {
- return generateEvaluatorFromFunction(dataStack, expression);
- }
- let evaluator = (receiver = () => {
- }, {scope = {}, params = []} = {}) => {
- let completeScope = mergeProxies([scope, ...dataStack]);
- if (completeScope[expression] !== void 0) {
- runIfTypeOfFunction(receiver, completeScope[expression], completeScope, params);
- }
- };
- return tryCatch.bind(null, el, expression, evaluator);
-}
-var src_default = alpine_default;
-
-// packages/csp/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/csp/dist/module.cjs.js b/alpinejs/packages/csp/dist/module.cjs.js
index 14b08ff..e22c5f5 100644
--- a/alpinejs/packages/csp/dist/module.cjs.js
+++ b/alpinejs/packages/csp/dist/module.cjs.js
@@ -1342,23 +1342,6 @@ function elementBoundEffect(el) {
}];
}
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -1489,14 +1472,6 @@ function onMutate(mutations) {
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -1907,6 +1882,23 @@ function holdNextTicks() {
isHolding = true;
}
+// packages/alpinejs/src/utils/walk.js
+function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+}
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/csp/dist/module.esm.js b/alpinejs/packages/csp/dist/module.esm.js
index 252351b..c65153f 100644
--- a/alpinejs/packages/csp/dist/module.esm.js
+++ b/alpinejs/packages/csp/dist/module.esm.js
@@ -1332,23 +1332,6 @@ function elementBoundEffect(el) {
}];
}
-// packages/alpinejs/src/utils/walk.js
-function walk(el, callback) {
- if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
- Array.from(el.children).forEach((el2) => walk(el2, callback));
- return;
- }
- let skip = false;
- callback(el, () => skip = true);
- if (skip)
- return;
- let node = el.firstElementChild;
- while (node) {
- walk(node, callback, false);
- node = node.nextElementSibling;
- }
-}
-
// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
@@ -1479,14 +1462,6 @@ function onMutate(mutations) {
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
- if (node.localName === "body") {
- node.querySelectorAll("[x-data]").forEach((el) => {
- walk(el, (el2) => {
- onElRemoveds.forEach((i) => i(el2));
- el2.remove();
- });
- });
- }
}
addedNodes = null;
removedNodes = null;
@@ -1897,6 +1872,23 @@ function holdNextTicks() {
isHolding = true;
}
+// packages/alpinejs/src/utils/walk.js
+function walk(el, callback) {
+ if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
+ Array.from(el.children).forEach((el2) => walk(el2, callback));
+ return;
+ }
+ let skip = false;
+ callback(el, () => skip = true);
+ if (skip)
+ return;
+ let node = el.firstElementChild;
+ while (node) {
+ walk(node, callback, false);
+ node = node.nextElementSibling;
+ }
+}
+
// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
diff --git a/alpinejs/packages/csp/package.json b/alpinejs/packages/csp/package.json
deleted file mode 100644
index 0a6726b..0000000
--- a/alpinejs/packages/csp/package.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "@alpinejs/csp",
- "version": "3.0.0-alpha.0",
- "description": "A CSP compatible build of Alpine",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "dependencies": {
- "@vue/reactivity": "^3.0.2"
- }
-}
diff --git a/alpinejs/packages/csp/src/index.js b/alpinejs/packages/csp/src/index.js
deleted file mode 100644
index 2f69a10..0000000
--- a/alpinejs/packages/csp/src/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import Alpine from 'alpinejs/src/alpine'
-
-Alpine.setEvaluator(cspCompliantEvaluator)
-
-import { reactive, effect, stop, toRaw } from '@vue/reactivity'
-Alpine.setReactivityEngine({ reactive, effect, release: stop, raw: toRaw })
-
-import 'alpinejs/src/magics/index'
-import 'alpinejs/src/directives/index'
-
-import { closestDataStack, mergeProxies } from 'alpinejs/src/scope'
-import { injectMagics } from 'alpinejs/src/magics'
-import { generateEvaluatorFromFunction, runIfTypeOfFunction, tryCatch } from 'alpinejs/src/evaluator'
-
-function cspCompliantEvaluator(el, expression) {
- let overriddenMagics = {}
-
- injectMagics(overriddenMagics, el)
-
- let dataStack = [overriddenMagics, ...closestDataStack(el)]
-
- if (typeof expression === 'function') {
- return generateEvaluatorFromFunction(dataStack, expression)
- }
-
- let evaluator = (receiver = () => {}, { scope = {}, params = [] } = {}) => {
- let completeScope = mergeProxies([scope, ...dataStack])
-
- if (completeScope[expression] !== undefined) {
- runIfTypeOfFunction(receiver, completeScope[expression], completeScope, params)
- }
- }
-
- return tryCatch.bind(null, el, expression, evaluator)
-}
-
-export default Alpine
diff --git a/alpinejs/packages/docs/package.json b/alpinejs/packages/docs/package.json
deleted file mode 100644
index 9becba9..0000000
--- a/alpinejs/packages/docs/package.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "@alpinejs/docs",
- "version": "3.4.2-revision.2",
- "description": "The documentation for Alpine",
- "author": "Caleb Porzio",
- "license": "MIT"
-}
diff --git a/alpinejs/packages/docs/src/en/advanced.md b/alpinejs/packages/docs/src/en/advanced.md
deleted file mode 100644
index e0e2ae2..0000000
--- a/alpinejs/packages/docs/src/en/advanced.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-order: 8
-title: Advanced
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/advanced/async.md b/alpinejs/packages/docs/src/en/advanced/async.md
deleted file mode 100644
index 3f76576..0000000
--- a/alpinejs/packages/docs/src/en/advanced/async.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-order: 4
-title: Async
----
-
-# Async
-
-Alpine is built to support asynchronous functions in most places it supports standard ones.
-
-For example, let's say you have a simple function called `getLabel()` that you use as the input to an `x-text` directive:
-
-```js
-function getLabel() {
- return 'Hello World!'
-}
-```
-```alpine
-<span x-text="getLabel()"></span>
-```
-
-Because `getLabel` is synchronous, everything works as expected.
-
-Now let's pretend that `getLabel` makes a network request to retrieve the label and can't return one instantaneously (asynchronous). By making `getLabel` an async function, you can call it from Alpine using JavaScript's `await` syntax.
-
-```js
-async function getLabel() {
- let response = await fetch('/api/label')
-
- return await response.text()
-}
-```
-```alpine
-<span x-text="await getLabel()"></span>
-```
-
-Additionally, if you prefer calling methods in Alpine without the trailing parenthesis, you can leave them out and Alpine will detect that the provided function is async and handle it accordingly. For example:
-
-```alpine
-<span x-text="getLabel"></span>
-```
diff --git a/alpinejs/packages/docs/src/en/advanced/csp.md b/alpinejs/packages/docs/src/en/advanced/csp.md
deleted file mode 100644
index a0bda72..0000000
--- a/alpinejs/packages/docs/src/en/advanced/csp.md
+++ /dev/null
@@ -1,72 +0,0 @@
----
-order: 5
-title: CSP
----
-
-# CSP (Content-Security Policy)
-
-In order for Alpine to be able to execute plain strings from HTML attributes as JavaScript expressions, for example `x-on:click="console.log()"`, it needs to rely on utilities that violate the "unsafe-eval" content security policy.
-
-> Under the hood, Alpine doesn't actually use eval() itself because it's slow and problematic. Instead it uses Function declarations, which are much better, but still violate "unsafe-eval".
-
-In order to accommodate environments where this CSP is necessary, Alpine offers an alternate build that doesn't violate "unsafe-eval", but has a more restrictive syntax.
-
-<a name="installation"></a>
-## Installation
-
-Like all Alpine extensions, you can include this either via `<script>` tag or module import:
-
-<a name="script-tag"></a>
-### Script tag
-
-```alpine
-<html>
- <script src="alpinejs/alpinejs-csp/cdn.js" defer></script>
-</html>
-```
-
-<a name="module-import"></a>
-### Module import
-
-```js
-import Alpine from '@alpinejs/csp'
-
-window.Alpine = Alpine
-window.Alpine.start()
-```
-
-<a name="restrictions"></a>
-## Restrictions
-
-Since Alpine can no longer interpret strings as plain JavaScript, it has to parse and construct JavaScript functions from them manually.
-
-Due to this limitation, you must use `Alpine.data` to register your `x-data` objects, and must reference properties and methods from it by key only.
-
-For example, an inline component like this will not work.
-
-```alpine
-<!-- Bad -->
-<div x-data="{ count: 1 }">
- <button @click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-However, breaking out the expressions into external APIs, the following is valid with the CSP build:
-
-```alpine
-<!-- Good -->
-<div x-data="counter">
- <button @click="increment">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-```js
-Alpine.data('counter', () => ({
- count: 1,
-
- increment() { this.count++ }
-}))
-```
diff --git a/alpinejs/packages/docs/src/en/advanced/extending.md b/alpinejs/packages/docs/src/en/advanced/extending.md
deleted file mode 100644
index d75948c..0000000
--- a/alpinejs/packages/docs/src/en/advanced/extending.md
+++ /dev/null
@@ -1,360 +0,0 @@
----
-order: 2
-title: Extending
----
-
-# Extending
-
-Alpine has a very open codebase that allows for extension in a number of ways. In fact, every available directive and magic in Alpine itself uses these exact APIs. In theory you could rebuild all of Alpine's functionality using them yourself.
-
-<a name="lifecycle-concerns"></a>
-## Lifecycle concerns
-Before we dive into each individual API, let's first talk about where in your codebase you should consume these APIs.
-
-Because these APIs have an impact on how Alpine initializes the page, they must be registered AFTER Alpine is downloaded and available on the page, but BEFORE it has initialized the page itself.
-
-There are two different techniques depending on if you are importing Alpine into a bundle, or including it directly via a `<script>` tag. Let's look at them both:
-
-<a name="via-script-tag"></a>
-### Via a script tag
-
-If you are including Alpine via a script tag, you will need to register any custom extension code inside an `alpine:init` event listener.
-
-Here's an example:
-
-```alpine
-<html>
- <script src="/js/alpine.js" defer></script>
-
- <div x-data x-foo></div>
-
- <script>
- document.addEventListener('alpine:init', () => {
- Alpine.directive('foo', ...)
- })
- </script>
-</html>
-```
-
-If you want to extract your extension code into an external file, you will need to make sure that file's `<script>` tag is located BEFORE Alpine's like so:
-
-```alpine
-<html>
- <script src="/js/foo.js" defer></script>
- <script src="/js/alpine.js" defer></script>
-
- <div x-data x-foo></div>
-</html>
-```
-
-<a name="via-npm"></a>
-### Via an NPM module
-
-If you imported Alpine into a bundle, you have to make sure you are registering any extension code IN BETWEEN when you import the `Alpine` global object, and when you initialize Alpine by calling `Alpine.start()`. For example:
-
-```js
-import Alpine from 'alpinejs'
-
-Alpine.directive('foo', ...)
-
-window.Alpine = Alpine
-window.Alpine.start()
-```
-
-Now that we know where to use these extension APIs, let's look more closely at how to use each one:
-
-<a name="custom-directives"></a>
-## Custom directives
-
-Alpine allows you to register your own custom directives using the `Alpine.directive()` API.
-
-<a name="method-signature"></a>
-### Method Signature
-
-```js
-Alpine.directive('[name]', (el, { value, modifiers, expression }, { Alpine, effect, cleanup }) => {})
-```
-
-&nbsp; | &nbsp;
----|---
-name | The name of the directive. The name "foo" for example would be consumed as `x-foo`
-el | The DOM element the directive is added to
-value | If provided, the part of the directive after a colon. Ex: `'bar'` in `x-foo:bar`
-modifiers | An array of dot-separated trailing additions to the directive. Ex: `['baz', 'lob']` from `x-foo.baz.lob`
-expression | The attribute value portion of the directive. Ex: `law` from `x-foo="law"`
-Alpine | The Alpine global object
-effect | A function to create reactive effects that will auto-cleanup after this directive is removed from the DOM
-cleanup | A function you can pass bespoke callbacks to that will run when this directive is removed from the DOM
-
-<a name="simple-example"></a>
-### Simple Example
-
-Here's an example of a simple directive we're going to create called: `x-uppercase`:
-
-```js
-Alpine.directive('uppercase', el => {
- el.textContent = el.textContent.toUpperCase()
-})
-```
-```alpine
-<div x-data>
- <span x-uppercase>Hello World!</span>
-</div>
-```
-
-<a name="evaluating-expressions"></a>
-### Evaluating expressions
-
-When registering a custom directive, you may want to evaluate a user-supplied JavaScript expression:
-
-For example, let's say you wanted to create a custom directive as a shortcut to `console.log()`. Something like:
-
-```alpine
-<div x-data="{ message: 'Hello World!' }">
- <div x-log="message"></div>
-</div>
-```
-
-You need to retrieve the actual value of `message` by evaluating it as a JavaScript expression with the `x-data` scope.
-
-Fortunately, Alpine exposes its system for evaluating JavaScript expressions with an `evaluate()` API. Here's an example:
-
-```js
-Alpine.directive('log', (el, { expression }, { evaluate }) => {
- // expression === 'message'
-
- console.log(
- evaluate(expression)
- )
-})
-```
-
-Now, when Alpine initializes the `<div x-log...>`, it will retrieve the expression passed into the directive ("message" in this case), and evaluate it in the context of the current element's Alpine component scope.
-
-<a name="introducing-reactivity"></a>
-### Introducing reactivity
-
-Building on the `x-log` example from before, let's say we wanted `x-log` to log the value of `message` and also log it if the value changes.
-
-Given the following template:
-
-```alpine
-<div x-data="{ message: 'Hello World!' }">
- <div x-log="message"></div>
-
- <button @click="message = 'yolo'">Change</button>
-</div>
-```
-
-We want "Hello World!" to be logged initially, then we want "yolo" to be logged after pressing the `<button>`.
-
-We can adjust the implementation of `x-log` and introduce two new APIs to achieve this: `evaluateLater()` and `effect()`:
-
-```js
-Alpine.directive('log', (el, { expression }, { evaluateLater, effect }) => {
- let getThingToLog = evaluateLater(expression)
-
- effect(() => {
- getThingToLog(thingToLog => {
- console.log(thingToLog)
- })
- })
-})
-```
-
-Let's walk through the above code, line by line.
-
-```js
-let getThingToLog = evaluateLater(expression)
-```
-
-Here, instead of immediately evaluating `message` and retrieving the result, we will convert the string expression ("message") into an actual JavaScript function that we can run at any time. If you're going to evaluate a JavaScript expression more than once, it is highly recommended to first generate a JavaScript function and use that rather than calling `evaluate()` directly. The reason being that the process to interpret a plain string as a JavaScript function is expensive and should be avoided when unnecessary.
-
-```js
-effect(() => {
- ...
-})
-```
-
-By passing in a callback to `effect()`, we are telling Alpine to run the callback immediately, then track any dependencies it uses (`x-data` properties like `message` in our case). Now as soon as one of the dependencies changes, this callback will be re-run. This gives us our "reactivity".
-
-You may recognize this functionality from `x-effect`. It is the same mechanism under the hood.
-
-You may also notice that `Alpine.effect()` exists and wonder why we're not using it here. The reason is that the `effect` function provided via the method parameter has special functionality that cleans itself up when the directive is removed from the page for any reason.
-
-For example, if for some reason the element with `x-log` on it got removed from the page, by using `effect()` instead of `Alpine.effect()` when the `message` property is changed, the value will no longer be logged to the console.
-
-[→ Read more about reactivity in Alpine](/advanced/reactivity)
-
-```js
-getThingToLog(thingToLog => {
- console.log(thingToLog)
-})
-```
-
-Now we will call `getThingToLog`, which if you recall is the actual JavaScript function version of the string expression: "message".
-
-You might expect `getThingToCall()` to return the result right away, but instead Alpine requires you to pass in a callback to receive the result.
-
-The reason for this is to support async expressions like `await getMessage()`. By passing in a "receiver" callback instead of getting the result immediately, you are allowing your directive to work with async expressions as well.
-
-[→ Read more about async in Alpine](/advanced/async)
-
-<a name="cleaning-up"></a>
-### Cleaning Up
-
-Let's say you needed to register an event listener from a custom directive. After that directive is removed from the page for any reason, you would want to remove the event listener as well.
-
-Alpine makes this simple by providing you with a `cleanup` function when registering custom directives.
-
-Here's an example:
-
-```js
-Alpine.directive('...', (el, {}, { cleanup }) => {
- let handler = () => {}
-
- window.addEventListener('click', handler)
-
- cleanup(() => {
- window.removeEventListener('click', handler)
- })
-
-})
-```
-
-Now if the directive is removed from this element or the element is removed itself, the event listener will be removed as well.
-
-<a name="custom-magics"></a>
-## Custom magics
-
-Alpine allows you to register custom "magics" (properties or methods) using `Alpine.magic()`. Any magic you register will be available to all your application's Alpine code with the `$` prefix.
-
-<a name="method-signature"></a>
-### Method Signature
-
-```js
-Alpine.magic('[name]', (el, { Alpine }) => {})
-```
-
-&nbsp; | &nbsp;
----|---
-name | The name of the magic. The name "foo" for example would be consumed as `$foo`
-el | The DOM element the magic was triggered from
-Alpine | The Alpine global object
-
-<a name="magic-properties"></a>
-### Magic Properties
-
-Here's a basic example of a "$now" magic helper to easily get the current time from anywhere in Alpine:
-
-```js
-Alpine.magic('now', () => {
- return (new Date).toLocaleTimeString()
-})
-```
-```alpine
-<span x-text="$now"></span>
-```
-
-Now the `<span>` tag will contain the current time, resembling something like "12:00:00 PM".
-
-As you can see `$now` behaves like a static property, but under the hood is actually a getter that evaluates every time the property is accessed.
-
-Because of this, you can implement magic "functions" by returning a function from the getter.
-
-<a name="magic-functions"></a>
-### Magic Functions
-
-For example, if we wanted to create a `$clipboard()` magic function that accepts a string to copy to clipboard, we could implement it like so:
-
-```js
-Alpine.magic('clipboard', () => {
- return subject => navigator.clipboard.writeText(subject)
-})
-```
-```alpine
-<button @click="$clipboard('hello world')">Copy "Hello World"</button>
-```
-
-Now that accessing `$clipboard` returns a function itself, we can immediately call it and pass it an argument like we see in the template with `$clipboard('hello world')`.
-
-You can use the more brief syntax (a double arrow function) for returning a function from a function if you'd prefer:
-
-```js
-Alpine.magic('clipboard', () => subject => {
- navigator.clipboard.writeText(subject)
-})
-```
-
-<a name="writing-and-sharing-plugins"></a>
-## Writing and sharing plugins
-
-By now you should see how friendly and simple it is to register your own custom directives and magics in your application, but what about sharing that functionality with others via an NPM package or something?
-
-You can get started quickly with Alpine's official "plugin-blueprint" package. It's as simple as cloning the repository and running `npm install && npm run build` to get a plugin authored.
-
-For demonstration purposes, let's create a pretend Alpine plugin from scratch called `Foo` that includes both a directive (`x-foo`) and a magic (`$foo`).
-
-We'll start producing this plugin for consumption as a simple `<script>` tag alongside Alpine, then we'll level it up to a module for importing into a bundle:
-
-<a name="script-include"></a>
-### Script include
-
-Let's start in reverse by looking at how our plugin will be included into a project:
-
-```alpine
-<html>
- <script src="/js/foo.js" defer></script>
- <script src="/js/alpine.js" defer></script>
-
- <div x-data x-init="$foo()">
- <span x-foo="'hello world'">
- </div>
-</html>
-```
-
-Notice how our script is included BEFORE Alpine itself. This is important, otherwise, Alpine would have already been initialized by the time our plugin got loaded.
-
-Now let's look inside of `/js/foo.js`'s contents:
-
-```js
-document.addEventListener('alpine:init', () => {
- window.Alpine.directive('foo', ...)
-
- window.Alpine.magic('foo', ...)
-})
-```
-
-That's it! Authoring a plugin for inclusion via a script tag is extremely simple with Alpine.
-
-<a name="bundle-module"></a>
-### Bundle module
-
-Now let's say you wanted to author a plugin that someone could install via NPM and include into their bundle.
-
-Like the last example, we'll walk through this in reverse, starting with what it will look like to consume this plugin:
-
-```js
-import Alpine from 'alpinejs'
-
-import foo from 'foo'
-Alpine.plugin(foo)
-
-window.Alpine = Alpine
-window.Alpine.start()
-```
-
-You'll notice a new API here: `Alpine.plugin()`. This is a convenience method Alpine exposes to prevent consumers of your plugin from having to register multiple different directives and magics themselves.
-
-Now let's look at the source of the plugin and what gets exported from `foo`:
-
-```js
-export default function (Alpine) {
- Alpine.directive('foo', ...)
- Alpine.magic('foo', ...)
-}
-```
-
-You'll see that `Alpine.plugin` is incredibly simple. It accepts a callback and immediately invokes it while providing the `Alpine` global as a parameter for use inside of it.
-
-Then you can go about extending Alpine as you please.
diff --git a/alpinejs/packages/docs/src/en/advanced/reactivity.md b/alpinejs/packages/docs/src/en/advanced/reactivity.md
deleted file mode 100644
index ddbb601..0000000
--- a/alpinejs/packages/docs/src/en/advanced/reactivity.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-order: 1
-title: Reactivity
----
-
-# Reactivity
-
-Alpine is "reactive" in the sense that when you change a piece of data, everything that depends on that data "reacts" automatically to that change.
-
-Every bit of reactivity that takes place in Alpine, happens because of two very important reactive functions in Alpine's core: `Alpine.reactive()`, and `Alpine.effect()`.
-
-> Alpine uses VueJS's reactivity engine under the hood to provide these functions.
-> [→ Read more about @vue/reactivity](https://github.com/vuejs/vue-next/tree/master/packages/reactivity)
-
-Understanding these two functions will give you super powers as an Alpine developer, but also just as a web developer in general.
-
-<a name="alpine-reactive"></a>
-## Alpine.reactive()
-
-Let's first look at `Alpine.reactive()`. This function accepts a JavaScript object as its parameter and returns a "reactive" version of that object. For example:
-
-```js
-let data = { count: 1 }
-
-let reactiveData = Alpine.reactive(data)
-```
-
-Under the hood, when `Alpine.reactive` receives `data`, it wraps it inside a custom JavaScript proxy.
-
-A proxy is a special kind of object in JavaScript that can intercept "get" and "set" calls to a JavaScript object.
-
-[→ Read more about JavaScript proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
-
-At face value, `reactiveData` should behave exactly like `data`. For example:
-
-```js
-console.log(data.count) // 1
-console.log(reactiveData.count) // 1
-
-reactiveData.count = 2
-
-console.log(data.count) // 2
-console.log(reactiveData.count) // 2
-```
-
-What you see here is that because `reactiveData` is a thin wrapper around `data`, any attempts to get or set a property will behave exactly as if you had interacted with `data` directly.
-
-The main difference here is that any time you modify or retrieve (get or set) a value from `reactiveData`, Alpine is aware of it and can execute any other logic that depends on this data.
-
-`Alpine.reactive` is only the first half of the story. `Alpine.effect` is the other half, let's dig in.
-
-<a name="alpine-effect"></a><a name="alpine-effect"></a>
-## Alpine.effect()
-
-`Alpine.effect` accepts a single callback function. As soon as `Alpine.effect` is called, it will run the provided function, but actively look for any interactions with reactive data. If it detects an interaction (a get or set from the aforementioned reactive proxy) it will keep track of it and make sure to re-run the callback if any of reactive data changes in the future. For example:
-
-```js
-let data = Alpine.reactive({ count: 1 })
-
-Alpine.effect(() => {
- console.log(data.count)
-})
-```
-
-When this code is first run, "1" will be logged to the console. Any time `data.count` changes, it's value will be logged to the console again.
-
-This is the mechanism that unlocks all of the reactivity at the core of Alpine.
-
-To connect the dots further, let's look at a simple "counter" component example without using Alpine syntax at all, only using `Alpine.reactive` and `Alpine.effect`:
-
-```alpine
-<button>Increment</button>
-
-Count: <span></span>
-```
-```js
-let button = document.querySelector('button')
-let span = document.querySelector('span')
-
-let data = Alpine.reactive({ count: 1 })
-
-Alpine.effect(() => {
- span.textContent = data.count
-})
-
-button.addEventListener('click', () => {
- data.count = data.count + 1
-})
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ count: 1 }" class="demo">
- <button @click="count++">Increment</button>
-
- <div>Count: <span x-text="count"></span></div>
-</div>
-<!-- END_VERBATIM -->
-
-As you can see, you can make any data reactive, and you can also wrap any functionality in `Alpine.effect`.
-
-This combination unlocks an incredibly powerful programming paradigm for web development. Run wild and free.
diff --git a/alpinejs/packages/docs/src/en/directives.md b/alpinejs/packages/docs/src/en/directives.md
deleted file mode 100644
index ef15b7b..0000000
--- a/alpinejs/packages/docs/src/en/directives.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-order: 4
-title: Directives
-prefix: x-
-font-type: mono
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/directives/bind.md b/alpinejs/packages/docs/src/en/directives/bind.md
deleted file mode 100644
index abe9155..0000000
--- a/alpinejs/packages/docs/src/en/directives/bind.md
+++ /dev/null
@@ -1,189 +0,0 @@
----
-order: 4
-title: bind
----
-
-# `x-bind`
-
-`x-bind` allows you to set HTML attributes on elements based on the result of JavaScript expressions.
-
-For example, here's a component where we will use `x-bind` to set the placeholder value of an input.
-
-```alpine
-<div x-data="{ placeholder: 'Type here...' }">
- <input type="text" x-bind:placeholder="placeholder">
-</div>
-```
-
-<a name="shorthand-syntax"></a>
-## Shorthand syntax
-
-If `x-bind:` is too verbose for your liking, you can use the shorthand: `:`. For example, here is the same input element as above, but refactored to use the shorthand syntax.
-
-```alpine
-<input type="text" :placeholder="placeholder">
-```
-
-<a name="binding-classes"></a>
-## Binding classes
-
-`x-bind` is most often useful for setting specific classes on an element based on your Alpine state.
-
-Here's a simple example of a simple dropdown toggle, but instead of using `x-show`, we'll use a "hidden" class to toggle an element.
-
-```alpine
-<div x-data="{ open: false }">
- <button x-on:click="open = ! open">Toggle Dropdown</button>
-
- <div :class="open ? '' : 'hidden'">
- Dropdown Contents...
- </div>
-</div>
-```
-
-Now, when `open` is `false`, the "hidden" class will be added to the dropdown.
-
-<a name="shorthand-conditionals"></a>
-### Shorthand conditionals
-
-In cases like these, if you prefer a less verbose syntax you can use JavaScript's short-circuit evaluation instead of standard conditionals:
-
-```alpine
-<div :class="show ? '' : 'hidden'">
-<!-- Is equivalent to: -->
-<div :class="show || 'hidden'">
-```
-
-The inverse is also available to you. Suppose instead of `open`, we use a variable with the opposite value: `closed`.
-
-```alpine
-<div :class="closed ? 'hidden' : ''">
-<!-- Is equivalent to: -->
-<div :class="closed && 'hidden'">
-```
-
-<a name="class-object-syntax"></a>
-### Class object syntax
-
-Alpine offers an additional syntax for toggling classes if you prefer. By passing a JavaScript object where the classes are the keys and booleans are the values, Alpine will know which classes to apply and which to remove. For example:
-
-```alpine
-<div :class="{ 'hidden': ! show }">
-```
-
-This technique offers a unique advantage to other methods. When using object-syntax, Alpine will NOT preserve original classes applied to an element's `class` attribute.
-
-For example, if you wanted to apply the "hidden" class to an element before Alpine loads, AND use Alpine to toggle its existence you can only achieve that behavior using object-syntax:
-
-```alpine
-<div class="hidden" :class="{ 'hidden': ! show }">
-```
-
-In case that confused you, let's dig deeper into how Alpine handles `x-bind:class` differently than other attributes.
-
-<a name="special-behavior"></a>
-### Special behavior
-
-`x-bind:class` behaves differently than other attributes under the hood.
-
-Consider the following case.
-
-```alpine
-<div class="opacity-50" :class="hide && 'hidden'">
-```
-
-If "class" were any other attribute, the `:class` binding would overwrite any existing class attribute, causing `opacity-50` to be overwritten by either `hidden` or `''`.
-
-However, Alpine treats `class` bindings differently. It's smart enough to preserve existing classes on an element.
-
-For example, if `hide` is true, the above example will result in the following DOM element:
-
-```alpine
-<div class="opacity-50 hidden">
-```
-
-If `hide` is false, the DOM element will look like:
-
-```alpine
-<div class="opacity-50">
-```
-
-This behavior should be invisible and intuitive to most users, but it is worth mentioning explicitly for the inquiring developer or any special cases that might crop up.
-
-<a name="binding-styles"></a>
-## Binding styles
-
-Similar to the special syntax for binding classes with JavaScript objects, Alpine also offers an object-based syntax for binding `style` attributes.
-
-Just like the class objects, this syntax is entirely optional. Only use it if it affords you some advantage.
-
-```alpine
-<div :style="{ color: 'red', display: 'flex' }">
-
-<!-- Will render: -->
-<div style="color: red; display: flex;" ...>
-```
-
-One advantage of this approach is being able to mix it in with existing styles on an element:
-
-```alpine
-<div style="padding: 1rem;" :style="{ color: 'red', display: 'flex' }">
-
-<!-- Will render: -->
-<div style="padding: 1rem; color: red; display: flex;" ...>
-```
-
-And like most expressions in Alpine, you can always use the result of a JavaScript expression as the reference:
-
-```alpine
-<div x-data="{ styles: { color: 'red', display: 'flex' }}">
- <div :style="styles">
-</div>
-
-<!-- Will render: -->
-<div ...>
- <div style="color: red; display: flex;" ...>
-</div>
-```
-
-<a name="bind-directives"></a>
-## Binding Alpine Directives Directly
-
-`x-bind` allows you to bind an object of different properties to an element.
-
-The object keys are the directives (can be any directive including modifiers), and the values are callbacks to be evaluated by Alpine.
-
-```alpine
-<div x-data="dropdown()">
- <button x-bind="trigger">Open Dropdown</button>
-
- <span x-bind="dialogue">Dropdown Contents</span>
-</div>
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.data('dropdown', () => ({
- open: false,
-
- trigger: {
- ['@click']() {
- this.open = true
- },
- },
-
- dialogue: {
- ['x-show']() {
- return this.open
- },
- ['@click.outside']() {
- this.open = false
- },
- },
- }))
- })
-</script>
-```
-
-There are a couple of caveats to this usage of `x-bind`:
-
-> When the directive being "bound" or "applied" is `x-for`, you should return a normal expression string from the callback. For example: `['x-for']() { return 'item in items' }`
diff --git a/alpinejs/packages/docs/src/en/directives/cloak.md b/alpinejs/packages/docs/src/en/directives/cloak.md
deleted file mode 100644
index aec2037..0000000
--- a/alpinejs/packages/docs/src/en/directives/cloak.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-order: 12
-title: cloak
----
-
-# `x-cloak`
-
-Sometimes, when you're using AlpineJS for a part of your template, there is a "blip" where you might see your uninitialized template after the page loads, but before Alpine loads.
-
-`x-cloak` addresses this scenario by hiding the element it's attached to until Alpine is fully loaded on the page.
-
-For `x-cloak` to work however, you must add the following CSS to the page.
-
-```css
-[x-cloak] { display: none !important; }
-```
-
-Now, the following example will hide the `<span>` tag until Alpine has set its text content to the `message` property.
-
-```alpine
-<span x-cloak x-text="message"></span>
-```
-
-When Alpine loads on the page, it removes all `x-cloak` property from the element, which also removes the `display: none;` applied by CSS, therefore showing the element.
-
-If you'd like to achieve this same behavior, but avoid having to include a global style, you can use the following cool, but admittedly odd trick:
-
-```alpine
-<template x-if="true">
- <span x-text="message"></span>
-</template>
-```
-
-This will achieve the same goal as `x-cloak` by just leveraging the way `x-if` works.
-
-Because `<template>` elements are "hidden" in browsers by default, you won't see the `<span>` until Alpine has had a chance to render the `x-if="true"` and show it.
-
-Again, this solution is not for everyone, but it's worth mentioning for special cases.
diff --git a/alpinejs/packages/docs/src/en/directives/data.md b/alpinejs/packages/docs/src/en/directives/data.md
deleted file mode 100644
index e90121b..0000000
--- a/alpinejs/packages/docs/src/en/directives/data.md
+++ /dev/null
@@ -1,170 +0,0 @@
----
-order: 1
-title: data
----
-
-# `x-data`
-
-Everything in Alpine starts with the `x-data` directive.
-
-`x-data` defines a chunk of HTML as an Alpine component and provides the reactive data for that component to reference.
-
-Here's an example of a contrived dropdown component:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Toggle Content</button>
-
- <div x-show="open">
- Content...
- </div>
-</div>
-```
-
-Don't worry about the other directives in this example (`@click` and `x-show`), we'll get to those in a bit. For now, let's focus on `x-data`.
-
-<a name="scope"></a>
-## Scope
-
-Properties defined in an `x-data` directive are available to all element children. Even ones inside other, nested `x-data` components.
-
-For example:
-
-```alpine
-<div x-data="{ foo: 'bar' }">
- <span x-text="foo"><!-- Will output: "bar" --></span>
-
- <div x-data="{ bar: 'baz' }">
- <span x-text="foo"><!-- Will output: "bar" --></span>
-
- <div x-data="{ foo: 'bob' }">
- <span x-text="foo"><!-- Will output: "bob" --></span>
- </div>
- </div>
-</div>
-```
-
-<a name="methods"></a>
-## Methods
-
-Because `x-data` is evaluated as a normal JavaScript object, in addition to state, you can store methods and even getters.
-
-For example, let's extract the "Toggle Content" behavior into a method on `x-data`.
-
-```alpine
-<div x-data="{ open: false, toggle() { this.open = ! this.open } }">
- <button @click="toggle()">Toggle Content</button>
-
- <div x-show="open">
- Content...
- </div>
-</div>
-```
-
-Notice the added `toggle() { this.open = ! this.open }` method on `x-data`. This method can now be called from anywhere inside the component.
-
-You'll also notice the usage of `this.` to access state on the object itself. This is because Alpine evaluates this data object like any standard JavaScript object with a `this` context.
-
-If you prefer, you can leave the calling parenthesis off of the `toggle` method completely. For example:
-
-```alpine
-<!-- Before -->
-<button @click="toggle()">...</button>
-
-<!-- After -->
-<button @click="toggle">...</button>
-```
-
-<a name="getters"></a>
-## Getters
-
-JavaScript [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) are handy when the sole purpose of a method is to return data based on other state.
-
-Think of them like "computed properties" (although, they are not cached like Vue's computed properties).
-
-Let's refactor our component to use a getter called `isOpen` instead of accessing `open` directly.
-
-```alpine
-<div x-data="{
- open: false,
- get isOpen() { return this.open },
- toggle() { this.open = ! this.open },
-}">
- <button @click="toggle()">Toggle Content</button>
-
- <div x-show="isOpen">
- Content...
- </div>
-</div>
-```
-
-Notice the "Content" now depends on the `isOpen` getter instead of the `open` property directly.
-
-In this case there is no tangible benefit. But in some cases, getters are helpful for providing a more expressive syntax in your components.
-
-<a name="data-less-components"></a>
-## Data-less components
-
-Occasionally, you want to create an Alpine component, but you don't need any data.
-
-In these cases, you can always pass in an empty object.
-
-```alpine
-<div x-data="{}"...
-```
-
-However, if you wish, you can also eliminate the attribute value entirely if it looks better to you.
-
-```alpine
-<div x-data...
-```
-
-<a name="single-element-components"></a>
-## Single-element components
-
-Sometimes you may only have a single element inside your Alpine component, like the following:
-
-```alpine
-<div x-data="{ open: true }">
- <button @click="open = false" x-show="open">Hide Me</button>
-</div>
-```
-
-In these cases, you can declare `x-data` directly on that single element:
-
-```alpine
-<button x-data="{ open: true }" @click="open = false" x-show="open">
- Hide Me
-</button>
-```
-
-<a name="re-usable-data"></a>
-## Re-usable Data
-
-If you find yourself duplicating the contents of `x-data`, or you find the inline syntax verbose, you can extract the `x-data` object out to a dedicated component using `Alpine.data`.
-
-Here's a quick example:
-
-```alpine
-<div x-data="dropdown">
- <button @click="toggle">Toggle Content</button>
-
- <div x-show="open">
- Content...
- </div>
-</div>
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.data('dropdown', () => ({
- open: false,
-
- toggle() {
- this.open = ! this.open
- },
- }))
- })
-</script>
-```
-
-[→ Read more about `Alpine.data(...)`](/globals/alpine-data)
diff --git a/alpinejs/packages/docs/src/en/directives/effect.md b/alpinejs/packages/docs/src/en/directives/effect.md
deleted file mode 100644
index afa4cb2..0000000
--- a/alpinejs/packages/docs/src/en/directives/effect.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 11
-title: effect
----
-
-# `x-effect`
-
-`x-effect` is a useful directive for re-evaluating an expression when one of its dependencies change. You can think of it as a watcher where you don't have to specify what property to watch, it will watch all properties used within it.
-
-If this definition is confusing for you, that's ok. It's better explained through an example:
-
-```alpine
-<div x-data="{ label: 'Hello' }" x-effect="console.log(label)">
- <button @click="label += ' World!'">Change Message</button>
-</div>
-```
-
-When this component is loaded, the `x-effect` expression will be run and "Hello" will be logged into the console.
-
-Because Alpine knows about any property references contained within `x-effect`, when the button is clicked and `label` is changed", the effect will be re-triggered and "Hello World!" will be logged to the console.
diff --git a/alpinejs/packages/docs/src/en/directives/for.md b/alpinejs/packages/docs/src/en/directives/for.md
deleted file mode 100644
index 1dc4584..0000000
--- a/alpinejs/packages/docs/src/en/directives/for.md
+++ /dev/null
@@ -1,87 +0,0 @@
----
-order: 8
-title: for
----
-
-# `x-for`
-
-Alpine's `x-for` directive allows you to create DOM elements by iterating through a list. Here's a simple example of using it to create a list of colors based on an array.
-
-```alpine
-<ul x-data="{ colors: ['Red', 'Orange', 'Yellow'] }">
- <template x-for="color in colors">
- <li x-text="color"></li>
- </template>
-</ul>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <ul x-data="{ colors: ['Red', 'Orange', 'Yellow'] }">
- <template x-for="color in colors">
- <li x-text="color"></li>
- </template>
- </ul>
-</div>
-<!-- END_VERBATIM -->
-
-There are two rules worth noting about `x-for`:
-
-* `x-for` MUST be declared on a `<template>` element
-* That `<template>` element MUST have only one root element
-
-<a name="keys"></a>
-## Keys
-
-It is important to specify keys for each `x-for` iteration if you are going to be re-ordering items. Without dynamic keys, Alpine may have a hard time keeping track of what re-orders and will cause odd side-effects.
-
-```alpine
-<ul x-data="{ colors: [
- { id: 1, label: 'Red' },
- { id: 2, label: 'Orange' },
- { id: 3, label: 'Yellow' },
-]}">
- <template x-for="color in colors" :key="color.id">
- <li x-text="color.label"></li>
- </template>
-</ul>
-```
-
-Now if the colors are added, removed, re-ordered, or their "id"s change, Alpine will preserve or destroy the iterated `<li>`elements accordingly.
-
-<a name="accessing-indexes"></a>
-## Accessing indexes
-
-If you need to access the index of each item in the iteration, you can do so using the `([item], [index]) in [items]` syntax like so:
-
-```alpine
-<ul x-data="{ colors: ['Red', 'Orange', 'Yellow'] }">
- <template x-for="(color, index) in colors">
- <li>
- <span x-text="index + ': '"></span>
- <span x-text="color"></span>
- </li>
- </template>
-</ul>
-```
-
-You can also access the index inside a dynamic `:key` expression.
-
-```alpine
-<template x-for="(color, index) in colors" :key="index">
-```
-
-<a name="iterating-over-a-range"></a>
-## Iterating over a range
-
-If you need to simply loop `n` number of times, rather than iterate through an array, Alpine offers a short syntax.
-
-```alpine
-<ul>
- <template x-for="i in 10">
- <li x-text="i"></li>
- </template>
-</ul>
-```
-
-`i` in this case can be named anything you like.
diff --git a/alpinejs/packages/docs/src/en/directives/html.md b/alpinejs/packages/docs/src/en/directives/html.md
deleted file mode 100644
index 0d1d0b6..0000000
--- a/alpinejs/packages/docs/src/en/directives/html.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-order: 7
-title: html
----
-
-# `x-html`
-
-`x-html` sets the "innerHTML" property of an element to the result of a given expression.
-
-> ⚠️ Only use on trusted content and never on user-provided content. ⚠️
-> Dynamically rendering HTML from third parties can easily lead to XSS vulnerabilities.
-
-Here's a basic example of using `x-html` to display a user's username.
-
-```alpine
-<div x-data="{ username: '<strong>calebporzio</strong>' }">
- Username: <span x-html="username"></span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ username: '<strong>calebporzio</strong>' }">
- Username: <span x-html="username"></span>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now the `<span>` tag's inner HTML will be set to "<strong>calebporzio</strong>".
diff --git a/alpinejs/packages/docs/src/en/directives/if.md b/alpinejs/packages/docs/src/en/directives/if.md
deleted file mode 100644
index 13e3aea..0000000
--- a/alpinejs/packages/docs/src/en/directives/if.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 16
-title: if
----
-
-# `x-if`
-
-`x-if` is used for toggling elements on the page, similarly to `x-show`, however it completely adds and removes the element it's applied to rather than just changing its CSS display property to "none".
-
-Because of this difference in behavior, `x-if` should not be applied directly to the element, but instead to a `<template>` tag that encloses the element. This way, Alpine can keep a record of the element once it's removed from the page.
-
-```alpine
-<template x-if="open">
- <div>Contents...</div>
-</template>
-```
-
-> Unlike `x-show`, `x-if`, does NOT support transitioning toggles with `x-transition`.
-
-> Remember: `<template>` tags can only contain one root level element.
diff --git a/alpinejs/packages/docs/src/en/directives/ignore.md b/alpinejs/packages/docs/src/en/directives/ignore.md
deleted file mode 100644
index 8709832..0000000
--- a/alpinejs/packages/docs/src/en/directives/ignore.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 11
-title: ignore
----
-
-# `x-ignore`
-
-By default, Alpine will crawl and initialize the entire DOM tree of an element containing `x-init` or `x-data`.
-
-If for some reason, you don't want Alpine to touch a specific section of your HTML, you can prevent it from doing so using `x-ignore`.
-
-```alpine
-<div x-data="{ label: 'From Alpine' }">
- <div x-ignore>
- <span x-text="label"></span>
- </div>
-</div>
-```
-
-In the above example, the `<span>` tag will not contain "From Alpine" because we told Alpine to ignore the contents of the `div` completely.
diff --git a/alpinejs/packages/docs/src/en/directives/init.md b/alpinejs/packages/docs/src/en/directives/init.md
deleted file mode 100644
index 6478ab1..0000000
--- a/alpinejs/packages/docs/src/en/directives/init.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-order: 2
-title: init
----
-
-# `x-init`
-
-The `x-init` directive allows you to hook into the initialization phase of any element in Alpine.
-
-```alpine
-<div x-init="console.log('I\'m being initialized!')"></div>
-```
-
-In the above example, "I\'m being initialized!" will be output in the console before it makes further DOM updates.
-
-Consider another example where `x-init` is used to fetch some JSON and store it in `x-data` before the component is processed.
-
-```alpine
-<div
- x-data="{ posts: [] }"
- x-init="posts = await (await fetch('/posts')).json()"
->...</div>
-```
-
-<a name="next-tick"></a>
-## $nextTick
-
-Sometimes, you want to wait until after Alpine has completely finished rendering to execute some code.
-
-This would be something like `useEffect(..., [])` in react, or `mount` in Vue.
-
-By using Alpine's internal `$nextTick` magic, you can make this happen.
-
-```alpine
-<div x-init="$nextTick(() => { ... })"></div>
-```
-
-<a name="standalone-x-init"></a>
-## Standalone `x-init`
-
-You can add `x-init` to any elements inside or outside an `x-data` HTML block. For example:
-
-```alpine
-<div x-data>
- <span x-init="console.log('I can initialize')"></span>
-</div>
-
-<span x-init="console.log('I can initialize too')"></span>
-```
-
-<a name="auto-evaluate-init-method"></a>
-## Auto-evaluate init() method
-
-If the `x-data` object of a component contains an `init()` method, it will be called automatically. For example:
-
-```alpine
-<div x-data="{
- init() {
- console.log('I am called automatically')
- }
-}">
- ...
-</div>
-```
-
-This is also the case for components that were registered using the `Alpine.data()` syntax.
-
-```js
-Alpine.data('dropdown', () => ({
- init() {
- console.log('I will get evaluated when initializing each "dropdown" component.')
- },
-}))
-```
diff --git a/alpinejs/packages/docs/src/en/directives/model.md b/alpinejs/packages/docs/src/en/directives/model.md
deleted file mode 100644
index b0995a0..0000000
--- a/alpinejs/packages/docs/src/en/directives/model.md
+++ /dev/null
@@ -1,338 +0,0 @@
----
-order: 7
-title: model
----
-
-# `x-model`
-
-`x-model` allows you to bind the value of an input element to Alpine data.
-
-Here's a simple example of using `x-model` to bind the value of a text field to a piece of data in Alpine.
-
-```alpine
-<div x-data="{ message: '' }">
- <input type="text" x-model="message">
-
- <span x-text="message">
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ message: '' }">
- <input type="text" x-model="message" placeholder="Type message...">
-
- <div class="pt-4" x-text="message"></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-
-Now as the user types into the text field, the `message` will be reflected in the `<span>` tag.
-
-`x-model` is two-way bound, meaning it both "sets" and "gets". In addition to changing data, if the data itself changes, the element will reflect the change.
-
-
-We can use the same example as above but this time, we'll add a button to change the value of the `message` property.
-
-```alpine
-<div x-data="{ message: '' }">
- <input type="text" x-model="message">
-
- <button x-on:click="message = 'changed'">Change Message</button>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ message: '' }">
- <input type="text" x-model="message" placeholder="Type message...">
-
- <button x-on:click="message = 'changed'">Change Message</button>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now when the `<button>` is clicked, the input element's value will instantly be updated to "changed".
-
-`x-model` works with the following input elements:
-
-* `<input type="text">`
-* `<textarea>`
-* `<input type="checkbox">`
-* `<input type="radio">`
-* `<select>`
-
-<a name="text-inputs"></a>
-## Text inputs
-
-```alpine
-<input type="text" x-model="message">
-
-<span x-text="message"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ message: '' }">
- <input type="text" x-model="message" placeholder="Type message">
-
- <div class="pt-4" x-text="message"></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="textarea-inputs"></a>
-## Textarea inputs
-
-```alpine
-<textarea x-model="message"></textarea>
-
-<span x-text="message"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ message: '' }">
- <textarea x-model="message" placeholder="Type message"></textarea>
-
- <div class="pt-4" x-text="message"></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="checkbox-inputs"></a>
-## Checkbox inputs
-
-<a name="single-checkbox-with-boolean"></a>
-### Single checkbox with boolean
-
-```alpine
-<input type="checkbox" id="checkbox" x-model="show">
-
-<label for="checkbox" x-text="show"></label>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ open: '' }">
- <input type="checkbox" id="checkbox" x-model="open">
-
- <label for="checkbox" x-text="open"></label>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="multiple-checkboxes-bound-to-array"></a>
-### Multiple checkboxes bound to array
-
-```alpine
-<input type="checkbox" value="red" x-model="colors">
-<input type="checkbox" value="orange" x-model="colors">
-<input type="checkbox" value="yellow" x-model="colors">
-
-Colors: <span x-text="colors"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ colors: [] }">
- <input type="checkbox" value="red" x-model="colors">
- <input type="checkbox" value="orange" x-model="colors">
- <input type="checkbox" value="yellow" x-model="colors">
-
- <div class="pt-4">Colors: <span x-text="colors"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="radio-inputs"></a>
-## Radio inputs
-
-```alpine
-<input type="radio" value="yes" x-model="answer">
-<input type="radio" value="no" x-model="answer">
-
-Answer: <span x-text="answer"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ answer: '' }">
- <input type="radio" value="yes" x-model="answer">
- <input type="radio" value="no" x-model="answer">
-
- <div class="pt-4">Answer: <span x-text="answer"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="select-inputs"></a>
-## Select inputs
-
-
-<a name="single-select"></a>
-### Single select
-
-```alpine
-<select x-model="color">
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
-</select>
-
-Color: <span x-text="color"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ color: '' }">
- <select x-model="color">
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
- </select>
-
- <div class="pt-4">Color: <span x-text="color"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="single-select-with-placeholder"></a>
-### Single select with placeholder
-
-```alpine
-<select x-model="color">
- <option value="" disabled>Select A Color</option>
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
-</select>
-
-Color: <span x-text="color"></span>
-```
-
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ color: '' }">
- <select x-model="color">
- <option value="" disabled>Select A Color</option>
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
- </select>
-
- <div class="pt-4">Color: <span x-text="color"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="multiple-select"></a>
-### Multiple select
-
-```alpine
-<select x-model="color" multiple>
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
-</select>
-
-Colors: <span x-text="color"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ color: '' }">
- <select x-model="color" multiple>
- <option>Red</option>
- <option>Orange</option>
- <option>Yellow</option>
- </select>
-
- <div class="pt-4">Color: <span x-text="color"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="dynamically-populated-select-options"></a>
-### Dynamically populated Select Options
-
-```alpine
-<select x-model="color">
- <template x-for="color in ['Red', 'Orange', 'Yellow']">
- <option x-text="color"></option>
- </template>
-</select>
-
-Color: <span x-text="color"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ color: '' }">
- <select x-model="color">
- <template x-for="color in ['Red', 'Orange', 'Yellow']">
- <option x-text="color"></option>
- </template>
- </select>
-
- <div class="pt-4">Color: <span x-text="color"></span></div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="modifiers"></a>
-## Modifiers
-
-<a name="lazy"></a>
-### `.lazy`
-
-On text inputs, by default, `x-model` updates the property on every key-stroke. By adding the `.lazy` modifier, you can force an `x-model` input to only update the property when user focuses away from the input element.
-
-This is handy for things like real-time form-validation where you might not want to show an input validation error until the user "tabs" away from a field.
-
-```alpine
-<input type="text" x-model.lazy="username">
-<span x-show="username.length > 20">The username is too long.</span>
-```
-
-<a name="number"></a>
-### `.number`
-
-By default, any data stored in a property via `x-model` is stored as a string. To force Alpine to store the value as a JavaScript number, add the `.number` modifier.
-
-```alpine
-<input type="text" x-model.number="age">
-<span x-text="typeof age"></span>
-```
-
-<a name="debounce"></a>
-### `.debounce`
-
-By adding `.debounce` to `x-model`, you can easily debounce the updating of bound input.
-
-This is useful for things like real-time search inputs that fetch new data from the server every time the search property changes.
-
-```alpine
-<input type="text" x-model.debounce="search">
-```
-
-The default debounce time is 250 milliseconds, you can easily customize this by adding a time modifier like so.
-
-```alpine
-<input type="text" x-model.debounce.500ms="search">
-```
-
-<a name="throttle"></a>
-### `.throttle`
-
-Similar to `.debounce` you can limit the property update triggered by `x-model` to only updating on a specified interval.
-
-<input type="text" x-model.throttle="search">
-
-The default throttle interval is 250 milliseconds, you can easily customize this by adding a time modifier like so.
-
-```alpine
-<input type="text" x-model.throttle.500ms="search">
-```
diff --git a/alpinejs/packages/docs/src/en/directives/on.md b/alpinejs/packages/docs/src/en/directives/on.md
deleted file mode 100644
index dde38f6..0000000
--- a/alpinejs/packages/docs/src/en/directives/on.md
+++ /dev/null
@@ -1,276 +0,0 @@
----
-order: 5
-title: on
----
-
-# `x-on`
-
-`x-on` allows you to easily run code on dispatched DOM events.
-
-Here's an example of simple button that shows an alert when clicked.
-
-```alpine
-<button x-on:click="alert('Hello World!')">Say Hi</button>
-```
-
-<a name="shorthand-syntax"></a>
-## Shorthand syntax
-
-If `x-on:` is too verbose for your tastes, you can use the shorthand syntax: `@`.
-
-Here's the same component as above, but using the shorthand syntax instead:
-
-```alpine
-<button @click="alert('Hello World!')">Say Hi</button>
-```
-
-<a name="the-event-object"></a>
-## The event object
-
-If you wish to access the native JavaScript event object from your expression, you can use Alpine's magic `$event` property.
-
-```alpine
-<button @click="alert($event.target.getAttribute('message'))" message="Hello World">Say Hi</button>
-```
-
-In addition, Alpine also passes the event object to any methods referenced without trailing parenthesis. For example:
-
-```alpine
-<button @click="handleClick">...</button>
-
-<script>
- function handleClick(e) {
- // Now you can access the event object (e) directly
- }
-</script>
-```
-
-<a name="keyboard-events"></a>
-## Keyboard events
-
-Alpine makes it easy to listen for `keydown` and `keyup` events on specific keys.
-
-Here's an example of listening for the `Enter` key inside an input element.
-
-```alpine
-<input type="text" @keyup.enter="alert('Submitted!')">
-```
-
-You can also chain these key modifiers to achieve more complex listeners.
-
-Here's a listener that runs when the `Shift` key is held and `Enter` is pressed, but not when `Enter` is pressed alone.
-
-```alpine
-<input type="text" @keyup.shift.enter="alert('Submitted!')">
-```
-
-You can directly use any valid key names exposed via [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) as modifiers by converting them to kebab-case.
-
-```alpine
-<input type="text" @keyup.page-down="alert('Submitted!')">
-```
-
-For easy reference, here is a list of common keys you may want to listen for.
-
-| Modifier | Keyboard Key |
-| -------------------------- | --------------------------- |
-| `.shift` | Shift |
-| `.enter` | Enter |
-| `.space` | Space |
-| `.ctrl` | Ctrl |
-| `.cmd` | Cmd |
-| `.meta` | Cmd on Mac, Ctrl on Windows |
-| `.alt` | Alt |
-| `.up` `.down` `.left` `.right` | Up/Down/Left/Right arrows |
-| `.escape` | Escape |
-| `.tab` | Tab |
-| `.caps-lock` | Caps Lock |
-| `.equal` | Equal, `=` |
-| `.period` | Period, `.` |
-
-<a name="custom-events"></a>
-## Custom events
-
-Alpine event listeners are a wrapper for native DOM event listeners. Therefore, they can listen for ANY DOM event, including custom events.
-
-Here's an example of a component that dispatches a custom DOM event and listens for it as well.
-
-```alpine
-<div x-data @foo="alert('Button Was Clicked!')">
- <button @click="$event.target.dispatchEvent(new CustomEvent('foo', { bubbles: true }))">...</button>
-</div>
-```
-
-When the button is clicked, the `@foo` listener will be called.
-
-Because the `.dispatchEvent` API is verbose, Alpine offers a `$dispatch` helper to simplify things.
-
-Here's the same component re-written with the `$dispatch` magic property.
-
-```alpine
-<div x-data @foo="alert('Button Was Clicked!')">
- <button @click="$dispatch('foo')">...</button>
-</div>
-```
-
-[→ Read more about `$dispatch`](/magics/dispatch)
-
-<a name="modifiers"></a>
-## Modifiers
-
-Alpine offers a number of directive modifiers to customize the behavior of your event listeners.
-
-<a name="prevent"></a>
-### .prevent
-
-`.prevent` is the equivalent of calling `.preventDefault()` inside a listener on the browser event object.
-
-```alpine
-<form @submit.prevent="console.log('submitted')" action="/foo">
- <button>Submit</button>
-</form>
-```
-
-In the above example, with the `.prevent`, clicking the button will NOT submit the form to the `/foo` endpoint. Instead, Alpine's listener will handle it and "prevent" the event from being handled any further.
-
-<a name="stop"></a>
-### .stop
-
-Similar to `.prevent`, `.stop` is the equivalent of calling `.stopPropagation()` inside a listener on the browser event object.
-
-```alpine
-<div @click="console.log('I will not get logged')">
- <button @click.stop>Click Me</button>
-</div>
-```
-
-In the above example, clicking the button WON'T log the message. This is because we are stopping the propagation of the event immediately and not allowing it to "bubble" up to the `<div>` with the `@click` listener on it.
-
-<a name="outside"></a>
-### .outside
-
-`.outside` is a convenience helper for listening for a click outside of the element it is attached to. Here's a simple dropdown component example to demonstrate:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <div x-show="open" @click.outside="open = false">
- Contents...
- </div>
-</div>
-```
-
-In the above example, after showing the dropdown contents by clicking the "Toggle" button, you can close the dropdown by clicking anywhere on the page outside the content.
-
-This is because `.outside` is listening for clicks that DONT originate from the element it's registered on.
-
-> It's worth noting that the `.outside` expression will only be evaluated when the element it's registered on is visible on the page. Otherwise, there would be nasty race conditions where clicking the "Toggle" button would also fire the `@click.outside` handler when it is not visible.
-
-<a name="window"></a>
-### .window
-
-When the `.window` modifier is present, Alpine will register the event listener on the root `window` object on the page instead of the element itself.
-
-```alpine
-<div @keyup.escape.window="...">...</div>
-```
-
-The above snippet will listen for the "escape" key to be pressed ANYWHERE on the page.
-
-Adding `.window` to listeners is extremely useful for these sorts of cases where a small part of your markup is concerned with events that take place on the entire page.
-
-<a name="document"></a>
-### .document
-
-`.document` works similarly to `.window` only it registers listeners on the `document` global, instead of the `window` global.
-
-<a name="once"></a>
-### .once
-
-By adding `.once` to a listener, you are ensuring that the handler is only called ONCE.
-
-```alpine
-<button @click.once="console.log('I will only log once')">...</button>
-```
-
-<a name="debounce"></a>
-### .debounce
-
-Sometimes it is useful to "debounce" an event handler so that it only is called after a certain period of inactivity (250 milliseconds by default).
-
-For example if you have a search field that fires network requests as the user types into it, adding a debounce will prevent the network requests from firing on every single keystroke.
-
-```alpine
-<input @input.debounce="fetchResults">
-```
-
-Now, instead of calling `fetchResults` after every keystroke, `fetchResults` will only be called after 250 milliseconds of no keystrokes.
-
-If you wish to lengthen or shorten the debounce time, you can do so by trailing a duration after the `.debounce` modifier like so:
-
-```alpine
-<input @input.debounce.500ms="fetchResults">
-```
-
-Now, `fetchResults` will only be called after 500 milliseconds of inactivity.
-
-<a name="throttle"></a>
-### .throttle
-
-`.throttle` is similar to `.debounce` except it will release a handler call every 250 milliseconds instead of deferring it indefinitely.
-
-This is useful for cases where there may be repeated and prolonged event firing and using `.debounce` won't work because you want to still handle the event every so often.
-
-For example:
-
-```alpine
-<div @scroll.window.throttle="handleScroll">...</div>
-```
-
-The above example is a great use case of throttling. Without `.throttle`, the `handleScroll` method would be fired hundreds of times as the user scrolls down a page. This can really slow down a site. By adding `.throttle`, we are ensuring that `handleScroll` only gets called every 250 milliseconds.
-
-> Fun Fact: This exact strategy is used on this very documentation site to update the currently highlighted section in the right sidebar.
-
-<a name="self"></a>
-### .self
-
-By adding `.self` to an event listener, you are ensuring that the event originated on the element it is declared on, and not from a child element.
-
-```alpine
-<button @click.self="handleClick">
- Click Me
-
- <img src="...">
-</button>
-```
-
-In the above example, we have an `<img>` tag inside the `<button>` tag. Normally, any click originating within the `<button>` element (like on `<img>` for example), would be picked up by a `@click` listener on the button.
-
-However, in this case, because we've added a `.self`, only clicking the button itself will call `handleClick`. Only clicks originating on the `<img>` element will not be handled.
-
-<a name="camel"></a>
-### .camel
-
-```alpine
-<div @custom-event.camel="handleCustomEvent">
- ...
-</div>
-```
-
-Sometimes you may want to listen for camelCased events such as `customEvent` in our example. Because camelCasing inside HTML attributes is not supported, adding the `.camel` modifier is necessary for Alpine to camelCase the event name internally.
-
-By adding `.camel` in the above example, Alpine is now listening for `customEvent` instead of `custom-event`.
-
-<a name="passive"></a>
-### .passive
-
-Browsers optimize scrolling on pages to be fast and smooth even when JavaScript is being executed on the page. However, improperly implemented touch and wheel listeners can block this optimization and cause poor site performance.
-
-If you are listening for touch events, it's important to add `.passive` to your listeners to not block scroll performance.
-
-```alpine
-<div @touchstart.passive="...">...</div>
-```
-
-[→ Read more about passive listeners](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners)
diff --git a/alpinejs/packages/docs/src/en/directives/ref.md b/alpinejs/packages/docs/src/en/directives/ref.md
deleted file mode 100644
index f4d91dd..0000000
--- a/alpinejs/packages/docs/src/en/directives/ref.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-order: 11
-title: ref
----
-
-# `x-ref`
-
-`x-ref` in combination with `$refs` is a useful utility for easily accessing DOM elements directly. It's most useful as a replacement for APIs like `getElementById` and `querySelector`.
-
-```alpine
-<button @click="$refs.text.remove()">Remove Text</button>
-
-<span x-ref="text">Hello 👋</span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data>
- <button @click="$refs.text.remove()">Remove Text</button>
-
- <div class="pt-4" x-ref="text">Hello 👋</div>
- </div>
-</div>
-<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/directives/show.md b/alpinejs/packages/docs/src/en/directives/show.md
deleted file mode 100644
index aa3e314..0000000
--- a/alpinejs/packages/docs/src/en/directives/show.md
+++ /dev/null
@@ -1,39 +0,0 @@
----
-order: 3
-title: show
----
-
-# `x-show`
-
-`x-show` is one of the most useful and powerful directives in Alpine. It provides an expressive way to show and hide DOM elements.
-
-Here's an example of a simple dropdown component using `x-show`.
-
-```alpine
-<div x-data="{ open: false }">
- <button x-on:click="open = ! open">Toggle Dropdown</button>
-
- <div x-show="open">
- Dropdown Contents...
- </div>
-</div>
-```
-
-When the "Toggle Dropdown" button is clicked, the dropdown will show and hide accordingly.
-
-> If the "default" state of an `x-show` on page load is "false", you may want to use `x-cloak` on the page to avoid "page flicker" (The effect that happens when the browser renders your content before Alpine is finished initializing and hiding it.) You can learn more about `x-cloak` in its documentation.
-
-<a name="with-transitions"></a>
-## With transitions
-
-If you want to apply smooth transitions to the `x-show` behavior, you can use it in conjunction with `x-transition`. You can learn more about that directive [here](/directives/transition), but here's a quick example of the same component as above, just with transitions applied.
-
-```alpine
-<div x-data="{ open: false }">
- <button x-on:click="open = ! open">Toggle Dropdown</button>
-
- <div x-show="open" x-transition>
- Dropdown Contents...
- </div>
-</div>
-```
diff --git a/alpinejs/packages/docs/src/en/directives/text.md b/alpinejs/packages/docs/src/en/directives/text.md
deleted file mode 100644
index c42be95..0000000
--- a/alpinejs/packages/docs/src/en/directives/text.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-order: 6
-title: text
----
-
-# `x-text`
-
-`x-text` sets the text content of an element to the result of a given expression.
-
-Here's a basic example of using `x-text` to display a user's username.
-
-```alpine
-<div x-data="{ username: 'calebporzio' }">
- Username: <strong x-text="username"></strong>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ username: 'calebporzio' }">
- Username: <strong x-text="username"></strong>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now the `<strong>` tag's inner text content will be set to "calebporzio".
diff --git a/alpinejs/packages/docs/src/en/directives/transition.md b/alpinejs/packages/docs/src/en/directives/transition.md
deleted file mode 100644
index 581b5f1..0000000
--- a/alpinejs/packages/docs/src/en/directives/transition.md
+++ /dev/null
@@ -1,175 +0,0 @@
----
-order: 10
-title: transition
----
-
-# `x-transition`
-
-Alpine provides a robust transitions utility out of the box. With a few `x-transition` directives, you can create smooth transitions between when an element is shown or hidden.
-
-There are two primary ways to handle transitions in Alpine:
-
-* [The Transition Helper]()
-* [Applying CSS Classes]()
-
-<a name="the-transition-helper"></a>
-## The transition helper
-
-The simplest way to achieve a transition using Alpine is by adding `x-transition` to an element with `x-show` on it. For example:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <span x-show="open" x-transition>
- Hello 👋
- </span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <span x-show="open" x-transition>
- Hello 👋
- </span>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-As you can see, by default, `x-transition` applies pleasant transition defaults to fade and scale the revealing element.
-
-You can override these defaults with modifiers attached to `x-transition`. Let's take a look at those.
-
-<a name="customizing-duration"></a>
-### Customizing duration
-
-You can configure the duration you want for a transition with the `.duration` modifier:
-
-```alpine
-<div ... x-transition.duration.500ms>
-```
-
-The above `<div>` will transition for 500 milliseconds when entering, and 250 milliseconds when leaving.
-
-This difference in duration generally desirable default. If you wish to customize the durations specifically for entering and leaving, you can do that like so:
-
-```alpine
-<div ...
- x-transition:enter.duration.500ms
- x-transition:leave.duration.400ms
->
-```
-
-<a name="customizing-delay"></a>
-### Customizing delay
-
-You can delay a transition using the `.delay` modifier like so:
-
-```alpine
-<div ... x-transition.delay.50ms>
-```
-
-The above example will delay the transition and in and out of the element by 50 milliseconds.
-
-<a name="customizing-opacity"></a>
-### Customizing opacity
-
-By default, Alpine's `x-transition` applies both a scale and opacity transition to achieve a "fade" effect.
-
-If you wish to only apply the opacity transition (no scale), you can accomplish that like so:
-
-```alpine
-<div ... x-transition.opacity>
-```
-
-<a name="customizing-scale"></a>
-### Customizing scale
-
-Similar to the `.opacity` modifier, you can configure `x-transition` to ONLY scale (and not transition opacity as well) like so:
-
-```alpine
-<div ... x-transition.scale>
-```
-
-The `.scale` modifier also offers the ability to configure its scale values AND its origin values:
-
-```alpine
-<div ... x-transition.scale.80>
-```
-
-The above snippet will scale the element up and down by 80%.
-
-Again, you may customize these values separately for enter and leaving transitions like so:
-
-```alpine
-<div ...
- x-transition:enter.scale.80
- x-transition:leave.scale.90
->
-```
-
-To customize the origin of the scale transition, you can use the `.origin` modifier:
-
-```alpine
-<div ... x-transition.scale.origin.top>
-```
-
-Now the scale will be applied using the top of the element as the origin, instead of the center by default.
-
-Like you may have guessed, the possible values for this customization are: `top`, `bottom`, `left`, and `right`.
-
-If you wish, you can also combine two origin values. For example, if you want the origin of the scale to be "top right", you can use: `.origin.top.right` as the modifier.
-
-
-<a name="applying-css-classes"></a>
-## Applying CSS classes
-
-For direct control over exactly what goes into your transitions, you can apply CSS classes at different stages of the transition.
-
-> The following examples use [TailwindCSS](https://tailwindcss.com/docs/transition-property) utility classes.
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <div
- x-show="open"
- x-transition:enter="transition ease-out duration-300"
- x-transition:enter-start="opacity-0 transform scale-90"
- x-transition:enter-end="opacity-100 transform scale-100"
- x-transition:leave="transition ease-in duration-300"
- x-transition:leave-start="opacity-100 transform scale-100"
- x-transition:leave-end="opacity-0 transform scale-90"
- >Hello 👋</div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <div
- x-show="open"
- x-transition:enter="transition ease-out duration-300"
- x-transition:enter-start="opacity-0 transform scale-90"
- x-transition:enter-end="opacity-100 transform scale-100"
- x-transition:leave="transition ease-in duration-300"
- x-transition:leave-start="opacity-100 transform scale-100"
- x-transition:leave-end="opacity-0 transform scale-90"
- >Hello 👋</div>
-</div>
-</div>
-<!-- END_VERBATIM -->
-
-| Directive | Description |
-| --- | --- |
-| `:enter` | Applied during the entire entering phase. |
-| `:enter-start` | Added before element is inserted, removed one frame after element is inserted. |
-| `:enter-end` | Added one frame after element is inserted (at the same time `enter-start` is removed), removed when transition/animation finishes.
-| `:leave` | Applied during the entire leaving phase. |
-| `:leave-start` | Added immediately when a leaving transition is triggered, removed after one frame. |
-| `:leave-end` | Added one frame after a leaving transition is triggered (at the same time `leave-start` is removed), removed when the transition/animation finishes.
diff --git a/alpinejs/packages/docs/src/en/essentials.md b/alpinejs/packages/docs/src/en/essentials.md
deleted file mode 100644
index 017c4d4..0000000
--- a/alpinejs/packages/docs/src/en/essentials.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-order: 3
-title: Essentials
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/essentials/events.md b/alpinejs/packages/docs/src/en/essentials/events.md
deleted file mode 100644
index 10b15a1..0000000
--- a/alpinejs/packages/docs/src/en/essentials/events.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-order: 4
-title: Events
----
-
-# Events
-
-Alpine makes it simple to listen for browser events and react to them.
-
-<a name="listening-for-simple-events"></a>
-## Listening for simple events
-
-By using `x-on`, you can listen for browser events that are dispatched on or within an element.
-
-Here's a basic example of listening for a click on a button:
-
-```alpine
-<button x-on:click="console.log('clicked')">...</button>
-```
-
-As an alternative, you can use the event shorthand syntax if you prefer: `@`. Here's the same example as before, but using the shorthand syntax (which we'll be using from now on):
-
-```alpine
-<button @click="...">...</button>
-```
-
-In addition to `click`, you can listen for any browser event by name. For example: `@mouseenter`, `@keyup`, etc... are all valid syntax.
-
-<a name="listening-for-specific-keys"></a>
-## Listening for specific keys
-
-Let's say you wanted to listen for the `enter` key to be pressed inside an `<input>` element. Alpine makes this easy by adding the `.enter` like so:
-
-```alpine
-<input @keyup.enter="...">
-```
-
-You can even combine key modifiers to listen for key combinations like pressing `enter` while holding `shift`:
-
-```alpine
-<input @keyup.shift.enter="...">
-```
-
-<a name="preventing-default"></a>
-## Preventing default
-
-When reacting to browser events, it is often necessary to "prevent default" (prevent the default behavior of the browser event).
-
-For example, if you want to listen for a form submission but prevent the browser from submitting a form request, you can use `.prevent`:
-
-```alpine
-<form @submit.prevent="...">...</form>
-```
-
-You can also apply `.stop` to achieve the equivalent of `event.stopPropagation()`.
-
-<a name="accessing-the-event-object"></a>
-## Accessing the event object
-
-Sometimes you may want to access the native browser event object inside your own code. To make this easy, Alpine automatically injects an `$event` magic variable:
-
-```alpine
-<button @click="$event.target.remove()">Remove Me</button>
-```
-
-<a name="dispatching-custom-events"></a>
-## Dispatching custom events
-
-In addition to listening for browser events, you can dispatch them as well. This is extremely useful for communicating with other Alpine components or triggering events in tools outside of Alpine itself.
-
-Alpine exposes a magic helper called `$dispatch` for this:
-
-```alpine
-<div @foo="console.log('foo was dispatched')">
- <button @click="$dispatch('foo')"></button>
-</div>
-```
-
-As you can see, when the button is clicked, Alpine will dispatch a browser event called "foo", and our `@foo` listener on the `<div>` will pick it up and react to it.
-
-<a name="listening-for-events-on-window"></a>
-## Listening for events on window
-
-Because of the nature of events in the browser, it is sometimes useful to listen to events on the top-level window object.
-
-This allows you to communicate across components completely like the following example:
-
-
-```alpine
-<div x-data>
- <button @click="$dispatch('foo')"></button>
-</div>
-
-<div x-data @foo.window="console.log('foo was dispatched')">...</div>
-```
-
-In the above example, if we click the button in the first component, Alpine will dispatch the "foo" event. Because of the way events work in the browser, they "bubble" up through parent elements all the way to the top-level "window".
-
-Now, because in our second component we are listening for "foo" on the window (with `.window`), when the button is clicked, this listener will pick it up and log the "foo was dispatched" message.
-
-[→ Read more about x-on](/directives/on)
diff --git a/alpinejs/packages/docs/src/en/essentials/installation.md b/alpinejs/packages/docs/src/en/essentials/installation.md
deleted file mode 100644
index b2b6f6a..0000000
--- a/alpinejs/packages/docs/src/en/essentials/installation.md
+++ /dev/null
@@ -1,68 +0,0 @@
----
-order: 1
-title: Installation
----
-
-# Installation
-
-There are 2 ways to include Alpine into your project:
-
-* Including it from a `<script>` tag
-* Importing it as a module
-
-Either is perfectly valid. It all depends on the project's needs and the developer's taste.
-
-<a name="from-a-script-tag"></a>
-## From a script tag
-
-This is by far the simplest way to get started with Alpine. Include the following `<script>` tag in the head of your HTML page.
-
-```alpine
-<html>
- <head>
- ...
-
- <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
- </head>
- ...
-</html>
-```
-
-> Don't forget the "defer" attribute in the `<script>` tag.
-
-Notice the `@3.x.x` in the provided CDN link. This will pull the latest version of Alpine version 3. For stability in production, it's recommended that you hardcode the latest version in the CDN link.
-
-```alpine
-<script defer src="https://unpkg.com/alpinejs@3.4.2/dist/cdn.min.js"></script>
-```
-
-That's it! Alpine is now available for use inside your page.
-
-<a name="as-a-module"></a>
-## As a module
-
-If you prefer the more robust approach, you can install Alpine via NPM and import it into a bundle.
-
-Run the following command to install it.
-
-```shell
-npm install alpinejs
-```
-
-Now import Alpine into your bundle and initialize it like so:
-
-```js
-import Alpine from 'alpinejs'
-
-window.Alpine = Alpine
-
-Alpine.start()
-```
-
-> The `window.Alpine = Alpine` bit is optional, but is nice to have for freedom and flexibility. Like when tinkering with Alpine from the devtools for example.
-
-
-> If you imported Alpine into a bundle, you have to make sure you are registering any extension code IN BETWEEN when you import the `Alpine` global object, and when you initialize Alpine by calling `Alpine.start()`.
-
-
-[→ Read more about extending Alpine](/advanced/extending)
diff --git a/alpinejs/packages/docs/src/en/essentials/lifecycle.md b/alpinejs/packages/docs/src/en/essentials/lifecycle.md
deleted file mode 100644
index 6e89310..0000000
--- a/alpinejs/packages/docs/src/en/essentials/lifecycle.md
+++ /dev/null
@@ -1,96 +0,0 @@
----
-order: 5
-title: Lifecycle
----
-
-# Lifecycle
-
-Alpine has a handful of different techniques for hooking into different parts of its lifecycle. Let's go through the most useful ones to familiarize yourself with:
-
-<a name="element-initialization"></a>
-## Element initialization
-
-Another extremely useful lifecycle hook in Alpine is the `x-init` directive.
-
-`x-init` can be added to any element on a page and will execute any JavaScript you call inside it when Alpine begins initializing that element.
-
-```alpine
-<button x-init="console.log('Im initing')">
-```
-
-In addition to the directive, Alpine will automatically call any `init()` methods stored on a data object. For example:
-
-```js
-Alpine.data('dropdown', () => ({
- init() {
- // I get called before the element using this data initializes.
- }
-}))
-```
-
-<a name="after-a-state-change"></a>
-## After a state change
-
-Alpine allows you to execute code when a piece of data (state) changes. It offers two different APIs for such a task: `$watch` and `x-effect`.
-
-<a name="watch"></a>
-### `$watch`
-
-```alpine
-<div x-data="{ open: false }" x-init="$watch('open', value => console.log(value))">
-```
-
-As you can see above, `$watch` allows you to hook into data changes using a dot-notation key. When that piece of data changes, Alpine will call the passed callback and pass it the new value. along with the old value before the change.
-
-[→ Read more about $watch](/magics/watch)
-
-<a name="x-effect"></a>
-### `x-effect`
-
-`x-effect` uses the same mechanism under the hood as `$watch` but has very different usage.
-
-Instead of specifying which data key you wish to watch, `x-effect` will call the provided code and intelligently look for any Alpine data used within it. Now when one of those pieces of data changes, the `x-effect` expression will be re-run.
-
-Here's the same bit of code from the `$watch` example rewritten using `x-effect`:
-
-```alpine
-<div x-data="{ open: false }" x-effect="console.log(open)">
-```
-
-Now, this expression will be called right away, and re-called every time `open` is updated.
-
-The two main behavioral differences with this approach are:
-
-1. The provided code will be run right away AND when data changes (`$watch` is "lazy" -- won't run until the first data change)
-2. No knowledge of the previous value. (The callback provided to `$watch` receives both the new value AND the old one)
-
-[→ Read more about x-effect](/directives/effect)
-
-<a name="alpine-initialization"></a>
-## Alpine initialization
-
-<a name="alpine-initializing"></a>
-### `Alpine.initializing`
-
-Ensuring a bit of code executes after Alpine is loaded, but BEFORE it initializes itself on the page is a necessary task.
-
-This hook allows you to register custom data, directives, magics, etc. before Alpine does its thing on a page.
-
-You can hook into this point in the lifecycle by listening for an event that Alpine dispatches called: `alpine:init`
-
-```js
-document.addEventListener('alpine:init', () => {
- Alpine.data(...)
-})
-```
-
-<a name="alpine-initialized"></a>
-### `Alpine.initialized`
-
-Alpine also offers a hook that you can use to execute code After it's done initializing called `alpine:initialized`:
-
-```js
-document.addEventListener('alpine:initialized', () => {
- //
-})
-```
diff --git a/alpinejs/packages/docs/src/en/essentials/state.md b/alpinejs/packages/docs/src/en/essentials/state.md
deleted file mode 100644
index fd1f39b..0000000
--- a/alpinejs/packages/docs/src/en/essentials/state.md
+++ /dev/null
@@ -1,133 +0,0 @@
----
-order: 2
-title: State
----
-
-# State
-
-State (JavaScript data that Alpine watches for changes) is at the core of everything you do in Alpine. You can provide local data to a chunk of HTML, or make it globally available for use anywhere on a page using `x-data` or `Alpine.store()` respectively.
-
-<a name="local-state-x-data"></a>
-## Local state
-
-Alpine allows you to declare an HTML block's state in a single `x-data` attribute without ever leaving your markup.
-
-Here's a basic example:
-
-```alpine
-<div x-data="{ open: false }">
- ...
-</div>
-```
-
-Now any other Alpine syntax on or within this element will be able to access `open`. And like you'd guess, when `open` changes for any reason, everything that depends on it will react automatically.
-
-[→ Read more about `x-data`](/directives/data)
-
-<a name="nesting-data"></a>
-### Nesting data
-
-Data is nestable in Alpine. For example, if you have two elements with Alpine data attached (one inside the other), you can access the parent's data from inside the child element.
-
-```alpine
-<div x-data="{ open: false }">
- <div x-data="{ label: 'Content:' }">
- <span x-text="label"></span>
- <span x-show="open"></span>
- </div>
-</div>
-```
-
-This is similar to scoping in JavaScript itself (code within a function can access variables declared outside that function.)
-
-Like you may have guessed, if the child has a data property matching the name of a parent's property, the child property will take precedence.
-
-<a name="single-element-data"></a>
-### Single-element data
-
-Although this may seem obvious to some, it's worth mentioning that Alpine data can be used within the same element. For example:
-
-```alpine
-<button x-data="{ label: 'Click Here' }" x-text="label"></button>
-```
-
-<a name="data-less-alpine"></a>
-### Data-less Alpine
-
-Sometimes you may want to use Alpine functionality, but don't need any reactive data. In these cases, you can opt-out of passing an expression to `x-data` entirely. For example:
-
-```alpine
-<button x-data @click="alert('I\'ve been clicked!')">Click Me</button>
-```
-
-<a name="re-usable-data"></a>
-### Re-usable data
-
-When using Alpine, you may find the need to re-use a chunk of data and/or its corresponding template.
-
-If you are using a backend framework like Rails or Laravel, Alpine first recommends that you extract the entire block of HTML into a template partial or include.
-
-If for some reason that isn't ideal for you or you're not in a back-end templating environment, Alpine allows you to globally register and re-use the data portion of a component using `Alpine.data(...)`.
-
-```js
-Alpine.data('dropdown', () => ({
- open: false,
-
- toggle() {
- this.open = ! this.open
- }
-}))
-```
-
-Now that you've registered the "dropdown" data, you can use it inside your markup in as many places as you like:
-
-```alpine
-<div x-data="dropdown">
- <button @click="toggle">Expand</button>
-
- <span x-show="open">Content...</span>
-</div>
-
-<div x-data="dropdown">
- <button @click="toggle">Expand</button>
-
- <span x-show="open">Some Other Content...</span>
-</div>
-```
-
-[→ Read more about using `Alpine.data()`](/globals/alpine-data)
-
-<a name="global-state"></a>
-## Global state
-
-If you wish to make some data available to every component on the page, you can do so using Alpine's "global store" feature.
-
-You can register a store using `Alpine.store(...)`, and reference one with the magic `$store()` method.
-
-Let's look at a simple example. First we'll register the store globally:
-
-```js
-Alpine.store('tabs', {
- current: 'first',
-
- items: ['first', 'second', 'third'],
-})
-```
-
-Now we can access or modify its data from anywhere on our page:
-
-```alpine
-<div x-data>
- <template x-for="tab in $store.tabs.items">
- ...
- </template>
-</div>
-
-<div x-data>
- <button @click="$store.tabs.current = 'first'">First Tab</button>
- <button @click="$store.tabs.current = 'second'">Second Tab</button>
- <button @click="$store.tabs.current = 'third'">Third Tab</button>
-</div>
-```
-
-[→ Read more about `Alpine.store()`](/globals/alpine-store)
diff --git a/alpinejs/packages/docs/src/en/essentials/templating.md b/alpinejs/packages/docs/src/en/essentials/templating.md
deleted file mode 100644
index 19f7eea..0000000
--- a/alpinejs/packages/docs/src/en/essentials/templating.md
+++ /dev/null
@@ -1,368 +0,0 @@
----
-order: 3
-title: Templating
----
-
-# Templating
-
-Alpine offers a handful of useful directives for manipulating the DOM on a web page.
-
-Let's cover a few of the basic templating directives here, but be sure to look through the available directives in the sidebar for an exhaustive list.
-
-<a name="text-content"></a>
-## Text content
-
-Alpine makes it easy to control the text content of an element with the `x-text` directive.
-
-```alpine
-<div x-data="{ title: 'Start Here' }">
- <h1 x-text="title"></h1>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ title: 'Start Here' }" class="demo">
- <strong x-text="title"></strong>
-</div>
-<!-- END_VERBATIM -->
-
-Now, Alpine will set the text content of the `<h1>` with the value of `title` ("Start Here"). When `title` changes, so will the contents of `<h1>`.
-
-Like all directives in Alpine, you can use any JavaScript expression you like. For example:
-
-```alpine
-<span x-text="1 + 2"></span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo" x-data>
- <span x-text="1 + 2"></span>
-</div>
-<!-- END_VERBATIM -->
-
-The `<span>` will now contain the sum of "1" and "2".
-
-[→ Read more about `x-text`](/directives/text)
-
-<a name="toggling-elements"></a>
-## Toggling elements
-
-Toggling elements is a common need in web pages and applications. Dropdowns, modals, dialogues, "show-more"s, etc... are all good examples.
-
-Alpine offers the `x-show` and `x-if` directives for toggling elements on a page.
-
-<a name="x-show"></a>
-### `x-show`
-
-Here's a simple toggle component using `x-show`.
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Expand</button>
-
- <div x-show="open">
- Content...
- </div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open" :aria-pressed="open">Expand</button>
-
- <div x-show="open">
- Content...
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now the entire `<div>` containing the contents will be shown and hidden based on the value of `open`.
-
-Under the hood, Alpine adds the CSS property `display: none;` to the element when it should be hidden.
-
-[→ Read more about `x-show`](/directives/show)
-
-This works well for most cases, but sometimes you may want to completely add and remove the element from the DOM entirely. This is what `x-if` is for.
-
-<a name="x-if"></a>
-### `x-if`
-
-Here is the same toggle from before, but this time using `x-if` instead of `x-show`.
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Expand</button>
-
- <template x-if="open">
- <div>
- Content...
- </div>
- </template>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open" :aria-pressed="open">Expand</button>
-
- <template x-if="open">
- <div>
- Content...
- </div>
- </template>
-</div>
-<!-- END_VERBATIM -->
-
-Notice that `x-if` must be declared on a `<template>` tag. This is so that Alpine can leverage the existing browser behavior of the `<template>` element and use it as the source of the target `<div>` to be added and removed from the page.
-
-When `open` is true, Alpine will append the `<div>` to the `<template>` tag, and remove it when `open` is false.
-
-[→ Read more about `x-if`](/directives/if)
-
-<a name="toggling-with-transitions"></a>
-## Toggling with transitions
-
-Alpine makes it simple to smoothly transition between "shown" and "hidden" states using the `x-transition` directive.
-
-> `x-transition` only works with `x-show`, not with `x-if`.
-
-Here is, again, the simple toggle example, but this time with transitions applied:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Expands</button>
-
- <div x-show="open" x-transition>
- Content...
- </div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open">Expands</button>
-
- <div class="flex">
- <div x-show="open" x-transition style="will-change: transform;">
- Content...
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Let's zoom in on the portion of the template dealing with transitions:
-
-```alpine
-<div x-show="open" x-transition>
-```
-
-`x-transition` by itself will apply sensible default transitions (fade and scale) to the toggle.
-
-There are two ways to customize these transitions:
-
-* Transition helpers
-* Transition CSS classes.
-
-Let's take a look at each of these approaches:
-
-<a name="transition-helpers"></a>
-### Transition helpers
-
-Let's say you wanted to make the duration of the transition longer, you can manually specify that using the `.duration` modifier like so:
-
-```alpine
-<div x-show="open" x-transition.duration.500ms>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open">Expands</button>
-
- <div class="flex">
- <div x-show="open" x-transition.duration.500ms style="will-change: transform;">
- Content...
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now the transition will last 500 milliseconds.
-
-If you want to specify different values for in and out transitions, you can use `x-transition:enter` and `x-transition:leave`:
-
-```alpine
-<div
- x-show="open"
- x-transition:enter.duration.500ms
- x-transition:leave.duration.1000ms
->
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open">Expands</button>
-
- <div class="flex">
- <div x-show="open" x-transition:enter.duration.500ms x-transition:leave.duration.1000ms style="will-change: transform;">
- Content...
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Additionally, you can add either `.opacity` or `.scale` to only transition that property. For example:
-
-```alpine
-<div x-show="open" x-transition.opacity>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open">Expands</button>
-
- <div class="flex">
- <div x-show="open" x-transition:enter.opacity.duration.500 x-transition:leave.opacity.duration.250>
- Content...
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-[→ Read more about transition helpers](/directives/transition#the-transition-helper)
-
-<a name="transition-classes"></a>
-### Transition classes
-
-If you need more fine-grained control over the transitions in your application, you can apply specific CSS classes at specific phases of the transition using the following syntax (this example uses [Tailwind CSS](https://tailwindcss.com/)):
-
-```alpine
-<div
- x-show="open"
- x-transition:enter="transition ease-out duration-300"
- x-transition:enter-start="opacity-0 transform scale-90"
- x-transition:enter-end="opacity-100 transform scale-100"
- x-transition:leave="transition ease-in duration-300"
- x-transition:leave-start="opacity-100 transform scale-100"
- x-transition:leave-end="opacity-0 transform scale-90"
->...</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <button @click="open = ! open">Expands</button>
-
- <div class="flex">
- <div
- x-show="open"
- x-transition:enter="transition ease-out duration-300"
- x-transition:enter-start="opacity-0 transform scale-90"
- x-transition:enter-end="opacity-100 transform scale-100"
- x-transition:leave="transition ease-in duration-300"
- x-transition:leave-start="opacity-100 transform scale-100"
- x-transition:leave-end="opacity-0 transform scale-90"
- style="will-change: transform"
- >
- Content...
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-[→ Read more about transition classes](/directives/transition#applying-css-classes)
-
-<a name="binding-attributes"></a>
-## Binding attributes
-
-You can add HTML attributes like `class`, `style`, `disabled`, etc... to elements in Alpine using the `x-bind` directive.
-
-Here is an example of a dynamically bound `class` attribute:
-
-```alpine
-<button
- x-data="{ red: false }"
- x-bind:class="red ? 'bg-red' : ''"
- @click="red = ! red"
->
- Toggle Red
-</button>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <button
- x-data="{ red: false }"
- x-bind:style="red && 'background: red'"
- @click="red = ! red"
- >
- Toggle Red
- </button>
-</div>
-<!-- END_VERBATIM -->
-
-
-As a shortcut, you can leave out the `x-bind` and use the shorthand `:` syntax directly:
-
-```alpine
-<button ... :class="red ? 'bg-red' : ''>"
-```
-
-Toggling classes on and off based on data inside Alpine is a common need. Here's an example of toggling a class using Alpine's `class` binding object syntax: (Note: this syntax is only available for `class` attributes)
-
-```alpine
-<div x-data="{ open: true }">
- <span :class="{ 'hidden': ! open }">...</span>
-</div>
-```
-
-Now the `hidden` class will be added to the element if `open` is false, and removed if `open` is true.
-
-<a name="looping-elements"></a>
-## Looping elements
-
-Alpine allows for iterating parts of your template based on JavaScript data using the `x-for` directive. Here is a simple example:
-
-```alpine
-<div x-data="{ statuses: ['open', 'closed', 'archived'] }">
- <template x-for="status in statuses">
- <div x-text="status"></div>
- </template>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ statuses: ['open', 'closed', 'archived'] }" class="demo">
- <template x-for="status in statuses">
- <div x-text="status"></div>
- </template>
-</div>
-<!-- END_VERBATIM -->
-
-Similar to `x-if`, `x-for` must be applied to a `<template>` tag. Internally, Alpine will append the contents of `<template>` tag for every iteration in the loop.
-
-As you can see the new `status` variable is available in the scope of the iterated templates.
-
-[→ Read more about `x-for`](/directives/for)
-
-<a name="inner-html"></a>
-## Inner HTML
-
-Alpine makes it easy to control the HTML content of an element with the `x-html` directive.
-
-```alpine
-<div x-data="{ title: '<h1>Start Here</h1>' }">
- <div x-html="title"></div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ title: '<h1>Start Here</h1>' }" class="demo">
- <div x-html="title"></div>
-</div>
-<!-- END_VERBATIM -->
-
-Now, Alpine will set the text content of the `<div>` with the element `<h1>Start Here</h1>`. When `title` changes, so will the contents of `<h1>`.
-
-> ⚠️ Only use on trusted content and never on user-provided content. ⚠️
-> Dynamically rendering HTML from third parties can easily lead to XSS vulnerabilities.
-
-[→ Read more about `x-html`](/directives/html)
diff --git a/alpinejs/packages/docs/src/en/globals.md b/alpinejs/packages/docs/src/en/globals.md
deleted file mode 100644
index f96ce88..0000000
--- a/alpinejs/packages/docs/src/en/globals.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-order: 6
-title: Globals
-font-type: mono
-prefix: Alpine.
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/globals/alpine-data.md b/alpinejs/packages/docs/src/en/globals/alpine-data.md
deleted file mode 100644
index 77246a5..0000000
--- a/alpinejs/packages/docs/src/en/globals/alpine-data.md
+++ /dev/null
@@ -1,136 +0,0 @@
----
-order: 1
-title: data()
----
-
-# `Alpine.data`
-
-`Alpine.data(...)` provides a way to re-use `x-data` contexts within your application.
-
-Here's a contrived `dropdown` component for example:
-
-```alpine
-<div x-data="dropdown">
- <button @click="toggle">...</button>
-
- <div x-show="open">...</div>
-</div>
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.data('dropdown', () => ({
- open: false,
-
- toggle() {
- this.open = ! this.open
- }
- }))
- })
-</script>
-```
-
-As you can see we've extracted the properties and methods we would usually define directly inside `x-data` into a separate Alpine component object.
-
-<a name="registering-from-a-bundle"></a>
-## Registering from a bundle
-
-If you've chosen to use a build step for your Alpine code, you should register your components in the following way:
-
-```js
-import Alpine from `alpinejs`
-import dropdown from './dropdown.js'
-
-Alpine.data('dropdown', dropdown)
-
-Alpine.start()
-```
-
-This assumes you have a file called `dropdown.js` with the following contents:
-
-```js
-export default () => ({
- open: false,
-
- toggle() {
- this.open = ! this.open
- }
-})
-```
-
-<a name="initial-parameters"></a>
-## Initial parameters
-
-In addition to referencing `Alpine.data` providers by their name plainly (like `x-data="dropdown"`), you can also reference them as functions (`x-data="dropdown()"`). By calling them as functions directly, you can pass in additional parameters to be used when creating the initial data object like so:
-
-```alpine
-<div x-data="dropdown(true)">
-```
-```js
-Alpine.data('dropdown', (initialOpenState = false) => ({
- open: initialOpenState
-}))
-```
-
-Now, you can re-use the `dropdown` object, but provide it with different parameters as you need to.
-
-<a name="init-functions"></a>
-## Init functions
-
-If your component contains an `init()` method, Alpine will automatically execute it before it renders the component. For example:
-
-```js
-Alpine.data('dropdown', () => ({
- init() {
- // This code will be executed before Alpine
- // initializes the rest of the component.
- }
-}))
-```
-
-<a name="using-magic-properties"></a>
-## Using magic properties
-
-If you want to access magic methods or properties from a component object, you can do so using the `this` context:
-
-```js
-Alpine.data('dropdown', () => ({
- open: false,
-
- init() {
- this.$watch('open', () => {...})
- }
-}))
-```
-
-<a name="encapsulating-directives-with-x-bind"></a>
-## Encapsulating directives with `x-bind`
-
-If you wish to re-use more than just the data object of a component, you can encapsulate entire Alpine template directives using `x-bind`.
-
-The following is an example of extracting the templating details of our previous dropdown component using `x-bind`:
-
-```alpine
-<div x-data="dropdown">
- <button x-bind="trigger"></button>
-
- <div x-bind="dialogue"></div>
-</div>
-```
-
-```js
-Alpine.data('dropdown', () => ({
- open: false,
-
- trigger: {
- ['@click']() {
- this.open = ! this.open
- },
- },
-
- dialogue: {
- ['x-show']() {
- return this.open
- },
- },
-}))
-```
diff --git a/alpinejs/packages/docs/src/en/globals/alpine-store.md b/alpinejs/packages/docs/src/en/globals/alpine-store.md
deleted file mode 100644
index 3366268..0000000
--- a/alpinejs/packages/docs/src/en/globals/alpine-store.md
+++ /dev/null
@@ -1,115 +0,0 @@
----
-order: 2
-title: store()
----
-
-# `Alpine.store`
-
-Alpine offers global state management through the `Alpine.store()` API.
-
-<a name="registering-a-store"></a>
-## Registering A Store
-
-You can either define an Alpine store inside of an `alpine:init` listener (in the case of including Alpine via a `<script>` tag), OR you can define it before manually calling `Alpine.start()` (in the case of importing Alpine into a build):
-
-**From a script tag:**
-```alpine
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.store('darkMode', {
- on: false,
-
- toggle() {
- this.on = ! this.on
- }
- })
- })
-</script>
-```
-
-**From a bundle:**
-```js
-import Alpine from 'alpinejs'
-
-Alpine.store('darkMode', {
- on: false,
-
- toggle() {
- this.on = ! this.on
- }
-})
-
-Alpine.start()
-```
-
-<a name="accessing stores"></a>
-## Accessing stores
-
-You can access data from any store within Alpine expressions using the `$store` magic property:
-
-```alpine
-<div x-data :class="$store.darkMode.on && 'bg-black'">...</div>
-```
-
-You can also modify properties within the store and everything that depends on those properties will automatically react. For example:
-
-```alpine
-<button x-data @click="$store.darkMode.toggle()">Toggle Dark Mode</button>
-```
-
-Additionally, you can access a store externally using `Alpine.store()` by omitting the second parameter like so:
-
-```alpine
-<script>
- Alpine.store('darkMode').toggle()
-</script>
-```
-
-<a name="initializing-stores"></a>
-## Initializing stores
-
-If you provide `init()` method in an Alpine store, it will be executed right after the store is registered. This is useful for initializing any state inside the store with sensible starting values.
-
-```alpine
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.store('darkMode', {
- init() {
- this.on = window.matchMedia('(prefers-color-scheme: dark)').matches
- },
-
- on: false,
-
- toggle() {
- this.on = ! this.on
- }
- })
- })
-</script>
-```
-
-Notice the newly added `init()` method in the example above. With this addition, the `on` store variable will be set to the browser's color scheme preference before Alpine renders anything on the page.
-
-<a name="single-value-stores"></a>
-## Single-value stores
-
-If you don't need an entire object for a store, you can set and use any kind of data as a store.
-
-Here's the example from above but using it more simply as a boolean value:
-
-```alpine
-<button x-data @click="$store.darkMode = ! $store.darkMode">Toggle Dark Mode</button>
-
-...
-
-<div x-data :class="$store.darkMode && 'bg-black'">
- ...
-</div>
-
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.store('darkMode', false)
- })
-</script>
-```
diff --git a/alpinejs/packages/docs/src/en/magics.md b/alpinejs/packages/docs/src/en/magics.md
deleted file mode 100644
index dcef517..0000000
--- a/alpinejs/packages/docs/src/en/magics.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-order: 5
-title: Magics
-prefix: $
-font-type: mono
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/magics/dispatch.md b/alpinejs/packages/docs/src/en/magics/dispatch.md
deleted file mode 100644
index 47eddbd..0000000
--- a/alpinejs/packages/docs/src/en/magics/dispatch.md
+++ /dev/null
@@ -1,106 +0,0 @@
----
-order: 5
-title: dispatch
----
-
-# `$dispatch`
-
-`$dispatch` is a helpful shortcut for dispatching browser events.
-
-```alpine
-<div @notify="alert('Hello World!')">
- <button @click="$dispatch('notify')">
- Notify
- </button>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data @notify="alert('Hello World!')">
- <button @click="$dispatch('notify')">
- Notify
- </button>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-You can also pass data along with the dispatched event if you wish. This data will be accessible as the `.detail` property of the event:
-
-```alpine
-<div @notify="alert($event.detail.message)">
- <button @click="$dispatch('notify', { message: 'Hello World!' })">
- Notify
- </button>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data @notify="alert($event.detail.message)">
- <button @click="$dispatch('notify', { message: 'Hello World!' })">Notify</button>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-
-Under the hood, `$dispatch` is a wrapper for the more verbose API: `element.dispatchEvent(new CustomEvent(...))`
-
-**Note on event propagation**
-
-Notice that, because of [event bubbling](https://en.wikipedia.org/wiki/Event_bubbling), when you need to capture events dispatched from nodes that are under the same nesting hierarchy, you'll need to use the [`.window`](https://github.com/alpinejs/alpine#x-on) modifier:
-
-**Example:**
-
-```alpine
-<!-- 🚫 Won't work -->
-<div x-data>
- <span @notify="..."></span>
- <button @click="$dispatch('notify')">
-<div>
-
-<!-- ✅ Will work (because of .window) -->
-<div x-data>
- <span @notify.window="..."></span>
- <button @click="$dispatch('notify')">
-<div>
-```
-
-> The first example won't work because when `custom-event` is dispatched, it'll propagate to its common ancestor, the `div`, not it's sibling, the `<span>`. The second example will work because the sibling is listening for `notify` at the `window` level, which the custom event will eventually bubble up to.
-
-<a name="dispatching-to-components"></a>
-## Dispatching to other components
-
-You can also take advantage of the previous technique to make your components talk to each other:
-
-**Example:**
-
-```alpine
-<div
- x-data="{ title: 'Hello' }"
- @set-title.window="title = $event.detail"
->
- <h1 x-text="title"></h1>
-</div>
-
-<div x-data>
- <button @click="$dispatch('set-title', 'Hello World!')">...</button>
-</div>
-<!-- When clicked, the content of the h1 will set to "Hello World!". -->
-```
-
-<a name="dispatching-to-x-model"></a>
-## Dispatching to x-model
-
-You can also use `$dispatch()` to trigger data updates for `x-model` data bindings. For example:
-
-```alpine
-<div x-data="{ title: 'Hello' }">
- <span x-model="title">
- <button @click="$dispatch('input', 'Hello World!')">
- <!-- After the button is pressed, `x-model` will catch the bubbling "input" event, and update title. -->
- </span>
-</div>
-```
-
-This opens up the door for making custom input components who's value can be set via `x-model`.
diff --git a/alpinejs/packages/docs/src/en/magics/el.md b/alpinejs/packages/docs/src/en/magics/el.md
deleted file mode 100644
index b5e1ead..0000000
--- a/alpinejs/packages/docs/src/en/magics/el.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-order: 1
-prefix: $
-title: el
----
-
-# `$el`
-
-`$el` is a magic property that can be used to retrieve the current DOM node.
-
-```alpine
-<button @click="$el.innerHTML = 'Hello World!'">Replace me with "Hello World!"</button>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data>
- <button @click="$el.textContent = 'Hello World!'">Replace me with "Hello World!"</button>
- </div>
-</div>
-<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/magics/nextTick.md b/alpinejs/packages/docs/src/en/magics/nextTick.md
deleted file mode 100644
index 6b40496..0000000
--- a/alpinejs/packages/docs/src/en/magics/nextTick.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-order: 6
-prefix: $
-title: nextTick
----
-
-# `$nextTick`
-
-`$nextTick` is a magic property that allows you to only execute a given expression AFTER Alpine has made its reactive DOM updates. This is useful for times you want to interact with the DOM state AFTER it's reflected any data updates you've made.
-
-```alpine
-<div x-data="{ title: 'Hello' }">
- <button
- @click="
- title = 'Hello World!';
- $nextTick(() => { console.log($el.innerText) });
- "
- x-text="title"
- ></button>
-</div>
-```
-
-In the above example, rather than logging "Hello" to the console, "Hello World!" will be logged because `$nextTick` was used to wait until Alpine was finished updating the DOM.
diff --git a/alpinejs/packages/docs/src/en/magics/refs.md b/alpinejs/packages/docs/src/en/magics/refs.md
deleted file mode 100644
index db6b5cd..0000000
--- a/alpinejs/packages/docs/src/en/magics/refs.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-order: 2
-prefix: $
-title: refs
----
-
-# `$refs`
-
-`$refs` is a magic property that can be used to retrieve DOM elements marked with `x-ref` inside the component. This is useful when you need to manually manipulate DOM elements. It's often used as a more succinct, scoped, alternative to `document.querySelector`.
-
-```alpine
-<button @click="$refs.text.remove()">Remove Text</button>
-
-<span x-ref="text">Hello 👋</span>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data>
- <button @click="$refs.text.remove()">Remove Text</button>
-
- <div class="pt-4" x-ref="text">Hello 👋</div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now, when the `<button>` is pressed, the `<span>` will be removed.
diff --git a/alpinejs/packages/docs/src/en/magics/root.md b/alpinejs/packages/docs/src/en/magics/root.md
deleted file mode 100644
index e07e8e8..0000000
--- a/alpinejs/packages/docs/src/en/magics/root.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-order: 7
-prefix: $
-title: root
----
-
-# `$root`
-
-`$root` is a magic property that can be used to retrieve the root element of any Alpine component. In other words the closest element up the DOM tree that contains `x-data`.
-
-```alpine
-<div x-data data-message="Hello World!">
- <button @click="alert($root.dataset.message)">Say Hi</button>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data data-message="Hello World!" class="demo">
- <button @click="alert($root.dataset.message)">Say Hi</button>
-</div>
-<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/magics/store.md b/alpinejs/packages/docs/src/en/magics/store.md
deleted file mode 100644
index cf63c1d..0000000
--- a/alpinejs/packages/docs/src/en/magics/store.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-order: 3
-prefix: $
-title: store
----
-
-# `$store`
-
-You can use `$store` to conveniently access global Alpine stores registered using [`Alpine.store(...)`](#). For example:
-
-```alpine
-<button x-data @click="$store.darkMode.toggle()">Toggle Dark Mode</button>
-
-...
-
-<div x-data :class="$store.darkMode.on && 'bg-black'">
- ...
-</div>
-
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.store('darkMode', {
- on: false,
-
- toggle() {
- this.on = ! this.on
- }
- })
- })
-</script>
-```
-
-Given that we've registered the `darkMode` store and set `on` to "false", when the `<button>` is pressed, `on` will be "true" and the background color of the page will change to black.
-
-<a name="single-value-stores"></a>
-## Single-value stores
-
-If you don't need an entire object for a store, you can set and use any kind of data as a store.
-
-Here's the example from above but using it more simply as a boolean value:
-
-```alpine
-<button x-data @click="$store.darkMode = ! $store.darkMode">Toggle Dark Mode</button>
-
-...
-
-<div x-data :class="$store.darkMode && 'bg-black'">
- ...
-</div>
-
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.store('darkMode', false)
- })
-</script>
-```
-
-[→ Read more about Alpine stores](/globals/alpine-store)
diff --git a/alpinejs/packages/docs/src/en/magics/watch.md b/alpinejs/packages/docs/src/en/magics/watch.md
deleted file mode 100644
index b6a642e..0000000
--- a/alpinejs/packages/docs/src/en/magics/watch.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-order: 4
-title: watch
----
-
-# `$watch`
-
-You can "watch" a component property using the `$watch` magic method. For example:
-
-```alpine
-<div x-data="{ open: false }" x-init="$watch('open', value => console.log(value))">
- <button @click="open = ! open">Toggle Open</button>
-</div>
-```
-
-In the above example, when the button is pressed and `open` is changed, the provided callback will fire and `console.log` the new value:
-
-You can watch deeply nested properties using "dot" notation
-
-```alpine
-<div x-data="{ foo: { bar: 'baz' }}" x-init="$watch('foo.bar', value => console.log(value))">
- <button @click="foo.bar = 'bob'">Toggle Open</button>
-</div>
-```
-
-When the `<button>` is pressed, `foo.bar` will be set to "bob", and "bob" will be logged to the console.
-
-<a name="getting-the-old-value"></a>
-### Getting the "old" value
-
-`$watch` keeps track of the previous value of the property being watched, You can access it using the optional second argument to the callback like so:
-
-```alpine
-<div x-data="{ open: false }" x-init="$watch('open', (value, oldValue) => console.log(value, oldValue))">
- <button @click="open = ! open">Toggle Open</button>
-</div>
-```
diff --git a/alpinejs/packages/docs/src/en/plugins.md b/alpinejs/packages/docs/src/en/plugins.md
deleted file mode 100644
index 75b8b2f..0000000
--- a/alpinejs/packages/docs/src/en/plugins.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-order: 7
-title: Plugins
-font-type: mono
-type: sub-directory
----
diff --git a/alpinejs/packages/docs/src/en/plugins/collapse.md b/alpinejs/packages/docs/src/en/plugins/collapse.md
deleted file mode 100644
index 183f12f..0000000
--- a/alpinejs/packages/docs/src/en/plugins/collapse.md
+++ /dev/null
@@ -1,109 +0,0 @@
----
-order: 4
-title: Collapse
-description: Collapse and expand elements with robust animations
-graph_image: https://alpinejs.dev/social_collapse.jpg
----
-
-# Collapse Plugin
-
-Alpine's Collapse plugin allows you to expand and collapse elements using smooth animations.
-
-Because this behavior and implementation differs from Alpine's standard transition system, this functionality was made into a dedicated plugin.
-
-<a name="installation"></a>
-## Installation
-
-You can use this plugin by either including it from a `<script>` tag or installing it via NPM:
-
-### Via CDN
-
-You can include the CDN build of this plugin as a `<script>` tag, just make sure to include it BEFORE Alpine's core JS file.
-
-```alpine
-<!-- Alpine Plugins -->
-<script defer src="https://unpkg.com/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
-
-<!-- Alpine Core -->
-<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
-```
-
-### Via NPM
-
-You can install Collapse from NPM for use inside your bundle like so:
-
-```shell
-npm install @alpinejs/collapse
-```
-
-Then initialize it from your bundle:
-
-```js
-import Alpine from 'alpinejs'
-import collapse from '@alpinejs/collapse'
-
-Alpine.plugin(collapse)
-
-...
-```
-
-<a name="x-collapse"></a>
-## x-collapse
-
-The primary API for using this plugin is the `x-collapse` directive.
-
-`x-collapse` can only exist on an element that already has an `x-show` directive. When added to an `x-show` element, `x-collapse` will smoothly "collapse" and "expand" the element when it's visibility is toggled by animating its height property.
-
-For example:
-
-```alpine
-<div x-data="{ expanded: false }">
- <button @click="expanded = ! expanded">Toggle Content</button>
-
- <p x-show="expanded" x-collapse>
- ...
- </p>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ expanded: false }" class="demo">
- <button @click="expanded = ! expanded">Toggle Content</button>
-
- <div x-show="expanded" x-collapse>
- <div class="pt-4">
- Reprehenderit eu excepteur ullamco esse cillum reprehenderit exercitation labore non. Dolore dolore ea dolore veniam sint in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet voluptate cillum deserunt. Amet nisi pariatur sit ut id. Ipsum est minim est commodo id dolor sint id quis sint Lorem.
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="modifiers"></a>
-## Modifiers
-
-<a name="dot-duration"></a>
-### .duration
-
-You can customize the duration of the collapse/expand transition by appending the `.duration` modifier like so:
-
-```alpine
-<div x-data="{ expanded: false }">
- <button @click="expanded = ! expanded">Toggle Content</button>
-
- <p x-show="expanded" x-collapse.duration.1000ms>
- ...
- </p>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ expanded: false }" class="demo">
- <button @click="expanded = ! expanded">Toggle Content</button>
-
- <div x-show="expanded" x-collapse.duration.1000ms>
- <div class="pt-4">
- Reprehenderit eu excepteur ullamco esse cillum reprehenderit exercitation labore non. Dolore dolore ea dolore veniam sint in sint ex Lorem ipsum. Sint laborum deserunt deserunt amet voluptate cillum deserunt. Amet nisi pariatur sit ut id. Ipsum est minim est commodo id dolor sint id quis sint Lorem.
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/plugins/intersect.md b/alpinejs/packages/docs/src/en/plugins/intersect.md
deleted file mode 100644
index 4d60c4f..0000000
--- a/alpinejs/packages/docs/src/en/plugins/intersect.md
+++ /dev/null
@@ -1,106 +0,0 @@
----
-order: 1
-title: Intersect
-description: An Alpine convenience wrapper for Intersection Observer that allows you to easily react when an element enters the viewport.
-graph_image: https://alpinejs.dev/social_intersect.jpg
----
-
-# Intersect Plugin
-
-Alpine's Intersect plugin is a convenience wrapper for [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) that allows you to easily react when an element enters the viewport.
-
-This is useful for: lazy loading images and other content, triggering animations, infinite scrolling, logging "views" of content, etc.
-
-<a name="installation"></a>
-## Installation
-
-You can use this plugin by either including it from a `<script>` tag or installing it via NPM:
-
-### Via CDN
-
-You can include the CDN build of this plugin as a `<script>` tag, just make sure to include it BEFORE Alpine's core JS file.
-
-```alpine
-<!-- Alpine Plugins -->
-<script defer src="https://unpkg.com/@alpinejs/intersect@3.x.x/dist/cdn.min.js"></script>
-
-<!-- Alpine Core -->
-<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
-```
-
-### Via NPM
-
-You can install Intersect from NPM for use inside your bundle like so:
-
-```shell
-npm install @alpinejs/intersect
-```
-
-Then initialize it from your bundle:
-
-```js
-import Alpine from 'alpinejs'
-import intersect from '@alpinejs/intersect'
-
-Alpine.plugin(intersect)
-
-...
-```
-
-<a name="x-intersect"></a>
-## x-intersect
-
-The primary API for using this plugin is `x-intersect`. You can add `x-intersect` to any element within an Alpine component, and when that component enters the viewport (is scrolled into view), the provided expression will execute.
-
-For example, in the following snippet, `shown` will remain `false` until the element is scrolled into view. At that point, the expression will execute and `shown` will become `true`:
-
-```alpine
-<div x-data="{ shown: false }" x-intersect="shown = true">
- <div x-show="shown" x-transition>
- I'm in the viewport!
- </div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo" style="height: 60px; overflow-y: scroll;" x-data x-ref="root">
- <a href="#" @click.prevent="$refs.root.scrollTo({ top: $refs.root.scrollHeight, behavior: 'smooth' })">Scroll Down 👇</a>
- <div style="height: 50vh"></div>
- <div x-data="{ shown: false }" x-intersect="shown = true" id="yoyo">
- <div x-show="shown" x-transition.duration.1000ms>
- I'm in the viewport!
- </div>
- <div x-show="! shown">&nbsp;</div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="x-intersect-enter"></a>
-### x-intersect:enter
-
-You can opt to only trigger x-intersect when the element ENTERS the viewport by adding the `:enter` suffix to `x-intersect` like so:
-
-```alpine
-<div x-intersect:enter="shown = true">...</div>
-```
-
-<a name="x-intersect-leave"></a>
-### x-intersect:leave
-
-Similarly, you can add `:leave` to only trigger x-intersect when the element LEAVES the viewport:
-
-```alpine
-<div x-intersect:leave="shown = true">...</div>
-```
-
-<a name="modifiers"></a>
-## Modifiers
-
-<a name="once"></a>
-### .once
-
-Sometimes it's useful to evaluate an expression only the first time an element enters the viewport and not subsequent times. For example when triggering "enter" animations. In these cases, you can add the `.once` modifier to `x-intersect` to achieve this.
-
-```alpine
-<div x-intersect.once="shown = true">...</div>
-```
diff --git a/alpinejs/packages/docs/src/en/plugins/persist.md b/alpinejs/packages/docs/src/en/plugins/persist.md
deleted file mode 100644
index dec0e0d..0000000
--- a/alpinejs/packages/docs/src/en/plugins/persist.md
+++ /dev/null
@@ -1,196 +0,0 @@
----
-order: 2
-title: Persist
-description: Easily persist data across page loads using localStorage
-graph_image: https://alpinejs.dev/social_persist.jpg
----
-
-# Persist Plugin
-
-Alpine's Persist plugin allows you to persist Alpine state across page loads.
-
-This is useful for persisting search filters, active tabs, and other features where users will be frustrated if their configuration is reset after refreshing or leaving and revisiting a page.
-
-<a name="installation"></a>
-## Installation
-
-You can use this plugin by either including it from a `<script>` tag or installing it via NPM:
-
-### Via CDN
-
-You can include the CDN build of this plugin as a `<script>` tag, just make sure to include it BEFORE Alpine's core JS file.
-
-```alpine
-<!-- Alpine Plugins -->
-<script defer src="https://unpkg.com/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
-
-<!-- Alpine Core -->
-<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
-```
-
-### Via NPM
-
-You can install Persist from NPM for use inside your bundle like so:
-
-```shell
-npm install @alpinejs/persist
-```
-
-Then initialize it from your bundle:
-
-```js
-import Alpine from 'alpinejs'
-import persist from '@alpinejs/persist'
-
-Alpine.plugin(persist)
-
-...
-```
-
-<a name="magic-persist"></a>
-## $persist
-
-The primary API for using this plugin is the magic `$persist` method.
-
-You can wrap any value inside `x-data` with `$persist` like below to persist its value across page loads:
-
-```alpine
-<div x-data="{ count: $persist(0) }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ count: $persist(0) }">
- <button x-on:click="count++">Increment</button>
- <span x-text="count"></span>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-In the above example, because we wrapped `0` in `$persist()`, Alpine will now intercept changes made to `count` and persist them across page loads.
-
-You can try this for yourself by incrementing the "count" in the above example, then refreshing this page and observing that the "count" maintains its state and isn't reset to "0".
-
-<a name="how-it-works"></a>
-## How does it work?
-
-If a value is wrapped in `$persist`, on initialization Alpine will register its own watcher for that value. Now everytime that value changes for any reason, Alpine will store the new value in [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).
-
-Now when a page is reloaded, Alpine will check localStorage (using the name of the property as the key) for a value. If it finds one, it will set the property value from localStorage immediately.
-
-You can observe this behavior by opening your browser devtool's localStorage viewer:
-
-<a href="https://developer.chrome.com/docs/devtools/storage/localstorage/"><img src="/img/persist_devtools.png" alt="Chrome devtools showing the localStorage view with count set to 0"></a>
-
-You'll observe that by simply visiting this page, Alpine already set the value of "count" in localStorage. You'll also notice it prefixes the property name "count" with "_x_" as a way of namespacing these values so Alpine doesn't conflict with other tools using localStorage.
-
-Now change the "count" in the following example and observe the changes made by Alpine to localStorage:
-
-```alpine
-<div x-data="{ count: $persist(0) }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ count: $persist(0) }">
- <button x-on:click="count++">Increment</button>
- <span x-text="count"></span>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-> `$persist` works with primitive values as well as with arrays and objects.
-However, it is worth noting that localStorage must be cleared when the type of the variable changes.<br>
-> Given the previous example, if we change count to a value of `$persist({ value: 0 })`, then localStorage must be cleared or the variable 'count' renamed.
-
-<a name="custom-key"></a>
-## Setting a custom key
-
-By default, Alpine uses the property key that `$persist(...)` is being assigned to ("count" in the above examples).
-
-Consider the scenario where you have multiple Alpine components across pages or even on the same page that all use "count" as the property key.
-
-Alpine will have no way of differentiating between these components.
-
-In these cases, you can set your own custom key for any persisted value using the `.as` modifier like so:
-
-
-```alpine
-<div x-data="{ count: $persist(0).as('other-count') }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-Now Alpine will store and retrieve the above "count" value using the key "other-count".
-
-Here's a view of Chrome Devtools to see for yourself:
-
-<img src="/img/persist_custom_key_devtools.png" alt="Chrome devtools showing the localStorage view with count set to 0">
-
-<a name="custom-storage"></a>
-## Using a custom storage
-
-By default, data is saved to localStorage, it does not have an expiration time and it's kept even when the page is closed.
-
-Consider the scenario where you want to clear the data once the user close the tab. In this case you can persist data to sessionStorage using the `.using` modifier like so:
-
-
-```alpine
-<div x-data="{ count: $persist(0).using(sessionStorage) }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-You can also define your custom storage object exposing a getItem function and a setItem function. For example, you can decide to use a session cookie as storage doing so:
-
-
-```alpine
-<script>
- window.cookieStorage = {
- getItem(key) {
- let cookies = document.cookie.split(";");
- for (let i = 0; i < cookies.length; i++) {
- let cookie = cookies[i].split("=");
- if (key == cookie[0].trim()) {
- return decodeURIComponent(cookie[1]);
- }
- }
- return null;
- },
- setItem(key, value) {
- document.cookie = key+' = '+encodeURIComponent(value)
- }
- }
-</script>
-
-<div x-data="{ count: $persist(0).using(cookieStorage) }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-<a name="using-persist-with-alpine-data"></a>
-## Using $persist with Alpine.data
-
-If you want to use `$persist` with `Alpine.data`, you need to use a standard function instead of an arrow function so Alpine can bind a custom `this` context when it initially evaluates the component scope.
-
-```js
-Alpine.data('dropdown', function () {
- return {
- open: this.$persist(false)
- }
-})
-```
diff --git a/alpinejs/packages/docs/src/en/plugins/trap.md b/alpinejs/packages/docs/src/en/plugins/trap.md
deleted file mode 100644
index 94700fa..0000000
--- a/alpinejs/packages/docs/src/en/plugins/trap.md
+++ /dev/null
@@ -1,180 +0,0 @@
----
-order: 3
-title: Trap
-description: Easily trap page focus within an element (modals, dialogues, etc...)
-graph_image: https://alpinejs.dev/social_trap.jpg
----
-
-# Trap Plugin
-
-Alpine's Trap plugin allows you to conditionally trap focus inside an element.
-
-This is useful for modals and other dialogue elements.
-
-<a name="installation"></a>
-## Installation
-
-You can use this plugin by either including it from a `<script>` tag or installing it via NPM:
-
-### Via CDN
-
-You can include the CDN build of this plugin as a `<script>` tag, just make sure to include it BEFORE Alpine's core JS file.
-
-```alpine
-<!-- Alpine Plugins -->
-<script defer src="https://unpkg.com/@alpinejs/trap@3.x.x/dist/cdn.min.js"></script>
-
-<!-- Alpine Core -->
-<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
-```
-
-### Via NPM
-
-You can install Trap from NPM for use inside your bundle like so:
-
-```shell
-npm install @alpinejs/trap
-```
-
-Then initialize it from your bundle:
-
-```js
-import Alpine from 'alpinejs'
-import trap from '@alpinejs/trap'
-
-Alpine.plugin(trap)
-
-...
-```
-
-<a name="x-trap"></a>
-## x-trap
-
-The primary API for using this plugin is the `x-trap` directive.
-
-`x-trap` accepts a JS expression. If the result of that expression is true, then the focus will be trapped inside that element until the expression becomes false, then at that point, focus will be returned to where it was previously.
-
-For example:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = true">Open Dialogue</button>
-
- <span x-show="open" x-trap="open">
- <p>...</p>
-
- <input type="text" placeholder="Some input...">
-
- <input type="text" placeholder="Some other input...">
-
- <button @click="open = false">Close Dialogue</button>
- </span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <div :class="open && 'opacity-50'">
- <button x-on:click="open = true">Open Dialogue</button>
- </div>
-
- <div x-show="open" x-trap="open" class="mt-4 space-y-4 p-4 border bg-yellow-100" @keyup.escape.window="open = false">
- <strong>
- <div>Focus is now "trapped" inside this dialogue, meaning you can only click/focus elements within this yellow dialogue. If you press tab repeatedly, the focus will stay within this dialogue, but also be allowed to cycle to the browser's URL bar.</div>
- </strong>
-
- <div>
- <input type="text" placeholder="Some input...">
- </div>
-
- <div>
- <input type="text" placeholder="Some other input...">
- </div>
-
- <div>
- <button @click="open = false">Close Dialogue</button>
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-<a name="nesting"></a>
-## Nesting dialogues
-
-Sometimes you may want to nest one dialogue inside another. `x-trap` makes this trivial and handles it automatically.
-
-`x-trap` keeps track of newly "trapped" elements and stores the last actively focused element. Once the element is "untrapped" then the focus will be returned to where it was originally.
-
-This mechanism is recursive, so you can trap focus within an already trapped element infinite times, then "untrap" each element successively.
-
-Here is nesting in action:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = true">Open Dialogue</button>
-
- <span x-show="open" x-trap="open">
-
- ...
-
- <div x-data="{ open: false }">
- <button @click="open = true">Open Nested Dialogue</button>
-
- <span x-show="open" x-trap="open">
-
- ...
-
- <button @click="open = false">Close Nested Dialogue</button>
- </span>
- </div>
-
- <button @click="open = false">Close Dialogue</button>
- </span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div x-data="{ open: false }" class="demo">
- <div :class="open && 'opacity-50'">
- <button x-on:click="open = true">Open Dialogue</button>
- </div>
-
- <div x-show="open" x-trap="open" class="mt-4 space-y-4 p-4 border bg-yellow-100" @keyup.escape.window="open = false">
- <div>
- <input type="text" placeholder="Some input...">
- </div>
-
- <div>
- <input type="text" placeholder="Some other input...">
- </div>
-
- <div x-data="{ open: false }">
- <div :class="open && 'opacity-50'">
- <button x-on:click="open = true">Open Nested Dialogue</button>
- </div>
-
- <div x-show="open" x-trap="open" class="mt-4 space-y-4 p-4 border border-gray-500 bg-yellow-200" @keyup.escape.window="open = false">
- <strong>
- <div>Focus is now "trapped" inside this nested dialogue. You cannot focus anything inside the outer dialogue while this is open. If you close this dialogue, focus will be returned to the last known active element.</div>
- </strong>
-
- <div>
- <input type="text" placeholder="Some input...">
- </div>
-
- <div>
- <input type="text" placeholder="Some other input...">
- </div>
-
- <div>
- <button @click="open = false">Close Nested Dialogue</button>
- </div>
- </div>
- </div>
-
- <div>
- <button @click="open = false">Close Dialogue</button>
- </div>
- </div>
-</div>
-<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/start-here.md b/alpinejs/packages/docs/src/en/start-here.md
deleted file mode 100644
index 62c4d0d..0000000
--- a/alpinejs/packages/docs/src/en/start-here.md
+++ /dev/null
@@ -1,326 +0,0 @@
----
-order: 1
-title: Start Here
----
-
-# Start Here
-
-Create a blank HTML file somewhere on your computer with a name like: `i-love-alpine.html`
-
-Using a text editor, fill the file with these contents:
-
-```alpine
-<html>
-<head>
- <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
-</head>
-<body>
- <h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="message"></h1>
-</body>
-</html>
-```
-
-Open your file in a web browser, if you see `I ❤️ Alpine`, you're ready to rumble!
-
-Now that you're all set up to play around, let's look at three practical examples as a foundation for teaching you the basics of Alpine. By the end of this exercise, you should be more than equipped to start building stuff on your own. Let's goooooo.
-
-<!-- START_VERBATIM -->
-<ul class="flex flex-col space-y-2 list-inside !list-decimal">
- <li><a href="#building-a-counter">Building a counter</a></li>
- <li><a href="#building-a-dropdown">Building a dropdown</a></li>
- <li><a href="#building-a-search-input">Building a search Input</a></li>
-</ul>
-<!-- END_VERBATIM -->
-
-<a name="building-a-counter"></a>
-## Building a counter
-
-Let's start with a simple "counter" component to demonstrate the basics of state and event listening in Alpine, two core features.
-
-Insert the following into the `<body>` tag:
-
-```alpine
-<div x-data="{ count: 0 }">
- <button x-on:click="count++">Increment</button>
-
- <span x-text="count"></span>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ count: 0 }">
- <button x-on:click="count++">Increment</button>
- <span x-text="count"></span>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-Now, you can see with 3 bits of Alpine sprinkled into this HTML, we've created an interactive "counter" component.
-
-Let's walk through what's happening briefly:
-
-<a name="declaring-data"></a>
-### Declaring data
-
-```alpine
-<div x-data="{ count: 0 }">
-```
-
-Everything in Alpine starts with an `x-data` directive. Inside of `x-data`, in plain JavaScript, you declare an object of data that Alpine will track.
-
-Every property inside this object will be made available to other directives inside this HTML element. In addition, when one of these properties changes, everything that relies on it will change as well.
-
-[→ Read more about `x-data`](/directives/data)
-
-Let's look at `x-on` and see how it can access and modify the `count` property from above:
-
-<a name="listening-for-events"></a>
-### Listening for events
-
-```alpine
-<button x-on:click="count++">Increment</button>
-```
-
-`x-on` is a directive you can use to listen for any event on an element. We're listening for a `click` event in this case, so ours looks like `x-on:click`.
-
-You can listen for other events as you'd imagine. For example, listening for a `mouseenter` event would look like this: `x-on:mouseenter`.
-
-When a `click` event happens, Alpine will call the associated JavaScript expression, `count++` in our case. As you can see, we have direct access to data declared in the `x-data` expression.
-
-> You will often see `@` instead of `x-on`. This is a shorter, friendlier syntax that many prefer. From now on, this documentation will likely use `@` instead of `x-on`.
-
-[→ Read more about `x-on`](/directives/on)
-
-<a name="reacting-to-changes"></a>
-### Reacting to changes
-
-```alpine
-<h1 x-text="count"></h1>
-```
-
-`x-text` is an Alpine directive you can use to set the text content of an element to the result of a JavaScript expression.
-
-In this case, we're telling Alpine to always make sure that the contents of this `h1` tag reflect the value of the `count` property.
-
-In case it's not clear, `x-text`, like most directives accepts a plain JavaScript expression as an argument. So for example, you could instead set its contents to: `x-text="count * 2"` and the text content of the `h1` will now always be 2 times the value of `count`.
-
-[→ Read more about `x-text`](/directives/text)
-
-<a name="building-a-dropdown"></a>
-## Building a dropdown
-
-Now that we've seen some basic functionality, let's keep going and look at an important directive in Alpine: `x-show`, by building a contrived "dropdown" component.
-
-Insert the following code into the `<body>` tag:
-
-```alpine
-<div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
-
- <div x-show="open" @click.outside="open = false">Contents...</div>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div x-data="{ open: false }">
- <button @click="open = ! open">Toggle</button>
- <div x-show="open" @click.outside="open = false">Contents...</div>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-If you load this component, you should see that the "Contents..." are hidden by default. You can toggle showing them on the page by clicking the "Toggle" button.
-
-The `x-data` and `x-on` directives should be familiar to you from the previous example, so we'll skip those explanations.
-
-<a name="toggling-elements"></a>
-### Toggling elements
-
-```alpine
-<div x-show="open" ...>Contents...</div>
-```
-
-`x-show` is an extremely powerful directive in Alpine that can be used to show and hide a block of HTML on a page based on the result of a JavaScript expression, in our case: `open`.
-
-[→ Read more about `x-show`](/directives/show)
-
-<a name="listening-for-a-click-outside"></a>
-### Listening for a click outside
-
-```alpine
-<div ... @click.outside="open = false">Contents...</div>
-```
-
-You'll notice something new in this example: `.outside`. Many directives in Alpine accept "modifiers" that are chained onto the end of the directive and are separated by periods.
-
-In this case, `.outside` tells Alpine to instead of listening for a click INSIDE the `<div>`, to listen for the click only if it happens OUTSIDE the `<div>`.
-
-This is a convenience helper built into Alpine because this is a common need and implementing it by hand is annoying and complex.
-
-[→ Read more about `x-on` modifiers](/directives/on#modifiers)
-
-<a name="building-a-search-input"></a>
-## Building a search input
-
-Let's now build a more complex component and introduce a handful of other directives and patterns.
-
-Insert the following code into the `<body>` tag:
-
-```alpine
-<div
- x-data="{
- search: '',
-
- items: ['foo', 'bar', 'baz'],
-
- get filteredItems() {
- return this.items.filter(
- i => i.startsWith(this.search)
- )
- }
- }"
->
- <input x-model="search" placeholder="Search...">
-
- <ul>
- <template x-for="item in filteredItems" :key="item">
- <li x-text="item"></li>
- </template>
- </ul>
-</div>
-```
-
-<!-- START_VERBATIM -->
-<div class="demo">
- <div
- x-data="{
- search: '',
-
- items: ['foo', 'bar', 'baz'],
-
- get filteredItems() {
- return this.items.filter(
- i => i.startsWith(this.search)
- )
- }
- }"
- >
- <input x-model="search" placeholder="Search...">
-
- <ul class="pl-6 pt-2">
- <template x-for="item in filteredItems" :key="item">
- <li x-text="item"></li>
- </template>
- </ul>
- </div>
-</div>
-<!-- END_VERBATIM -->
-
-By default, all of the "items" (foo, bar, and baz) will be shown on the page, but you can filter them by typing into the text input. As you type, the list of items will change to reflect what you're searching for.
-
-Now there's quite a bit happening here, so let's go through this snippet piece by piece.
-
-<a name="multi-line-formatting"></a>
-### Multi line formatting
-
-The first thing I'd like to point out is that `x-data` now has a lot more going on in it than before. To make it easier to write and read, we've split it up into multiple lines in our HTML. This is completely optional and we'll talk more in a bit about how to avoid this problem altogether, but for now, we'll keep all of this JavaScript directly in the HTML.
-
-<a name="binding-to-inputs"></a>
-### Binding to inputs
-
-```alpine
-<input x-model="search" placeholder="Search...">
-```
-
-You'll notice a new directive we haven't seen yet: `x-model`.
-
-`x-model` is used to "bind" the value of an input element with a data property: "search" from `x-data="{ search: '', ... }"` in our case.
-
-This means that anytime the value of the input changes, the value of "search" will change to reflect that.
-
-`x-model` is capable of much more than this simple example.
-
-[→ Read more about `x-model`](/directives/model)
-
-<a name="computed-properties-using-getters"></a>
-### Computed properties using getters
-
-The next bit I'd like to draw your attention to is the `items` and `filteredItems` properties from the `x-data` directive.
-
-```js
-{
- ...
- items: ['foo', 'bar', 'baz'],
-
- get filteredItems() {
- return this.items.filter(
- i => i.startsWith(this.search)
- )
- }
-}
-```
-
-The `items` property should be self-explanatory. Here we are setting the value of `items` to a JavaScript array of 3 different items (foo, bar, and baz).
-
-The interesting part of this snippet is the `filteredItems` property.
-
-Denoted by the `get` prefix for this property, `filteredItems` is a "getter" property in this object. This means we can access `filteredItems` as if it was a normal property in our data object, but when we do, JavaScript will evaluate the provided function under the hood and return the result.
-
-It's completely acceptable to forgo the `get` and just make this a method that you can call from the template, but some prefer the nicer syntax of the getter.
-
-[→ Read more about JavaScript getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)
-
-Now let's look inside the `filteredItems` getter and make sure we understand what's going on there:
-
-```js
-return this.items.filter(
- i => i.startsWith(this.search)
-)
-```
-
-This is all plain JavaScript. We are first getting the array of items (foo, bar, and baz) and filtering them using the provided callback: `i => i.startsWith(this.search)`.
-
-By passing in this callback to `filter`, we are telling JavaScript to only return the items that start with the string: `this.search`, which like we saw with `x-model` will always reflect the value of the input.
-
-You may notice that up until now, we haven't had to use `this.` to reference properties. However, because we are working directly inside the `x-data` object, we must reference any properties using `this.[property]` instead of simply `[property]`.
-
-Because Alpine is a "reactive" framework. Any time the value of `this.search` changes, parts of the template that use `filteredItems` will automatically be updated.
-
-<a name="looping-elements"></a>
-### Looping elements
-
-Now that we understand the data part of our component, let's understand what's happening in the template that allows us to loop through `filteredItems` on the page.
-
-```alpine
-<ul>
- <template x-for="item in filteredItems">
- <li x-text="item"></li>
- </template>
-</ul>
-```
-
-The first thing to notice here is the `x-for` directive. `x-for` expressions take the following form: `[item] in [items]` where [items] is any array of data, and [item] is the name of the variable that will be assigned to an iteration inside the loop.
-
-Also notice that `x-for` is declared on a `<template>` element and not directly on the `<li>`. This is a requirement of using `x-for`. It allows Alpine to leverage the existing behavior of `<template>` tags in the browser to its advantage.
-
-Now any element inside the `<template>` tag will be repeated for every item inside `filteredItems` and all expressions evaluated inside the loop will have direct access to the iteration variable (`item` in this case).
-
-[→ Read more about `x-for`](/directives/for)
-
-<a name="recap"></a>
-## Recap
-
-If you've made it this far, you've been exposed to the following directives in Alpine:
-
-* x-data
-* x-on
-* x-text
-* x-show
-* x-model
-* x-for
-
-That's a great start, however, there are many more directives to sink your teeth into. The best way to absorb Alpine is to read through this documentation. No need to comb over every word, but if you at least glance through every page you will be MUCH more effective when using Alpine.
-
-Happy Coding!
diff --git a/alpinejs/packages/docs/src/en/upgrade-guide.md b/alpinejs/packages/docs/src/en/upgrade-guide.md
deleted file mode 100644
index 2bc78f3..0000000
--- a/alpinejs/packages/docs/src/en/upgrade-guide.md
+++ /dev/null
@@ -1,375 +0,0 @@
----
-order: 2
-title: Upgrade From V2
----
-
-# Upgrade from V2
-
-Below is an exhaustive guide on the breaking changes in Alpine V3, but if you'd prefer something more lively, you can review all the changes as well as new features in V3 by watching the Alpine Day 2021 "Future of Alpine" keynote:
-
-<!-- START_VERBATIM -->
-<div class="relative w-full" style="padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
- <iframe
- class="absolute top-0 left-0 right-0 bottom-0 w-full h-full"
- src="https://www.youtube.com/embed/WixS4JXMwIQ?modestbranding=1&autoplay=1"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
- ></iframe>
-</div>
-<!-- END_VERBATIM -->
-
-Upgrading from Alpine V2 to V3 should be fairly painless. In many cases, NOTHING has to be done to your codebase to use V3. Below is an exhaustive list of breaking changes and deprecations in descending order of how likely users are to be affected by them:
-
-> Note if you use Laravel Livewire and Alpine together, to use V3 of Alpine, you will need to upgrade to Livewire v2.5.1 or greater.
-
-<a name="breaking-changes"></a>
-## Breaking Changes
-* [`$el` is now always the current element](#el-no-longer-root)
-* [Automatically evaluate `init()` functions defined on data object](#auto-init)
-* [Need to call `Alpine.start()` after import](#need-to-call-alpine-start)
-* [`x-show.transition` is now `x-transition`](#removed-show-dot-transition)
-* [`x-if` no longer supports `x-transition`](#x-if-no-transitions)
-* [`x-data` cascading scope](#x-data-scope)
-* [`x-init` no longer accepts a callback return](#x-init-no-callback)
-* [Returning `false` from event handlers no longer implicitly "preventDefault"s](#no-false-return-from-event-handlers)
-* [`x-spread` is now `x-bind`](#x-spread-now-x-bind)
-* [`x-ref` no longer supports binding](#x-ref-no-more-dynamic)
-* [Use global lifecycle events instead of `Alpine.deferLoadingAlpine()`](#use-global-events-now)
-* [IE11 no longer supported](#no-ie-11)
-
-<a name="el-no-longer-root"></a>
-### `$el` is now always the current element
-
-`$el` now always represents the element that an expression was executed on, not the root element of the component. This will replace most usages of `x-ref` and in the cases where you still want to access the root of a component, you can do so using `x-ref`. For example:
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data>
- <button @click="console.log($el)"></button>
- <!-- In V2, $el would have been the <div>, now it's the <button> -->
-</div>
-
-<!-- ✅ After -->
-<div x-data x-ref="root">
- <button @click="console.log($refs.root)"></button>
-</div>
-```
-
-For a smoother upgrade experience, you can optionally replace all instances of `$el` with a custom magic called `$root`, then add the following code to your site to mimic the behavior:
-
-```alpine
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.magic('root', el => {
- let closestRootEl = (node) => {
- if (node.hasAttribute('x-data')) return node
-
- return closestRootEl(node.parentNode)
- }
-
- return closestRootEl(el)
- })
- })
-</script>
-```
-
-[→ Read more about $el in V3](/magics/el)
-
-<a name="auto-init"></a>
-### Automatically evaluate `init()` functions defined on data object
-
-A common pattern in V2 was to manually call an `init()` (or similarly named method) on an `x-data` object.
-
-In V3, Alpine will automatically call `init()` methods on data objects.
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data="foo()" x-init="init()"></div>
-
-<!-- ✅ After -->
-<div x-data="foo()"></div>
-
-<script>
- function foo() {
- return {
- init() {
- //
- }
- }
- }
-</script>
-```
-
-[→ Read more about auto-evaluating init functions](/globals/alpine-data#init-functions)
-
-<a name="need-to-call-alpine-start"></a>
-### Need to call Alpine.start() after import
-
-If you were importing Alpine V2 from NPM, you will now need to manually call `Alpine.start()` for V3. This doesn't affect you if you use Alpine's build file or CDN from a `<template>` tag.
-
-```js
-// 🚫 Before
-import 'alpinejs'
-
-// ✅ After
-import Alpine from 'alpinejs'
-
-window.Alpine = Alpine
-
-Alpine.start()
-```
-
-[→ Read more about initializing Alpine V3](/essentials/installation#as-a-module)
-
-<a name="removed-show-dot-transition"></a>
-### `x-show.transition` is now `x-transition`
-
-All of the conveniences provided by `x-show.transition...` helpers are still available, but now from a more unified API: `x-transition`:
-
-```alpine
-<!-- 🚫 Before -->
-<div x-show.transition="open"></div>
-<!-- ✅ After -->
-<div x-show="open" x-transition></div>
-
-<!-- 🚫 Before -->
-<div x-show.transition.duration.500ms="open"></div>
-<!-- ✅ After -->
-<div x-show="open" x-transition.duration.500ms></div>
-
-<!-- 🚫 Before -->
-<div x-show.transition.in.duration.500ms.out.duration.750ms="open"></div>
-<!-- ✅ After -->
-<div
- x-show="open"
- x-transition:enter.duration.500ms
- x-transition:leave.duration.750ms
-></div>
-```
-
-[→ Read more about x-transition](/directives/transition)
-
-<a name="x-if-no-transitions"></a>
-### `x-if` no longer supports `x-transition`
-
-The ability to transition elements in and add before/after being removed from the DOM is no longer available in Alpine.
-
-This was a feature very few people even knew existed let alone used.
-
-Because the transition system is complex, it makes more sense from a maintenance perspective to only support transitioning elements with `x-show`.
-
-```alpine
-<!-- 🚫 Before -->
-<template x-if.transition="open">
- <div>...</div>
-</template>
-
-<!-- ✅ After -->
-<div x-show="open" x-transition>...</div>
-```
-
-[→ Read more about x-if](/directives/if)
-
-<a name="x-data-scope"></a>
-### `x-data` cascading scope
-
-Scope defined in `x-data` is now available to all children unless overwritten by a nested `x-data` expression.
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data="{ foo: 'bar' }">
- <div x-data="{}">
- <!-- foo is undefined -->
- </div>
-</div>
-
-<!-- ✅ After -->
-<div x-data="{ foo: 'bar' }">
- <div x-data="{}">
- <!-- foo is 'bar' -->
- </div>
-</div>
-```
-
-[→ Read more about x-data scoping](/directives/data#scope)
-
-<a name="x-init-no-callback"></a>
-### `x-init` no longer accepts a callback return
-
-Before V3, if `x-init` received a return value that is `typeof` "function", it would execute the callback after Alpine finished initializing all other directives in the tree. Now, you must manually call `$nextTick()` to achieve that behavior. `x-init` is no longer "return value aware".
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data x-init="() => { ... }">...</div>
-
-<!-- ✅ After -->
-<div x-data x-init="$nextTick(() => { ... })">...</div>
-```
-
-[→ Read more about $nextTick](/magics/next-tick)
-
-<a name="no-false-return-from-event-handlers"></a>
-### Returning `false` from event handlers no longer implicitly "preventDefault"s
-
-Alpine V2 observes a return value of `false` as a desire to run `preventDefault` on the event. This conforms to the standard behavior of native, inline listeners: `<... oninput="someFunctionThatReturnsFalse()">`. Alpine V3 no longer supports this API. Most people don't know it exists and therefore is surprising behavior.
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data="{ blockInput() { return false } }">
- <input type="text" @input="blockInput()">
-</div>
-
-<!-- ✅ After -->
-<div x-data="{ blockInput(e) { e.preventDefault() }">
- <input type="text" @input="blockInput($event)">
-</div>
-```
-
-[→ Read more about x-on](/directives/on)
-
-<a name="x-spread-now-x-bind"></a>
-### `x-spread` is now `x-bind`
-
-One of Alpine's stories for re-using functionality is abstracting Alpine directives into objects and applying them to elements with `x-spread`. This behavior is still the same, except now `x-bind` (with no specified attribute) is the API instead of `x-spread`.
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data="dropdown()">
- <button x-spread="trigger">Toggle</button>
-
- <div x-spread="dialogue">...</div>
-</div>
-
-<!-- ✅ After -->
-<div x-data="dropdown()">
- <button x-bind="trigger">Toggle</button>
-
- <div x-bind="dialogue">...</div>
-</div>
-
-
-<script>
- function dropdown() {
- return {
- open: false,
-
- trigger: {
- 'x-on:click'() { this.open = ! this.open },
- },
-
- dialogue: {
- 'x-show'() { return this.open },
- 'x-bind:class'() { return 'foo bar' },
- },
- }
- }
-</script>
-```
-
-[→ Read more about binding directives using x-bind](/directives/bind#bind-directives)
-
-<a name="use-global-events-now"></a>
-### Use global lifecycle events instead of `Alpine.deferLoadingAlpine()`
-
-```alpine
-<!-- 🚫 Before -->
-<script>
- window.deferLoadingAlpine = startAlpine => {
- // Will be executed before initializing Alpine.
-
- startAlpine()
-
- // Will be executed after initializing Alpine.
- }
-</script>
-
-<!-- ✅ After -->
-<script>
- document.addEventListener('alpine:init', () => {
- // Will be executed before initializing Alpine.
- })
-
- document.addEventListener('alpine:initialized', () => {
- // Will be executed after initializing Alpine.
- })
-</script>
-```
-
-[→ Read more about Alpine lifecycle events](/essentials/lifecycle#alpine-initialization)
-
-
-<a name="x-ref-no-more-dynamic"></a>
-### `x-ref` no longer supports binding
-
-In Alpine V2 for below code
-
-```alpine
-<div x-data="{options: [{value: 1}, {value: 2}, {value: 3}] }">
- <div x-ref="0">0</div>
- <template x-for="option in options">
- <div :x-ref="option.value" x-text="option.value"></div>
- </template>
-
- <button @click="console.log($refs[0], $refs[1], $refs[2], $refs[3]);">Display $refs</button>
-</div>
-```
-
-after clicking button all `$refs` were displayed. However in Alpine V3 it's possible to access only `$refs` for elements created statically, so only first ref will be returned as expected.
-
-
-<a name="no-ie-11"></a>
-### IE11 no longer supported
-
-Alpine will no longer officially support Internet Explorer 11. If you need support for IE11, we recommend still using Alpine V2.
-
-## Deprecated APIs
-
-The following 2 APIs will still work in V3, but are considered deprecated and are likely to be removed at some point in the future.
-
-<a name="away-replace-with-outside"></a>
-### Event listener modifier `.away` should be replaced with `.outside`
-
-```alpine
-<!-- 🚫 Before -->
-<div x-show="open" @click.away="open = false">
- ...
-</div>
-
-<!-- ✅ After -->
-<div x-show="open" @click.outside="open = false">
- ...
-</div>
-```
-
-<a name="alpine-data-instead-of-global-functions"></a>
-### Prefer `Alpine.data()` to global Alpine function data providers
-
-```alpine
-<!-- 🚫 Before -->
-<div x-data="dropdown()">
- ...
-</div>
-
-<script>
- function dropdown() {
- return {
- ...
- }
- }
-</script>
-
-<!-- ✅ After -->
-<div x-data="dropdown">
- ...
-</div>
-
-<script>
- document.addEventListener('alpine:init', () => {
- Alpine.data('dropdown', () => ({
- ...
- }))
- })
-</script>
-```
-
-> Note that you need to define `Alpine.data()` extensions BEFORE you call `Alpine.start()`. For more information, refer to the [Lifecycle Concerns](https://alpinejs.dev/advanced/extending#lifecycle-concerns) and [Installation as a Module](https://alpinejs.dev/essentials/installation#as-a-module) documentation pages.
diff --git a/alpinejs/packages/history/builds/cdn.js b/alpinejs/packages/history/builds/cdn.js
deleted file mode 100644
index 869edb2..0000000
--- a/alpinejs/packages/history/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import history from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(history)
-})
diff --git a/alpinejs/packages/history/builds/module.js b/alpinejs/packages/history/builds/module.js
deleted file mode 100644
index a7d9aba..0000000
--- a/alpinejs/packages/history/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import history from '../src/index.js'
-
-export default history
diff --git a/alpinejs/packages/history/dist/dist/cdn.js b/alpinejs/packages/history/dist/dist/cdn.js
deleted file mode 100644
index efd7abd..0000000
--- a/alpinejs/packages/history/dist/dist/cdn.js
+++ /dev/null
@@ -1,67 +0,0 @@
-(() => {
- // packages/history/src/index.js
- function history(Alpine) {
- Alpine.magic("queryString", (el, {interceptor}) => {
- let alias;
- return interceptor((initialValue, getter, setter, path, key) => {
- let pause = false;
- let queryKey = alias || path;
- let value = initialValue;
- let url = new URL(window.location.href);
- if (url.searchParams.has(queryKey)) {
- value = url.searchParams.get(queryKey);
- }
- setter(value);
- let object = {value};
- url.searchParams.set(queryKey, value);
- replace(url.toString(), path, object);
- window.addEventListener("popstate", (e) => {
- if (!e.state)
- return;
- if (!e.state.alpine)
- return;
- Object.entries(e.state.alpine).forEach(([newKey, {value: value2}]) => {
- if (newKey !== key)
- return;
- pause = true;
- Alpine.disableEffectScheduling(() => {
- setter(value2);
- });
- pause = false;
- });
- });
- Alpine.effect(() => {
- let value2 = getter();
- if (pause)
- return;
- let object2 = {value: value2};
- let url2 = new URL(window.location.href);
- url2.searchParams.set(queryKey, value2);
- push(url2.toString(), path, object2);
- });
- return value;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- };
- });
- });
- }
- function replace(url, key, object) {
- let state = window.history.state || {};
- if (!state.alpine)
- state.alpine = {};
- state.alpine[key] = object;
- window.history.replaceState(state, "", url);
- }
- function push(url, key, object) {
- let state = {alpine: {...window.history.state.alpine, ...{[key]: object}}};
- window.history.pushState(state, "", url);
- }
-
- // packages/history/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(history);
- });
-})();
diff --git a/alpinejs/packages/history/dist/dist/cdn.min.js b/alpinejs/packages/history/dist/dist/cdn.min.js
deleted file mode 100644
index 6ffe1a9..0000000
--- a/alpinejs/packages/history/dist/dist/cdn.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{function h(t){t.magic("queryString",(n,{interceptor:i})=>{let e;return i((s,c,p,f,y)=>{let w=!1,l=e||f,r=s,o=new URL(window.location.href);o.searchParams.has(l)&&(r=o.searchParams.get(l)),p(r);let m={value:r};return o.searchParams.set(l,r),g(o.toString(),f,m),window.addEventListener("popstate",a=>{!a.state||!a.state.alpine||Object.entries(a.state.alpine).forEach(([d,{value:u}])=>{d===y&&(w=!0,t.disableEffectScheduling(()=>{p(u)}),w=!1)})}),t.effect(()=>{let a=c();if(w)return;let d={value:a},u=new URL(window.location.href);u.searchParams.set(l,a),S(u.toString(),f,d)}),r},s=>{s.as=c=>(e=c,s)})})}function g(t,n,i){let e=window.history.state||{};e.alpine||(e.alpine={}),e.alpine[n]=i,window.history.replaceState(e,"",t)}function S(t,n,i){let e={alpine:{...window.history.state.alpine,[n]:i}};window.history.pushState(e,"",t)}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(h)});})();
diff --git a/alpinejs/packages/history/dist/dist/module.cjs.js b/alpinejs/packages/history/dist/dist/module.cjs.js
deleted file mode 100644
index 27b86d4..0000000
--- a/alpinejs/packages/history/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,76 +0,0 @@
-var __defProp = Object.defineProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-
-// packages/history/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/history/src/index.js
-function history(Alpine) {
- Alpine.magic("queryString", (el, {interceptor}) => {
- let alias;
- return interceptor((initialValue, getter, setter, path, key) => {
- let pause = false;
- let queryKey = alias || path;
- let value = initialValue;
- let url = new URL(window.location.href);
- if (url.searchParams.has(queryKey)) {
- value = url.searchParams.get(queryKey);
- }
- setter(value);
- let object = {value};
- url.searchParams.set(queryKey, value);
- replace(url.toString(), path, object);
- window.addEventListener("popstate", (e) => {
- if (!e.state)
- return;
- if (!e.state.alpine)
- return;
- Object.entries(e.state.alpine).forEach(([newKey, {value: value2}]) => {
- if (newKey !== key)
- return;
- pause = true;
- Alpine.disableEffectScheduling(() => {
- setter(value2);
- });
- pause = false;
- });
- });
- Alpine.effect(() => {
- let value2 = getter();
- if (pause)
- return;
- let object2 = {value: value2};
- let url2 = new URL(window.location.href);
- url2.searchParams.set(queryKey, value2);
- push(url2.toString(), path, object2);
- });
- return value;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- };
- });
- });
-}
-function replace(url, key, object) {
- let state = window.history.state || {};
- if (!state.alpine)
- state.alpine = {};
- state.alpine[key] = object;
- window.history.replaceState(state, "", url);
-}
-function push(url, key, object) {
- let state = {alpine: {...window.history.state.alpine, ...{[key]: object}}};
- window.history.pushState(state, "", url);
-}
-
-// packages/history/builds/module.js
-var module_default = history;
diff --git a/alpinejs/packages/history/dist/dist/module.esm.js b/alpinejs/packages/history/dist/dist/module.esm.js
deleted file mode 100644
index dd124fb..0000000
--- a/alpinejs/packages/history/dist/dist/module.esm.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// packages/history/src/index.js
-function history(Alpine) {
- Alpine.magic("queryString", (el, {interceptor}) => {
- let alias;
- return interceptor((initialValue, getter, setter, path, key) => {
- let pause = false;
- let queryKey = alias || path;
- let value = initialValue;
- let url = new URL(window.location.href);
- if (url.searchParams.has(queryKey)) {
- value = url.searchParams.get(queryKey);
- }
- setter(value);
- let object = {value};
- url.searchParams.set(queryKey, value);
- replace(url.toString(), path, object);
- window.addEventListener("popstate", (e) => {
- if (!e.state)
- return;
- if (!e.state.alpine)
- return;
- Object.entries(e.state.alpine).forEach(([newKey, {value: value2}]) => {
- if (newKey !== key)
- return;
- pause = true;
- Alpine.disableEffectScheduling(() => {
- setter(value2);
- });
- pause = false;
- });
- });
- Alpine.effect(() => {
- let value2 = getter();
- if (pause)
- return;
- let object2 = {value: value2};
- let url2 = new URL(window.location.href);
- url2.searchParams.set(queryKey, value2);
- push(url2.toString(), path, object2);
- });
- return value;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- };
- });
- });
-}
-function replace(url, key, object) {
- let state = window.history.state || {};
- if (!state.alpine)
- state.alpine = {};
- state.alpine[key] = object;
- window.history.replaceState(state, "", url);
-}
-function push(url, key, object) {
- let state = {alpine: {...window.history.state.alpine, ...{[key]: object}}};
- window.history.pushState(state, "", url);
-}
-
-// packages/history/builds/module.js
-var module_default = history;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/history/package.json b/alpinejs/packages/history/package.json
deleted file mode 100644
index 08355c2..0000000
--- a/alpinejs/packages/history/package.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "@alpinejs/history",
- "version": "3.0.0-alpha.0",
- "description": "Sync Alpine data with the browser's query string",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "dependencies": {
- "@vue/reactivity": "^3.0.2"
- }
-}
diff --git a/alpinejs/packages/history/src/index.js b/alpinejs/packages/history/src/index.js
deleted file mode 100644
index f230d80..0000000
--- a/alpinejs/packages/history/src/index.js
+++ /dev/null
@@ -1,76 +0,0 @@
-export default function history(Alpine) {
- Alpine.magic('queryString', (el, { interceptor }) => {
- let alias
-
- return interceptor((initialValue, getter, setter, path, key) => {
- let pause = false
- let queryKey = alias || path
-
- let value = initialValue
- let url = new URL(window.location.href)
-
- if (url.searchParams.has(queryKey)) {
- value = url.searchParams.get(queryKey)
- }
-
- setter(value)
-
- let object = { value }
-
- url.searchParams.set(queryKey, value)
-
- replace(url.toString(), path, object)
-
- window.addEventListener('popstate', (e) => {
- if (! e.state) return
- if (! e.state.alpine) return
-
- Object.entries(e.state.alpine).forEach(([newKey, { value }]) => {
- if (newKey !== key) return
-
- pause = true
-
- Alpine.disableEffectScheduling(() => {
- setter(value)
- })
-
- pause = false
- })
- })
-
- Alpine.effect(() => {
- let value = getter()
-
- if (pause) return
-
- let object = { value }
-
- let url = new URL(window.location.href)
-
- url.searchParams.set(queryKey, value)
-
- push(url.toString(), path, object)
- })
-
- return value
- }, func => {
- func.as = key => { alias = key; return func }
- })
- })
-}
-
-function replace(url, key, object) {
- let state = window.history.state || {}
-
- if (! state.alpine) state.alpine = {}
-
- state.alpine[key] = object
-
- window.history.replaceState(state, '', url)
-}
-
-function push(url, key, object) {
- let state = { alpine: {...window.history.state.alpine, ...{[key]: object}} }
-
- window.history.pushState(state, '', url)
-}
diff --git a/alpinejs/packages/history/src/url.js b/alpinejs/packages/history/src/url.js
deleted file mode 100644
index 7e2b4b6..0000000
--- a/alpinejs/packages/history/src/url.js
+++ /dev/null
@@ -1,36 +0,0 @@
-
-export function hasQueryParam(param) {
- let queryParams = new URLSearchParams(window.location.search);
-
- return queryParams.has(param)
-}
-
-export function getQueryParam(param) {
- let queryParams = new URLSearchParams(window.location.search);
-
- return queryParams.get(param)
-}
-
-export function setQueryParam(param, value) {
- let queryParams = new URLSearchParams(window.location.search);
-
- queryParams.set(param, value)
-
- let url = urlFromQueryParams(queryParams)
-
- history.replaceState(history.state, '', url)
-}
-
-function urlFromParams(params = {}) {
- let queryParams = new URLSearchParams(window.location.search);
-
- Object.entries(params).forEach(([key, value]) => {
- queryParams.set(key, value)
- })
-
- let queryString = Array.from(queryParams.entries()).length > 0
- ? '?'+params.toString()
- : ''
-
- return window.location.origin + window.location.pathname + '?'+queryString + window.location.hash
-}
diff --git a/alpinejs/packages/intersect/builds/cdn.js b/alpinejs/packages/intersect/builds/cdn.js
deleted file mode 100644
index 11f6360..0000000
--- a/alpinejs/packages/intersect/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import intersect from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(intersect)
-})
diff --git a/alpinejs/packages/intersect/builds/module.js b/alpinejs/packages/intersect/builds/module.js
deleted file mode 100644
index e33db04..0000000
--- a/alpinejs/packages/intersect/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import intersect from './../src/index.js'
-
-export default intersect
diff --git a/alpinejs/packages/intersect/dist/dist/cdn.js b/alpinejs/packages/intersect/dist/dist/cdn.js
deleted file mode 100644
index ddf68bb..0000000
--- a/alpinejs/packages/intersect/dist/dist/cdn.js
+++ /dev/null
@@ -1,35 +0,0 @@
-(() => {
- // packages/intersect/src/index.js
- function src_default(Alpine) {
- Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
- let evaluate = evaluateLater(expression);
- let options = {
- threshold: getThreshhold(modifiers)
- };
- let observer = new IntersectionObserver((entries) => {
- entries.forEach((entry) => {
- if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
- return;
- evaluate();
- modifiers.includes("once") && observer.disconnect();
- });
- }, options);
- observer.observe(el);
- cleanup(() => {
- observer.disconnect();
- });
- });
- }
- function getThreshhold(modifiers) {
- if (modifiers.includes("full"))
- return 0.99;
- if (modifiers.includes("half"))
- return 0.5;
- return 0;
- }
-
- // packages/intersect/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(src_default);
- });
-})();
diff --git a/alpinejs/packages/intersect/dist/dist/cdn.min.js b/alpinejs/packages/intersect/dist/dist/cdn.min.js
deleted file mode 100644
index 6adbb58..0000000
--- a/alpinejs/packages/intersect/dist/dist/cdn.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{function c(e){e.directive("intersect",(s,{value:n,expression:o,modifiers:r},{evaluateLater:l,cleanup:d})=>{let u=l(o),f={threshold:h(r)},t=new IntersectionObserver(a=>{a.forEach(i=>{!i.isIntersecting&&n==="enter"||i.isIntersecting&&n==="leave"||i.intersectionRatio===0&&!n||(u(),r.includes("once")&&t.disconnect())})},f);t.observe(s),d(()=>{t.disconnect()})})}function h(e){return e.includes("full")?.99:e.includes("half")?.5:0}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(c)});})();
diff --git a/alpinejs/packages/intersect/dist/dist/module.cjs.js b/alpinejs/packages/intersect/dist/dist/module.cjs.js
deleted file mode 100644
index e136fa2..0000000
--- a/alpinejs/packages/intersect/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var __defProp = Object.defineProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-
-// packages/intersect/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/intersect/src/index.js
-function src_default(Alpine) {
- Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
- let evaluate = evaluateLater(expression);
- let options = {
- threshold: getThreshhold(modifiers)
- };
- let observer = new IntersectionObserver((entries) => {
- entries.forEach((entry) => {
- if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
- return;
- evaluate();
- modifiers.includes("once") && observer.disconnect();
- });
- }, options);
- observer.observe(el);
- cleanup(() => {
- observer.disconnect();
- });
- });
-}
-function getThreshhold(modifiers) {
- if (modifiers.includes("full"))
- return 0.99;
- if (modifiers.includes("half"))
- return 0.5;
- return 0;
-}
-
-// packages/intersect/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/intersect/dist/dist/module.esm.js b/alpinejs/packages/intersect/dist/dist/module.esm.js
deleted file mode 100644
index 84aa068..0000000
--- a/alpinejs/packages/intersect/dist/dist/module.esm.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// packages/intersect/src/index.js
-function src_default(Alpine) {
- Alpine.directive("intersect", (el, {value, expression, modifiers}, {evaluateLater, cleanup}) => {
- let evaluate = evaluateLater(expression);
- let options = {
- threshold: getThreshhold(modifiers)
- };
- let observer = new IntersectionObserver((entries) => {
- entries.forEach((entry) => {
- if (!entry.isIntersecting && value === "enter" || entry.isIntersecting && value === "leave" || entry.intersectionRatio === 0 && !value)
- return;
- evaluate();
- modifiers.includes("once") && observer.disconnect();
- });
- }, options);
- observer.observe(el);
- cleanup(() => {
- observer.disconnect();
- });
- });
-}
-function getThreshhold(modifiers) {
- if (modifiers.includes("full"))
- return 0.99;
- if (modifiers.includes("half"))
- return 0.5;
- return 0;
-}
-
-// packages/intersect/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/intersect/package.json b/alpinejs/packages/intersect/package.json
deleted file mode 100644
index fc9b07d..0000000
--- a/alpinejs/packages/intersect/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "@alpinejs/intersect",
- "version": "3.4.2",
- "description": "Trigger JavaScript when an element enters the viewport",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "unpkg": "dist/cdn.min.js",
- "dependencies": {}
-}
diff --git a/alpinejs/packages/intersect/src/index.js b/alpinejs/packages/intersect/src/index.js
deleted file mode 100644
index ab53d9a..0000000
--- a/alpinejs/packages/intersect/src/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-
-export default function (Alpine) {
- Alpine.directive('intersect', (el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
- let evaluate = evaluateLater(expression)
-
- let options = {
- threshold: getThreshhold(modifiers),
- }
-
- let observer = new IntersectionObserver(entries => {
- entries.forEach(entry => {
- if (
- ! entry.isIntersecting && value === 'enter'
- || entry.isIntersecting && value === 'leave'
- || entry.intersectionRatio === 0 && ! value
- ) return
-
- evaluate()
-
- modifiers.includes('once') && observer.disconnect()
- })
- }, options)
-
- observer.observe(el)
-
- cleanup(() => {
- observer.disconnect()
- })
- })
-}
-
-function getThreshhold(modifiers) {
- if (modifiers.includes('full')) return 0.99
- if (modifiers.includes('half')) return 0.5
-
- return 0
-}
diff --git a/alpinejs/packages/morph/builds/cdn.js b/alpinejs/packages/morph/builds/cdn.js
deleted file mode 100644
index 3f1414c..0000000
--- a/alpinejs/packages/morph/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import morph from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(morph)
-})
diff --git a/alpinejs/packages/morph/builds/module.js b/alpinejs/packages/morph/builds/module.js
deleted file mode 100644
index 0359ad7..0000000
--- a/alpinejs/packages/morph/builds/module.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import morphPlugin, { morph } from '../src/index.js'
-
-export default morphPlugin
-
-export { morph }
diff --git a/alpinejs/packages/morph/dist/dist/cdn.js b/alpinejs/packages/morph/dist/dist/cdn.js
deleted file mode 100644
index e023c91..0000000
--- a/alpinejs/packages/morph/dist/dist/cdn.js
+++ /dev/null
@@ -1,219 +0,0 @@
-(() => {
- // packages/morph/src/morph.js
- function morph(dom, toHtml, options) {
- assignOptions(options);
- patch(dom, createElement(toHtml));
- return dom;
- }
- var key;
- var lookahead;
- var updating;
- var updated;
- var removing;
- var removed;
- var adding;
- var added;
- var noop = () => {
- };
- function assignOptions(options = {}) {
- let defaultGetKey = (el) => el.getAttribute("key");
- key = options.key || defaultGetKey;
- lookahead = options.lookahead || false;
- updating = options.updating || noop;
- updated = options.updated || noop;
- removing = options.removing || noop;
- removed = options.removed || noop;
- adding = options.adding || noop;
- added = options.added || noop;
- }
- function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
- }
- function patch(dom, to) {
- if (dom.isEqualNode(to))
- return;
- if (differentElementNamesTypesOrKeys(dom, to)) {
- return patchElement(dom, to);
- }
- let updateChildrenOnly = false;
- if (shouldSkip(updating, dom, to, () => updateChildrenOnly = true))
- return;
- if (textOrComment(to)) {
- patchNodeValue(dom, to);
- updated(dom, to);
- return;
- }
- if (!updateChildrenOnly) {
- patchAttributes(dom, to);
- }
- updated(dom, to);
- patchChildren(dom, to);
- }
- function differentElementNamesTypesOrKeys(dom, to) {
- return dom.nodeType != to.nodeType || dom.nodeName != to.nodeName || getKey(dom) != getKey(to);
- }
- function textOrComment(el) {
- return el.nodeType === 3 || el.nodeType === 8;
- }
- function patchElement(dom, to) {
- if (shouldSkip(removing, dom))
- return;
- let toCloned = to.cloneNode(true);
- if (shouldSkip(adding, toCloned))
- return;
- dom.parentNode.replaceChild(toCloned, dom);
- removed(dom);
- added(toCloned);
- }
- function patchNodeValue(dom, to) {
- let value = to.nodeValue;
- if (dom.nodeValue !== value)
- dom.nodeValue = value;
- }
- function patchAttributes(dom, to) {
- if (dom._x_isShown && !to._x_isShown) {
- return;
- }
- if (!dom._x_isShown && to._x_isShown) {
- return;
- }
- let domAttributes = Array.from(dom.attributes);
- let toAttributes = Array.from(to.attributes);
- for (let i = domAttributes.length - 1; i >= 0; i--) {
- let name = domAttributes[i].name;
- if (!to.hasAttribute(name))
- dom.removeAttribute(name);
- }
- for (let i = toAttributes.length - 1; i >= 0; i--) {
- let name = toAttributes[i].name;
- let value = toAttributes[i].value;
- if (dom.getAttribute(name) !== value)
- dom.setAttribute(name, value);
- }
- }
- function patchChildren(dom, to) {
- let domChildren = dom.childNodes;
- let toChildren = to.childNodes;
- let toKeyToNodeMap = keyToMap(toChildren);
- let domKeyDomNodeMap = keyToMap(domChildren);
- let currentTo = to.firstChild;
- let currentFrom = dom.firstChild;
- let domKeyHoldovers = {};
- while (currentTo) {
- let toKey = getKey(currentTo);
- let domKey = getKey(currentFrom);
- if (!currentFrom) {
- if (toKey && domKeyHoldovers[toKey]) {
- let holdover = domKeyHoldovers[toKey];
- dom.appendChild(holdover);
- currentFrom = holdover;
- } else {
- addNodeTo(currentTo, dom);
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- if (lookahead) {
- let nextToElementSibling = currentTo.nextElementSibling;
- if (nextToElementSibling && currentFrom.isEqualNode(nextToElementSibling)) {
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKey = getKey(currentFrom);
- }
- }
- if (toKey !== domKey) {
- if (!toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- if (toKey && !domKey) {
- if (domKeyDomNodeMap[toKey]) {
- currentFrom.parentElement.replaceChild(domKeyDomNodeMap[toKey], currentFrom);
- currentFrom = domKeyDomNodeMap[toKey];
- }
- }
- if (toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- let domKeyNode = domKeyDomNodeMap[toKey];
- if (domKeyNode) {
- currentFrom.parentElement.replaceChild(domKeyNode, currentFrom);
- currentFrom = domKeyNode;
- } else {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- }
- patch(currentFrom, currentTo);
- currentTo = currentTo && currentTo.nextSibling;
- currentFrom = currentFrom && currentFrom.nextSibling;
- }
- while (currentFrom) {
- if (!shouldSkip(removing, currentFrom)) {
- let domForRemoval = currentFrom;
- dom.removeChild(domForRemoval);
- removed(domForRemoval);
- }
- currentFrom = currentFrom.nextSibling;
- }
- }
- function getKey(el) {
- return el && el.nodeType === 1 && key(el);
- }
- function keyToMap(els) {
- let map = {};
- els.forEach((el) => {
- let theKey = getKey(el);
- if (theKey) {
- map[theKey] = el;
- }
- });
- return map;
- }
- function shouldSkip(hook, ...args) {
- let skip = false;
- hook(...args, () => skip = true);
- return skip;
- }
- function addNodeTo(node, parent) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- parent.appendChild(clone);
- added(clone);
- }
- }
- function addNodeBefore(node, beforeMe) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- beforeMe.parentElement.insertBefore(clone, beforeMe);
- added(clone);
- return clone;
- }
- return beforeMe;
- }
-
- // packages/morph/src/index.js
- function src_default(Alpine) {
- Alpine.directive("morph", (el, {expression}, {effect, evaluateLater}) => {
- let evaluate = evaluateLater(expression);
- effect(() => {
- evaluate((value) => {
- let child = el.firstElementChild || el.firstChild || el.appendChild(document.createTextNode(""));
- morph(child, value);
- });
- });
- });
- }
-
- // packages/morph/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(src_default);
- });
-})();
diff --git a/alpinejs/packages/morph/dist/dist/cdn.min.js b/alpinejs/packages/morph/dist/dist/cdn.min.js
deleted file mode 100644
index cad56f2..0000000
--- a/alpinejs/packages/morph/dist/dist/cdn.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{function C(e,t,i){return T(i),b(e,K(t)),e}var N,v,w,g,y,S,m,x,h=()=>{};function T(e={}){let t=i=>i.getAttribute("key");N=e.key||t,v=e.lookahead||!1,w=e.updating||h,g=e.updated||h,y=e.removing||h,S=e.removed||h,m=e.adding||h,x=e.added||h}function K(e){return document.createRange().createContextualFragment(e).firstElementChild}function b(e,t){if(e.isEqualNode(t))return;if(k(e,t))return V(e,t);let i=!1;if(!p(w,e,t,()=>i=!0)){if(O(t)){F(e,t),g(e,t);return}i||q(e,t),g(e,t),B(e,t)}}function k(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||s(e)!=s(t)}function O(e){return e.nodeType===3||e.nodeType===8}function V(e,t){if(p(y,e))return;let i=t.cloneNode(!0);p(m,i)||(e.parentNode.replaceChild(i,e),S(e),x(i))}function F(e,t){let i=t.nodeValue;e.nodeValue!==i&&(e.nodeValue=i)}function q(e,t){if(e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let i=Array.from(e.attributes),o=Array.from(t.attributes);for(let u=i.length-1;u>=0;u--){let a=i[u].name;t.hasAttribute(a)||e.removeAttribute(a)}for(let u=o.length-1;u>=0;u--){let a=o[u].name,r=o[u].value;e.getAttribute(a)!==r&&e.setAttribute(a,r)}}function B(e,t){let i=e.childNodes,o=t.childNodes,u=A(o),a=A(i),r=t.firstChild,n=e.firstChild,c={};for(;r;){let l=s(r),d=s(n);if(!n)if(l&&c[l]){let f=c[l];e.appendChild(f),n=f}else{H(r,e),r=r.nextSibling;continue}if(v){let f=r.nextElementSibling;f&&n.isEqualNode(f)&&(n=_(r,n),d=s(n))}if(l!==d){if(!l&&d){c[d]=n,n=_(r,n),c[d].remove(),n=n.nextSibling,r=r.nextSibling;continue}if(l&&!d&&a[l]&&(n.parentElement.replaceChild(a[l],n),n=a[l]),l&&d){c[d]=n;let f=a[l];if(f)n.parentElement.replaceChild(f,n),n=f;else{c[d]=n,n=_(r,n),c[d].remove(),n=n.nextSibling,r=r.nextSibling;continue}}}b(n,r),r=r&&r.nextSibling,n=n&&n.nextSibling}for(;n;){if(!p(y,n)){let l=n;e.removeChild(l),S(l)}n=n.nextSibling}}function s(e){return e&&e.nodeType===1&&N(e)}function A(e){let t={};return e.forEach(i=>{let o=s(i);o&&(t[o]=i)}),t}function p(e,...t){let i=!1;return e(...t,()=>i=!0),i}function H(e,t){if(!p(m,e)){let i=e.cloneNode(!0);t.appendChild(i),x(i)}}function _(e,t){if(!p(m,e)){let i=e.cloneNode(!0);return t.parentElement.insertBefore(i,t),x(i),i}return t}function E(e){e.directive("morph",(t,{expression:i},{effect:o,evaluateLater:u})=>{let a=u(i);o(()=>{a(r=>{let n=t.firstElementChild||t.firstChild||t.appendChild(document.createTextNode(""));C(n,r)})})})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(E)});})();
diff --git a/alpinejs/packages/morph/dist/dist/module.cjs.js b/alpinejs/packages/morph/dist/dist/module.cjs.js
deleted file mode 100644
index d3b7faa..0000000
--- a/alpinejs/packages/morph/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,229 +0,0 @@
-var __defProp = Object.defineProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-
-// packages/morph/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default,
- morph: () => morph
-});
-
-// packages/morph/src/morph.js
-function morph(dom, toHtml, options) {
- assignOptions(options);
- patch(dom, createElement(toHtml));
- return dom;
-}
-var key;
-var lookahead;
-var updating;
-var updated;
-var removing;
-var removed;
-var adding;
-var added;
-var noop = () => {
-};
-function assignOptions(options = {}) {
- let defaultGetKey = (el) => el.getAttribute("key");
- key = options.key || defaultGetKey;
- lookahead = options.lookahead || false;
- updating = options.updating || noop;
- updated = options.updated || noop;
- removing = options.removing || noop;
- removed = options.removed || noop;
- adding = options.adding || noop;
- added = options.added || noop;
-}
-function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
-}
-function patch(dom, to) {
- if (dom.isEqualNode(to))
- return;
- if (differentElementNamesTypesOrKeys(dom, to)) {
- return patchElement(dom, to);
- }
- let updateChildrenOnly = false;
- if (shouldSkip(updating, dom, to, () => updateChildrenOnly = true))
- return;
- if (textOrComment(to)) {
- patchNodeValue(dom, to);
- updated(dom, to);
- return;
- }
- if (!updateChildrenOnly) {
- patchAttributes(dom, to);
- }
- updated(dom, to);
- patchChildren(dom, to);
-}
-function differentElementNamesTypesOrKeys(dom, to) {
- return dom.nodeType != to.nodeType || dom.nodeName != to.nodeName || getKey(dom) != getKey(to);
-}
-function textOrComment(el) {
- return el.nodeType === 3 || el.nodeType === 8;
-}
-function patchElement(dom, to) {
- if (shouldSkip(removing, dom))
- return;
- let toCloned = to.cloneNode(true);
- if (shouldSkip(adding, toCloned))
- return;
- dom.parentNode.replaceChild(toCloned, dom);
- removed(dom);
- added(toCloned);
-}
-function patchNodeValue(dom, to) {
- let value = to.nodeValue;
- if (dom.nodeValue !== value)
- dom.nodeValue = value;
-}
-function patchAttributes(dom, to) {
- if (dom._x_isShown && !to._x_isShown) {
- return;
- }
- if (!dom._x_isShown && to._x_isShown) {
- return;
- }
- let domAttributes = Array.from(dom.attributes);
- let toAttributes = Array.from(to.attributes);
- for (let i = domAttributes.length - 1; i >= 0; i--) {
- let name = domAttributes[i].name;
- if (!to.hasAttribute(name))
- dom.removeAttribute(name);
- }
- for (let i = toAttributes.length - 1; i >= 0; i--) {
- let name = toAttributes[i].name;
- let value = toAttributes[i].value;
- if (dom.getAttribute(name) !== value)
- dom.setAttribute(name, value);
- }
-}
-function patchChildren(dom, to) {
- let domChildren = dom.childNodes;
- let toChildren = to.childNodes;
- let toKeyToNodeMap = keyToMap(toChildren);
- let domKeyDomNodeMap = keyToMap(domChildren);
- let currentTo = to.firstChild;
- let currentFrom = dom.firstChild;
- let domKeyHoldovers = {};
- while (currentTo) {
- let toKey = getKey(currentTo);
- let domKey = getKey(currentFrom);
- if (!currentFrom) {
- if (toKey && domKeyHoldovers[toKey]) {
- let holdover = domKeyHoldovers[toKey];
- dom.appendChild(holdover);
- currentFrom = holdover;
- } else {
- addNodeTo(currentTo, dom);
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- if (lookahead) {
- let nextToElementSibling = currentTo.nextElementSibling;
- if (nextToElementSibling && currentFrom.isEqualNode(nextToElementSibling)) {
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKey = getKey(currentFrom);
- }
- }
- if (toKey !== domKey) {
- if (!toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- if (toKey && !domKey) {
- if (domKeyDomNodeMap[toKey]) {
- currentFrom.parentElement.replaceChild(domKeyDomNodeMap[toKey], currentFrom);
- currentFrom = domKeyDomNodeMap[toKey];
- }
- }
- if (toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- let domKeyNode = domKeyDomNodeMap[toKey];
- if (domKeyNode) {
- currentFrom.parentElement.replaceChild(domKeyNode, currentFrom);
- currentFrom = domKeyNode;
- } else {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- }
- patch(currentFrom, currentTo);
- currentTo = currentTo && currentTo.nextSibling;
- currentFrom = currentFrom && currentFrom.nextSibling;
- }
- while (currentFrom) {
- if (!shouldSkip(removing, currentFrom)) {
- let domForRemoval = currentFrom;
- dom.removeChild(domForRemoval);
- removed(domForRemoval);
- }
- currentFrom = currentFrom.nextSibling;
- }
-}
-function getKey(el) {
- return el && el.nodeType === 1 && key(el);
-}
-function keyToMap(els) {
- let map = {};
- els.forEach((el) => {
- let theKey = getKey(el);
- if (theKey) {
- map[theKey] = el;
- }
- });
- return map;
-}
-function shouldSkip(hook, ...args) {
- let skip = false;
- hook(...args, () => skip = true);
- return skip;
-}
-function addNodeTo(node, parent) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- parent.appendChild(clone);
- added(clone);
- }
-}
-function addNodeBefore(node, beforeMe) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- beforeMe.parentElement.insertBefore(clone, beforeMe);
- added(clone);
- return clone;
- }
- return beforeMe;
-}
-
-// packages/morph/src/index.js
-function src_default(Alpine) {
- Alpine.directive("morph", (el, {expression}, {effect, evaluateLater}) => {
- let evaluate = evaluateLater(expression);
- effect(() => {
- evaluate((value) => {
- let child = el.firstElementChild || el.firstChild || el.appendChild(document.createTextNode(""));
- morph(child, value);
- });
- });
- });
-}
-
-// packages/morph/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/morph/dist/dist/module.esm.js b/alpinejs/packages/morph/dist/dist/module.esm.js
deleted file mode 100644
index 14fae59..0000000
--- a/alpinejs/packages/morph/dist/dist/module.esm.js
+++ /dev/null
@@ -1,219 +0,0 @@
-// packages/morph/src/morph.js
-function morph(dom, toHtml, options) {
- assignOptions(options);
- patch(dom, createElement(toHtml));
- return dom;
-}
-var key;
-var lookahead;
-var updating;
-var updated;
-var removing;
-var removed;
-var adding;
-var added;
-var noop = () => {
-};
-function assignOptions(options = {}) {
- let defaultGetKey = (el) => el.getAttribute("key");
- key = options.key || defaultGetKey;
- lookahead = options.lookahead || false;
- updating = options.updating || noop;
- updated = options.updated || noop;
- removing = options.removing || noop;
- removed = options.removed || noop;
- adding = options.adding || noop;
- added = options.added || noop;
-}
-function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
-}
-function patch(dom, to) {
- if (dom.isEqualNode(to))
- return;
- if (differentElementNamesTypesOrKeys(dom, to)) {
- return patchElement(dom, to);
- }
- let updateChildrenOnly = false;
- if (shouldSkip(updating, dom, to, () => updateChildrenOnly = true))
- return;
- if (textOrComment(to)) {
- patchNodeValue(dom, to);
- updated(dom, to);
- return;
- }
- if (!updateChildrenOnly) {
- patchAttributes(dom, to);
- }
- updated(dom, to);
- patchChildren(dom, to);
-}
-function differentElementNamesTypesOrKeys(dom, to) {
- return dom.nodeType != to.nodeType || dom.nodeName != to.nodeName || getKey(dom) != getKey(to);
-}
-function textOrComment(el) {
- return el.nodeType === 3 || el.nodeType === 8;
-}
-function patchElement(dom, to) {
- if (shouldSkip(removing, dom))
- return;
- let toCloned = to.cloneNode(true);
- if (shouldSkip(adding, toCloned))
- return;
- dom.parentNode.replaceChild(toCloned, dom);
- removed(dom);
- added(toCloned);
-}
-function patchNodeValue(dom, to) {
- let value = to.nodeValue;
- if (dom.nodeValue !== value)
- dom.nodeValue = value;
-}
-function patchAttributes(dom, to) {
- if (dom._x_isShown && !to._x_isShown) {
- return;
- }
- if (!dom._x_isShown && to._x_isShown) {
- return;
- }
- let domAttributes = Array.from(dom.attributes);
- let toAttributes = Array.from(to.attributes);
- for (let i = domAttributes.length - 1; i >= 0; i--) {
- let name = domAttributes[i].name;
- if (!to.hasAttribute(name))
- dom.removeAttribute(name);
- }
- for (let i = toAttributes.length - 1; i >= 0; i--) {
- let name = toAttributes[i].name;
- let value = toAttributes[i].value;
- if (dom.getAttribute(name) !== value)
- dom.setAttribute(name, value);
- }
-}
-function patchChildren(dom, to) {
- let domChildren = dom.childNodes;
- let toChildren = to.childNodes;
- let toKeyToNodeMap = keyToMap(toChildren);
- let domKeyDomNodeMap = keyToMap(domChildren);
- let currentTo = to.firstChild;
- let currentFrom = dom.firstChild;
- let domKeyHoldovers = {};
- while (currentTo) {
- let toKey = getKey(currentTo);
- let domKey = getKey(currentFrom);
- if (!currentFrom) {
- if (toKey && domKeyHoldovers[toKey]) {
- let holdover = domKeyHoldovers[toKey];
- dom.appendChild(holdover);
- currentFrom = holdover;
- } else {
- addNodeTo(currentTo, dom);
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- if (lookahead) {
- let nextToElementSibling = currentTo.nextElementSibling;
- if (nextToElementSibling && currentFrom.isEqualNode(nextToElementSibling)) {
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKey = getKey(currentFrom);
- }
- }
- if (toKey !== domKey) {
- if (!toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- if (toKey && !domKey) {
- if (domKeyDomNodeMap[toKey]) {
- currentFrom.parentElement.replaceChild(domKeyDomNodeMap[toKey], currentFrom);
- currentFrom = domKeyDomNodeMap[toKey];
- }
- }
- if (toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom;
- let domKeyNode = domKeyDomNodeMap[toKey];
- if (domKeyNode) {
- currentFrom.parentElement.replaceChild(domKeyNode, currentFrom);
- currentFrom = domKeyNode;
- } else {
- domKeyHoldovers[domKey] = currentFrom;
- currentFrom = addNodeBefore(currentTo, currentFrom);
- domKeyHoldovers[domKey].remove();
- currentFrom = currentFrom.nextSibling;
- currentTo = currentTo.nextSibling;
- continue;
- }
- }
- }
- patch(currentFrom, currentTo);
- currentTo = currentTo && currentTo.nextSibling;
- currentFrom = currentFrom && currentFrom.nextSibling;
- }
- while (currentFrom) {
- if (!shouldSkip(removing, currentFrom)) {
- let domForRemoval = currentFrom;
- dom.removeChild(domForRemoval);
- removed(domForRemoval);
- }
- currentFrom = currentFrom.nextSibling;
- }
-}
-function getKey(el) {
- return el && el.nodeType === 1 && key(el);
-}
-function keyToMap(els) {
- let map = {};
- els.forEach((el) => {
- let theKey = getKey(el);
- if (theKey) {
- map[theKey] = el;
- }
- });
- return map;
-}
-function shouldSkip(hook, ...args) {
- let skip = false;
- hook(...args, () => skip = true);
- return skip;
-}
-function addNodeTo(node, parent) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- parent.appendChild(clone);
- added(clone);
- }
-}
-function addNodeBefore(node, beforeMe) {
- if (!shouldSkip(adding, node)) {
- let clone = node.cloneNode(true);
- beforeMe.parentElement.insertBefore(clone, beforeMe);
- added(clone);
- return clone;
- }
- return beforeMe;
-}
-
-// packages/morph/src/index.js
-function src_default(Alpine) {
- Alpine.directive("morph", (el, {expression}, {effect, evaluateLater}) => {
- let evaluate = evaluateLater(expression);
- effect(() => {
- evaluate((value) => {
- let child = el.firstElementChild || el.firstChild || el.appendChild(document.createTextNode(""));
- morph(child, value);
- });
- });
- });
-}
-
-// packages/morph/builds/module.js
-var module_default = src_default;
-export {
- module_default as default,
- morph
-};
diff --git a/alpinejs/packages/morph/package.json b/alpinejs/packages/morph/package.json
deleted file mode 100644
index 101f7cf..0000000
--- a/alpinejs/packages/morph/package.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "@alpinejs/morph",
- "version": "3.0.0-alpha.0",
- "description": "Diff and patch a block of HTML on a page with an HTML template",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "dependencies": {
- "@vue/reactivity": "^3.0.2"
- }
-}
diff --git a/alpinejs/packages/morph/src/index.js b/alpinejs/packages/morph/src/index.js
deleted file mode 100644
index 8b3efb9..0000000
--- a/alpinejs/packages/morph/src/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { morph } from './morph'
-
-export default function (Alpine) {
- Alpine.directive('morph', (el, { expression }, { effect, evaluateLater }) => {
- let evaluate = evaluateLater(expression)
-
- effect(() => {
- evaluate(value => {
- let child = el.firstElementChild || el.firstChild || el.appendChild(document.createTextNode(''))
-
- morph(child, value)
- })
- })
- })
-}
-
-export { morph }
diff --git a/alpinejs/packages/morph/src/morph.js b/alpinejs/packages/morph/src/morph.js
deleted file mode 100644
index f3e341a..0000000
--- a/alpinejs/packages/morph/src/morph.js
+++ /dev/null
@@ -1,370 +0,0 @@
-
-export function morph(dom, toHtml, options) {
- assignOptions(options)
-
- patch(dom, createElement(toHtml))
-
- return dom
-}
-
-let key
-,lookahead
-,updating
-,updated
-,removing
-,removed
-,adding
-,added
-
-let noop = () => {}
-
-function assignOptions(options = {}) {
- let defaultGetKey = el => el.getAttribute('key')
-
- key = options.key || defaultGetKey
- lookahead = options.lookahead || false
- updating = options.updating || noop
- updated = options.updated || noop
- removing = options.removing || noop
- removed = options.removed || noop
- adding = options.adding || noop
- added = options.added || noop
-}
-
-function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild
-}
-
-function patch(dom, to) {
- if (dom.isEqualNode(to)) return
-
- if (differentElementNamesTypesOrKeys(dom, to)) {
- return patchElement(dom, to)
- }
-
- let updateChildrenOnly = false
-
- if (shouldSkip(updating, dom, to, () => updateChildrenOnly = true)) return
-
- // window.Alpine && initializeAlpineOnTo(dom, to, () => updateChildrenOnly = true)
-
- if (textOrComment(to)) {
- patchNodeValue(dom, to)
- updated(dom, to)
- return
- }
-
- if (! updateChildrenOnly) {
- patchAttributes(dom, to)
- }
-
- updated(dom, to)
-
- patchChildren(dom, to)
-}
-
-function differentElementNamesTypesOrKeys(dom, to) {
- return dom.nodeType != to.nodeType
- || dom.nodeName != to.nodeName
- || getKey(dom) != getKey(to)
-}
-
-function textOrComment(el) {
- return el.nodeType === 3
- || el.nodeType === 8
-}
-
-function patchElement(dom, to) {
- if(shouldSkip(removing, dom)) return
-
- let toCloned = to.cloneNode(true)
-
- if(shouldSkip(adding, toCloned)) return
-
- dom.parentNode.replaceChild(toCloned, dom)
-
- removed(dom)
- added(toCloned)
-}
-
-function patchNodeValue(dom, to) {
- let value = to.nodeValue
-
- if (dom.nodeValue !== value) dom.nodeValue = value
-}
-
-function patchAttributes(dom, to) {
- if (dom._x_isShown && ! to._x_isShown) {
- return
- // dom._x_hide()
- }
- if (! dom._x_isShown && to._x_isShown) {
- return
- // dom._x_show()
- }
-
- let domAttributes = Array.from(dom.attributes)
- let toAttributes = Array.from(to.attributes)
-
- for (let i = domAttributes.length - 1; i >= 0; i--) {
- let name = domAttributes[i].name;
-
- if (! to.hasAttribute(name)) dom.removeAttribute(name)
- }
-
- for (let i = toAttributes.length - 1; i >= 0; i--) {
- let name = toAttributes[i].name
- let value = toAttributes[i].value
-
- if (dom.getAttribute(name) !== value) dom.setAttribute(name, value)
- }
-}
-
-function patchChildren(dom, to) {
- let domChildren = dom.childNodes
- let toChildren = to.childNodes
-
- let toKeyToNodeMap = keyToMap(toChildren)
- let domKeyDomNodeMap = keyToMap(domChildren)
-
- let currentTo = to.firstChild
- let currentFrom = dom.firstChild
-
- let domKeyHoldovers = {}
-
- while (currentTo) {
- let toKey = getKey(currentTo)
- let domKey = getKey(currentFrom)
-
- // Add new elements
- if (! currentFrom) {
- if (toKey && domKeyHoldovers[toKey]) {
- let holdover = domKeyHoldovers[toKey]
-
- dom.appendChild(holdover)
- currentFrom = holdover
- } else {
- addNodeTo(currentTo, dom)
- currentTo = currentTo.nextSibling
- continue
- }
- }
-
- if (lookahead) {
- let nextToElementSibling = currentTo.nextElementSibling
-
- if (nextToElementSibling && currentFrom.isEqualNode(nextToElementSibling)) {
- currentFrom = addNodeBefore(currentTo, currentFrom)
-
- domKey = getKey(currentFrom)
- }
- }
-
- if (toKey !== domKey) {
- if (! toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom
- currentFrom = addNodeBefore(currentTo, currentFrom)
- domKeyHoldovers[domKey].remove()
- currentFrom = currentFrom.nextSibling
- currentTo = currentTo.nextSibling
- continue
- }
-
- if (toKey && ! domKey) {
- if (domKeyDomNodeMap[toKey]) {
- currentFrom.parentElement.replaceChild(domKeyDomNodeMap[toKey], currentFrom)
- currentFrom = domKeyDomNodeMap[toKey]
- }
- }
-
- if (toKey && domKey) {
- domKeyHoldovers[domKey] = currentFrom
- let domKeyNode = domKeyDomNodeMap[toKey]
-
- if (domKeyNode) {
- currentFrom.parentElement.replaceChild(domKeyNode, currentFrom)
- currentFrom = domKeyNode
- } else {
- domKeyHoldovers[domKey] = currentFrom
- currentFrom = addNodeBefore(currentTo, currentFrom)
- domKeyHoldovers[domKey].remove()
- currentFrom = currentFrom.nextSibling
- currentTo = currentTo.nextSibling
- continue
- }
- }
- }
-
- // Patch elements
- patch(currentFrom, currentTo)
-
- currentTo = currentTo && currentTo.nextSibling
- currentFrom = currentFrom && currentFrom.nextSibling
- }
-
- // Cleanup extra froms
- while (currentFrom) {
- if(! shouldSkip(removing, currentFrom)) {
- let domForRemoval = currentFrom
-
- dom.removeChild(domForRemoval)
-
- removed(domForRemoval)
- }
-
- currentFrom = currentFrom.nextSibling
- }
-}
-
-function getKey(el) {
- return el && el.nodeType === 1 && key(el)
-}
-
-function keyToMap(els) {
- let map = {}
-
- els.forEach(el => {
- let theKey = getKey(el)
-
- if (theKey) {
- map[theKey] = el
- }
- })
-
- return map
-}
-
-function shouldSkip(hook, ...args) {
- let skip = false
-
- hook(...args, () => skip = true)
-
- return skip
-}
-
-function addNodeTo(node, parent) {
- if(! shouldSkip(adding, node)) {
- let clone = node.cloneNode(true)
-
- parent.appendChild(clone);
-
- added(clone)
- }
-}
-
-function addNodeBefore(node, beforeMe) {
- if(! shouldSkip(adding, node)) {
- let clone = node.cloneNode(true)
-
- beforeMe.parentElement.insertBefore(clone, beforeMe);
-
- added(clone)
-
- return clone
- }
-
- return beforeMe
-}
-
-function initializeAlpineOnTo(from, to, childrenOnly) {
- if (from.nodeType !== 1) return
-
- // If the element we are updating is an Alpine component...
- if (from._x_dataStack) {
- // Then temporarily clone it (with it's data) to the "to" element.
- // This should simulate backend Livewire being aware of Alpine changes.
- window.Alpine.clone(from, to)
- }
-
- // x-show elements require care because of transitions.
- if (
- Array.from(from.attributes)
- .map(attr => attr.name)
- .some(name => /x-show/.test(name))
- ) {
- if (from._x_transition) {
- // This covers @entangle('something')
- // childrenOnly()
- } else {
- // This covers x-show="$wire.something"
- //
- // If the element has x-show, we need to "reverse" the damage done by "clone",
- // so that if/when the element has a transition on it, it will occur naturally.
- // if (isHiding(from, to)) {
- // let style = to.getAttribute('style')
- // to.setAttribute('style', style.replace('display: none;', ''))
- // } else if (isShowing(from, to)) {
- // to.style.display = from.style.display
- // }
- }
- }
-}
-
-function isHiding(from, to) {
- return from._x_isShown && ! to._x_isShown
-}
-
-function isShowing(from, to) {
- return ! from._x_isShown && to._x_isShown
-}
-
-
-// This is from Livewire:
-
-
-// function alpinifyElementsForMorphdom(from, to) {
-// // If the element we are updating is an Alpine component...
-// if (from.__x) {
-// // Then temporarily clone it (with it's data) to the "to" element.
-// // This should simulate backend Livewire being aware of Alpine changes.
-// window.Alpine.clone(from.__x, to)
-// }
-
-// // x-show elements require care because of transitions.
-// if (
-// Array.from(from.attributes)
-// .map(attr => attr.name)
-// .some(name => /x-show/.test(name))
-// ) {
-// if (from.__x_transition) {
-// // This covers @entangle('something')
-// from.skipElUpdatingButStillUpdateChildren = true
-// } else {
-// // This covers x-show="$wire.something"
-// //
-// // If the element has x-show, we need to "reverse" the damage done by "clone",
-// // so that if/when the element has a transition on it, it will occur naturally.
-// if (isHiding(from, to)) {
-// let style = to.getAttribute('style')
-
-// if (style) {
-// to.setAttribute('style', style.replace('display: none;', ''))
-// }
-// } else if (isShowing(from, to)) {
-// to.style.display = from.style.display
-// }
-// }
-// }
-// }
-
-// function isHiding(from, to) {
-// if (beforeAlpineTwoPointSevenPointThree()) {
-// return from.style.display === '' && to.style.display === 'none'
-// }
-
-// return from._x_isShown && ! to._x_isShown
-// }
-
-// function isShowing(from, to) {
-// if (beforeAlpineTwoPointSevenPointThree()) {
-// return from.style.display === 'none' && to.style.display === ''
-// }
-
-// return ! from._x_isShown && to._x_isShown
-// }
-
-// function beforeAlpineTwoPointSevenPointThree() {
-// let [major, minor, patch] = window.Alpine.version.split('.').map(i => Number(i))
-
-// return major <= 2 && minor <= 7 && patch <= 2
-// }
diff --git a/alpinejs/packages/persist/builds/cdn.js b/alpinejs/packages/persist/builds/cdn.js
deleted file mode 100644
index c113e1a..0000000
--- a/alpinejs/packages/persist/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import persist from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(persist)
-})
diff --git a/alpinejs/packages/persist/builds/module.js b/alpinejs/packages/persist/builds/module.js
deleted file mode 100644
index 2872c9f..0000000
--- a/alpinejs/packages/persist/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import persist from '../src/index.js'
-
-export default persist
diff --git a/alpinejs/packages/persist/dist/dist/cdn.js b/alpinejs/packages/persist/dist/dist/cdn.js
deleted file mode 100644
index 0727150..0000000
--- a/alpinejs/packages/persist/dist/dist/cdn.js
+++ /dev/null
@@ -1,42 +0,0 @@
-(() => {
- // packages/persist/src/index.js
- function src_default(Alpine) {
- Alpine.magic("persist", (el, {interceptor}) => {
- let alias;
- let storage = localStorage;
- return interceptor((initialValue, getter, setter, path, key) => {
- let lookup = alias || `_x_${path}`;
- let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue;
- setter(initial);
- Alpine.effect(() => {
- let value = getter();
- storageSet(lookup, value, storage);
- setter(value);
- });
- return initial;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- }, func.using = (target) => {
- storage = target;
- return func;
- };
- });
- });
- }
- function storageHas(key, storage) {
- return storage.getItem(key) !== null;
- }
- function storageGet(key, storage) {
- return JSON.parse(storage.getItem(key, storage));
- }
- function storageSet(key, value, storage) {
- storage.setItem(key, JSON.stringify(value));
- }
-
- // packages/persist/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(src_default);
- });
-})();
diff --git a/alpinejs/packages/persist/dist/dist/cdn.min.js b/alpinejs/packages/persist/dist/dist/cdn.min.js
deleted file mode 100644
index b59eb98..0000000
--- a/alpinejs/packages/persist/dist/dist/cdn.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(()=>{function p(e){e.magic("persist",(t,{interceptor:l})=>{let o,i=localStorage;return l((r,n,s,m,S)=>{let a=o||`_x_${m}`,u=c(a,i)?d(a,i):r;return s(u),e.effect(()=>{let g=n();f(a,g,i),s(g)}),u},r=>{r.as=n=>(o=n,r),r.using=n=>(i=n,r)})})}function c(e,t){return t.getItem(e)!==null}function d(e,t){return JSON.parse(t.getItem(e,t))}function f(e,t,l){l.setItem(e,JSON.stringify(t))}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(p)});})();
diff --git a/alpinejs/packages/persist/dist/dist/module.cjs.js b/alpinejs/packages/persist/dist/dist/module.cjs.js
deleted file mode 100644
index 9a5e28d..0000000
--- a/alpinejs/packages/persist/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var __defProp = Object.defineProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-
-// packages/persist/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/persist/src/index.js
-function src_default(Alpine) {
- Alpine.magic("persist", (el, {interceptor}) => {
- let alias;
- let storage = localStorage;
- return interceptor((initialValue, getter, setter, path, key) => {
- let lookup = alias || `_x_${path}`;
- let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue;
- setter(initial);
- Alpine.effect(() => {
- let value = getter();
- storageSet(lookup, value, storage);
- setter(value);
- });
- return initial;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- }, func.using = (target) => {
- storage = target;
- return func;
- };
- });
- });
-}
-function storageHas(key, storage) {
- return storage.getItem(key) !== null;
-}
-function storageGet(key, storage) {
- return JSON.parse(storage.getItem(key, storage));
-}
-function storageSet(key, value, storage) {
- storage.setItem(key, JSON.stringify(value));
-}
-
-// packages/persist/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/persist/dist/dist/module.esm.js b/alpinejs/packages/persist/dist/dist/module.esm.js
deleted file mode 100644
index dbdd3b8..0000000
--- a/alpinejs/packages/persist/dist/dist/module.esm.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// packages/persist/src/index.js
-function src_default(Alpine) {
- Alpine.magic("persist", (el, {interceptor}) => {
- let alias;
- let storage = localStorage;
- return interceptor((initialValue, getter, setter, path, key) => {
- let lookup = alias || `_x_${path}`;
- let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue;
- setter(initial);
- Alpine.effect(() => {
- let value = getter();
- storageSet(lookup, value, storage);
- setter(value);
- });
- return initial;
- }, (func) => {
- func.as = (key) => {
- alias = key;
- return func;
- }, func.using = (target) => {
- storage = target;
- return func;
- };
- });
- });
-}
-function storageHas(key, storage) {
- return storage.getItem(key) !== null;
-}
-function storageGet(key, storage) {
- return JSON.parse(storage.getItem(key, storage));
-}
-function storageSet(key, value, storage) {
- storage.setItem(key, JSON.stringify(value));
-}
-
-// packages/persist/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/persist/package.json b/alpinejs/packages/persist/package.json
deleted file mode 100644
index 8c64dde..0000000
--- a/alpinejs/packages/persist/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "@alpinejs/persist",
- "version": "3.4.2",
- "description": "Persist Alpine data across page loads",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "unpkg": "dist/cdn.min.js",
- "dependencies": {}
-}
diff --git a/alpinejs/packages/persist/src/index.js b/alpinejs/packages/persist/src/index.js
deleted file mode 100644
index fcb308f..0000000
--- a/alpinejs/packages/persist/src/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-
-export default function (Alpine) {
- Alpine.magic('persist', (el, { interceptor }) => {
- let alias
- let storage = localStorage
-
- return interceptor((initialValue, getter, setter, path, key) => {
- let lookup = alias || `_x_${path}`
-
- let initial = storageHas(lookup, storage)
- ? storageGet(lookup, storage)
- : initialValue
-
- setter(initial)
-
- Alpine.effect(() => {
- let value = getter()
-
- storageSet(lookup, value, storage)
-
- setter(value)
- })
-
- return initial
- }, func => {
- func.as = key => { alias = key; return func },
- func.using = target => { storage = target; return func }
- })
- })
-}
-
-function storageHas(key, storage) {
- return storage.getItem(key) !== null
-}
-
-function storageGet(key, storage) {
- return JSON.parse(storage.getItem(key, storage))
-}
-
-function storageSet(key, value, storage) {
- storage.setItem(key, JSON.stringify(value))
-}
diff --git a/alpinejs/packages/trap/.gitignore b/alpinejs/packages/trap/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/alpinejs/packages/trap/.gitignore
+++ /dev/null
diff --git a/alpinejs/packages/trap/builds/cdn.js b/alpinejs/packages/trap/builds/cdn.js
deleted file mode 100644
index 4d17037..0000000
--- a/alpinejs/packages/trap/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import trap from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(trap)
-})
diff --git a/alpinejs/packages/trap/builds/module.js b/alpinejs/packages/trap/builds/module.js
deleted file mode 100644
index 0b45041..0000000
--- a/alpinejs/packages/trap/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import registerTrapDirective from '../src/index.js'
-
-export default registerTrapDirective
diff --git a/alpinejs/packages/trap/dist/dist/cdn.js b/alpinejs/packages/trap/dist/dist/cdn.js
deleted file mode 100644
index b104cf6..0000000
--- a/alpinejs/packages/trap/dist/dist/cdn.js
+++ /dev/null
@@ -1,650 +0,0 @@
-(() => {
- // node_modules/tabbable/dist/index.esm.js
- /*!
- * tabbable 5.2.1
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
- */
- var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"];
- var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
- var matches = typeof Element === "undefined" ? function() {
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
- var getCandidates = function getCandidates2(el, includeContainer, filter) {
- var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
- if (includeContainer && matches.call(el, candidateSelector)) {
- candidates.unshift(el);
- }
- candidates = candidates.filter(filter);
- return candidates;
- };
- var isContentEditable = function isContentEditable2(node) {
- return node.contentEditable === "true";
- };
- var getTabindex = function getTabindex2(node) {
- var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
- if (!isNaN(tabindexAttr)) {
- return tabindexAttr;
- }
- if (isContentEditable(node)) {
- return 0;
- }
- if ((node.nodeName === "AUDIO" || node.nodeName === "VIDEO" || node.nodeName === "DETAILS") && node.getAttribute("tabindex") === null) {
- return 0;
- }
- return node.tabIndex;
- };
- var sortOrderedTabbables = function sortOrderedTabbables2(a, b) {
- return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
- };
- var isInput = function isInput2(node) {
- return node.tagName === "INPUT";
- };
- var isHiddenInput = function isHiddenInput2(node) {
- return isInput(node) && node.type === "hidden";
- };
- var isDetailsWithSummary = function isDetailsWithSummary2(node) {
- var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
- return child.tagName === "SUMMARY";
- });
- return r;
- };
- var getCheckedRadio = function getCheckedRadio2(nodes, form) {
- for (var i = 0; i < nodes.length; i++) {
- if (nodes[i].checked && nodes[i].form === form) {
- return nodes[i];
- }
- }
- };
- var isTabbableRadio = function isTabbableRadio2(node) {
- if (!node.name) {
- return true;
- }
- var radioScope = node.form || node.ownerDocument;
- var queryRadios = function queryRadios2(name) {
- return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
- };
- var radioSet;
- if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
- radioSet = queryRadios(window.CSS.escape(node.name));
- } else {
- try {
- radioSet = queryRadios(node.name);
- } catch (err) {
- console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
- return false;
- }
- }
- var checked = getCheckedRadio(radioSet, node.form);
- return !checked || checked === node;
- };
- var isRadio = function isRadio2(node) {
- return isInput(node) && node.type === "radio";
- };
- var isNonTabbableRadio = function isNonTabbableRadio2(node) {
- return isRadio(node) && !isTabbableRadio(node);
- };
- var isHidden = function isHidden2(node, displayCheck) {
- if (getComputedStyle(node).visibility === "hidden") {
- return true;
- }
- var isDirectSummary = matches.call(node, "details>summary:first-of-type");
- var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
- if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
- return true;
- }
- if (!displayCheck || displayCheck === "full") {
- while (node) {
- if (getComputedStyle(node).display === "none") {
- return true;
- }
- node = node.parentElement;
- }
- } else if (displayCheck === "non-zero-area") {
- var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
- return width === 0 && height === 0;
- }
- return false;
- };
- var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
- if (isInput(node) || node.tagName === "SELECT" || node.tagName === "TEXTAREA" || node.tagName === "BUTTON") {
- var parentNode = node.parentElement;
- while (parentNode) {
- if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
- for (var i = 0; i < parentNode.children.length; i++) {
- var child = parentNode.children.item(i);
- if (child.tagName === "LEGEND") {
- if (child.contains(node)) {
- return false;
- }
- return true;
- }
- }
- return true;
- }
- parentNode = parentNode.parentElement;
- }
- }
- return false;
- };
- var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
- if (node.disabled || isHiddenInput(node) || isHidden(node, options.displayCheck) || isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
- return false;
- }
- return true;
- };
- var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) {
- if (!isNodeMatchingSelectorFocusable(options, node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
- return false;
- }
- return true;
- };
- var tabbable = function tabbable2(el, options) {
- options = options || {};
- var regularTabbables = [];
- var orderedTabbables = [];
- var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
- candidates.forEach(function(candidate, i) {
- var candidateTabindex = getTabindex(candidate);
- if (candidateTabindex === 0) {
- regularTabbables.push(candidate);
- } else {
- orderedTabbables.push({
- documentOrder: i,
- tabIndex: candidateTabindex,
- node: candidate
- });
- }
- });
- var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
- return a.node;
- }).concat(regularTabbables);
- return tabbableNodes;
- };
- var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(",");
- var isFocusable = function isFocusable2(node, options) {
- options = options || {};
- if (!node) {
- throw new Error("No node provided");
- }
- if (matches.call(node, focusableCandidateSelector) === false) {
- return false;
- }
- return isNodeMatchingSelectorFocusable(options, node);
- };
-
- // node_modules/focus-trap/dist/focus-trap.esm.js
- /*!
- * focus-trap 6.6.1
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
- */
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) {
- symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- }
- keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- var activeFocusTraps = function() {
- var trapQueue = [];
- return {
- activateTrap: function activateTrap(trap) {
- if (trapQueue.length > 0) {
- var activeTrap = trapQueue[trapQueue.length - 1];
- if (activeTrap !== trap) {
- activeTrap.pause();
- }
- }
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex === -1) {
- trapQueue.push(trap);
- } else {
- trapQueue.splice(trapIndex, 1);
- trapQueue.push(trap);
- }
- },
- deactivateTrap: function deactivateTrap(trap) {
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex !== -1) {
- trapQueue.splice(trapIndex, 1);
- }
- if (trapQueue.length > 0) {
- trapQueue[trapQueue.length - 1].unpause();
- }
- }
- };
- }();
- var isSelectableInput = function isSelectableInput2(node) {
- return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
- };
- var isEscapeEvent = function isEscapeEvent2(e) {
- return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
- };
- var isTabEvent = function isTabEvent2(e) {
- return e.key === "Tab" || e.keyCode === 9;
- };
- var delay = function delay2(fn) {
- return setTimeout(fn, 0);
- };
- var findIndex = function findIndex2(arr, fn) {
- var idx = -1;
- arr.every(function(value, i) {
- if (fn(value)) {
- idx = i;
- return false;
- }
- return true;
- });
- return idx;
- };
- var valueOrHandler = function valueOrHandler2(value) {
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- params[_key - 1] = arguments[_key];
- }
- return typeof value === "function" ? value.apply(void 0, params) : value;
- };
- var createFocusTrap = function createFocusTrap2(elements, userOptions) {
- var doc = document;
- var config = _objectSpread2({
- returnFocusOnDeactivate: true,
- escapeDeactivates: true,
- delayInitialFocus: true
- }, userOptions);
- var state = {
- containers: [],
- tabbableGroups: [],
- nodeFocusedBeforeActivation: null,
- mostRecentlyFocusedNode: null,
- active: false,
- paused: false,
- delayInitialFocusTimer: void 0
- };
- var trap;
- var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) {
- return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName];
- };
- var containersContain = function containersContain2(element) {
- return state.containers.some(function(container) {
- return container.contains(element);
- });
- };
- var getNodeForOption = function getNodeForOption2(optionName) {
- var optionValue = config[optionName];
- if (!optionValue) {
- return null;
- }
- var node = optionValue;
- if (typeof optionValue === "string") {
- node = doc.querySelector(optionValue);
- if (!node) {
- throw new Error("`".concat(optionName, "` refers to no known node"));
- }
- }
- if (typeof optionValue === "function") {
- node = optionValue();
- if (!node) {
- throw new Error("`".concat(optionName, "` did not return a node"));
- }
- }
- return node;
- };
- var getInitialFocusNode = function getInitialFocusNode2() {
- var node;
- if (getOption({}, "initialFocus") === false) {
- return false;
- }
- if (getNodeForOption("initialFocus") !== null) {
- node = getNodeForOption("initialFocus");
- } else if (containersContain(doc.activeElement)) {
- node = doc.activeElement;
- } else {
- var firstTabbableGroup = state.tabbableGroups[0];
- var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
- node = firstTabbableNode || getNodeForOption("fallbackFocus");
- }
- if (!node) {
- throw new Error("Your focus-trap needs to have at least one focusable element");
- }
- return node;
- };
- var updateTabbableNodes = function updateTabbableNodes2() {
- state.tabbableGroups = state.containers.map(function(container) {
- var tabbableNodes = tabbable(container);
- if (tabbableNodes.length > 0) {
- return {
- container,
- firstTabbableNode: tabbableNodes[0],
- lastTabbableNode: tabbableNodes[tabbableNodes.length - 1]
- };
- }
- return void 0;
- }).filter(function(group) {
- return !!group;
- });
- if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) {
- throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
- }
- };
- var tryFocus = function tryFocus2(node) {
- if (node === false) {
- return;
- }
- if (node === doc.activeElement) {
- return;
- }
- if (!node || !node.focus) {
- tryFocus2(getInitialFocusNode());
- return;
- }
- node.focus({
- preventScroll: !!config.preventScroll
- });
- state.mostRecentlyFocusedNode = node;
- if (isSelectableInput(node)) {
- node.select();
- }
- };
- var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) {
- var node = getNodeForOption("setReturnFocus");
- return node ? node : previousActiveElement;
- };
- var checkPointerDown = function checkPointerDown2(e) {
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- trap.deactivate({
- returnFocus: config.returnFocusOnDeactivate && !isFocusable(e.target)
- });
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- };
- var checkFocusIn = function checkFocusIn2(e) {
- var targetContained = containersContain(e.target);
- if (targetContained || e.target instanceof Document) {
- if (targetContained) {
- state.mostRecentlyFocusedNode = e.target;
- }
- } else {
- e.stopImmediatePropagation();
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
- }
- };
- var checkTab = function checkTab2(e) {
- updateTabbableNodes();
- var destinationNode = null;
- if (state.tabbableGroups.length > 0) {
- var containerIndex = findIndex(state.tabbableGroups, function(_ref) {
- var container = _ref.container;
- return container.contains(e.target);
- });
- if (containerIndex < 0) {
- if (e.shiftKey) {
- destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
- } else {
- destinationNode = state.tabbableGroups[0].firstTabbableNode;
- }
- } else if (e.shiftKey) {
- var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) {
- var firstTabbableNode = _ref2.firstTabbableNode;
- return e.target === firstTabbableNode;
- });
- if (startOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- startOfGroupIndex = containerIndex;
- }
- if (startOfGroupIndex >= 0) {
- var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
- var destinationGroup = state.tabbableGroups[destinationGroupIndex];
- destinationNode = destinationGroup.lastTabbableNode;
- }
- } else {
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) {
- var lastTabbableNode = _ref3.lastTabbableNode;
- return e.target === lastTabbableNode;
- });
- if (lastOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- lastOfGroupIndex = containerIndex;
- }
- if (lastOfGroupIndex >= 0) {
- var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
- var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
- destinationNode = _destinationGroup.firstTabbableNode;
- }
- }
- } else {
- destinationNode = getNodeForOption("fallbackFocus");
- }
- if (destinationNode) {
- e.preventDefault();
- tryFocus(destinationNode);
- }
- };
- var checkKey = function checkKey2(e) {
- if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates) !== false) {
- e.preventDefault();
- trap.deactivate();
- return;
- }
- if (isTabEvent(e)) {
- checkTab(e);
- return;
- }
- };
- var checkClick = function checkClick2(e) {
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- return;
- }
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- e.stopImmediatePropagation();
- };
- var addListeners = function addListeners2() {
- if (!state.active) {
- return;
- }
- activeFocusTraps.activateTrap(trap);
- state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() {
- tryFocus(getInitialFocusNode());
- }) : tryFocus(getInitialFocusNode());
- doc.addEventListener("focusin", checkFocusIn, true);
- doc.addEventListener("mousedown", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("touchstart", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("click", checkClick, {
- capture: true,
- passive: false
- });
- doc.addEventListener("keydown", checkKey, {
- capture: true,
- passive: false
- });
- return trap;
- };
- var removeListeners = function removeListeners2() {
- if (!state.active) {
- return;
- }
- doc.removeEventListener("focusin", checkFocusIn, true);
- doc.removeEventListener("mousedown", checkPointerDown, true);
- doc.removeEventListener("touchstart", checkPointerDown, true);
- doc.removeEventListener("click", checkClick, true);
- doc.removeEventListener("keydown", checkKey, true);
- return trap;
- };
- trap = {
- activate: function activate(activateOptions) {
- if (state.active) {
- return this;
- }
- var onActivate = getOption(activateOptions, "onActivate");
- var onPostActivate = getOption(activateOptions, "onPostActivate");
- var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap");
- if (!checkCanFocusTrap) {
- updateTabbableNodes();
- }
- state.active = true;
- state.paused = false;
- state.nodeFocusedBeforeActivation = doc.activeElement;
- if (onActivate) {
- onActivate();
- }
- var finishActivation = function finishActivation2() {
- if (checkCanFocusTrap) {
- updateTabbableNodes();
- }
- addListeners();
- if (onPostActivate) {
- onPostActivate();
- }
- };
- if (checkCanFocusTrap) {
- checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
- return this;
- }
- finishActivation();
- return this;
- },
- deactivate: function deactivate(deactivateOptions) {
- if (!state.active) {
- return this;
- }
- clearTimeout(state.delayInitialFocusTimer);
- state.delayInitialFocusTimer = void 0;
- removeListeners();
- state.active = false;
- state.paused = false;
- activeFocusTraps.deactivateTrap(trap);
- var onDeactivate = getOption(deactivateOptions, "onDeactivate");
- var onPostDeactivate = getOption(deactivateOptions, "onPostDeactivate");
- var checkCanReturnFocus = getOption(deactivateOptions, "checkCanReturnFocus");
- if (onDeactivate) {
- onDeactivate();
- }
- var returnFocus = getOption(deactivateOptions, "returnFocus", "returnFocusOnDeactivate");
- var finishDeactivation = function finishDeactivation2() {
- delay(function() {
- if (returnFocus) {
- tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
- }
- if (onPostDeactivate) {
- onPostDeactivate();
- }
- });
- };
- if (returnFocus && checkCanReturnFocus) {
- checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
- return this;
- }
- finishDeactivation();
- return this;
- },
- pause: function pause() {
- if (state.paused || !state.active) {
- return this;
- }
- state.paused = true;
- removeListeners();
- return this;
- },
- unpause: function unpause() {
- if (!state.paused || !state.active) {
- return this;
- }
- state.paused = false;
- updateTabbableNodes();
- addListeners();
- return this;
- },
- updateContainerElements: function updateContainerElements(containerElements) {
- var elementsAsArray = [].concat(containerElements).filter(Boolean);
- state.containers = elementsAsArray.map(function(element) {
- return typeof element === "string" ? doc.querySelector(element) : element;
- });
- if (state.active) {
- updateTabbableNodes();
- }
- return this;
- }
- };
- trap.updateContainerElements(elements);
- return trap;
- };
-
- // packages/trap/src/index.js
- function src_default(Alpine) {
- Alpine.directive("trap", (el, {expression}, {effect, evaluateLater}) => {
- let evaluator = evaluateLater(expression);
- let oldValue = false;
- let trap = createFocusTrap(el, {
- escapeDeactivates: false,
- allowOutsideClick: true
- });
- effect(() => evaluator((value) => {
- if (oldValue === value)
- return;
- if (value && !oldValue) {
- setTimeout(() => {
- trap.activate();
- });
- }
- if (!value && oldValue) {
- trap.deactivate();
- }
- oldValue = !!value;
- }));
- });
- }
-
- // packages/trap/builds/cdn.js
- document.addEventListener("alpine:init", () => {
- window.Alpine.plugin(src_default);
- });
-})();
diff --git a/alpinejs/packages/trap/dist/dist/cdn.min.js b/alpinejs/packages/trap/dist/dist/cdn.min.js
deleted file mode 100644
index ae219c8..0000000
--- a/alpinejs/packages/trap/dist/dist/cdn.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-(()=>{var P=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],x=P.join(","),S=typeof Element=="undefined"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=function(e,t,a){var c=Array.prototype.slice.apply(e.querySelectorAll(x));return t&&S.call(e,x)&&c.unshift(e),c=c.filter(a),c},X=function(e){return e.contentEditable==="true"},j=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?X(e)||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t},J=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},D=function(e){return e.tagName==="INPUT"},Z=function(e){return D(e)&&e.type==="hidden"},$=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(a){return a.tagName==="SUMMARY"});return t},_=function(e,t){for(var a=0;a<e.length;a++)if(e[a].checked&&e[a].form===t)return e[a]},ee=function(e){if(!e.name)return!0;var t=e.form||e.ownerDocument,a=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},c;if(typeof window!="undefined"&&typeof window.CSS!="undefined"&&typeof window.CSS.escape=="function")c=a(window.CSS.escape(e.name));else try{c=a(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var n=_(c,e.form);return!n||n===e},te=function(e){return D(e)&&e.type==="radio"},re=function(e){return te(e)&&!ee(e)},ae=function(e,t){if(getComputedStyle(e).visibility==="hidden")return!0;var a=S.call(e,"details>summary:first-of-type"),c=a?e.parentElement:e;if(S.call(c,"details:not([open]) *"))return!0;if(!t||t==="full")for(;e;){if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}else if(t==="non-zero-area"){var n=e.getBoundingClientRect(),s=n.width,l=n.height;return s===0&&l===0}return!1},ne=function(e){if(D(e)||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.tagName==="BUTTON")for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var a=0;a<t.children.length;a++){var c=t.children.item(a);if(c.tagName==="LEGEND")return!c.contains(e)}return!0}t=t.parentElement}return!1},G=function(e,t){return!(t.disabled||Z(t)||ae(t,e.displayCheck)||$(t)||ne(t))},ie=function(e,t){return!(!G(e,t)||re(t)||j(t)<0)},M=function(e,t){t=t||{};var a=[],c=[],n=Q(e,t.includeContainer,ie.bind(null,t));n.forEach(function(l,v){var d=j(l);d===0?a.push(l):c.push({documentOrder:v,tabIndex:d,node:l})});var s=c.sort(J).map(function(l){return l.node}).concat(a);return s};var ue=P.concat("iframe").join(","),q=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return S.call(e,ue)===!1?!1:G(t,e)};function B(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);e&&(a=a.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),t.push.apply(t,a)}return t}function oe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(a){ce(i,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(t,a))})}return i}function ce(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var H=function(){var i=[];return{activateTrap:function(t){if(i.length>0){var a=i[i.length-1];a!==t&&a.pause()}var c=i.indexOf(t);c===-1||i.splice(c,1),i.push(t)},deactivateTrap:function(t){var a=i.indexOf(t);a!==-1&&i.splice(a,1),i.length>0&&i[i.length-1].unpause()}}}(),se=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},le=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},fe=function(e){return e.key==="Tab"||e.keyCode===9},K=function(e){return setTimeout(e,0)},k=function(e,t){var a=-1;return e.every(function(c,n){return t(c)?(a=n,!1):!0}),a},F=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),c=1;c<t;c++)a[c-1]=arguments[c];return typeof e=="function"?e.apply(void 0,a):e},U=function(e,t){var a=document,c=oe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),n={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,l=function(r,u,o){return r&&r[u]!==void 0?r[u]:c[o||u]},v=function(r){return n.containers.some(function(u){return u.contains(r)})},d=function(r){var u=c[r];if(!u)return null;var o=u;if(typeof u=="string"&&(o=a.querySelector(u),!o))throw new Error("`".concat(r,"` refers to no known node"));if(typeof u=="function"&&(o=u(),!o))throw new Error("`".concat(r,"` did not return a node"));return o},w=function(){var r;if(l({},"initialFocus")===!1)return!1;if(d("initialFocus")!==null)r=d("initialFocus");else if(v(a.activeElement))r=a.activeElement;else{var u=n.tabbableGroups[0],o=u&&u.firstTabbableNode;r=o||d("fallbackFocus")}if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r},g=function(){if(n.tabbableGroups=n.containers.map(function(r){var u=M(r);if(u.length>0)return{container:r,firstTabbableNode:u[0],lastTabbableNode:u[u.length-1]}}).filter(function(r){return!!r}),n.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function f(r){if(r!==!1&&r!==a.activeElement){if(!r||!r.focus){f(w());return}r.focus({preventScroll:!!c.preventScroll}),n.mostRecentlyFocusedNode=r,se(r)&&r.select()}},C=function(r){var u=d("setReturnFocus");return u||r},N=function(r){if(!v(r.target)){if(F(c.clickOutsideDeactivates,r)){s.deactivate({returnFocus:c.returnFocusOnDeactivate&&!q(r.target)});return}F(c.allowOutsideClick,r)||r.preventDefault()}},A=function(r){var u=v(r.target);u||r.target instanceof Document?u&&(n.mostRecentlyFocusedNode=r.target):(r.stopImmediatePropagation(),y(n.mostRecentlyFocusedNode||w()))},Y=function(r){g();var u=null;if(n.tabbableGroups.length>0){var o=k(n.tabbableGroups,function(T){var E=T.container;return E.contains(r.target)});if(o<0)r.shiftKey?u=n.tabbableGroups[n.tabbableGroups.length-1].lastTabbableNode:u=n.tabbableGroups[0].firstTabbableNode;else if(r.shiftKey){var b=k(n.tabbableGroups,function(T){var E=T.firstTabbableNode;return r.target===E});if(b<0&&n.tabbableGroups[o].container===r.target&&(b=o),b>=0){var p=b===0?n.tabbableGroups.length-1:b-1,m=n.tabbableGroups[p];u=m.lastTabbableNode}}else{var h=k(n.tabbableGroups,function(T){var E=T.lastTabbableNode;return r.target===E});if(h<0&&n.tabbableGroups[o].container===r.target&&(h=o),h>=0){var W=h===n.tabbableGroups.length-1?0:h+1,z=n.tabbableGroups[W];u=z.firstTabbableNode}}}else u=d("fallbackFocus");u&&(r.preventDefault(),y(u))},O=function(r){if(le(r)&&F(c.escapeDeactivates)!==!1){r.preventDefault(),s.deactivate();return}if(fe(r)){Y(r);return}},I=function(r){F(c.clickOutsideDeactivates,r)||v(r.target)||F(c.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())},L=function(){if(!!n.active)return H.activateTrap(s),n.delayInitialFocusTimer=c.delayInitialFocus?K(function(){y(w())}):y(w()),a.addEventListener("focusin",A,!0),a.addEventListener("mousedown",N,{capture:!0,passive:!1}),a.addEventListener("touchstart",N,{capture:!0,passive:!1}),a.addEventListener("click",I,{capture:!0,passive:!1}),a.addEventListener("keydown",O,{capture:!0,passive:!1}),s},R=function(){if(!!n.active)return a.removeEventListener("focusin",A,!0),a.removeEventListener("mousedown",N,!0),a.removeEventListener("touchstart",N,!0),a.removeEventListener("click",I,!0),a.removeEventListener("keydown",O,!0),s};return s={activate:function(r){if(n.active)return this;var u=l(r,"onActivate"),o=l(r,"onPostActivate"),b=l(r,"checkCanFocusTrap");b||g(),n.active=!0,n.paused=!1,n.nodeFocusedBeforeActivation=a.activeElement,u&&u();var p=function(){b&&g(),L(),o&&o()};return b?(b(n.containers.concat()).then(p,p),this):(p(),this)},deactivate:function(r){if(!n.active)return this;clearTimeout(n.delayInitialFocusTimer),n.delayInitialFocusTimer=void 0,R(),n.active=!1,n.paused=!1,H.deactivateTrap(s);var u=l(r,"onDeactivate"),o=l(r,"onPostDeactivate"),b=l(r,"checkCanReturnFocus");u&&u();var p=l(r,"returnFocus","returnFocusOnDeactivate"),m=function(){K(function(){p&&y(C(n.nodeFocusedBeforeActivation)),o&&o()})};return p&&b?(b(C(n.nodeFocusedBeforeActivation)).then(m,m),this):(m(),this)},pause:function(){return n.paused||!n.active?this:(n.paused=!0,R(),this)},unpause:function(){return!n.paused||!n.active?this:(n.paused=!1,g(),L(),this)},updateContainerElements:function(r){var u=[].concat(r).filter(Boolean);return n.containers=u.map(function(o){return typeof o=="string"?a.querySelector(o):o}),n.active&&g(),this}},s.updateContainerElements(e),s};function V(i){i.directive("trap",(e,{expression:t},{effect:a,evaluateLater:c})=>{let n=c(t),s=!1,l=U(e,{escapeDeactivates:!1,allowOutsideClick:!0});a(()=>n(v=>{s!==v&&(v&&!s&&setTimeout(()=>{l.activate()}),!v&&s&&l.deactivate(),s=!!v)}))})}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(V)});})();
-/*!
-* focus-trap 6.6.1
-* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
-*/
-/*!
-* tabbable 5.2.1
-* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
-*/
diff --git a/alpinejs/packages/trap/dist/dist/module.cjs.js b/alpinejs/packages/trap/dist/dist/module.cjs.js
deleted file mode 100644
index 2f12973..0000000
--- a/alpinejs/packages/trap/dist/dist/module.cjs.js
+++ /dev/null
@@ -1,712 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module2) => () => {
- if (!module2) {
- module2 = {exports: {}};
- callback(module2.exports, module2);
- }
- return module2.exports;
-};
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, {get: all[name], enumerable: true});
-};
-var __exportStar = (target, module2, desc) => {
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
- for (let key of __getOwnPropNames(module2))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module2) => {
- return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
-};
-
-// node_modules/tabbable/dist/index.js
-var require_dist = __commonJS((exports2) => {
- /*!
- * tabbable 5.2.1
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
- */
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"];
- var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
- var matches = typeof Element === "undefined" ? function() {
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
- var getCandidates = function getCandidates2(el, includeContainer, filter) {
- var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
- if (includeContainer && matches.call(el, candidateSelector)) {
- candidates.unshift(el);
- }
- candidates = candidates.filter(filter);
- return candidates;
- };
- var isContentEditable = function isContentEditable2(node) {
- return node.contentEditable === "true";
- };
- var getTabindex = function getTabindex2(node) {
- var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
- if (!isNaN(tabindexAttr)) {
- return tabindexAttr;
- }
- if (isContentEditable(node)) {
- return 0;
- }
- if ((node.nodeName === "AUDIO" || node.nodeName === "VIDEO" || node.nodeName === "DETAILS") && node.getAttribute("tabindex") === null) {
- return 0;
- }
- return node.tabIndex;
- };
- var sortOrderedTabbables = function sortOrderedTabbables2(a, b) {
- return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
- };
- var isInput = function isInput2(node) {
- return node.tagName === "INPUT";
- };
- var isHiddenInput = function isHiddenInput2(node) {
- return isInput(node) && node.type === "hidden";
- };
- var isDetailsWithSummary = function isDetailsWithSummary2(node) {
- var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
- return child.tagName === "SUMMARY";
- });
- return r;
- };
- var getCheckedRadio = function getCheckedRadio2(nodes, form) {
- for (var i = 0; i < nodes.length; i++) {
- if (nodes[i].checked && nodes[i].form === form) {
- return nodes[i];
- }
- }
- };
- var isTabbableRadio = function isTabbableRadio2(node) {
- if (!node.name) {
- return true;
- }
- var radioScope = node.form || node.ownerDocument;
- var queryRadios = function queryRadios2(name) {
- return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
- };
- var radioSet;
- if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
- radioSet = queryRadios(window.CSS.escape(node.name));
- } else {
- try {
- radioSet = queryRadios(node.name);
- } catch (err) {
- console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
- return false;
- }
- }
- var checked = getCheckedRadio(radioSet, node.form);
- return !checked || checked === node;
- };
- var isRadio = function isRadio2(node) {
- return isInput(node) && node.type === "radio";
- };
- var isNonTabbableRadio = function isNonTabbableRadio2(node) {
- return isRadio(node) && !isTabbableRadio(node);
- };
- var isHidden = function isHidden2(node, displayCheck) {
- if (getComputedStyle(node).visibility === "hidden") {
- return true;
- }
- var isDirectSummary = matches.call(node, "details>summary:first-of-type");
- var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
- if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
- return true;
- }
- if (!displayCheck || displayCheck === "full") {
- while (node) {
- if (getComputedStyle(node).display === "none") {
- return true;
- }
- node = node.parentElement;
- }
- } else if (displayCheck === "non-zero-area") {
- var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
- return width === 0 && height === 0;
- }
- return false;
- };
- var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
- if (isInput(node) || node.tagName === "SELECT" || node.tagName === "TEXTAREA" || node.tagName === "BUTTON") {
- var parentNode = node.parentElement;
- while (parentNode) {
- if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
- for (var i = 0; i < parentNode.children.length; i++) {
- var child = parentNode.children.item(i);
- if (child.tagName === "LEGEND") {
- if (child.contains(node)) {
- return false;
- }
- return true;
- }
- }
- return true;
- }
- parentNode = parentNode.parentElement;
- }
- }
- return false;
- };
- var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
- if (node.disabled || isHiddenInput(node) || isHidden(node, options.displayCheck) || isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
- return false;
- }
- return true;
- };
- var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) {
- if (!isNodeMatchingSelectorFocusable(options, node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
- return false;
- }
- return true;
- };
- var tabbable = function tabbable2(el, options) {
- options = options || {};
- var regularTabbables = [];
- var orderedTabbables = [];
- var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
- candidates.forEach(function(candidate, i) {
- var candidateTabindex = getTabindex(candidate);
- if (candidateTabindex === 0) {
- regularTabbables.push(candidate);
- } else {
- orderedTabbables.push({
- documentOrder: i,
- tabIndex: candidateTabindex,
- node: candidate
- });
- }
- });
- var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
- return a.node;
- }).concat(regularTabbables);
- return tabbableNodes;
- };
- var focusable = function focusable2(el, options) {
- options = options || {};
- var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
- return candidates;
- };
- var isTabbable = function isTabbable2(node, options) {
- options = options || {};
- if (!node) {
- throw new Error("No node provided");
- }
- if (matches.call(node, candidateSelector) === false) {
- return false;
- }
- return isNodeMatchingSelectorTabbable(options, node);
- };
- var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(",");
- var isFocusable = function isFocusable2(node, options) {
- options = options || {};
- if (!node) {
- throw new Error("No node provided");
- }
- if (matches.call(node, focusableCandidateSelector) === false) {
- return false;
- }
- return isNodeMatchingSelectorFocusable(options, node);
- };
- exports2.focusable = focusable;
- exports2.isFocusable = isFocusable;
- exports2.isTabbable = isTabbable;
- exports2.tabbable = tabbable;
-});
-
-// node_modules/focus-trap/dist/focus-trap.js
-var require_focus_trap = __commonJS((exports2) => {
- /*!
- * focus-trap 6.6.1
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
- */
- "use strict";
- Object.defineProperty(exports2, "__esModule", {value: true});
- var tabbable = require_dist();
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) {
- symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- }
- keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- var activeFocusTraps = function() {
- var trapQueue = [];
- return {
- activateTrap: function activateTrap(trap) {
- if (trapQueue.length > 0) {
- var activeTrap = trapQueue[trapQueue.length - 1];
- if (activeTrap !== trap) {
- activeTrap.pause();
- }
- }
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex === -1) {
- trapQueue.push(trap);
- } else {
- trapQueue.splice(trapIndex, 1);
- trapQueue.push(trap);
- }
- },
- deactivateTrap: function deactivateTrap(trap) {
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex !== -1) {
- trapQueue.splice(trapIndex, 1);
- }
- if (trapQueue.length > 0) {
- trapQueue[trapQueue.length - 1].unpause();
- }
- }
- };
- }();
- var isSelectableInput = function isSelectableInput2(node) {
- return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
- };
- var isEscapeEvent = function isEscapeEvent2(e) {
- return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
- };
- var isTabEvent = function isTabEvent2(e) {
- return e.key === "Tab" || e.keyCode === 9;
- };
- var delay = function delay2(fn) {
- return setTimeout(fn, 0);
- };
- var findIndex = function findIndex2(arr, fn) {
- var idx = -1;
- arr.every(function(value, i) {
- if (fn(value)) {
- idx = i;
- return false;
- }
- return true;
- });
- return idx;
- };
- var valueOrHandler = function valueOrHandler2(value) {
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- params[_key - 1] = arguments[_key];
- }
- return typeof value === "function" ? value.apply(void 0, params) : value;
- };
- var createFocusTrap2 = function createFocusTrap3(elements, userOptions) {
- var doc = document;
- var config = _objectSpread2({
- returnFocusOnDeactivate: true,
- escapeDeactivates: true,
- delayInitialFocus: true
- }, userOptions);
- var state = {
- containers: [],
- tabbableGroups: [],
- nodeFocusedBeforeActivation: null,
- mostRecentlyFocusedNode: null,
- active: false,
- paused: false,
- delayInitialFocusTimer: void 0
- };
- var trap;
- var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) {
- return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName];
- };
- var containersContain = function containersContain2(element) {
- return state.containers.some(function(container) {
- return container.contains(element);
- });
- };
- var getNodeForOption = function getNodeForOption2(optionName) {
- var optionValue = config[optionName];
- if (!optionValue) {
- return null;
- }
- var node = optionValue;
- if (typeof optionValue === "string") {
- node = doc.querySelector(optionValue);
- if (!node) {
- throw new Error("`".concat(optionName, "` refers to no known node"));
- }
- }
- if (typeof optionValue === "function") {
- node = optionValue();
- if (!node) {
- throw new Error("`".concat(optionName, "` did not return a node"));
- }
- }
- return node;
- };
- var getInitialFocusNode = function getInitialFocusNode2() {
- var node;
- if (getOption({}, "initialFocus") === false) {
- return false;
- }
- if (getNodeForOption("initialFocus") !== null) {
- node = getNodeForOption("initialFocus");
- } else if (containersContain(doc.activeElement)) {
- node = doc.activeElement;
- } else {
- var firstTabbableGroup = state.tabbableGroups[0];
- var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
- node = firstTabbableNode || getNodeForOption("fallbackFocus");
- }
- if (!node) {
- throw new Error("Your focus-trap needs to have at least one focusable element");
- }
- return node;
- };
- var updateTabbableNodes = function updateTabbableNodes2() {
- state.tabbableGroups = state.containers.map(function(container) {
- var tabbableNodes = tabbable.tabbable(container);
- if (tabbableNodes.length > 0) {
- return {
- container,
- firstTabbableNode: tabbableNodes[0],
- lastTabbableNode: tabbableNodes[tabbableNodes.length - 1]
- };
- }
- return void 0;
- }).filter(function(group) {
- return !!group;
- });
- if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) {
- throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
- }
- };
- var tryFocus = function tryFocus2(node) {
- if (node === false) {
- return;
- }
- if (node === doc.activeElement) {
- return;
- }
- if (!node || !node.focus) {
- tryFocus2(getInitialFocusNode());
- return;
- }
- node.focus({
- preventScroll: !!config.preventScroll
- });
- state.mostRecentlyFocusedNode = node;
- if (isSelectableInput(node)) {
- node.select();
- }
- };
- var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) {
- var node = getNodeForOption("setReturnFocus");
- return node ? node : previousActiveElement;
- };
- var checkPointerDown = function checkPointerDown2(e) {
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- trap.deactivate({
- returnFocus: config.returnFocusOnDeactivate && !tabbable.isFocusable(e.target)
- });
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- };
- var checkFocusIn = function checkFocusIn2(e) {
- var targetContained = containersContain(e.target);
- if (targetContained || e.target instanceof Document) {
- if (targetContained) {
- state.mostRecentlyFocusedNode = e.target;
- }
- } else {
- e.stopImmediatePropagation();
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
- }
- };
- var checkTab = function checkTab2(e) {
- updateTabbableNodes();
- var destinationNode = null;
- if (state.tabbableGroups.length > 0) {
- var containerIndex = findIndex(state.tabbableGroups, function(_ref) {
- var container = _ref.container;
- return container.contains(e.target);
- });
- if (containerIndex < 0) {
- if (e.shiftKey) {
- destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
- } else {
- destinationNode = state.tabbableGroups[0].firstTabbableNode;
- }
- } else if (e.shiftKey) {
- var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) {
- var firstTabbableNode = _ref2.firstTabbableNode;
- return e.target === firstTabbableNode;
- });
- if (startOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- startOfGroupIndex = containerIndex;
- }
- if (startOfGroupIndex >= 0) {
- var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
- var destinationGroup = state.tabbableGroups[destinationGroupIndex];
- destinationNode = destinationGroup.lastTabbableNode;
- }
- } else {
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) {
- var lastTabbableNode = _ref3.lastTabbableNode;
- return e.target === lastTabbableNode;
- });
- if (lastOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- lastOfGroupIndex = containerIndex;
- }
- if (lastOfGroupIndex >= 0) {
- var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
- var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
- destinationNode = _destinationGroup.firstTabbableNode;
- }
- }
- } else {
- destinationNode = getNodeForOption("fallbackFocus");
- }
- if (destinationNode) {
- e.preventDefault();
- tryFocus(destinationNode);
- }
- };
- var checkKey = function checkKey2(e) {
- if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates) !== false) {
- e.preventDefault();
- trap.deactivate();
- return;
- }
- if (isTabEvent(e)) {
- checkTab(e);
- return;
- }
- };
- var checkClick = function checkClick2(e) {
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- return;
- }
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- e.stopImmediatePropagation();
- };
- var addListeners = function addListeners2() {
- if (!state.active) {
- return;
- }
- activeFocusTraps.activateTrap(trap);
- state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() {
- tryFocus(getInitialFocusNode());
- }) : tryFocus(getInitialFocusNode());
- doc.addEventListener("focusin", checkFocusIn, true);
- doc.addEventListener("mousedown", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("touchstart", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("click", checkClick, {
- capture: true,
- passive: false
- });
- doc.addEventListener("keydown", checkKey, {
- capture: true,
- passive: false
- });
- return trap;
- };
- var removeListeners = function removeListeners2() {
- if (!state.active) {
- return;
- }
- doc.removeEventListener("focusin", checkFocusIn, true);
- doc.removeEventListener("mousedown", checkPointerDown, true);
- doc.removeEventListener("touchstart", checkPointerDown, true);
- doc.removeEventListener("click", checkClick, true);
- doc.removeEventListener("keydown", checkKey, true);
- return trap;
- };
- trap = {
- activate: function activate(activateOptions) {
- if (state.active) {
- return this;
- }
- var onActivate = getOption(activateOptions, "onActivate");
- var onPostActivate = getOption(activateOptions, "onPostActivate");
- var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap");
- if (!checkCanFocusTrap) {
- updateTabbableNodes();
- }
- state.active = true;
- state.paused = false;
- state.nodeFocusedBeforeActivation = doc.activeElement;
- if (onActivate) {
- onActivate();
- }
- var finishActivation = function finishActivation2() {
- if (checkCanFocusTrap) {
- updateTabbableNodes();
- }
- addListeners();
- if (onPostActivate) {
- onPostActivate();
- }
- };
- if (checkCanFocusTrap) {
- checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
- return this;
- }
- finishActivation();
- return this;
- },
- deactivate: function deactivate(deactivateOptions) {
- if (!state.active) {
- return this;
- }
- clearTimeout(state.delayInitialFocusTimer);
- state.delayInitialFocusTimer = void 0;
- removeListeners();
- state.active = false;
- state.paused = false;
- activeFocusTraps.deactivateTrap(trap);
- var onDeactivate = getOption(deactivateOptions, "onDeactivate");
- var onPostDeactivate = getOption(deactivateOptions, "onPostDeactivate");
- var checkCanReturnFocus = getOption(deactivateOptions, "checkCanReturnFocus");
- if (onDeactivate) {
- onDeactivate();
- }
- var returnFocus = getOption(deactivateOptions, "returnFocus", "returnFocusOnDeactivate");
- var finishDeactivation = function finishDeactivation2() {
- delay(function() {
- if (returnFocus) {
- tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
- }
- if (onPostDeactivate) {
- onPostDeactivate();
- }
- });
- };
- if (returnFocus && checkCanReturnFocus) {
- checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
- return this;
- }
- finishDeactivation();
- return this;
- },
- pause: function pause() {
- if (state.paused || !state.active) {
- return this;
- }
- state.paused = true;
- removeListeners();
- return this;
- },
- unpause: function unpause() {
- if (!state.paused || !state.active) {
- return this;
- }
- state.paused = false;
- updateTabbableNodes();
- addListeners();
- return this;
- },
- updateContainerElements: function updateContainerElements(containerElements) {
- var elementsAsArray = [].concat(containerElements).filter(Boolean);
- state.containers = elementsAsArray.map(function(element) {
- return typeof element === "string" ? doc.querySelector(element) : element;
- });
- if (state.active) {
- updateTabbableNodes();
- }
- return this;
- }
- };
- trap.updateContainerElements(elements);
- return trap;
- };
- exports2.createFocusTrap = createFocusTrap2;
-});
-
-// packages/trap/builds/module.js
-__markAsModule(exports);
-__export(exports, {
- default: () => module_default
-});
-
-// packages/trap/src/index.js
-var import_focus_trap = __toModule(require_focus_trap());
-function src_default(Alpine) {
- Alpine.directive("trap", (el, {expression}, {effect, evaluateLater}) => {
- let evaluator = evaluateLater(expression);
- let oldValue = false;
- let trap = (0, import_focus_trap.createFocusTrap)(el, {
- escapeDeactivates: false,
- allowOutsideClick: true
- });
- effect(() => evaluator((value) => {
- if (oldValue === value)
- return;
- if (value && !oldValue) {
- setTimeout(() => {
- trap.activate();
- });
- }
- if (!value && oldValue) {
- trap.deactivate();
- }
- oldValue = !!value;
- }));
- });
-}
-
-// packages/trap/builds/module.js
-var module_default = src_default;
diff --git a/alpinejs/packages/trap/dist/dist/module.esm.js b/alpinejs/packages/trap/dist/dist/module.esm.js
deleted file mode 100644
index 4c745ae..0000000
--- a/alpinejs/packages/trap/dist/dist/module.esm.js
+++ /dev/null
@@ -1,705 +0,0 @@
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
-var __commonJS = (callback, module) => () => {
- if (!module) {
- module = {exports: {}};
- callback(module.exports, module);
- }
- return module.exports;
-};
-var __exportStar = (target, module, desc) => {
- if (module && typeof module === "object" || typeof module === "function") {
- for (let key of __getOwnPropNames(module))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
- }
- return target;
-};
-var __toModule = (module) => {
- return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: () => module.default, enumerable: true} : {value: module, enumerable: true})), module);
-};
-
-// node_modules/tabbable/dist/index.js
-var require_dist = __commonJS((exports) => {
- /*!
- * tabbable 5.2.1
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
- */
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"];
- var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
- var matches = typeof Element === "undefined" ? function() {
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
- var getCandidates = function getCandidates2(el, includeContainer, filter) {
- var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
- if (includeContainer && matches.call(el, candidateSelector)) {
- candidates.unshift(el);
- }
- candidates = candidates.filter(filter);
- return candidates;
- };
- var isContentEditable = function isContentEditable2(node) {
- return node.contentEditable === "true";
- };
- var getTabindex = function getTabindex2(node) {
- var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
- if (!isNaN(tabindexAttr)) {
- return tabindexAttr;
- }
- if (isContentEditable(node)) {
- return 0;
- }
- if ((node.nodeName === "AUDIO" || node.nodeName === "VIDEO" || node.nodeName === "DETAILS") && node.getAttribute("tabindex") === null) {
- return 0;
- }
- return node.tabIndex;
- };
- var sortOrderedTabbables = function sortOrderedTabbables2(a, b) {
- return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
- };
- var isInput = function isInput2(node) {
- return node.tagName === "INPUT";
- };
- var isHiddenInput = function isHiddenInput2(node) {
- return isInput(node) && node.type === "hidden";
- };
- var isDetailsWithSummary = function isDetailsWithSummary2(node) {
- var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
- return child.tagName === "SUMMARY";
- });
- return r;
- };
- var getCheckedRadio = function getCheckedRadio2(nodes, form) {
- for (var i = 0; i < nodes.length; i++) {
- if (nodes[i].checked && nodes[i].form === form) {
- return nodes[i];
- }
- }
- };
- var isTabbableRadio = function isTabbableRadio2(node) {
- if (!node.name) {
- return true;
- }
- var radioScope = node.form || node.ownerDocument;
- var queryRadios = function queryRadios2(name) {
- return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
- };
- var radioSet;
- if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
- radioSet = queryRadios(window.CSS.escape(node.name));
- } else {
- try {
- radioSet = queryRadios(node.name);
- } catch (err) {
- console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
- return false;
- }
- }
- var checked = getCheckedRadio(radioSet, node.form);
- return !checked || checked === node;
- };
- var isRadio = function isRadio2(node) {
- return isInput(node) && node.type === "radio";
- };
- var isNonTabbableRadio = function isNonTabbableRadio2(node) {
- return isRadio(node) && !isTabbableRadio(node);
- };
- var isHidden = function isHidden2(node, displayCheck) {
- if (getComputedStyle(node).visibility === "hidden") {
- return true;
- }
- var isDirectSummary = matches.call(node, "details>summary:first-of-type");
- var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
- if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
- return true;
- }
- if (!displayCheck || displayCheck === "full") {
- while (node) {
- if (getComputedStyle(node).display === "none") {
- return true;
- }
- node = node.parentElement;
- }
- } else if (displayCheck === "non-zero-area") {
- var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
- return width === 0 && height === 0;
- }
- return false;
- };
- var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
- if (isInput(node) || node.tagName === "SELECT" || node.tagName === "TEXTAREA" || node.tagName === "BUTTON") {
- var parentNode = node.parentElement;
- while (parentNode) {
- if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
- for (var i = 0; i < parentNode.children.length; i++) {
- var child = parentNode.children.item(i);
- if (child.tagName === "LEGEND") {
- if (child.contains(node)) {
- return false;
- }
- return true;
- }
- }
- return true;
- }
- parentNode = parentNode.parentElement;
- }
- }
- return false;
- };
- var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
- if (node.disabled || isHiddenInput(node) || isHidden(node, options.displayCheck) || isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
- return false;
- }
- return true;
- };
- var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) {
- if (!isNodeMatchingSelectorFocusable(options, node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
- return false;
- }
- return true;
- };
- var tabbable = function tabbable2(el, options) {
- options = options || {};
- var regularTabbables = [];
- var orderedTabbables = [];
- var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
- candidates.forEach(function(candidate, i) {
- var candidateTabindex = getTabindex(candidate);
- if (candidateTabindex === 0) {
- regularTabbables.push(candidate);
- } else {
- orderedTabbables.push({
- documentOrder: i,
- tabIndex: candidateTabindex,
- node: candidate
- });
- }
- });
- var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
- return a.node;
- }).concat(regularTabbables);
- return tabbableNodes;
- };
- var focusable = function focusable2(el, options) {
- options = options || {};
- var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
- return candidates;
- };
- var isTabbable = function isTabbable2(node, options) {
- options = options || {};
- if (!node) {
- throw new Error("No node provided");
- }
- if (matches.call(node, candidateSelector) === false) {
- return false;
- }
- return isNodeMatchingSelectorTabbable(options, node);
- };
- var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(",");
- var isFocusable = function isFocusable2(node, options) {
- options = options || {};
- if (!node) {
- throw new Error("No node provided");
- }
- if (matches.call(node, focusableCandidateSelector) === false) {
- return false;
- }
- return isNodeMatchingSelectorFocusable(options, node);
- };
- exports.focusable = focusable;
- exports.isFocusable = isFocusable;
- exports.isTabbable = isTabbable;
- exports.tabbable = tabbable;
-});
-
-// node_modules/focus-trap/dist/focus-trap.js
-var require_focus_trap = __commonJS((exports) => {
- /*!
- * focus-trap 6.6.1
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
- */
- "use strict";
- Object.defineProperty(exports, "__esModule", {value: true});
- var tabbable = require_dist();
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) {
- symbols = symbols.filter(function(sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- }
- keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function(key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function(key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
- return target;
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- var activeFocusTraps = function() {
- var trapQueue = [];
- return {
- activateTrap: function activateTrap(trap) {
- if (trapQueue.length > 0) {
- var activeTrap = trapQueue[trapQueue.length - 1];
- if (activeTrap !== trap) {
- activeTrap.pause();
- }
- }
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex === -1) {
- trapQueue.push(trap);
- } else {
- trapQueue.splice(trapIndex, 1);
- trapQueue.push(trap);
- }
- },
- deactivateTrap: function deactivateTrap(trap) {
- var trapIndex = trapQueue.indexOf(trap);
- if (trapIndex !== -1) {
- trapQueue.splice(trapIndex, 1);
- }
- if (trapQueue.length > 0) {
- trapQueue[trapQueue.length - 1].unpause();
- }
- }
- };
- }();
- var isSelectableInput = function isSelectableInput2(node) {
- return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
- };
- var isEscapeEvent = function isEscapeEvent2(e) {
- return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
- };
- var isTabEvent = function isTabEvent2(e) {
- return e.key === "Tab" || e.keyCode === 9;
- };
- var delay = function delay2(fn) {
- return setTimeout(fn, 0);
- };
- var findIndex = function findIndex2(arr, fn) {
- var idx = -1;
- arr.every(function(value, i) {
- if (fn(value)) {
- idx = i;
- return false;
- }
- return true;
- });
- return idx;
- };
- var valueOrHandler = function valueOrHandler2(value) {
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- params[_key - 1] = arguments[_key];
- }
- return typeof value === "function" ? value.apply(void 0, params) : value;
- };
- var createFocusTrap2 = function createFocusTrap3(elements, userOptions) {
- var doc = document;
- var config = _objectSpread2({
- returnFocusOnDeactivate: true,
- escapeDeactivates: true,
- delayInitialFocus: true
- }, userOptions);
- var state = {
- containers: [],
- tabbableGroups: [],
- nodeFocusedBeforeActivation: null,
- mostRecentlyFocusedNode: null,
- active: false,
- paused: false,
- delayInitialFocusTimer: void 0
- };
- var trap;
- var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) {
- return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName];
- };
- var containersContain = function containersContain2(element) {
- return state.containers.some(function(container) {
- return container.contains(element);
- });
- };
- var getNodeForOption = function getNodeForOption2(optionName) {
- var optionValue = config[optionName];
- if (!optionValue) {
- return null;
- }
- var node = optionValue;
- if (typeof optionValue === "string") {
- node = doc.querySelector(optionValue);
- if (!node) {
- throw new Error("`".concat(optionName, "` refers to no known node"));
- }
- }
- if (typeof optionValue === "function") {
- node = optionValue();
- if (!node) {
- throw new Error("`".concat(optionName, "` did not return a node"));
- }
- }
- return node;
- };
- var getInitialFocusNode = function getInitialFocusNode2() {
- var node;
- if (getOption({}, "initialFocus") === false) {
- return false;
- }
- if (getNodeForOption("initialFocus") !== null) {
- node = getNodeForOption("initialFocus");
- } else if (containersContain(doc.activeElement)) {
- node = doc.activeElement;
- } else {
- var firstTabbableGroup = state.tabbableGroups[0];
- var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
- node = firstTabbableNode || getNodeForOption("fallbackFocus");
- }
- if (!node) {
- throw new Error("Your focus-trap needs to have at least one focusable element");
- }
- return node;
- };
- var updateTabbableNodes = function updateTabbableNodes2() {
- state.tabbableGroups = state.containers.map(function(container) {
- var tabbableNodes = tabbable.tabbable(container);
- if (tabbableNodes.length > 0) {
- return {
- container,
- firstTabbableNode: tabbableNodes[0],
- lastTabbableNode: tabbableNodes[tabbableNodes.length - 1]
- };
- }
- return void 0;
- }).filter(function(group) {
- return !!group;
- });
- if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) {
- throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
- }
- };
- var tryFocus = function tryFocus2(node) {
- if (node === false) {
- return;
- }
- if (node === doc.activeElement) {
- return;
- }
- if (!node || !node.focus) {
- tryFocus2(getInitialFocusNode());
- return;
- }
- node.focus({
- preventScroll: !!config.preventScroll
- });
- state.mostRecentlyFocusedNode = node;
- if (isSelectableInput(node)) {
- node.select();
- }
- };
- var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) {
- var node = getNodeForOption("setReturnFocus");
- return node ? node : previousActiveElement;
- };
- var checkPointerDown = function checkPointerDown2(e) {
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- trap.deactivate({
- returnFocus: config.returnFocusOnDeactivate && !tabbable.isFocusable(e.target)
- });
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- };
- var checkFocusIn = function checkFocusIn2(e) {
- var targetContained = containersContain(e.target);
- if (targetContained || e.target instanceof Document) {
- if (targetContained) {
- state.mostRecentlyFocusedNode = e.target;
- }
- } else {
- e.stopImmediatePropagation();
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
- }
- };
- var checkTab = function checkTab2(e) {
- updateTabbableNodes();
- var destinationNode = null;
- if (state.tabbableGroups.length > 0) {
- var containerIndex = findIndex(state.tabbableGroups, function(_ref) {
- var container = _ref.container;
- return container.contains(e.target);
- });
- if (containerIndex < 0) {
- if (e.shiftKey) {
- destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
- } else {
- destinationNode = state.tabbableGroups[0].firstTabbableNode;
- }
- } else if (e.shiftKey) {
- var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) {
- var firstTabbableNode = _ref2.firstTabbableNode;
- return e.target === firstTabbableNode;
- });
- if (startOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- startOfGroupIndex = containerIndex;
- }
- if (startOfGroupIndex >= 0) {
- var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
- var destinationGroup = state.tabbableGroups[destinationGroupIndex];
- destinationNode = destinationGroup.lastTabbableNode;
- }
- } else {
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) {
- var lastTabbableNode = _ref3.lastTabbableNode;
- return e.target === lastTabbableNode;
- });
- if (lastOfGroupIndex < 0 && state.tabbableGroups[containerIndex].container === e.target) {
- lastOfGroupIndex = containerIndex;
- }
- if (lastOfGroupIndex >= 0) {
- var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
- var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
- destinationNode = _destinationGroup.firstTabbableNode;
- }
- }
- } else {
- destinationNode = getNodeForOption("fallbackFocus");
- }
- if (destinationNode) {
- e.preventDefault();
- tryFocus(destinationNode);
- }
- };
- var checkKey = function checkKey2(e) {
- if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates) !== false) {
- e.preventDefault();
- trap.deactivate();
- return;
- }
- if (isTabEvent(e)) {
- checkTab(e);
- return;
- }
- };
- var checkClick = function checkClick2(e) {
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
- return;
- }
- if (containersContain(e.target)) {
- return;
- }
- if (valueOrHandler(config.allowOutsideClick, e)) {
- return;
- }
- e.preventDefault();
- e.stopImmediatePropagation();
- };
- var addListeners = function addListeners2() {
- if (!state.active) {
- return;
- }
- activeFocusTraps.activateTrap(trap);
- state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() {
- tryFocus(getInitialFocusNode());
- }) : tryFocus(getInitialFocusNode());
- doc.addEventListener("focusin", checkFocusIn, true);
- doc.addEventListener("mousedown", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("touchstart", checkPointerDown, {
- capture: true,
- passive: false
- });
- doc.addEventListener("click", checkClick, {
- capture: true,
- passive: false
- });
- doc.addEventListener("keydown", checkKey, {
- capture: true,
- passive: false
- });
- return trap;
- };
- var removeListeners = function removeListeners2() {
- if (!state.active) {
- return;
- }
- doc.removeEventListener("focusin", checkFocusIn, true);
- doc.removeEventListener("mousedown", checkPointerDown, true);
- doc.removeEventListener("touchstart", checkPointerDown, true);
- doc.removeEventListener("click", checkClick, true);
- doc.removeEventListener("keydown", checkKey, true);
- return trap;
- };
- trap = {
- activate: function activate(activateOptions) {
- if (state.active) {
- return this;
- }
- var onActivate = getOption(activateOptions, "onActivate");
- var onPostActivate = getOption(activateOptions, "onPostActivate");
- var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap");
- if (!checkCanFocusTrap) {
- updateTabbableNodes();
- }
- state.active = true;
- state.paused = false;
- state.nodeFocusedBeforeActivation = doc.activeElement;
- if (onActivate) {
- onActivate();
- }
- var finishActivation = function finishActivation2() {
- if (checkCanFocusTrap) {
- updateTabbableNodes();
- }
- addListeners();
- if (onPostActivate) {
- onPostActivate();
- }
- };
- if (checkCanFocusTrap) {
- checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
- return this;
- }
- finishActivation();
- return this;
- },
- deactivate: function deactivate(deactivateOptions) {
- if (!state.active) {
- return this;
- }
- clearTimeout(state.delayInitialFocusTimer);
- state.delayInitialFocusTimer = void 0;
- removeListeners();
- state.active = false;
- state.paused = false;
- activeFocusTraps.deactivateTrap(trap);
- var onDeactivate = getOption(deactivateOptions, "onDeactivate");
- var onPostDeactivate = getOption(deactivateOptions, "onPostDeactivate");
- var checkCanReturnFocus = getOption(deactivateOptions, "checkCanReturnFocus");
- if (onDeactivate) {
- onDeactivate();
- }
- var returnFocus = getOption(deactivateOptions, "returnFocus", "returnFocusOnDeactivate");
- var finishDeactivation = function finishDeactivation2() {
- delay(function() {
- if (returnFocus) {
- tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
- }
- if (onPostDeactivate) {
- onPostDeactivate();
- }
- });
- };
- if (returnFocus && checkCanReturnFocus) {
- checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
- return this;
- }
- finishDeactivation();
- return this;
- },
- pause: function pause() {
- if (state.paused || !state.active) {
- return this;
- }
- state.paused = true;
- removeListeners();
- return this;
- },
- unpause: function unpause() {
- if (!state.paused || !state.active) {
- return this;
- }
- state.paused = false;
- updateTabbableNodes();
- addListeners();
- return this;
- },
- updateContainerElements: function updateContainerElements(containerElements) {
- var elementsAsArray = [].concat(containerElements).filter(Boolean);
- state.containers = elementsAsArray.map(function(element) {
- return typeof element === "string" ? doc.querySelector(element) : element;
- });
- if (state.active) {
- updateTabbableNodes();
- }
- return this;
- }
- };
- trap.updateContainerElements(elements);
- return trap;
- };
- exports.createFocusTrap = createFocusTrap2;
-});
-
-// packages/trap/src/index.js
-var import_focus_trap = __toModule(require_focus_trap());
-function src_default(Alpine) {
- Alpine.directive("trap", (el, {expression}, {effect, evaluateLater}) => {
- let evaluator = evaluateLater(expression);
- let oldValue = false;
- let trap = (0, import_focus_trap.createFocusTrap)(el, {
- escapeDeactivates: false,
- allowOutsideClick: true
- });
- effect(() => evaluator((value) => {
- if (oldValue === value)
- return;
- if (value && !oldValue) {
- setTimeout(() => {
- trap.activate();
- });
- }
- if (!value && oldValue) {
- trap.deactivate();
- }
- oldValue = !!value;
- }));
- });
-}
-
-// packages/trap/builds/module.js
-var module_default = src_default;
-export {
- module_default as default
-};
diff --git a/alpinejs/packages/trap/package.json b/alpinejs/packages/trap/package.json
deleted file mode 100644
index 6bb2ba4..0000000
--- a/alpinejs/packages/trap/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "@alpinejs/trap",
- "version": "3.4.2",
- "description": "Trap focus on a page within a specific element",
- "author": "Caleb Porzio",
- "license": "MIT",
- "main": "dist/module.cjs.js",
- "module": "dist/module.esm.js",
- "unpkg": "dist/cdn.min.js",
- "dependencies": {
- "focus-trap": "^6.6.1"
- }
-}
diff --git a/alpinejs/packages/trap/src/index.js b/alpinejs/packages/trap/src/index.js
deleted file mode 100644
index 2586f88..0000000
--- a/alpinejs/packages/trap/src/index.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import { createFocusTrap } from 'focus-trap';
-
-export default function (Alpine) {
- Alpine.directive('trap', (el, { expression }, { effect, evaluateLater }) => {
- let evaluator = evaluateLater(expression)
-
- let oldValue = false
-
- let trap = createFocusTrap(el, {
- escapeDeactivates: false,
- allowOutsideClick: true
- })
-
- effect(() => evaluator(value => {
- if (oldValue === value) return
-
- // Start trapping.
- if (value && ! oldValue) {
- setTimeout(() => {
- trap.activate()
- });
- }
-
- // Stop trapping.
- if (! value && oldValue) {
- trap.deactivate()
- }
-
- oldValue = !! value
- }))
- })
-}