@aevantec/litevue 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +3 -2
  2. package/dist/litevue-devtools.iife.js +1 -1
  3. package/dist/litevue-devtools.mjs +1 -1
  4. package/dist/litevue-devtools.umd.js +1 -1
  5. package/dist/litevue-plugins.iife.js +1 -1
  6. package/dist/litevue-plugins.mjs +1 -1
  7. package/dist/litevue-plugins.umd.js +1 -1
  8. package/dist/litevue.iife.js +1 -1
  9. package/dist/litevue.mjs +1 -1
  10. package/dist/litevue.umd.js +1 -1
  11. package/dist/plugins/morph.iife.js +1 -1
  12. package/dist/plugins/morph.mjs +1 -1
  13. package/dist/plugins/morph.umd.js +1 -1
  14. package/dist/types/app.d.mts +8 -18
  15. package/dist/types/app.d.ts +8 -18
  16. package/dist/types/block.d.mts +1 -2
  17. package/dist/types/block.d.ts +1 -2
  18. package/dist/types/context.d.mts +5 -8
  19. package/dist/types/context.d.ts +5 -8
  20. package/dist/types/devtools.d.mts +7 -0
  21. package/dist/types/devtools.d.ts +7 -0
  22. package/dist/types/effect.d.mts +6 -10
  23. package/dist/types/effect.d.ts +6 -10
  24. package/dist/types/magics.d.mts +5 -6
  25. package/dist/types/magics.d.ts +5 -6
  26. package/dist/types/ownership.d.mts +9 -16
  27. package/dist/types/ownership.d.ts +9 -16
  28. package/dist/types/plugins/focus/index.d.mts +6 -8
  29. package/dist/types/plugins/focus/index.d.ts +6 -8
  30. package/dist/types/plugins/media/index.d.mts +6 -7
  31. package/dist/types/plugins/media/index.d.ts +6 -7
  32. package/dist/types/plugins/morph/index.d.mts +21 -10
  33. package/dist/types/plugins/morph/index.d.ts +21 -10
  34. package/dist/types/plugins/persist/index.d.mts +12 -19
  35. package/dist/types/plugins/persist/index.d.ts +12 -19
  36. package/dist/types/plugins/resize/index.d.mts +5 -7
  37. package/dist/types/plugins/resize/index.d.ts +5 -7
  38. package/dist/types/plugins/transition/index.d.mts +7 -12
  39. package/dist/types/plugins/transition/index.d.ts +7 -12
  40. package/dist/types/store.d.mts +3 -6
  41. package/dist/types/store.d.ts +3 -6
  42. package/dist/types/utils.d.mts +3 -3
  43. package/dist/types/utils.d.ts +3 -3
  44. package/dist/types/warn.d.mts +6 -8
  45. package/dist/types/warn.d.ts +6 -8
  46. package/package.json +2 -1
package/README.md CHANGED
@@ -6,11 +6,12 @@ Published on npm as **[`@aevantec/litevue`](https://www.npmjs.com/package/@aevan
6
6
  unscoped name is blocked by an unrelated `lite-vue` package. The IIFE/UMD global
7
7
  stays `LiteVue`.
8
8
 
9
- - **~9kb** gzipped core, driven by the real `@vue/reactivity`
9
+ - **~9kb**<!-- size:dist/litevue.iife.js --> gzipped core, driven by the real `@vue/reactivity`
10
10
  - Vue-compatible syntax: `{{ }}`, `v-if`/`v-for` (keyed), `v-model`, `v-show`, …
11
11
  - **Built-in devtools** — in-page inspector panel + browser extension, one line to disable in production
12
12
  - **Transitions** that work with `v-show` *and* `v-if` (deferred unmount)
13
- - **Plugin system** with first-party plugins: intersect, persist, focus (+trap), collapse, transition, mask, morph
13
+ - **Plugin system** with nine first-party plugins: intersect, persist, focus (+trap), collapse, transition, mask, morph, media, resize
14
+ - **Components** registered by name with `app.component()`, usable from `v-scope`
14
15
  - **Global store** (`store()` / `$store`) and magic properties (`$dispatch`, `$watch`, `$id`, `$root`, …)
15
16
  - **Cached derived state** with `computed()`, alongside `reactive()` and `watchEffect()`
16
17
  - Extra event modifiers: `.outside`, `.window`, `.debounce`, `.throttle`, animation-event filters
@@ -1 +1 @@
1
- var LiteVueDevtoolsPanel=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,d,a,s,p,c,h,u=null,g=null,f=!1,v="",x="Elements",b="float",y="",m="",w="",k="",C=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",L="litevue-devtools-theme",E="litevue-devtools-ui",O=()=>{try{return JSON.parse(localStorage.getItem(E)||"{}")}catch{return{}}},S=e=>{try{localStorage.setItem(E,JSON.stringify({...O(),...e}))}catch{}},_={dark:C('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:C('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:C('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},z={float:C('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:C('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:C('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},M={float:"bottom",bottom:"right",right:"float"},$={float:"floating",bottom:"docked to bottom",right:"docked to right"},N={dark:"light",light:"system",system:"dark"},j="dark";try{const e=localStorage.getItem(L);"light"!==e&&"system"!==e||(j=e)}catch{}var T=matchMedia("(prefers-color-scheme: light)"),P=()=>{const e="light"===j||"system"===j&&T.matches;t.host.classList.toggle("light",e),a.innerHTML=_[j],a.title="theme: "+j},I=new Set,D=new WeakSet,V=e=>{"float"===b&&(y=o.style.width||y,m=o.style.height||m,w=o.style.right||w,k=o.style.bottom||k),b=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":w,o.style.bottom=n?"":k,o.style.width="bottom"===e?"":y,o.style.height="right"===e?"":m,p.innerHTML=z[e],p.title="panel: "+$[e]},R=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},H=e=>{const n=R("span","label");return n.appendChild(R("span","punct","<")),n.appendChild(R("span","name",q(e))),n.appendChild(R("span","punct",">")),n},W=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},A=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},B=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},F=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},J=()=>{s.style.display="none"},U=e=>{e!==u&&I.clear(),g=null,u=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,G(),K()},X=e=>{e!==g&&I.clear(),u=null,g=e,x="Stores",window.$scope=n.stores.get(e),G(),K()},Y=e=>{x=e,G()},q=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),G=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===x?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!v||q(i).toLowerCase().includes(v))t.set(i,void 0);else{const e=A(n.scopes.get(i),v);e&&t.set(i,e)}if(!t.size)return void i.appendChild(R("div","empty",v?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=W(n);e;e=W(e))o.add(e)}const r=new Map,l=new Map,d=new Map;for(const n of e){if(!o.has(n))continue;const e=W(n);r.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(D.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=R("div",s===u?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=D.has(s);if(l.get(s)){const n=R("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?D.delete(s):D.add(s),G()},e.appendChild(n)}else e.appendChild(R("span","spacer"));e.appendChild(H(s));const p=n.exps.get(s);p&&e.appendChild(R("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(R("span","hit"," "+c)),e.onclick=()=>U(s),e.onmouseenter=()=>F(s),e.onmouseleave=J,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!v||o.toLowerCase().includes(v))e.set(o,void 0);else{const t=A(n.stores.get(o),v);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=R("div",n===g?"row sel":"row"),o=R("span","label");o.appendChild(R("span","punct","$store.")),o.appendChild(R("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(R("span","hit"," "+r)),t.onclick=()=>X(n),i.appendChild(t)}else i.appendChild(R("div","empty",v?"no matching stores":"no stores registered"))},K=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=g?n.stores.get(g):u?n.scopes.get(u):void 0;if(!e)return void l.appendChild(R("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>Z(n,e,n,0,"prop",[])),r.length&&(l.appendChild(R("div","divider","inherited")),r.forEach(n=>Z(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(R("div","empty","empty scope")),l.appendChild(Q(e))},Q=e=>{const n=R("div","prop adder");n.appendChild(R("span","spacer"));const t=R("input","val key-in");t.placeholder="key";const o=R("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),ie(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},Z=(e,n,t,o,r,i)=>{const d=n[e],a=R("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&I.has(t);if(a.appendChild(R("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(R("span","key",e)),a.appendChild(R("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${B(e)}`:B(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?I.delete(t):I.add(t),K()}),ee(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=R("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)Z(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(R("span","spacer")),a.appendChild(R("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(R("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(R("span","preview",B(d)));else if("boolean"==typeof d){a.appendChild(R("span","bool",String(d)));const t=R("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),ie()},a.appendChild(t)}else{const t=R("input","val");t.value=B(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=B(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,ie()):t.value=B(d)},a.appendChild(t)}ee(a,n,e,o,r),l.appendChild(a)},ee=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=R("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],ie()},e.appendChild(d)},ne=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),oe();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&U(r)},te=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?F(o):J()}},oe=()=>{f=!1,d.classList.remove("active"),J(),document.removeEventListener("click",ne,!0),document.removeEventListener("mousemove",te,!0)},re=!1,ie=()=>{re||(re=!0,setTimeout(()=>{re=!1,"none"!==o.style.display&&(G(),K())}))},le=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const g=document.createElement("style");g.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n resize: vertical;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n resize: horizontal;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(g),s=R("div","highlight"),t.appendChild(s),(r=R("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",S({open:!0}),ie()},t.appendChild(r),(o=R("div","panel")).style.display="none";const x=R("div","header");x.appendChild(R("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==b)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),S({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),(p=R("button","btn")).onclick=()=>{V(M[b]),S({dock:b})},x.appendChild(p),(a=R("button","btn")).onclick=()=>{j=N[j];try{localStorage.setItem(L,j)}catch{}P()},x.appendChild(a),T.addEventListener("change",()=>{"system"===j&&P()}),P(),(d=R("button","btn")).title="pick an element on the page",d.innerHTML=C('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>f?oe():(f=!0,d.classList.add("active"),document.addEventListener("click",ne,!0),void document.addEventListener("mousemove",te,!0)),x.appendChild(d);const E=R("button","btn","\u2715");E.onclick=()=>{f&&oe(),o.style.display="none",r.style.display="",S({open:!1})},x.appendChild(E),o.appendChild(x);const _=R("div","body"),z=R("div","side"),$=R("div","tabs");(c=R("div","tab active")).onclick=()=>Y("Elements"),(h=R("div","tab")).onclick=()=>Y("Stores"),$.appendChild(c),$.appendChild(h),z.appendChild($);const I=R("input","filter");I.placeholder="Filter by name or state",I.oninput=()=>{v=I.value.trim().toLowerCase(),G()},I.onkeydown=e=>{"Escape"===e.key&&(I.value="",v="",G())},z.appendChild(I),i=R("div","tree"),z.appendChild(i),l=R("div","state"),_.appendChild(z),_.appendChild(l),o.appendChild(_),t.appendChild(o);const D=O();if(null!=D.right&&(w=o.style.right=D.right+"px"),null!=D.bottom&&(k=o.style.bottom=D.bottom+"px"),D.w&&(y=o.style.width=D.w+"px"),D.h&&(m=o.style.height=D.h+"px"),V(D.dock||"float"),D.open&&(r.style.display="none",o.style.display="flex",ie()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&S({..."bottom"!==b&&{w:o.offsetWidth},..."right"!==b&&{h:o.offsetHeight}})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",ie),n.on("scope:unmount",e=>{e===u&&(u=null),ie()}),n.stores&&n.on("store:register",ie),n.on("flush",ie)},de=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?le():addEventListener("DOMContentLoaded",le)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return de(),e.init=de,e}({});
1
+ var LiteVueDevtoolsPanel=function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,d,a,s,p,c,h,u=null,g=null,v=!1,f="",x="Elements",b="float",m="",y="",w="",k="",C="",L="",E=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),O=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",S="litevue-devtools-theme",_="litevue-devtools-ui",$=()=>{try{return JSON.parse(localStorage.getItem(_)||"{}")}catch{return{}}},M=e=>{try{localStorage.setItem(_,JSON.stringify({...$(),...e}))}catch{}},z={dark:O('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:O('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:O('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},I={float:O('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:O('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:O('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},N={float:"bottom",bottom:"right",right:"float"},j={float:"floating",bottom:"docked to bottom",right:"docked to right"},P={dark:"light",light:"system",system:"dark"},T="dark";try{const e=localStorage.getItem(S);"light"!==e&&"system"!==e||(T=e)}catch{}var D=matchMedia("(prefers-color-scheme: light)"),H=()=>{const e="light"===T||"system"===T&&D.matches;t.host.classList.toggle("light",e),a.innerHTML=z[T],a.title="theme: "+T},W=new Set,V=new WeakSet,R=()=>{if("float"!==b)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;w=o.style.right=E(e,0,window.innerWidth-o.offsetWidth)+"px",k=o.style.bottom=E(n,0,window.innerHeight-o.offsetHeight)+"px"},X=e=>{"float"===b?(m=o.style.width||m,y=o.style.height||y,w=o.style.right||w,k=o.style.bottom||k):"bottom"===b?C=o.style.height||C:L=o.style.width||L,b=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":w,o.style.bottom=n?"":k,o.style.width="bottom"===e?"":"right"===e?L:m,o.style.height="right"===e?"":"bottom"===e?C:y,p.innerHTML=I[e],p.title="panel: "+j[e]},Y=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},A=e=>{const n=Y("span","label");return n.appendChild(Y("span","punct","<")),n.appendChild(Y("span","name",ee(e))),n.appendChild(Y("span","punct",">")),n},B=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},F=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},J=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},U=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},q=()=>{s.style.display="none"},G=e=>{e!==u&&W.clear(),g=null,u=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,ne(),te()},Z=e=>{e!==g&&W.clear(),u=null,g=e,x="Stores",window.$scope=n.stores.get(e),ne(),te()},K=e=>{x=e,ne()},Q=/^\s*([A-Za-z_$][\w$]*)\s*\(/,ee=e=>n.names.get(e)||(e=>{const t=Q.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),ne=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===x?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!f||ee(i).toLowerCase().includes(f))t.set(i,void 0);else{const e=F(n.scopes.get(i),f);e&&t.set(i,e)}if(!t.size)return void i.appendChild(Y("div","empty",f?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=B(n);e;e=B(e))o.add(e)}const r=new Map,l=new Map,d=new Map;for(const n of e){if(!o.has(n))continue;const e=B(n);r.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(V.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=Y("div",s===u?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=V.has(s);if(l.get(s)){const n=Y("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?V.delete(s):V.add(s),ne()},e.appendChild(n)}else e.appendChild(Y("span","spacer"));e.appendChild(A(s));const p=n.exps.get(s);p&&e.appendChild(Y("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(Y("span","hit"," "+c)),e.onclick=()=>G(s),e.onmouseenter=()=>U(s),e.onmouseleave=q,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!f||o.toLowerCase().includes(f))e.set(o,void 0);else{const t=F(n.stores.get(o),f);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=Y("div",n===g?"row sel":"row"),o=Y("span","label");o.appendChild(Y("span","punct","$store.")),o.appendChild(Y("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(Y("span","hit"," "+r)),t.onclick=()=>Z(n),i.appendChild(t)}else i.appendChild(Y("div","empty",f?"no matching stores":"no stores registered"))},te=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=g?n.stores.get(g):u?n.scopes.get(u):void 0;if(!e)return void l.appendChild(Y("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>re(n,e,n,0,"prop",[])),r.length&&(l.appendChild(Y("div","divider","inherited")),r.forEach(n=>re(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(Y("div","empty","empty scope")),l.appendChild(oe(e))},oe=e=>{const n=Y("div","prop adder");n.appendChild(Y("span","spacer"));const t=Y("input","val key-in");t.placeholder="key";const o=Y("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),pe(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},re=(e,n,t,o,r,i)=>{const d=n[e],a=Y("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&W.has(t);if(a.appendChild(Y("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(Y("span","key",e)),a.appendChild(Y("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${J(e)}`:J(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?W.delete(t):W.add(t),te()}),ie(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=Y("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)re(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(Y("span","spacer")),a.appendChild(Y("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(Y("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(Y("span","preview",J(d)));else if("boolean"==typeof d){a.appendChild(Y("span","bool",String(d)));const t=Y("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),pe()},a.appendChild(t)}else{const t=Y("input","val");t.value=J(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=J(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,pe()):t.value=J(d)},a.appendChild(t)}ie(a,n,e,o,r),l.appendChild(a)},ie=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=Y("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],pe()},e.appendChild(d)},le=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),ae();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&G(r)},de=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?U(o):q()}},ae=()=>{v=!1,d.classList.remove("active"),q(),document.removeEventListener("click",le,!0),document.removeEventListener("mousemove",de,!0)},se=!1,pe=()=>{se||(se=!0,setTimeout(()=>{se=!1,"none"!==o.style.display&&(ne(),te())}))},ce=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const g=document.createElement("style");g.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(g),s=Y("div","highlight"),t.appendChild(s),(r=Y("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",R(),M({open:!0}),pe()},t.appendChild(r),(o=Y("div","panel")).style.display="none";const x=Y("div","header");x.appendChild(Y("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==b)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=E(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=E(r-(e.clientY-l),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),M({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)});const _=Y("div","grip");_.addEventListener("mousedown",e=>{e.preventDefault(),_.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,l=n.height,d=e=>{if("right"!==b){const n="bottom"===b?r-e.clientY:e.clientY-r;o.style.height=E(l+n,320,window.innerHeight-24)+"px"}if("bottom"!==b){const n="right"===b?t-e.clientX:e.clientX-t;o.style.width=E(i+n,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),_.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);M("float"===b?{w:e,h:n}:"bottom"===b?{bh:n}:{rw:e})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),(p=Y("button","btn")).onclick=()=>{X(N[b]),M({dock:b})},x.appendChild(p),(a=Y("button","btn")).onclick=()=>{T=P[T];try{localStorage.setItem(S,T)}catch{}H()},x.appendChild(a),D.addEventListener("change",()=>{"system"===T&&H()}),H(),(d=Y("button","btn")).title="pick an element on the page",d.innerHTML=O('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>v?ae():(v=!0,d.classList.add("active"),document.addEventListener("click",le,!0),void document.addEventListener("mousemove",de,!0)),x.appendChild(d);const z=Y("button","btn","\u2715");z.onclick=()=>{v&&ae(),o.style.display="none",r.style.display="",M({open:!1})},x.appendChild(z),o.appendChild(x);const I=Y("div","body"),j=Y("div","side"),W=Y("div","tabs");(c=Y("div","tab active")).onclick=()=>K("Elements"),(h=Y("div","tab")).onclick=()=>K("Stores"),W.appendChild(c),W.appendChild(h),j.appendChild(W);const V=Y("input","filter");V.placeholder="Filter by name or state",V.oninput=()=>{f=V.value.trim().toLowerCase(),ne()},V.onkeydown=e=>{"Escape"===e.key&&(V.value="",f="",ne())},j.appendChild(V),i=Y("div","tree"),j.appendChild(i),l=Y("div","state"),I.appendChild(j),I.appendChild(l),o.appendChild(I),o.appendChild(_),t.appendChild(o);const A=$();A.w&&(m=o.style.width=A.w+"px"),A.h&&(y=o.style.height=A.h+"px"),null!=A.right&&(w=o.style.right=A.right+"px"),null!=A.bottom&&(k=o.style.bottom=A.bottom+"px"),A.bh&&(C=A.bh+"px"),A.rw&&(L=A.rw+"px"),X(A.dock||"float"),document.body.appendChild(e),A.open&&(r.style.display="none",o.style.display="flex",R(),pe()),n.on("scope:mount",pe),n.on("scope:unmount",e=>{e===u&&(u=null),pe()}),n.stores&&n.on("store:register",pe),n.on("flush",pe)},he=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?ce():addEventListener("DOMContentLoaded",ce)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return he(),e.init=he,e}({});
@@ -1 +1 @@
1
- var e,n,t,o,r,i,l,d,a,s,p,c,h=null,u=null,g=!1,f="",v="Elements",x="float",b="",y="",m="",w="",k=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",C="litevue-devtools-theme",L="litevue-devtools-ui",E=()=>{try{return JSON.parse(localStorage.getItem(L)||"{}")}catch{return{}}},O=e=>{try{localStorage.setItem(L,JSON.stringify({...E(),...e}))}catch{}},S={dark:k('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:k('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:k('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},_={float:k('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:k('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:k('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},z={float:"bottom",bottom:"right",right:"float"},$={float:"floating",bottom:"docked to bottom",right:"docked to right"},M={dark:"light",light:"system",system:"dark"},N="dark";try{const e=localStorage.getItem(C);"light"!==e&&"system"!==e||(N=e)}catch{}var j=matchMedia("(prefers-color-scheme: light)"),T=()=>{const e="light"===N||"system"===N&&j.matches;n.host.classList.toggle("light",e),d.innerHTML=S[N],d.title="theme: "+N},I=/* @__PURE__ */new Set,P=/* @__PURE__ */new WeakSet,D=e=>{"float"===x&&(b=t.style.width||b,y=t.style.height||y,m=t.style.right||m,w=t.style.bottom||w),x=e;const n="float"!==e;t.classList.toggle("dock-bottom","bottom"===e),t.classList.toggle("dock-right","right"===e),t.style.right=n?"":m,t.style.bottom=n?"":w,t.style.width="bottom"===e?"":b,t.style.height="right"===e?"":y,s.innerHTML=_[e],s.title="panel: "+$[e]},R=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},V=e=>{const n=R("span","label");return n.appendChild(R("span","punct","<")),n.appendChild(R("span","name",Y(e))),n.appendChild(R("span","punct",">")),n},H=n=>{let t=n.parentElement;for(;t;){if(e.scopes.has(t))return t;t=t.parentElement}return null},W=(e,n)=>{const t=/* @__PURE__ */new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},A=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},B=e=>{const n=e.getBoundingClientRect();a.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},F=()=>{a.style.display="none"},J=n=>{n!==h&&I.clear(),u=null,h=n,v="Elements",window.$scope=n?e.scopes.get(n):void 0,q(),G()},U=n=>{n!==u&&I.clear(),h=null,u=n,v="Stores",window.$scope=e.stores.get(n),q(),G()},X=e=>{v=e,q()},Y=n=>e.names.get(n)||n.id||n.tagName.toLowerCase(),q=()=>{if((()=>{const n=e.stores?e.stores.size:0;p.textContent=`Elements (${e.scopes.size})`,p.className="Elements"===v?"tab active":"tab",c.textContent=`Stores (${n})`,c.className="Stores"===v?"tab active":"tab"})(),r.textContent="","Elements"===v){const n=[...e.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const r of n)if(!f||Y(r).toLowerCase().includes(f))t.set(r,void 0);else{const n=W(e.scopes.get(r),f);n&&t.set(r,n)}if(!t.size)return void r.appendChild(R("div","empty",f?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const e of t.keys()){o.add(e);for(let n=H(e);n;n=H(n))o.add(n)}const i=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;for(const e of n){if(!o.has(e))continue;const n=H(e);i.set(e,n),d.set(e,n?(d.get(n)??0)+1:0),n&&l.set(n,(l.get(n)||0)+1)}const a=e=>{for(let n=i.get(e);n;n=i.get(n)??null)if(P.has(n))return!0;return!1};for(const s of n){if(!o.has(s)||a(s))continue;const n=R("div",s===h?"row sel":"row");n.style.paddingLeft=8+12*(d.get(s)??0)+"px";const i=P.has(s);if(l.get(s)){const e=R("span",i?"arrow":"arrow open","\u25b6");e.onclick=e=>{e.stopPropagation(),i?P.delete(s):P.add(s),q()},n.appendChild(e)}else n.appendChild(R("span","spacer"));n.appendChild(V(s));const p=e.exps.get(s);p&&n.appendChild(R("span","exp"," "+p));const c=t.get(s);c&&n.appendChild(R("span","hit"," "+c)),n.onclick=()=>J(s),n.onmouseenter=()=>B(s),n.onmouseleave=F,r.appendChild(n)}return}const n=/* @__PURE__ */new Map;for(const o of e.stores?e.stores.keys():[])if(!f||o.toLowerCase().includes(f))n.set(o,void 0);else{const t=W(e.stores.get(o),f);t&&n.set(o,t)}const t=[...n.keys()];if(t.length)for(const e of t){const t=R("div",e===u?"row sel":"row"),o=R("span","label");o.appendChild(R("span","punct","$store.")),o.appendChild(R("span","name",e)),t.appendChild(o);const i=n.get(e);i&&t.appendChild(R("span","hit"," "+i)),t.onclick=()=>U(e),r.appendChild(t)}else r.appendChild(R("div","empty",f?"no matching stores":"no stores registered"))},G=()=>{if(i.contains(n.activeElement))return;i.textContent="";const t=u?e.stores.get(u):h?e.scopes.get(h):void 0;if(!t)return void i.appendChild(R("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(t);o.forEach(e=>Q(e,t,e,0,"prop",[])),r.length&&(i.appendChild(R("div","divider","inherited")),r.forEach(e=>Q(e,t,e,0,"prop inherited",[]))),o.length||r.length||i.appendChild(R("div","empty","empty scope")),i.appendChild(K(t))},K=e=>{const n=R("div","prop adder");n.appendChild(R("span","spacer"));const t=R("input","val key-in");t.placeholder="key";const o=R("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let l=r;"true"===r?l=!0:"false"===r?l=!1:""===r||isNaN(+r)||(l=+r),e[n]=l,t.blur(),o.blur(),re(),setTimeout(()=>{const e=i.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},Q=(e,n,t,o,r,l)=>{const d=n[e],a=R("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=l.indexOf(d)>-1,p=!s&&I.has(t);if(a.appendChild(R("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(R("span","key",e)),a.appendChild(R("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${A(e)}`:A(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?I.delete(t):I.add(t),G()}),Z(a,n,e,o,r),i.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=R("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",i.appendChild(e)}for(const n of e)Q(n,d,t+"."+n,o+1,r,l.concat([d]))}return}a.appendChild(R("span","spacer")),a.appendChild(R("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(R("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(R("span","preview",A(d)));else if("boolean"==typeof d){a.appendChild(R("span","bool",String(d)));const t=R("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),re()},a.appendChild(t)}else{const t=R("input","val");t.value=A(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=A(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,re()):t.value=A(d)},a.appendChild(t)}Z(a,n,e,o,r),i.appendChild(a)},Z=(e,t,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(t,o);if(l&&l.get)return;const d=R("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=n.activeElement;r&&r.blur&&r.blur(),delete t[o],re()},e.appendChild(d)},ee=t=>{const o=t.target;if(o===n.host)return;t.preventDefault(),t.stopPropagation(),te();let r=o;for(;r&&!e.scopes.has(r);)r=r.parentElement;r&&J(r)},ne=t=>{let o=t.target;if(o!==n.host){for(;o&&!e.scopes.has(o);)o=o.parentElement;o?B(o):F()}},te=()=>{g=!1,l.classList.remove("active"),F(),document.removeEventListener("click",ee,!0),document.removeEventListener("mousemove",ne,!0)},oe=!1,re=()=>{oe||(oe=!0,setTimeout(()=>{oe=!1,"none"!==t.style.display&&(q(),G())}))},ie=()=>{const u=document.createElement("div");n=u.attachShadow({mode:"open"});const v=document.createElement("style");v.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n resize: vertical;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n resize: horizontal;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",n.appendChild(v),a=R("div","highlight"),n.appendChild(a),(o=R("div","pill","\u26a1 LiteVue")).onclick=()=>{o.style.display="none",t.style.display="flex",O({open:!0}),re()},n.appendChild(o),(t=R("div","panel")).style.display="none";const L=R("div","header");L.appendChild(R("span","title","\u26a1 LiteVue")),L.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==x)return;e.preventDefault();const n=t.getBoundingClientRect(),o=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{t.style.right=Math.max(0,o-(e.clientX-i))+"px",t.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),O({right:parseInt(t.style.right)||12,bottom:parseInt(t.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),(s=R("button","btn")).onclick=()=>{D(z[x]),O({dock:x})},L.appendChild(s),(d=R("button","btn")).onclick=()=>{N=M[N];try{localStorage.setItem(C,N)}catch{}T()},L.appendChild(d),j.addEventListener("change",()=>{"system"===N&&T()}),T(),(l=R("button","btn")).title="pick an element on the page",l.innerHTML=k('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),l.onclick=()=>g?te():(g=!0,l.classList.add("active"),document.addEventListener("click",ee,!0),void document.addEventListener("mousemove",ne,!0)),L.appendChild(l);const S=R("button","btn","\u2715");S.onclick=()=>{g&&te(),t.style.display="none",o.style.display="",O({open:!1})},L.appendChild(S),t.appendChild(L);const _=R("div","body"),$=R("div","side"),I=R("div","tabs");(p=R("div","tab active")).onclick=()=>X("Elements"),(c=R("div","tab")).onclick=()=>X("Stores"),I.appendChild(p),I.appendChild(c),$.appendChild(I);const P=R("input","filter");P.placeholder="Filter by name or state",P.oninput=()=>{f=P.value.trim().toLowerCase(),q()},P.onkeydown=e=>{"Escape"===e.key&&(P.value="",f="",q())},$.appendChild(P),r=R("div","tree"),$.appendChild(r),i=R("div","state"),_.appendChild($),_.appendChild(i),t.appendChild(_),n.appendChild(t);const V=E();if(null!=V.right&&(m=t.style.right=V.right+"px"),null!=V.bottom&&(w=t.style.bottom=V.bottom+"px"),V.w&&(b=t.style.width=V.w+"px"),V.h&&(y=t.style.height=V.h+"px"),D(V.dock||"float"),V.open&&(o.style.display="none",t.style.display="flex",re()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==t.style.display&&t.offsetWidth&&O({..."bottom"!==x&&{w:t.offsetWidth},..."right"!==x&&{h:t.offsetHeight}})},300)}).observe(t)}document.body.appendChild(u),e.on("scope:mount",re),e.on("scope:unmount",e=>{e===h&&(h=null),re()}),e.stores&&e.on("store:register",re),e.on("flush",re)},le=()=>{const n=window.__LITE_VUE__;n?(e=n,document.body?ie():addEventListener("DOMContentLoaded",ie)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};le();export{le as init};
1
+ var e,n,t,o,r,i,d,l,a,s,p,c,h=null,g=null,u=!1,v="",f="Elements",x="float",b="",m="",y="",w="",k="",C="",L=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),E=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",O="litevue-devtools-theme",S="litevue-devtools-ui",_=()=>{try{return JSON.parse(localStorage.getItem(S)||"{}")}catch{return{}}},$=e=>{try{localStorage.setItem(S,JSON.stringify({..._(),...e}))}catch{}},M={dark:E('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:E('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:E('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},z={float:E('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:E('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:E('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},I={float:"bottom",bottom:"right",right:"float"},N={float:"floating",bottom:"docked to bottom",right:"docked to right"},j={dark:"light",light:"system",system:"dark"},P="dark";try{const e=localStorage.getItem(O);"light"!==e&&"system"!==e||(P=e)}catch{}var T=matchMedia("(prefers-color-scheme: light)"),H=()=>{const e="light"===P||"system"===P&&T.matches;n.host.classList.toggle("light",e),l.innerHTML=M[P],l.title="theme: "+P},D=/* @__PURE__ */new Set,W=/* @__PURE__ */new WeakSet,V=()=>{if("float"!==x)return;const e=parseInt(t.style.right)||0,n=parseInt(t.style.bottom)||0;y=t.style.right=L(e,0,window.innerWidth-t.offsetWidth)+"px",w=t.style.bottom=L(n,0,window.innerHeight-t.offsetHeight)+"px"},R=e=>{"float"===x?(b=t.style.width||b,m=t.style.height||m,y=t.style.right||y,w=t.style.bottom||w):"bottom"===x?k=t.style.height||k:C=t.style.width||C,x=e;const n="float"!==e;t.classList.toggle("dock-bottom","bottom"===e),t.classList.toggle("dock-right","right"===e),t.style.right=n?"":y,t.style.bottom=n?"":w,t.style.width="bottom"===e?"":"right"===e?C:b,t.style.height="right"===e?"":"bottom"===e?k:m,s.innerHTML=z[e],s.title="panel: "+N[e]},X=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},Y=e=>{const n=X("span","label");return n.appendChild(X("span","punct","<")),n.appendChild(X("span","name",Q(e))),n.appendChild(X("span","punct",">")),n},A=n=>{let t=n.parentElement;for(;t;){if(e.scopes.has(t))return t;t=t.parentElement}return null},B=(e,n)=>{const t=/* @__PURE__ */new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let d;try{d=e[t]}catch{continue}if("function"==typeof d)continue;const l=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return l;const a=o(d,l,i+1);if(a)return a}}};return o(e,"",0)},F=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},J=e=>{const n=e.getBoundingClientRect();a.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},U=()=>{a.style.display="none"},q=n=>{n!==h&&D.clear(),g=null,h=n,f="Elements",window.$scope=n?e.scopes.get(n):void 0,ee(),ne()},G=n=>{n!==g&&D.clear(),h=null,g=n,f="Stores",window.$scope=e.stores.get(n),ee(),ne()},Z=e=>{f=e,ee()},K=/^\s*([A-Za-z_$][\w$]*)\s*\(/,Q=n=>e.names.get(n)||(n=>{const t=K.exec(e.exps.get(n)||"")?.[1];return t&&e.components?.has(t)?t:void 0})(n)||n.id||n.tagName.toLowerCase(),ee=()=>{if((()=>{const n=e.stores?e.stores.size:0;p.textContent=`Elements (${e.scopes.size})`,p.className="Elements"===f?"tab active":"tab",c.textContent=`Stores (${n})`,c.className="Stores"===f?"tab active":"tab"})(),r.textContent="","Elements"===f){const n=[...e.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=/* @__PURE__ */new Map;for(const r of n)if(!v||Q(r).toLowerCase().includes(v))t.set(r,void 0);else{const n=B(e.scopes.get(r),v);n&&t.set(r,n)}if(!t.size)return void r.appendChild(X("div","empty",v?"no matching scopes":"no scopes mounted"));const o=/* @__PURE__ */new Set;for(const e of t.keys()){o.add(e);for(let n=A(e);n;n=A(n))o.add(n)}const i=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map;for(const e of n){if(!o.has(e))continue;const n=A(e);i.set(e,n),l.set(e,n?(l.get(n)??0)+1:0),n&&d.set(n,(d.get(n)||0)+1)}const a=e=>{for(let n=i.get(e);n;n=i.get(n)??null)if(W.has(n))return!0;return!1};for(const s of n){if(!o.has(s)||a(s))continue;const n=X("div",s===h?"row sel":"row");n.style.paddingLeft=8+12*(l.get(s)??0)+"px";const i=W.has(s);if(d.get(s)){const e=X("span",i?"arrow":"arrow open","\u25b6");e.onclick=e=>{e.stopPropagation(),i?W.delete(s):W.add(s),ee()},n.appendChild(e)}else n.appendChild(X("span","spacer"));n.appendChild(Y(s));const p=e.exps.get(s);p&&n.appendChild(X("span","exp"," "+p));const c=t.get(s);c&&n.appendChild(X("span","hit"," "+c)),n.onclick=()=>q(s),n.onmouseenter=()=>J(s),n.onmouseleave=U,r.appendChild(n)}return}const n=/* @__PURE__ */new Map;for(const o of e.stores?e.stores.keys():[])if(!v||o.toLowerCase().includes(v))n.set(o,void 0);else{const t=B(e.stores.get(o),v);t&&n.set(o,t)}const t=[...n.keys()];if(t.length)for(const e of t){const t=X("div",e===g?"row sel":"row"),o=X("span","label");o.appendChild(X("span","punct","$store.")),o.appendChild(X("span","name",e)),t.appendChild(o);const i=n.get(e);i&&t.appendChild(X("span","hit"," "+i)),t.onclick=()=>G(e),r.appendChild(t)}else r.appendChild(X("div","empty",v?"no matching stores":"no stores registered"))},ne=()=>{if(i.contains(n.activeElement))return;i.textContent="";const t=g?e.stores.get(g):h?e.scopes.get(h):void 0;if(!t)return void i.appendChild(X("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(t);o.forEach(e=>oe(e,t,e,0,"prop",[])),r.length&&(i.appendChild(X("div","divider","inherited")),r.forEach(e=>oe(e,t,e,0,"prop inherited",[]))),o.length||r.length||i.appendChild(X("div","empty","empty scope")),i.appendChild(te(t))},te=e=>{const n=X("div","prop adder");n.appendChild(X("span","spacer"));const t=X("input","val key-in");t.placeholder="key";const o=X("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let d=r;"true"===r?d=!0:"false"===r?d=!1:""===r||isNaN(+r)||(d=+r),e[n]=d,t.blur(),o.blur(),se(),setTimeout(()=>{const e=i.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},oe=(e,n,t,o,r,d)=>{const l=n[e],a=X("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==l&&"object"==typeof l){const s=d.indexOf(l)>-1,p=!s&&D.has(t);if(a.appendChild(X("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(X("span","key",e)),a.appendChild(X("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${F(e)}`:F(e))(l))),s||(a.classList.add("toggle"),a.onclick=()=>{p?D.delete(t):D.add(t),ne()}),re(a,n,e,o,r),i.appendChild(a),p){const e=Object.keys(l);if(!e.length){const e=X("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",i.appendChild(e)}for(const n of e)oe(n,l,t+"."+n,o+1,r,d.concat([l]))}return}a.appendChild(X("span","spacer")),a.appendChild(X("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof l)a.appendChild(X("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(X("span","preview",F(l)));else if("boolean"==typeof l){a.appendChild(X("span","bool",String(l)));const t=X("input","check");t.type="checkbox",t.checked=l,t.onchange=()=>{n[e]=t.checked,t.blur(),se()},a.appendChild(t)}else{const t=X("input","val");t.value=F(l),t.onfocus=()=>{t.value="string"==typeof l?l:String(l)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=F(l),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,l);o!==l?(n[e]=o,se()):t.value=F(l)},a.appendChild(t)}re(a,n,e,o,r),i.appendChild(a)},re=(e,t,o,r,i)=>{if(0!==r||"prop"!==i)return;const d=Object.getOwnPropertyDescriptor(t,o);if(d&&d.get)return;const l=X("button","del","\u2715");l.title=`delete "${o}"`,l.onclick=e=>{e.stopPropagation();const r=n.activeElement;r&&r.blur&&r.blur(),delete t[o],se()},e.appendChild(l)},ie=t=>{const o=t.target;if(o===n.host)return;t.preventDefault(),t.stopPropagation(),le();let r=o;for(;r&&!e.scopes.has(r);)r=r.parentElement;r&&q(r)},de=t=>{let o=t.target;if(o!==n.host){for(;o&&!e.scopes.has(o);)o=o.parentElement;o?J(o):U()}},le=()=>{u=!1,d.classList.remove("active"),U(),document.removeEventListener("click",ie,!0),document.removeEventListener("mousemove",de,!0)},ae=!1,se=()=>{ae||(ae=!0,setTimeout(()=>{ae=!1,"none"!==t.style.display&&(ee(),ne())}))},pe=()=>{const g=document.createElement("div");n=g.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",n.appendChild(f),a=X("div","highlight"),n.appendChild(a),(o=X("div","pill","\u26a1 LiteVue")).onclick=()=>{o.style.display="none",t.style.display="flex",V(),$({open:!0}),se()},n.appendChild(o),(t=X("div","panel")).style.display="none";const S=X("div","header");S.appendChild(X("span","title","\u26a1 LiteVue")),S.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==x)return;e.preventDefault();const n=t.getBoundingClientRect(),o=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,d=e.clientY,l=e=>{t.style.right=L(o-(e.clientX-i),0,window.innerWidth-t.offsetWidth)+"px",t.style.bottom=L(r-(e.clientY-d),0,window.innerHeight-t.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),$({right:parseInt(t.style.right)||12,bottom:parseInt(t.style.bottom)||12})};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)});const M=X("div","grip");M.addEventListener("mousedown",e=>{e.preventDefault(),M.classList.add("active");const n=t.getBoundingClientRect(),o=e.clientX,r=e.clientY,i=n.width,d=n.height,l=e=>{if("right"!==x){const n="bottom"===x?r-e.clientY:e.clientY-r;t.style.height=L(d+n,320,window.innerHeight-24)+"px"}if("bottom"!==x){const n="right"===x?o-e.clientX:e.clientX-o;t.style.width=L(i+n,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),M.classList.remove("active");const e=parseInt(t.style.width),n=parseInt(t.style.height);$("float"===x?{w:e,h:n}:"bottom"===x?{bh:n}:{rw:e})};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}),(s=X("button","btn")).onclick=()=>{R(I[x]),$({dock:x})},S.appendChild(s),(l=X("button","btn")).onclick=()=>{P=j[P];try{localStorage.setItem(O,P)}catch{}H()},S.appendChild(l),T.addEventListener("change",()=>{"system"===P&&H()}),H(),(d=X("button","btn")).title="pick an element on the page",d.innerHTML=E('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>u?le():(u=!0,d.classList.add("active"),document.addEventListener("click",ie,!0),void document.addEventListener("mousemove",de,!0)),S.appendChild(d);const z=X("button","btn","\u2715");z.onclick=()=>{u&&le(),t.style.display="none",o.style.display="",$({open:!1})},S.appendChild(z),t.appendChild(S);const N=X("div","body"),D=X("div","side"),W=X("div","tabs");(p=X("div","tab active")).onclick=()=>Z("Elements"),(c=X("div","tab")).onclick=()=>Z("Stores"),W.appendChild(p),W.appendChild(c),D.appendChild(W);const Y=X("input","filter");Y.placeholder="Filter by name or state",Y.oninput=()=>{v=Y.value.trim().toLowerCase(),ee()},Y.onkeydown=e=>{"Escape"===e.key&&(Y.value="",v="",ee())},D.appendChild(Y),r=X("div","tree"),D.appendChild(r),i=X("div","state"),N.appendChild(D),N.appendChild(i),t.appendChild(N),t.appendChild(M),n.appendChild(t);const A=_();A.w&&(b=t.style.width=A.w+"px"),A.h&&(m=t.style.height=A.h+"px"),null!=A.right&&(y=t.style.right=A.right+"px"),null!=A.bottom&&(w=t.style.bottom=A.bottom+"px"),A.bh&&(k=A.bh+"px"),A.rw&&(C=A.rw+"px"),R(A.dock||"float"),document.body.appendChild(g),A.open&&(o.style.display="none",t.style.display="flex",V(),se()),e.on("scope:mount",se),e.on("scope:unmount",e=>{e===h&&(h=null),se()}),e.stores&&e.on("store:register",se),e.on("flush",se)},ce=()=>{const n=window.__LITE_VUE__;n?(e=n,document.body?pe():addEventListener("DOMContentLoaded",pe)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};ce();export{ce as init};
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,l,d,a,s,p,c,h,u=null,f=null,g=!1,v="",x="Elements",b="float",y="",m="",w="",k="",C=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",L="litevue-devtools-theme",E="litevue-devtools-ui",O=()=>{try{return JSON.parse(localStorage.getItem(E)||"{}")}catch{return{}}},S=e=>{try{localStorage.setItem(E,JSON.stringify({...O(),...e}))}catch{}},_={dark:C('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:C('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:C('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},z={float:C('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:C('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:C('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},M={float:"bottom",bottom:"right",right:"float"},$={float:"floating",bottom:"docked to bottom",right:"docked to right"},j={dark:"light",light:"system",system:"dark"},N="dark";try{const e=localStorage.getItem(L);"light"!==e&&"system"!==e||(N=e)}catch{}var T=matchMedia("(prefers-color-scheme: light)"),P=()=>{const e="light"===N||"system"===N&&T.matches;t.host.classList.toggle("light",e),a.innerHTML=_[N],a.title="theme: "+N},I=new Set,D=new WeakSet,V=e=>{"float"===b&&(y=o.style.width||y,m=o.style.height||m,w=o.style.right||w,k=o.style.bottom||k),b=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":w,o.style.bottom=n?"":k,o.style.width="bottom"===e?"":y,o.style.height="right"===e?"":m,p.innerHTML=z[e],p.title="panel: "+$[e]},R=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},H=e=>{const n=R("span","label");return n.appendChild(R("span","punct","<")),n.appendChild(R("span","name",q(e))),n.appendChild(R("span","punct",">")),n},W=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},A=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let l;try{l=e[t]}catch{continue}if("function"==typeof l)continue;const d=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return d;const a=o(l,d,i+1);if(a)return a}}};return o(e,"",0)},B=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},F=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},J=()=>{s.style.display="none"},U=e=>{e!==u&&I.clear(),f=null,u=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,G(),K()},X=e=>{e!==f&&I.clear(),u=null,f=e,x="Stores",window.$scope=n.stores.get(e),G(),K()},Y=e=>{x=e,G()},q=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),G=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===x?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!v||q(i).toLowerCase().includes(v))t.set(i,void 0);else{const e=A(n.scopes.get(i),v);e&&t.set(i,e)}if(!t.size)return void i.appendChild(R("div","empty",v?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=W(n);e;e=W(e))o.add(e)}const r=new Map,l=new Map,d=new Map;for(const n of e){if(!o.has(n))continue;const e=W(n);r.set(n,e),d.set(n,e?(d.get(e)??0)+1:0),e&&l.set(e,(l.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(D.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=R("div",s===u?"row sel":"row");e.style.paddingLeft=8+12*(d.get(s)??0)+"px";const r=D.has(s);if(l.get(s)){const n=R("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?D.delete(s):D.add(s),G()},e.appendChild(n)}else e.appendChild(R("span","spacer"));e.appendChild(H(s));const p=n.exps.get(s);p&&e.appendChild(R("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(R("span","hit"," "+c)),e.onclick=()=>U(s),e.onmouseenter=()=>F(s),e.onmouseleave=J,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!v||o.toLowerCase().includes(v))e.set(o,void 0);else{const t=A(n.stores.get(o),v);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=R("div",n===f?"row sel":"row"),o=R("span","label");o.appendChild(R("span","punct","$store.")),o.appendChild(R("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(R("span","hit"," "+r)),t.onclick=()=>X(n),i.appendChild(t)}else i.appendChild(R("div","empty",v?"no matching stores":"no stores registered"))},K=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=f?n.stores.get(f):u?n.scopes.get(u):void 0;if(!e)return void l.appendChild(R("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>Z(n,e,n,0,"prop",[])),r.length&&(l.appendChild(R("div","divider","inherited")),r.forEach(n=>Z(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(R("div","empty","empty scope")),l.appendChild(Q(e))},Q=e=>{const n=R("div","prop adder");n.appendChild(R("span","spacer"));const t=R("input","val key-in");t.placeholder="key";const o=R("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),ie(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},Z=(e,n,t,o,r,i)=>{const d=n[e],a=R("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&I.has(t);if(a.appendChild(R("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(R("span","key",e)),a.appendChild(R("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${B(e)}`:B(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?I.delete(t):I.add(t),K()}),ee(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=R("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)Z(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(R("span","spacer")),a.appendChild(R("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(R("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(R("span","preview",B(d)));else if("boolean"==typeof d){a.appendChild(R("span","bool",String(d)));const t=R("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),ie()},a.appendChild(t)}else{const t=R("input","val");t.value=B(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=B(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,ie()):t.value=B(d)},a.appendChild(t)}ee(a,n,e,o,r),l.appendChild(a)},ee=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=R("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],ie()},e.appendChild(d)},ne=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),oe();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&U(r)},te=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?F(o):J()}},oe=()=>{g=!1,d.classList.remove("active"),J(),document.removeEventListener("click",ne,!0),document.removeEventListener("mousemove",te,!0)},re=!1,ie=()=>{re||(re=!0,setTimeout(()=>{re=!1,"none"!==o.style.display&&(G(),K())}))},le=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const f=document.createElement("style");f.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n resize: vertical;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n resize: horizontal;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(f),s=R("div","highlight"),t.appendChild(s),(r=R("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",S({open:!0}),ie()},t.appendChild(r),(o=R("div","panel")).style.display="none";const x=R("div","header");x.appendChild(R("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==b)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),S({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),(p=R("button","btn")).onclick=()=>{V(M[b]),S({dock:b})},x.appendChild(p),(a=R("button","btn")).onclick=()=>{N=j[N];try{localStorage.setItem(L,N)}catch{}P()},x.appendChild(a),T.addEventListener("change",()=>{"system"===N&&P()}),P(),(d=R("button","btn")).title="pick an element on the page",d.innerHTML=C('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>g?oe():(g=!0,d.classList.add("active"),document.addEventListener("click",ne,!0),void document.addEventListener("mousemove",te,!0)),x.appendChild(d);const E=R("button","btn","\u2715");E.onclick=()=>{g&&oe(),o.style.display="none",r.style.display="",S({open:!1})},x.appendChild(E),o.appendChild(x);const _=R("div","body"),z=R("div","side"),$=R("div","tabs");(c=R("div","tab active")).onclick=()=>Y("Elements"),(h=R("div","tab")).onclick=()=>Y("Stores"),$.appendChild(c),$.appendChild(h),z.appendChild($);const I=R("input","filter");I.placeholder="Filter by name or state",I.oninput=()=>{v=I.value.trim().toLowerCase(),G()},I.onkeydown=e=>{"Escape"===e.key&&(I.value="",v="",G())},z.appendChild(I),i=R("div","tree"),z.appendChild(i),l=R("div","state"),_.appendChild(z),_.appendChild(l),o.appendChild(_),t.appendChild(o);const D=O();if(null!=D.right&&(w=o.style.right=D.right+"px"),null!=D.bottom&&(k=o.style.bottom=D.bottom+"px"),D.w&&(y=o.style.width=D.w+"px"),D.h&&(m=o.style.height=D.h+"px"),V(D.dock||"float"),D.open&&(r.style.display="none",o.style.display="flex",ie()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&S({..."bottom"!==b&&{w:o.offsetWidth},..."right"!==b&&{h:o.offsetHeight}})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",ie),n.on("scope:unmount",e=>{e===u&&(u=null),ie()}),n.stores&&n.on("store:register",ie),n.on("flush",ie)},de=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?le():addEventListener("DOMContentLoaded",le)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};de(),e.init=de});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n,t,o,r,i,d,l,a,s,p,c,h,u=null,g=null,f=!1,v="",x="Elements",b="float",m="",y="",w="",k="",C="",L="",E=(e,n,t)=>Math.min(Math.max(e,n),Math.max(n,t)),O=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",S="litevue-devtools-theme",_="litevue-devtools-ui",$=()=>{try{return JSON.parse(localStorage.getItem(_)||"{}")}catch{return{}}},M=e=>{try{localStorage.setItem(_,JSON.stringify({...$(),...e}))}catch{}},j={dark:O('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:O('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:O('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},z={float:O('<rect x="2" y="4" width="14" height="11" rx="1"/><rect x="9" y="10" width="13" height="10" rx="1" fill="currentColor"/>'),bottom:O('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="2" y="14" width="20" height="7" fill="currentColor"/>'),right:O('<rect x="2" y="3" width="20" height="18" rx="1"/><rect x="14" y="3" width="8" height="18" fill="currentColor"/>')},I={float:"bottom",bottom:"right",right:"float"},N={float:"floating",bottom:"docked to bottom",right:"docked to right"},T={dark:"light",light:"system",system:"dark"},P="dark";try{const e=localStorage.getItem(S);"light"!==e&&"system"!==e||(P=e)}catch{}var D=matchMedia("(prefers-color-scheme: light)"),H=()=>{const e="light"===P||"system"===P&&D.matches;t.host.classList.toggle("light",e),a.innerHTML=j[P],a.title="theme: "+P},W=new Set,V=new WeakSet,R=()=>{if("float"!==b)return;const e=parseInt(o.style.right)||0,n=parseInt(o.style.bottom)||0;w=o.style.right=E(e,0,window.innerWidth-o.offsetWidth)+"px",k=o.style.bottom=E(n,0,window.innerHeight-o.offsetHeight)+"px"},X=e=>{"float"===b?(m=o.style.width||m,y=o.style.height||y,w=o.style.right||w,k=o.style.bottom||k):"bottom"===b?C=o.style.height||C:L=o.style.width||L,b=e;const n="float"!==e;o.classList.toggle("dock-bottom","bottom"===e),o.classList.toggle("dock-right","right"===e),o.style.right=n?"":w,o.style.bottom=n?"":k,o.style.width="bottom"===e?"":"right"===e?L:m,o.style.height="right"===e?"":"bottom"===e?C:y,p.innerHTML=z[e],p.title="panel: "+N[e]},Y=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},A=e=>{const n=Y("span","label");return n.appendChild(Y("span","punct","<")),n.appendChild(Y("span","name",ee(e))),n.appendChild(Y("span","punct",">")),n},B=e=>{let t=e.parentElement;for(;t;){if(n.scopes.has(t))return t;t=t.parentElement}return null},F=(e,n)=>{const t=new Set,o=(e,r,i)=>{if(null!=e){if("object"!=typeof e)return String(e).toLowerCase().includes(n)?r:void 0;if(i>4||t.has(e))return;t.add(e);for(const t of Object.keys(e)){if("$"===t[0])continue;let d;try{d=e[t]}catch{continue}if("function"==typeof d)continue;const l=r?`${r}.${t}`:t;if(t.toLowerCase().includes(n))return l;const a=o(d,l,i+1);if(a)return a}}};return o(e,"",0)},J=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},U=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},q=()=>{s.style.display="none"},G=e=>{e!==u&&W.clear(),g=null,u=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,ne(),te()},Z=e=>{e!==g&&W.clear(),u=null,g=e,x="Stores",window.$scope=n.stores.get(e),ne(),te()},K=e=>{x=e,ne()},Q=/^\s*([A-Za-z_$][\w$]*)\s*\(/,ee=e=>n.names.get(e)||(e=>{const t=Q.exec(n.exps.get(e)||"")?.[1];return t&&n.components?.has(t)?t:void 0})(e)||e.id||e.tagName.toLowerCase(),ne=()=>{if((()=>{const e=n.stores?n.stores.size:0;c.textContent=`Elements (${n.scopes.size})`,c.className="Elements"===x?"tab active":"tab",h.textContent=`Stores (${e})`,h.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t=new Map;for(const i of e)if(!v||ee(i).toLowerCase().includes(v))t.set(i,void 0);else{const e=F(n.scopes.get(i),v);e&&t.set(i,e)}if(!t.size)return void i.appendChild(Y("div","empty",v?"no matching scopes":"no scopes mounted"));const o=new Set;for(const n of t.keys()){o.add(n);for(let e=B(n);e;e=B(e))o.add(e)}const r=new Map,d=new Map,l=new Map;for(const n of e){if(!o.has(n))continue;const e=B(n);r.set(n,e),l.set(n,e?(l.get(e)??0)+1:0),e&&d.set(e,(d.get(e)||0)+1)}const a=e=>{for(let n=r.get(e);n;n=r.get(n)??null)if(V.has(n))return!0;return!1};for(const s of e){if(!o.has(s)||a(s))continue;const e=Y("div",s===u?"row sel":"row");e.style.paddingLeft=8+12*(l.get(s)??0)+"px";const r=V.has(s);if(d.get(s)){const n=Y("span",r?"arrow":"arrow open","\u25b6");n.onclick=e=>{e.stopPropagation(),r?V.delete(s):V.add(s),ne()},e.appendChild(n)}else e.appendChild(Y("span","spacer"));e.appendChild(A(s));const p=n.exps.get(s);p&&e.appendChild(Y("span","exp"," "+p));const c=t.get(s);c&&e.appendChild(Y("span","hit"," "+c)),e.onclick=()=>G(s),e.onmouseenter=()=>U(s),e.onmouseleave=q,i.appendChild(e)}return}const e=new Map;for(const o of n.stores?n.stores.keys():[])if(!v||o.toLowerCase().includes(v))e.set(o,void 0);else{const t=F(n.stores.get(o),v);t&&e.set(o,t)}const t=[...e.keys()];if(t.length)for(const n of t){const t=Y("div",n===g?"row sel":"row"),o=Y("span","label");o.appendChild(Y("span","punct","$store.")),o.appendChild(Y("span","name",n)),t.appendChild(o);const r=e.get(n);r&&t.appendChild(Y("span","hit"," "+r)),t.onclick=()=>Z(n),i.appendChild(t)}else i.appendChild(Y("div","empty",v?"no matching stores":"no stores registered"))},te=()=>{if(d.contains(t.activeElement))return;d.textContent="";const e=g?n.stores.get(g):u?n.scopes.get(u):void 0;if(!e)return void d.appendChild(Y("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>re(n,e,n,0,"prop",[])),r.length&&(d.appendChild(Y("div","divider","inherited")),r.forEach(n=>re(n,e,n,0,"prop inherited",[]))),o.length||r.length||d.appendChild(Y("div","empty","empty scope")),d.appendChild(oe(e))},oe=e=>{const n=Y("div","prop adder");n.appendChild(Y("span","spacer"));const t=Y("input","val key-in");t.placeholder="key";const o=Y("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),pe(),setTimeout(()=>{const e=d.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},re=(e,n,t,o,r,i)=>{const l=n[e],a=Y("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==l&&"object"==typeof l){const s=i.indexOf(l)>-1,p=!s&&W.has(t);if(a.appendChild(Y("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(Y("span","key",e)),a.appendChild(Y("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${J(e)}`:J(e))(l))),s||(a.classList.add("toggle"),a.onclick=()=>{p?W.delete(t):W.add(t),te()}),ie(a,n,e,o,r),d.appendChild(a),p){const e=Object.keys(l);if(!e.length){const e=Y("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",d.appendChild(e)}for(const n of e)re(n,l,t+"."+n,o+1,r,i.concat([l]))}return}a.appendChild(Y("span","spacer")),a.appendChild(Y("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof l)a.appendChild(Y("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(Y("span","preview",J(l)));else if("boolean"==typeof l){a.appendChild(Y("span","bool",String(l)));const t=Y("input","check");t.type="checkbox",t.checked=l,t.onchange=()=>{n[e]=t.checked,t.blur(),pe()},a.appendChild(t)}else{const t=Y("input","val");t.value=J(l),t.onfocus=()=>{t.value="string"==typeof l?l:String(l)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=J(l),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,l);o!==l?(n[e]=o,pe()):t.value=J(l)},a.appendChild(t)}ie(a,n,e,o,r),d.appendChild(a)},ie=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const d=Object.getOwnPropertyDescriptor(n,o);if(d&&d.get)return;const l=Y("button","del","\u2715");l.title=`delete "${o}"`,l.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],pe()},e.appendChild(l)},de=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),ae();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&G(r)},le=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?U(o):q()}},ae=()=>{f=!1,l.classList.remove("active"),q(),document.removeEventListener("click",de,!0),document.removeEventListener("mousemove",le,!0)},se=!1,pe=()=>{se||(se=!0,setTimeout(()=>{se=!1,"none"!==o.style.display&&(ne(),te())}))},ce=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const g=document.createElement("style");g.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(g),s=Y("div","highlight"),t.appendChild(s),(r=Y("div","pill","\u26a1 LiteVue")).onclick=()=>{r.style.display="none",o.style.display="flex",R(),M({open:!0}),pe()},t.appendChild(r),(o=Y("div","panel")).style.display="none";const x=Y("div","header");x.appendChild(Y("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;if("float"!==b)return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,d=e.clientY,l=e=>{o.style.right=E(t-(e.clientX-i),0,window.innerWidth-o.offsetWidth)+"px",o.style.bottom=E(r-(e.clientY-d),0,window.innerHeight-o.offsetHeight)+"px"},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),M({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)});const _=Y("div","grip");_.addEventListener("mousedown",e=>{e.preventDefault(),_.classList.add("active");const n=o.getBoundingClientRect(),t=e.clientX,r=e.clientY,i=n.width,d=n.height,l=e=>{if("right"!==b){const n="bottom"===b?r-e.clientY:e.clientY-r;o.style.height=E(d+n,320,window.innerHeight-24)+"px"}if("bottom"!==b){const n="right"===b?t-e.clientX:e.clientX-t;o.style.width=E(i+n,320,window.innerWidth-24)+"px"}},a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),_.classList.remove("active");const e=parseInt(o.style.width),n=parseInt(o.style.height);M("float"===b?{w:e,h:n}:"bottom"===b?{bh:n}:{rw:e})};document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}),(p=Y("button","btn")).onclick=()=>{X(I[b]),M({dock:b})},x.appendChild(p),(a=Y("button","btn")).onclick=()=>{P=T[P];try{localStorage.setItem(S,P)}catch{}H()},x.appendChild(a),D.addEventListener("change",()=>{"system"===P&&H()}),H(),(l=Y("button","btn")).title="pick an element on the page",l.innerHTML=O('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),l.onclick=()=>f?ae():(f=!0,l.classList.add("active"),document.addEventListener("click",de,!0),void document.addEventListener("mousemove",le,!0)),x.appendChild(l);const j=Y("button","btn","\u2715");j.onclick=()=>{f&&ae(),o.style.display="none",r.style.display="",M({open:!1})},x.appendChild(j),o.appendChild(x);const z=Y("div","body"),N=Y("div","side"),W=Y("div","tabs");(c=Y("div","tab active")).onclick=()=>K("Elements"),(h=Y("div","tab")).onclick=()=>K("Stores"),W.appendChild(c),W.appendChild(h),N.appendChild(W);const V=Y("input","filter");V.placeholder="Filter by name or state",V.oninput=()=>{v=V.value.trim().toLowerCase(),ne()},V.onkeydown=e=>{"Escape"===e.key&&(V.value="",v="",ne())},N.appendChild(V),i=Y("div","tree"),N.appendChild(i),d=Y("div","state"),z.appendChild(N),z.appendChild(d),o.appendChild(z),o.appendChild(_),t.appendChild(o);const A=$();A.w&&(m=o.style.width=A.w+"px"),A.h&&(y=o.style.height=A.h+"px"),null!=A.right&&(w=o.style.right=A.right+"px"),null!=A.bottom&&(k=o.style.bottom=A.bottom+"px"),A.bh&&(C=A.bh+"px"),A.rw&&(L=A.rw+"px"),X(A.dock||"float"),document.body.appendChild(e),A.open&&(r.style.display="none",o.style.display="flex",R(),pe()),n.on("scope:mount",pe),n.on("scope:unmount",e=>{e===u&&(u=null),pe()}),n.stores&&n.on("store:register",pe),n.on("flush",pe)},he=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?ce():addEventListener("DOMContentLoaded",ce)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};he(),e.init=he});
@@ -1 +1 @@
1
- var LiteVuePlugins=function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let s=0;s<n.length;s++)i=Math.max(i,r(n[s])+r(o[s%o.length]));return i},i="litevue:",s=Object.create(null),c="local",l=e=>{const t=e??c;return"string"!=typeof t?t:s[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},a=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},f=/^(?:v-|:|@)/,u=/^(?::|v-bind:)/,d=["id","data-key","data-id"],m=e=>{for(const t of d){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},p=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},v=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),h=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)u.test(n)?t.add(n.replace(u,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])f.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},b=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return g(e,t,n);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return g(e,t,n);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(h(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||v(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(v(t))return!0;return!1})(i)||k(o,i,o.__ctx||n,r))},g=(e,t,n)=>{const r=t.cloneNode(!0);n?.dispose?.(e),e.parentNode.replaceChild(r,e),y(r,n)},y=(e,t)=>{const n=t||p(e.parentNode);n?.walk?.(e,n)},k=(e,t,n,r)=>{const o=r.key||m,i=new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,l=t.firstChild;const a=t=>{const r=t.cloneNode(!0);e.insertBefore(r,c),y(r,n)};for(;l;){const t=l.nextSibling,o=s(l);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),b(t,l,n,r)):a(l)}else if(c&&null==s(c)){const e=c.nextSibling;b(c,l,n,r),c=e}else a(l);l=t}for(;c;){const t=c.nextSibling;n?.dispose?.(c),e.removeChild(c),c=t}},x=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=w();b(e,r,p(e),n),t()}return e},w=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},S={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},E=Object.freeze({...S}),O={mobile:"base",tablet:"md",desktop:"lg"},A=/^\d+$/,L=(0,t.reactive)({bp:"base",tick:0}),$={...S},T=["base"],_=!1,j=[],q=new Map,P=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,C=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),D=()=>{for(let e=j.length-1;e>=0;e--)if(j[e].mql.matches)return T[e+1];return"base"},M=()=>{j.forEach(e=>e.off()),j=[];const e=Object.keys($).filter(e=>$[e]>0).sort((e,t)=>$[e]-$[t]);T=["base",...e],P()&&(j=e.map(e=>{const t=window.matchMedia(`(min-width: ${$[e]}px)`);return C(t,()=>{L.bp=D()})}),L.bp=D())},N=()=>{_||(_=!0,M()),L.tick},z=e=>{if(!P())return!1;let t=q.get(e);if(!t){const n=window.matchMedia(e);t=C(n,()=>L.tick++),q.set(e,t)}return t.mql.matches},I=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(A.test(e))return Number(e);const t=O[e];return void 0!==t?"base"===t?0:$[t]:$[e]},B=e=>{if(e<=0)return!0;const t=T.findIndex(t=>"base"!==t&&$[t]===e);return-1!==t?T.indexOf(L.bp)>=t:(L.tick,z(`(min-width: ${e}px)`))},R=new Set,H=(e,t)=>{let n;N();let r=-1;for(const o of Object.keys(e)){const t=I(o);void 0!==t?t>=r&&B(t)&&(r=t,n=e[o]):(T.join(", "),Object.keys(O).join(", "))}return void 0!==n?n:t},J=e=>{const t=O[e],n=$[t];return void 0!==n?n:S[t]},K=Object.defineProperties((e,t)=>H(e,t),{props:{value:e=>{N();const t={};for(const n of Object.keys(e))t[n]=H(e[n]);return t}},breakpoint:{get:()=>(N(),L.bp),enumerable:!0},device:{get:()=>(N(),B(J("tablet"))?B(J("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{N();const t=I(e);return void 0!==t&&B(t)}},match:{value:e=>(N(),z(e))},configure:{value:({breakpoints:e})=>{e&&($={...e},_&&(M(),L.tick++))}}}),V=()=>{j.forEach(e=>e.off()),q.forEach(e=>e.off()),j=[],q.clear(),_=!1};return e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const l=new Set,a=(e,t)=>{const n=setTimeout(()=>{l.delete(n),e()},t);l.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void a(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",a(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>l.forEach(clearTimeout)})},e.defaultBreakpoints=E,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=()=>{const e=((e,t)=>{let r="",o="",i=0;for(let s=0;s<t.length;s++){const c=n[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;r+=o+e[i++],o=""}else o+=t[s],e[i]===t[s]&&i++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",o),o(),()=>e.removeEventListener("input",o)})},e.media=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&K.configure(t),e.scope.$mq=K,e.scope.$mqProps=K.props,e.scope.$mqAtLeast=K.atLeast,e.scope.$mqMatch=K.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>K.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>K.device,enumerable:!0,configurable:!0}),V),e.morph=x,e.morphPlugin=e=>{e.scope.$morph=x},e.mq=K,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:s})=>{const c=i+(n||t.id);let f;for(const i in o||{})if(l(i)){f=i;break}const u=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;a(e.scope,c,u,l(f),s)})},e.persistStore=(e,n={})=>{const r=(0,t.store)(e);if(!r)return()=>{};const o=l(n.storage);return a(r,i+(n.key??e),n.keys,o,t.watchEffect)},e.registerStorage=(e,t)=>{s[e]=t},e.resetMedia=()=>{V(),$={...S},T=["base",...Object.keys($).sort((e,t)=>$[e]-$[t])],_=!1,R.clear(),L.bp="base",L.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:i,exp:s})=>{const c=e,l=r||"v",a=e=>`${l}-${e}`;let f,u=0,d=!0;const m=()=>{c.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},p=(e,t)=>{const n=++u;m(),c.classList.add(a(e+"-from"),a(e+"-active")),c.offsetWidth,c.classList.remove(a(e+"-from")),c.classList.add(a(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===u&&(m(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(c))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),c.__leave=()=>new Promise(e=>p("leave",e)),()=>{e=!1,clearTimeout(f),delete c.__leave}}return n(()=>{const e=!!t();if(d)return d=!1,c.style.display=e?"":"none",void(e&&i?.appear&&p("enter"));e?(c.style.display="",p("enter")):p("leave",()=>{c.style.display="none"})}),()=>clearTimeout(f)})},e}({},LiteVue);
1
+ var LiteVuePlugins=function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let s=0;s<n.length;s++)i=Math.max(i,r(n[s])+r(o[s%o.length]));return i},i="litevue:",s=Object.create(null),c="local",a=e=>{const t=e??c;return"string"!=typeof t?t:s[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},l=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},f=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),d=/^(?:v-|:|@)/,u=/^(?::|v-bind:)/,m=["id","data-key","data-id"],p=e=>{for(const t of m){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},v=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},h=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),b=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)u.test(n)?t.add(n.replace(u,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])d.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},g=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return y(e,t,n,r);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return y(e,t,n,r);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(b(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||h(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(h(t))return!0;return!1})(i)||x(o,i,o.__ctx||n,r))},y=(e,t,n,r)=>{if(f(e,r))return;const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(n?.dispose?.(e),e.parentNode.replaceChild(o,e),r.afterNodeRemoved?.(e),k(o,n))},k=(e,t)=>{const n=t||v(e.parentNode);n?.walk?.(e,n)},x=(e,t,n,r)=>{const o=r.key||p,i=new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,a=t.firstChild;const l=t=>{const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(e.insertBefore(o,c),k(o,n))};for(;a;){const t=a.nextSibling,o=s(a);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),g(t,a,n,r)):l(a)}else if(c&&null==s(c)){const e=c.nextSibling;g(c,a,n,r),c=e}else l(a);a=t}for(;c;){const t=c.nextSibling;f(c,r)||(n?.dispose?.(c),e.removeChild(c),r.afterNodeRemoved?.(c)),c=t}},w=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=S();g(e,r,v(e),n),t()}return e},S=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},E={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},A=Object.freeze({...E}),O={mobile:"base",tablet:"md",desktop:"lg"},L=/^\d+$/,$=(0,t.reactive)({bp:"base",tick:0}),T={...E},_=["base"],j=!1,N=[],q=new Map,P=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,C=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),D=()=>{for(let e=N.length-1;e>=0;e--)if(N[e].mql.matches)return _[e+1];return"base"},M=()=>{N.forEach(e=>e.off()),N=[];const e=Object.keys(T).filter(e=>T[e]>0).sort((e,t)=>T[e]-T[t]);_=["base",...e],P()&&(N=e.map(e=>{const t=window.matchMedia(`(min-width: ${T[e]}px)`);return C(t,()=>{$.bp=D()})}),$.bp=D())},R=()=>{j||(j=!0,M()),$.tick},z=e=>{if(!P())return!1;let t=q.get(e);if(!t){const n=window.matchMedia(e);t=C(n,()=>$.tick++),q.set(e,t)}return t.mql.matches},I=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(L.test(e))return Number(e);const t=O[e];return void 0!==t?"base"===t?0:T[t]:T[e]},B=e=>{if(e<=0)return!0;const t=_.findIndex(t=>"base"!==t&&T[t]===e);return-1!==t?_.indexOf($.bp)>=t:($.tick,z(`(min-width: ${e}px)`))},H=new Set,J=(e,t)=>{let n;R();let r=-1;for(const o of Object.keys(e)){const t=I(o);void 0!==t?t>=r&&B(t)&&(r=t,n=e[o]):(_.join(", "),Object.keys(O).join(", "))}return void 0!==n?n:t},K=e=>{const t=O[e],n=T[t];return void 0!==n?n:E[t]},V=Object.defineProperties((e,t)=>J(e,t),{props:{value:e=>{R();const t={};for(const n of Object.keys(e))t[n]=J(e[n]);return t}},breakpoint:{get:()=>(R(),$.bp),enumerable:!0},device:{get:()=>(R(),B(K("tablet"))?B(K("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{R();const t=I(e);return void 0!==t&&B(t)}},match:{value:e=>(R(),z(e))},configure:{value:({breakpoints:e})=>{e&&(T={...e},j&&(M(),$.tick++))}}}),Z=()=>{N.forEach(e=>e.off()),q.forEach(e=>e.off()),N=[],q.clear(),j=!1};return e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const a=new Set,l=(e,t)=>{const n=setTimeout(()=>{a.delete(n),e()},t);a.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void l(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",l(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>a.forEach(clearTimeout)})},e.defaultBreakpoints=A,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=()=>{const e=((e,t)=>{let r="",o="",i=0;for(let s=0;s<t.length;s++){const c=n[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;r+=o+e[i++],o=""}else o+=t[s],e[i]===t[s]&&i++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",o),o(),()=>e.removeEventListener("input",o)})},e.media=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&V.configure(t),e.scope.$mq=V,e.scope.$mqProps=V.props,e.scope.$mqAtLeast=V.atLeast,e.scope.$mqMatch=V.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>V.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>V.device,enumerable:!0,configurable:!0}),Z),e.morph=w,e.morphPlugin=e=>{e.scope.$morph=w},e.mq=V,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:s})=>{const c=i+(n||t.id);let f;for(const i in o||{})if(a(i)){f=i;break}const d=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;l(e.scope,c,d,a(f),s)})},e.persistStore=(e,n={})=>{const r=(0,t.store)(e);if(!r)return()=>{};const o=a(n.storage);return l(r,i+(n.key??e),n.keys,o,t.watchEffect)},e.registerStorage=(e,t)=>{s[e]=t},e.resetMedia=()=>{Z(),T={...E},_=["base",...Object.keys(T).sort((e,t)=>T[e]-T[t])],j=!1,H.clear(),$.bp="base",$.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:i,exp:s})=>{const c=e,a=r||"v",l=e=>`${a}-${e}`;let f,d=0,u=!0;const m=()=>{c.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},p=(e,t)=>{const n=++d;m(),c.classList.add(l(e+"-from"),l(e+"-active")),c.offsetWidth,c.classList.remove(l(e+"-from")),c.classList.add(l(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===d&&(m(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(c))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),c.__leave=()=>new Promise(e=>p("leave",e)),()=>{e=!1,clearTimeout(f),delete c.__leave}}return n(()=>{const e=!!t();if(u)return u=!1,c.style.display=e?"":"none",void(e&&i?.appear&&p("enter"));e?(c.style.display="",p("enter")):p("leave",()=>{c.style.display="none"})}),()=>clearTimeout(f)})},e}({},LiteVue);
@@ -1 +1 @@
1
- import{reactive as e,store as t,watchEffect as n}from"@aevantec/litevue";var r=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},o={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},i=e=>{e.directive("mask",({el:e,exp:t})=>{const n=e,r=()=>{const e=((e,t)=>{let n="",r="",i=0;for(let s=0;s<t.length;s++){const c=o[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;n+=r+e[i++],r=""}else r+=t[s],e[i]===t[s]&&i++}return n})(n.value,t);e!==n.value&&(n.value=e)};return e.addEventListener("input",r),r(),()=>e.removeEventListener("input",r)})},s=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),c=(e,t)=>{const n=e.split(","),r=t.split(",");let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,s(n[i])+s(r[i%r.length]));return o},l=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:o,exp:i})=>{const s=e,l=r||"v",a=e=>`${l}-${e}`;let f,u=0,d=!0;const m=()=>{s.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},p=(e,t)=>{const n=++u;m(),s.classList.add(a(e+"-from"),a(e+"-active")),s.offsetWidth,s.classList.remove(a(e+"-from")),s.classList.add(a(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===u&&(m(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(c(t.transitionDuration,t.transitionDelay),c(t.animationDuration,t.animationDelay))})(s))};if(!i){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),s.__leave=()=>new Promise(e=>p("leave",e)),()=>{e=!1,clearTimeout(f),delete s.__leave}}return n(()=>{const e=!!t();if(d)return d=!1,s.style.display=e?"":"none",void(e&&o?.appear&&p("enter"));e?(s.style.display="",p("enter")):p("leave",()=>{s.style.display="none"})}),()=>clearTimeout(f)})},a="litevue:",f=Object.create(null),u="local",d=e=>{const t=e??u;return"string"!=typeof t?t:f[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},m=(e,t)=>{f[e]=t},p=e=>{u=e},v=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},h=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:i})=>{const s=a+(n||t.id);let c;for(const a in o||{})if(d(a)){c=a;break}const l=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;v(e.scope,s,l,d(c),i)})},b=(e,r={})=>{const o=t(e);if(!o)return()=>{};const i=d(r.storage);return v(o,a+(r.key??e),r.keys,i,n)},g=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},y=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const l=/* @__PURE__ */new Set,a=(e,t)=>{const n=setTimeout(()=>{l.delete(n),e()},t);l.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void a(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",a(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>l.forEach(clearTimeout)})},k=/^(?:v-|:|@)/,x=/^(?::|v-bind:)/,w=["id","data-key","data-id"],E=e=>{for(const t of w){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},S=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},A=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),O=(e,t)=>{const n=(e=>{const t=/* @__PURE__ */new Set;for(const{name:n}of e.attributes)x.test(n)?t.add(n.replace(x,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])k.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},$=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return L(e,t,n);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return L(e,t,n);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(O(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||A(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(A(t))return!0;return!1})(i)||T(o,i,o.__ctx||n,r))},L=(e,t,n)=>{const r=t.cloneNode(!0);n?.dispose?.(e),e.parentNode.replaceChild(r,e),_(r,n)},_=(e,t)=>{const n=t||S(e.parentNode);n?.walk?.(e,n)},T=(e,t,n,r)=>{const o=r.key||E,i=/* @__PURE__ */new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,l=t.firstChild;const a=t=>{const r=t.cloneNode(!0);e.insertBefore(r,c),_(r,n)};for(;l;){const t=l.nextSibling,o=s(l);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),$(t,l,n,r)):a(l)}else if(c&&null==s(c)){const e=c.nextSibling;$(c,l,n,r),c=e}else a(l);l=t}for(;c;){const t=c.nextSibling;n?.dispose?.(c),e.removeChild(c),c=t}},j=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=q();$(e,r,S(e),n),t()}return e},q=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},C=e=>{e.scope.$morph=j},N={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},D=Object.freeze({...N}),M={mobile:"base",tablet:"md",desktop:"lg"},P=/^\d+$/,I=e({bp:"base",tick:0}),z={...N},R=["base"],B=!1,H=[],J=/* @__PURE__ */new Map,K=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,Z=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),F=()=>{for(let e=H.length-1;e>=0;e--)if(H[e].mql.matches)return R[e+1];return"base"},W=()=>{H.forEach(e=>e.off()),H=[];const e=Object.keys(z).filter(e=>z[e]>0).sort((e,t)=>z[e]-z[t]);R=["base",...e],K()&&(H=e.map(e=>{const t=window.matchMedia(`(min-width: ${z[e]}px)`);return Z(t,()=>{I.bp=F()})}),I.bp=F())},G=()=>{B||(B=!0,W()),I.tick},Q=e=>{if(!K())return!1;let t=J.get(e);if(!t){const n=window.matchMedia(e);t=Z(n,()=>I.tick++),J.set(e,t)}return t.mql.matches},U=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(P.test(e))return Number(e);const t=M[e];return void 0!==t?"base"===t?0:z[t]:z[e]},V=e=>{if(e<=0)return!0;const t=R.findIndex(t=>"base"!==t&&z[t]===e);return-1!==t?R.indexOf(I.bp)>=t:(I.tick,Q(`(min-width: ${e}px)`))},X=/* @__PURE__ */new Set,Y=(e,t)=>{let n;G();let r=-1;for(const o of Object.keys(e)){const t=U(o);void 0!==t?t>=r&&V(t)&&(r=t,n=e[o]):(R.join(", "),Object.keys(M).join(", "))}return void 0!==n?n:t},ee=e=>{const t=M[e],n=z[t];return void 0!==n?n:N[t]},te=Object.defineProperties((e,t)=>Y(e,t),{props:{value:e=>{G();const t={};for(const n of Object.keys(e))t[n]=Y(e[n]);return t}},breakpoint:{get:()=>(G(),I.bp),enumerable:!0},device:{get:()=>(G(),V(ee("tablet"))?V(ee("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{G();const t=U(e);return void 0!==t&&V(t)}},match:{value:e=>(G(),Q(e))},configure:{value:({breakpoints:e})=>{e&&(z={...e},B&&(W(),I.tick++))}}}),ne=()=>{H.forEach(e=>e.off()),J.forEach(e=>e.off()),H=[],J.clear(),B=!1},re=()=>{ne(),z={...N},R=["base",...Object.keys(z).sort((e,t)=>z[e]-z[t])],B=!1,X.clear(),I.bp="base",I.tick=0},oe=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&te.configure(t),e.scope.$mq=te,e.scope.$mqProps=te.props,e.scope.$mqAtLeast=te.atLeast,e.scope.$mqMatch=te.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>te.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>te.device,enumerable:!0,configurable:!0}),ne),ie=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})};export{y as collapse,D as defaultBreakpoints,g as focus,r as intersect,i as mask,oe as media,j as morph,C as morphPlugin,te as mq,h as persist,b as persistStore,m as registerStorage,re as resetMedia,ie as resize,p as setDefaultStorage,l as transition};
1
+ import{reactive as e,store as t,watchEffect as n}from"@aevantec/litevue";var r=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},o={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},i=e=>{e.directive("mask",({el:e,exp:t})=>{const n=e,r=()=>{const e=((e,t)=>{let n="",r="",i=0;for(let s=0;s<t.length;s++){const c=o[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;n+=r+e[i++],r=""}else r+=t[s],e[i]===t[s]&&i++}return n})(n.value,t);e!==n.value&&(n.value=e)};return e.addEventListener("input",r),r(),()=>e.removeEventListener("input",r)})},s=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),c=(e,t)=>{const n=e.split(","),r=t.split(",");let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,s(n[i])+s(r[i%r.length]));return o},l=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:o,exp:i})=>{const s=e,l=r||"v",a=e=>`${l}-${e}`;let f,d=0,u=!0;const m=()=>{s.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},p=(e,t)=>{const n=++d;m(),s.classList.add(a(e+"-from"),a(e+"-active")),s.offsetWidth,s.classList.remove(a(e+"-from")),s.classList.add(a(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===d&&(m(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(c(t.transitionDuration,t.transitionDelay),c(t.animationDuration,t.animationDelay))})(s))};if(!i){let e=!0;return Promise.resolve().then(()=>{e&&p("enter")}),s.__leave=()=>new Promise(e=>p("leave",e)),()=>{e=!1,clearTimeout(f),delete s.__leave}}return n(()=>{const e=!!t();if(u)return u=!1,s.style.display=e?"":"none",void(e&&o?.appear&&p("enter"));e?(s.style.display="",p("enter")):p("leave",()=>{s.style.display="none"})}),()=>clearTimeout(f)})},a="litevue:",f=Object.create(null),d="local",u=e=>{const t=e??d;return"string"!=typeof t?t:f[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},m=(e,t)=>{f[e]=t},p=e=>{d=e},v=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},h=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:i})=>{const s=a+(n||t.id);let c;for(const a in o||{})if(u(a)){c=a;break}const l=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;v(e.scope,s,l,u(c),i)})},b=(e,r={})=>{const o=t(e);if(!o)return()=>{};const i=u(r.storage);return v(o,a+(r.key??e),r.keys,i,n)},g=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},y=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const l=/* @__PURE__ */new Set,a=(e,t)=>{const n=setTimeout(()=>{l.delete(n),e()},t);l.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void a(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",a(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>l.forEach(clearTimeout)})},k=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),x=/^(?:v-|:|@)/,w=/^(?::|v-bind:)/,A=["id","data-key","data-id"],E=e=>{for(const t of A){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},S=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},O=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),$=(e,t)=>{const n=(e=>{const t=/* @__PURE__ */new Set;for(const{name:n}of e.attributes)w.test(n)?t.add(n.replace(w,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])x.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},L=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return T(e,t,n,r);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return T(e,t,n,r);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||($(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||O(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(O(t))return!0;return!1})(i)||N(o,i,o.__ctx||n,r))},T=(e,t,n,r)=>{if(k(e,r))return;const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(n?.dispose?.(e),e.parentNode.replaceChild(o,e),r.afterNodeRemoved?.(e),_(o,n))},_=(e,t)=>{const n=t||S(e.parentNode);n?.walk?.(e,n)},N=(e,t,n,r)=>{const o=r.key||E,i=/* @__PURE__ */new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,l=t.firstChild;const a=t=>{const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(e.insertBefore(o,c),_(o,n))};for(;l;){const t=l.nextSibling,o=s(l);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),L(t,l,n,r)):a(l)}else if(c&&null==s(c)){const e=c.nextSibling;L(c,l,n,r),c=e}else a(l);l=t}for(;c;){const t=c.nextSibling;k(c,r)||(n?.dispose?.(c),e.removeChild(c),r.afterNodeRemoved?.(c)),c=t}},j=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=q();L(e,r,S(e),n),t()}return e},q=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},C=e=>{e.scope.$morph=j},D={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},M=Object.freeze({...D}),P={mobile:"base",tablet:"md",desktop:"lg"},R=/^\d+$/,I=e({bp:"base",tick:0}),z={...D},B=["base"],H=!1,J=[],K=/* @__PURE__ */new Map,Z=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,F=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),W=()=>{for(let e=J.length-1;e>=0;e--)if(J[e].mql.matches)return B[e+1];return"base"},G=()=>{J.forEach(e=>e.off()),J=[];const e=Object.keys(z).filter(e=>z[e]>0).sort((e,t)=>z[e]-z[t]);B=["base",...e],Z()&&(J=e.map(e=>{const t=window.matchMedia(`(min-width: ${z[e]}px)`);return F(t,()=>{I.bp=W()})}),I.bp=W())},Q=()=>{H||(H=!0,G()),I.tick},U=e=>{if(!Z())return!1;let t=K.get(e);if(!t){const n=window.matchMedia(e);t=F(n,()=>I.tick++),K.set(e,t)}return t.mql.matches},V=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(R.test(e))return Number(e);const t=P[e];return void 0!==t?"base"===t?0:z[t]:z[e]},X=e=>{if(e<=0)return!0;const t=B.findIndex(t=>"base"!==t&&z[t]===e);return-1!==t?B.indexOf(I.bp)>=t:(I.tick,U(`(min-width: ${e}px)`))},Y=/* @__PURE__ */new Set,ee=(e,t)=>{let n;Q();let r=-1;for(const o of Object.keys(e)){const t=V(o);void 0!==t?t>=r&&X(t)&&(r=t,n=e[o]):(B.join(", "),Object.keys(P).join(", "))}return void 0!==n?n:t},te=e=>{const t=P[e],n=z[t];return void 0!==n?n:D[t]},ne=Object.defineProperties((e,t)=>ee(e,t),{props:{value:e=>{Q();const t={};for(const n of Object.keys(e))t[n]=ee(e[n]);return t}},breakpoint:{get:()=>(Q(),I.bp),enumerable:!0},device:{get:()=>(Q(),X(te("tablet"))?X(te("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{Q();const t=V(e);return void 0!==t&&X(t)}},match:{value:e=>(Q(),U(e))},configure:{value:({breakpoints:e})=>{e&&(z={...e},H&&(G(),I.tick++))}}}),re=()=>{J.forEach(e=>e.off()),K.forEach(e=>e.off()),J=[],K.clear(),H=!1},oe=()=>{re(),z={...D},B=["base",...Object.keys(z).sort((e,t)=>z[e]-z[t])],H=!1,Y.clear(),I.bp="base",I.tick=0},ie=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&ne.configure(t),e.scope.$mq=ne,e.scope.$mqProps=ne.props,e.scope.$mqAtLeast=ne.atLeast,e.scope.$mqMatch=ne.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>ne.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>ne.device,enumerable:!0,configurable:!0}),re),se=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})};export{y as collapse,M as defaultBreakpoints,g as focus,r as intersect,i as mask,ie as media,j as morph,C as morphPlugin,ne as mq,h as persist,b as persistStore,m as registerStorage,oe as resetMedia,se as resize,p as setDefaultStorage,l as transition};
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@aevantec/litevue")):"function"==typeof define&&define.amd?define(["exports","@aevantec/litevue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVuePlugins={},e.LiteVue)}(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let s=0;s<n.length;s++)i=Math.max(i,r(n[s])+r(o[s%o.length]));return i},i="litevue:",s=Object.create(null),c="local",l=e=>{const t=e??c;return"string"!=typeof t?t:s[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},a=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},f=/^(?:v-|:|@)/,u=/^(?::|v-bind:)/,d=["id","data-key","data-id"],p=e=>{for(const t of d){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},m=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},v=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),h=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)u.test(n)?t.add(n.replace(u,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])f.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},b=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return g(e,t,n);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return g(e,t,n);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(h(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||v(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(v(t))return!0;return!1})(i)||k(o,i,o.__ctx||n,r))},g=(e,t,n)=>{const r=t.cloneNode(!0);n?.dispose?.(e),e.parentNode.replaceChild(r,e),y(r,n)},y=(e,t)=>{const n=t||m(e.parentNode);n?.walk?.(e,n)},k=(e,t,n,r)=>{const o=r.key||p,i=new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,l=t.firstChild;const a=t=>{const r=t.cloneNode(!0);e.insertBefore(r,c),y(r,n)};for(;l;){const t=l.nextSibling,o=s(l);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),b(t,l,n,r)):a(l)}else if(c&&null==s(c)){const e=c.nextSibling;b(c,l,n,r),c=e}else a(l);l=t}for(;c;){const t=c.nextSibling;n?.dispose?.(c),e.removeChild(c),c=t}},x=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=w();b(e,r,m(e),n),t()}return e},w=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},S={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},E=Object.freeze({...S}),O={mobile:"base",tablet:"md",desktop:"lg"},A=/^\d+$/,L=(0,t.reactive)({bp:"base",tick:0}),T={...S},$=["base"],j=!1,_=[],q=new Map,P=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,C=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),D=()=>{for(let e=_.length-1;e>=0;e--)if(_[e].mql.matches)return $[e+1];return"base"},M=()=>{_.forEach(e=>e.off()),_=[];const e=Object.keys(T).filter(e=>T[e]>0).sort((e,t)=>T[e]-T[t]);$=["base",...e],P()&&(_=e.map(e=>{const t=window.matchMedia(`(min-width: ${T[e]}px)`);return C(t,()=>{L.bp=D()})}),L.bp=D())},N=()=>{j||(j=!0,M()),L.tick},z=e=>{if(!P())return!1;let t=q.get(e);if(!t){const n=window.matchMedia(e);t=C(n,()=>L.tick++),q.set(e,t)}return t.mql.matches},I=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(A.test(e))return Number(e);const t=O[e];return void 0!==t?"base"===t?0:T[t]:T[e]},B=e=>{if(e<=0)return!0;const t=$.findIndex(t=>"base"!==t&&T[t]===e);return-1!==t?$.indexOf(L.bp)>=t:(L.tick,z(`(min-width: ${e}px)`))},R=new Set,H=(e,t)=>{let n;N();let r=-1;for(const o of Object.keys(e)){const t=I(o);void 0!==t?t>=r&&B(t)&&(r=t,n=e[o]):($.join(", "),Object.keys(O).join(", "))}return void 0!==n?n:t},J=e=>{const t=O[e],n=T[t];return void 0!==n?n:S[t]},K=Object.defineProperties((e,t)=>H(e,t),{props:{value:e=>{N();const t={};for(const n of Object.keys(e))t[n]=H(e[n]);return t}},breakpoint:{get:()=>(N(),L.bp),enumerable:!0},device:{get:()=>(N(),B(J("tablet"))?B(J("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{N();const t=I(e);return void 0!==t&&B(t)}},match:{value:e=>(N(),z(e))},configure:{value:({breakpoints:e})=>{e&&(T={...e},j&&(M(),L.tick++))}}}),V=()=>{_.forEach(e=>e.off()),q.forEach(e=>e.off()),_=[],q.clear(),j=!1};e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const l=new Set,a=(e,t)=>{const n=setTimeout(()=>{l.delete(n),e()},t);l.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void a(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",a(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>l.forEach(clearTimeout)})},e.defaultBreakpoints=E,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=()=>{const e=((e,t)=>{let r="",o="",i=0;for(let s=0;s<t.length;s++){const c=n[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;r+=o+e[i++],o=""}else o+=t[s],e[i]===t[s]&&i++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",o),o(),()=>e.removeEventListener("input",o)})},e.media=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&K.configure(t),e.scope.$mq=K,e.scope.$mqProps=K.props,e.scope.$mqAtLeast=K.atLeast,e.scope.$mqMatch=K.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>K.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>K.device,enumerable:!0,configurable:!0}),V),e.morph=x,e.morphPlugin=e=>{e.scope.$morph=x},e.mq=K,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:s})=>{const c=i+(n||t.id);let f;for(const i in o||{})if(l(i)){f=i;break}const u=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;a(e.scope,c,u,l(f),s)})},e.persistStore=(e,n={})=>{const r=(0,t.store)(e);if(!r)return()=>{};const o=l(n.storage);return a(r,i+(n.key??e),n.keys,o,t.watchEffect)},e.registerStorage=(e,t)=>{s[e]=t},e.resetMedia=()=>{V(),T={...S},$=["base",...Object.keys(T).sort((e,t)=>T[e]-T[t])],j=!1,R.clear(),L.bp="base",L.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:i,exp:s})=>{const c=e,l=r||"v",a=e=>`${l}-${e}`;let f,u=0,d=!0;const p=()=>{c.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},m=(e,t)=>{const n=++u;p(),c.classList.add(a(e+"-from"),a(e+"-active")),c.offsetWidth,c.classList.remove(a(e+"-from")),c.classList.add(a(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===u&&(p(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(c))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&m("enter")}),c.__leave=()=>new Promise(e=>m("leave",e)),()=>{e=!1,clearTimeout(f),delete c.__leave}}return n(()=>{const e=!!t();if(d)return d=!1,c.style.display=e?"":"none",void(e&&i?.appear&&m("enter"));e?(c.style.display="",m("enter")):m("leave",()=>{c.style.display="none"})}),()=>clearTimeout(f)})}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@aevantec/litevue")):"function"==typeof define&&define.amd?define(["exports","@aevantec/litevue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVuePlugins={},e.LiteVue)}(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let s=0;s<n.length;s++)i=Math.max(i,r(n[s])+r(o[s%o.length]));return i},i="litevue:",s=Object.create(null),c="local",a=e=>{const t=e??c;return"string"!=typeof t?t:s[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},l=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},f=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),d=/^(?:v-|:|@)/,u=/^(?::|v-bind:)/,p=["id","data-key","data-id"],m=e=>{for(const t of p){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},v=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},h=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),b=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)u.test(n)?t.add(n.replace(u,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])d.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},g=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return y(e,t,n,r);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return y(e,t,n,r);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(b(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||h(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(h(t))return!0;return!1})(i)||x(o,i,o.__ctx||n,r))},y=(e,t,n,r)=>{if(f(e,r))return;const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(n?.dispose?.(e),e.parentNode.replaceChild(o,e),r.afterNodeRemoved?.(e),k(o,n))},k=(e,t)=>{const n=t||v(e.parentNode);n?.walk?.(e,n)},x=(e,t,n,r)=>{const o=r.key||m,i=new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let c=e.firstChild,a=t.firstChild;const l=t=>{const o=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(o)&&(e.insertBefore(o,c),k(o,n))};for(;a;){const t=a.nextSibling,o=s(a);if(null!=o){const t=i.get(o);t?(t===c?c=c.nextSibling:e.insertBefore(t,c),i.delete(o),g(t,a,n,r)):l(a)}else if(c&&null==s(c)){const e=c.nextSibling;g(c,a,n,r),c=e}else l(a);a=t}for(;c;){const t=c.nextSibling;f(c,r)||(n?.dispose?.(c),e.removeChild(c),r.afterNodeRemoved?.(c)),c=t}},w=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=S();g(e,r,v(e),n),t()}return e},S=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},E={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},A=Object.freeze({...E}),O={mobile:"base",tablet:"md",desktop:"lg"},L=/^\d+$/,T=(0,t.reactive)({bp:"base",tick:0}),$={...E},j=["base"],_=!1,N=[],q=new Map,P=()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia,C=(e,t)=>e.addEventListener?(e.addEventListener("change",t),{mql:e,off:()=>e.removeEventListener("change",t)}):(e.addListener(t),{mql:e,off:()=>e.removeListener(t)}),D=()=>{for(let e=N.length-1;e>=0;e--)if(N[e].mql.matches)return j[e+1];return"base"},M=()=>{N.forEach(e=>e.off()),N=[];const e=Object.keys($).filter(e=>$[e]>0).sort((e,t)=>$[e]-$[t]);j=["base",...e],P()&&(N=e.map(e=>{const t=window.matchMedia(`(min-width: ${$[e]}px)`);return C(t,()=>{T.bp=D()})}),T.bp=D())},R=()=>{_||(_=!0,M()),T.tick},z=e=>{if(!P())return!1;let t=q.get(e);if(!t){const n=window.matchMedia(e);t=C(n,()=>T.tick++),q.set(e,t)}return t.mql.matches},I=e=>{if("number"==typeof e)return e;if("base"===e)return 0;if(L.test(e))return Number(e);const t=O[e];return void 0!==t?"base"===t?0:$[t]:$[e]},B=e=>{if(e<=0)return!0;const t=j.findIndex(t=>"base"!==t&&$[t]===e);return-1!==t?j.indexOf(T.bp)>=t:(T.tick,z(`(min-width: ${e}px)`))},H=new Set,J=(e,t)=>{let n;R();let r=-1;for(const o of Object.keys(e)){const t=I(o);void 0!==t?t>=r&&B(t)&&(r=t,n=e[o]):(j.join(", "),Object.keys(O).join(", "))}return void 0!==n?n:t},K=e=>{const t=O[e],n=$[t];return void 0!==n?n:E[t]},V=Object.defineProperties((e,t)=>J(e,t),{props:{value:e=>{R();const t={};for(const n of Object.keys(e))t[n]=J(e[n]);return t}},breakpoint:{get:()=>(R(),T.bp),enumerable:!0},device:{get:()=>(R(),B(K("tablet"))?B(K("desktop"))?"desktop":"tablet":"mobile"),enumerable:!0},atLeast:{value:e=>{R();const t=I(e);return void 0!==t&&B(t)}},match:{value:e=>(R(),z(e))},configure:{value:({breakpoints:e})=>{e&&($={...e},_&&(M(),T.tick++))}}}),Z=()=>{N.forEach(e=>e.off()),q.forEach(e=>e.off()),N=[],q.clear(),_=!1};e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const f in r||{}){const e=/^duration-(\d+)$/.exec(f);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,c=0;const a=new Set,l=(e,t)=>{const n=setTimeout(()=>{a.delete(n),e()},t);a.add(n)};return n(()=>{const e=!!t(),n=++c;if(s)return s=!1,e||(o.style.height="0px"),void l(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",l(()=>{n===c&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")}),()=>a.forEach(clearTimeout)})},e.defaultBreakpoints=A,e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{let o=!0;return n(()=>{const n=!!t();Promise.resolve().then(()=>{o&&n&&(e.focus(),r?.select&&e.select&&e.select())})}),()=>{o=!1}}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},c=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&c()}),()=>{r&&c()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e)(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=()=>{const e=((e,t)=>{let r="",o="",i=0;for(let s=0;s<t.length;s++){const c=n[t[s]];if(c){for(;i<e.length&&!c.test(e[i]);)i++;if(i>=e.length)break;r+=o+e[i++],o=""}else o+=t[s],e[i]===t[s]&&i++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",o),o(),()=>e.removeEventListener("input",o)})},e.media=(e,t)=>(t?.breakpoints&&JSON.stringify(t.breakpoints),t&&V.configure(t),e.scope.$mq=V,e.scope.$mqProps=V.props,e.scope.$mqAtLeast=V.atLeast,e.scope.$mqMatch=V.match,Object.defineProperty(e.scope,"$mqBreakpoint",{get:()=>V.breakpoint,enumerable:!0,configurable:!0}),Object.defineProperty(e.scope,"$mqDevice",{get:()=>V.device,enumerable:!0,configurable:!0}),Z),e.morph=w,e.morphPlugin=e=>{e.scope.$morph=w},e.mq=V,e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:s})=>{const c=i+(n||t.id);let f;for(const i in o||{})if(a(i)){f=i;break}const d=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;l(e.scope,c,d,a(f),s)})},e.persistStore=(e,n={})=>{const r=(0,t.store)(e);if(!r)return()=>{};const o=a(n.storage);return l(r,i+(n.key??e),n.keys,o,t.watchEffect)},e.registerStorage=(e,t)=>{s[e]=t},e.resetMedia=()=>{Z(),$={...E},j=["base",...Object.keys($).sort((e,t)=>$[e]-$[t])],_=!1,H.clear(),T.bp="base",T.tick=0},e.resize=e=>{e.directive("resize",({el:e,get:t,exp:n})=>{const r=t(`(($width, $height) => { ${n} })`),o=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect;r(e.width,e.height)}});return o.observe(e),()=>o.disconnect()})},e.setDefaultStorage=e=>{c=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:i,exp:s})=>{const c=e,a=r||"v",l=e=>`${a}-${e}`;let f,d=0,u=!0;const p=()=>{c.classList.remove(l("enter-from"),l("enter-active"),l("enter-to"),l("leave-from"),l("leave-active"),l("leave-to"))},m=(e,t)=>{const n=++d;p(),c.classList.add(l(e+"-from"),l(e+"-active")),c.offsetWidth,c.classList.remove(l(e+"-from")),c.classList.add(l(e+"-to")),clearTimeout(f),f=setTimeout(()=>{n===d&&(p(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(c))};if(!s){let e=!0;return Promise.resolve().then(()=>{e&&m("enter")}),c.__leave=()=>new Promise(e=>m("leave",e)),()=>{e=!1,clearTimeout(f),delete c.__leave}}return n(()=>{const e=!!t();if(u)return u=!1,c.style.display=e?"":"none",void(e&&i?.appear&&m("enter"));e?(c.style.display="",m("enter")):m("leave",()=>{c.style.display="none"})}),()=>clearTimeout(f)})}});