mancha 0.20.5 → 0.20.7

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.
package/README.md CHANGED
@@ -59,6 +59,7 @@ Here's a small sample of the things that you can do with `mancha`:
59
59
  - **[Server-Side Rendering](./docs/06_ssr.md)**: Using Mancha on the server (Node, Workers).
60
60
  - **[TypeScript](./docs/07_typescript.md)**: Type safety and checking.
61
61
  - **[Testing](./docs/08_testing.md)**: Testing your UI.
62
+ - **[Performance](./docs/09_performance.md)**: Performance monitoring and optimization.
62
63
 
63
64
  ## AI Agents
64
65
 
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as StoreState, i as IRenderer, n as RenderParams, r as RendererPlugin, t as ParserParams } from "./interfaces-BR8ZL61m.js";
1
+ import { a as StoreState, i as IRenderer, n as RenderParams, r as RendererPlugin, t as ParserParams } from "./interfaces-BcLK40e4.js";
2
2
  import { SafeStyleSheet } from "safevalues";
3
3
 
4
4
  //#region src/css_gen_basic.d.ts
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- import{n as e,t}from"./renderer-OrXcTBG0.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";function a(){return r([i`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,i`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,i`body{margin:0;line-height:inherit}`,i`hr{height:0;color:inherit;border-top-width:1px}`,i`abbr:where([title]){text-decoration:underline dotted}`,i`b,strong{font-weight:bolder}`,i`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,i`small{font-size:80%}`,i`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,i`sub{bottom:-0.25em}`,i`sup{top:-0.5em}`,i`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,i`button,select{text-transform:none}`,i`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,i`:-moz-focusring{outline:auto}`,i`:-moz-ui-invalid{box-shadow:none}`,i`progress{vertical-align:baseline}`,i`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,i`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,i`::-webkit-search-decoration{-webkit-appearance:none}`,i`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,i`summary{display:list-item}`,i`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,i`fieldset{margin:0;padding:0}`,i`legend{padding:0}`,i`ol,ul,menu{list-style:none;margin:0;padding:0}`,i`textarea{resize:vertical}`,i`::placeholder{opacity:1;color:#9ca3af}`,i`button,[role="button"]{cursor:pointer}`,i`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,i`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,i`img,video{max-width:100%;height:auto}`,i`[hidden]{display:none}`,i`dialog{padding:0}`,i`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function o(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}const s={sm:640,md:768,lg:1024,xl:1280},c=Object.entries(s),l=.25,u=[...Array(15)].map((e,t)=>t+1),d=[16,20,24,28,32,36,40,48,56,64],f=[72,80,96,128,160,192,256,320,384,512],p=[...u,...d,...f,...Object.values(s)],m=Array.from({length:20},(e,t)=>(t+1)*5),h=[0,10,20,30,40,50,60,70,80,90,100],g=[25,50,75,100,150,200,300,500,700,1e3],_=[`hover`,`focus`,`disabled`],v={margin:`m`,padding:`p`},y={width:`w`,height:`h`},b={top:`top`,right:`right`,bottom:`bottom`,left:`left`},x={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},S={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},C=[`@keyframes spin {
1
+ import{n as e,t}from"./renderer-RfUkDfVD.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";function a(){return r([i`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,i`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,i`body{margin:0;line-height:inherit}`,i`hr{height:0;color:inherit;border-top-width:1px}`,i`abbr:where([title]){text-decoration:underline dotted}`,i`b,strong{font-weight:bolder}`,i`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,i`small{font-size:80%}`,i`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,i`sub{bottom:-0.25em}`,i`sup{top:-0.5em}`,i`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,i`button,select{text-transform:none}`,i`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,i`:-moz-focusring{outline:auto}`,i`:-moz-ui-invalid{box-shadow:none}`,i`progress{vertical-align:baseline}`,i`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,i`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,i`::-webkit-search-decoration{-webkit-appearance:none}`,i`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,i`summary{display:list-item}`,i`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,i`fieldset{margin:0;padding:0}`,i`legend{padding:0}`,i`ol,ul,menu{list-style:none;margin:0;padding:0}`,i`textarea{resize:vertical}`,i`::placeholder{opacity:1;color:#9ca3af}`,i`button,[role="button"]{cursor:pointer}`,i`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,i`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,i`img,video{max-width:100%;height:auto}`,i`[hidden]{display:none}`,i`dialog{padding:0}`,i`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function o(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}const s={sm:640,md:768,lg:1024,xl:1280},c=Object.entries(s),l=.25,u=[...Array(15)].map((e,t)=>t+1),d=[16,20,24,28,32,36,40,48,56,64],f=[72,80,96,128,160,192,256,320,384,512],p=[...u,...d,...f,...Object.values(s)],m=Array.from({length:20},(e,t)=>(t+1)*5),h=[0,10,20,30,40,50,60,70,80,90,100],g=[25,50,75,100,150,200,300,500,700,1e3],_=[`hover`,`focus`,`disabled`],v={margin:`m`,padding:`p`},y={width:`w`,height:`h`},b={top:`top`,right:`right`,bottom:`bottom`,left:`left`},x={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},S={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},C=[`@keyframes spin {
2
2
  from { transform: rotate(0deg) }
3
3
  to { transform: rotate(360deg) }
4
4
  }`,`@keyframes ping {
@@ -38,7 +38,6 @@ type SignalStoreProxy = SignalStore & InternalStoreState & {
38
38
  type ReactiveContext<T extends StoreState = StoreState> = SignalStore<T> & InternalStoreState & T & Record<string, unknown>;
39
39
  type Observer<T> = (this: SignalStoreProxy) => T;
40
40
  type KeyValueHandler = (this: SignalStoreProxy, key: string, value: unknown) => void;
41
- type AnyFunction = (...args: unknown[]) => unknown;
42
41
  /** Symbol used to identify computed value markers. */
43
42
  declare const COMPUTED_MARKER: unique symbol;
44
43
  /** Function type for computed value definitions. Receives reactive context as `$` parameter. */
@@ -48,19 +47,18 @@ interface ComputedMarker<R> {
48
47
  [COMPUTED_MARKER]: true;
49
48
  fn: ComputedFn<StoreState, R>;
50
49
  }
51
- declare abstract class IDebouncer {
52
- timeouts: Map<AnyFunction, ReturnType<typeof setTimeout>>;
53
- debounce<T>(millis: number, callback: () => T | Promise<T>): Promise<T>;
54
- }
55
- /** Default debouncer time in millis. */
56
-
57
- declare class SignalStore<T extends StoreState = StoreState> extends IDebouncer {
50
+ declare class SignalStore<T extends StoreState = StoreState> {
58
51
  protected readonly evalkeys: string[];
59
52
  protected readonly expressionCache: Map<string, EvalFunction>;
60
53
  protected readonly observers: Map<string, Set<ObserverEntry>>;
61
54
  protected readonly keyHandlers: Map<RegExp, Set<KeyValueHandler>>;
62
55
  readonly _store: Map<string, unknown>;
63
56
  _lock: Promise<void>;
57
+ /**
58
+ * Notification state per key. Value is a pending timeout, or "executing"
59
+ * when observers are running. Used to debounce and prevent infinite loops.
60
+ */
61
+ private readonly _notify;
64
62
  constructor(data?: T);
65
63
  private wrapObject;
66
64
  watch<T>(key: string, observer: Observer<T>): void;
package/dist/mancha.js CHANGED
@@ -39,10 +39,10 @@ let we=new Set([`this`,`typeof`]),Te=new Set([`in`]),Ee=new Set([`+`,`-`,`!`,`ty
39
39
  * Portions Copyright (c) 2013, the Dart project authors.
40
40
  */
41
41
  let je=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Me=new Set([`===`,`!==`]),P=function(e){return e[e.STRING=1]=`STRING`,e[e.IDENTIFIER=2]=`IDENTIFIER`,e[e.DOT=3]=`DOT`,e[e.COMMA=4]=`COMMA`,e[e.COLON=5]=`COLON`,e[e.INTEGER=6]=`INTEGER`,e[e.DECIMAL=7]=`DECIMAL`,e[e.OPERATOR=8]=`OPERATOR`,e[e.GROUPER=9]=`GROUPER`,e[e.KEYWORD=10]=`KEYWORD`,e[e.ARROW=11]=`ARROW`,e[e.OPTIONAL_DOT=12]=`OPTIONAL_DOT`,e[e.SPREAD=13]=`SPREAD`,e}({}),F=(e,t,n=0)=>({kind:e,value:t,precedence:n}),Ne=e=>e===9||e===10||e===13||e===32,Pe=e=>{if(e===95||e===36)return!0;let t=e&-33;return 65<=t&&t<=90},Fe=e=>Pe(e)||I(e),Ie=e=>we.has(e),Le=e=>e===34||e===39,I=e=>48<=e&&e<=57,Re=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,ze=e=>e===40||e===41||e===91||e===93||e===123||e===125,Be=e=>e.replace(/\\(.)/g,(e,t)=>{switch(t){case`n`:return`
42
- `;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var Ve=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;Ne(this._next??-1);)this._advance(!0);if(Le(this._next??-1))return this._tokenizeString();if(Pe(this._next??-1))return this._tokenizeIdentOrKeyword();if(I(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(Re(this._next??-1))return this._tokenizeOperator();if(ze(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=F(P.STRING,Be(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(Fe(this._next??-1));let e=this._getValue();return F(Ie(e)?P.KEYWORD:Te.has(e)?P.OPERATOR:P.IDENTIFIER,e,N[e]??0)}_tokenizeNumber(){do this._advance();while(I(this._next??-1));return this._next===46?this._tokenizeDot():F(P.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),I(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),F(P.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),F(P.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),F(P.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),F(P.COLON,`:`)}_tokenizeFraction(){do this._advance();while(I(this._next??-1));return F(P.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Me.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),F(P.ARROW,e);je.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?F(P.OPTIONAL_DOT,e,13):F(P.OPERATOR,e,N[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=F(P.GROUPER,e,N[e]);return this._advance(!0),t}};let He=(e,t)=>new Ue(e,t).parse();var Ue=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new Ve(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(P.DOT)||this._matches(P.OPTIONAL_DOT)){let t=this._kind===P.OPTIONAL_DOT;if(this._advance(),t&&this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(P.KEYWORD))break;else if(this._matches(P.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!De.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===P.OPERATOR||this._kind===P.DOT||this._kind===P.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(P.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(P.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(P.INTEGER))return this._parseInteger(e);if(this._matches(P.DECIMAL))return this._parseDecimal(e)}if(!e||!Ee.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(P.OPERATOR,`?`);let t=this._parseExpression();this._advance(P.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case P.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw we.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case P.IDENTIFIER:return this._parseInvokeOrIdentifier();case P.STRING:return this._parseString();case P.INTEGER:return this._parseInteger();case P.DECIMAL:return this._parseDecimal();case P.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case P.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`]`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`}`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(P.STRING)||this._matches(P.IDENTIFIER))&&this._advance(),this._matches(P.COLON)){this._advance(P.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(P.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(P.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(P.GROUPER,`)`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(P.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(P.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}};let L=Symbol(`__computed__`);function We(e){return typeof e==`object`&&!!e&&L in e&&e[L]===!0}var Ge=class{timeouts=new Map;debounce(e,t){return new Promise((n,r)=>{let i=this.timeouts.get(t);i&&clearTimeout(i),this.timeouts.set(t,setTimeout(()=>{try{n(t()),this.timeouts.delete(t)}catch(e){r(e)}},e))})}};let Ke=new Ae,R=`__is_proxy__`;function qe(e){return e instanceof Xe||e[R]===!0}function Je(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return Je(n.get(`$parent`),t)}function z(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?z(n.get(`$parent`),t):null}function Ye(e,t,n){let r=z(e,t);r?r._store.set(t,n):e._store.set(t,n)}var Xe=class e extends Ge{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapObject(e,t){return e==null||qe(e)||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof Promise||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||typeof Node<`u`&&e instanceof Node?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{if(Reflect.get(e,n,i)===r)return!0;typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,n,r)=>{if(n===R)return!0;let i=Reflect.get(e,n,r);if(typeof i==`object`&&i&&!qe(i)){let a=this.wrapObject(i,t);if(a!==i)return Reflect.set(e,n,a,r),a}return i}})}watch(e,t){let n=z(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),Array.from(n.observers.get(e)||[]).some(e=>e.observer===t)||n.observers.get(e)?.add({observer:t,store:this})}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=z(this,e),r=Array.from(n?.observers.get(e)||[]);await this.debounce(t,()=>Promise.all(r.map(e=>e.observer.call(e.store.proxify(e.observer)))))}get(e,t){return t&&this.watch(e,t),Je(this,e)}setupComputed(e,t){let n=this;this.effect(function(){let r=t.call(this,this);if(n._store.get(e)!==r){Ye(n,e,r);let t=z(n,e),i=Array.from(t?.observers.get(e)||[]);for(let e of i)e.observer.call(e.store.proxify(e.observer))}})}async set(e,t,n){if(We(t)){this.setupComputed(e,t.fn);return}if(this._store.has(e)&&t===this._store.get(e))return;let r=()=>this.notify(e);if(t&&typeof t==`object`&&(t=this.wrapObject(t,r)),n?this._store.set(e,t):Ye(this,e,t),!n){for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t))}await r()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}getObserverStats(){let e={},t=0;for(let[n,r]of this.observers)e[n]=r.size,t+=r.size;return{totalKeys:this.observers.size,totalObservers:t,byKey:e}}effect(e,t){return e.call(this.proxify(e))}$computed(e){return{[L]:!0,fn:e}}proxify(t){let n=Array.from(this._store.entries()).map(([e])=>e),r=Object.fromEntries(n.map(e=>[e,null])),i=(e,t,n)=>typeof e==`function`&&t!==`constructor`?(...t)=>e.call(n,...t):e;return new Proxy(r,{has:(e,t)=>typeof t==`string`&&(z(this,t)||Reflect.has(this,t))?!0:Reflect.has(r,t),get:(n,r,a)=>{if(typeof r==`string`){if(z(this,r)){let n=this.get(r,t);return t&&n instanceof e?n.proxify(t):i(n,r,a)}if(t&&r!==R&&!Reflect.has(this,r))return this.set(r,void 0),this.get(r,t)}return r===`$`?this.proxify(t):i(Reflect.get(this,r,a),r,a)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=He(e,Ke),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},Ze=class e extends Xe{_debugLevel=`off`;dirpath=``;_perfData={lifecycle:{},effects:new Map};static DEBUG_LEVELS=[`off`,`lifecycle`,`effects`,`verbose`];_skipNodes=new Set;_customElements=new Map;_pendingValueRetries=[];debug(e){return typeof e==`boolean`?this._debugLevel=e?`lifecycle`:`off`:this._debugLevel=e,this}get debugging(){return this._debugLevel!==`off`}shouldLog(t){return e.DEBUG_LEVELS.indexOf(this._debugLevel)>=e.DEBUG_LEVELS.indexOf(t)}clearPerformanceReport(){this._perfData={lifecycle:{},effects:new Map}}getNodePath(e){let t=[],n=e;for(;n?.tagName;){let e=n.tagName.toLowerCase(),r=n.parentElement;if(r){let i=Array.from(r.children).filter(t=>t.tagName.toLowerCase()===e);if(i.length>1){let r=i.indexOf(n)+1;t.unshift(`${e}:nth-child(${r})`)}else t.unshift(e)}else t.unshift(e);n=r}return t.join(`>`)}buildEffectId(e){let t=e?.directive??`unknown`,n=D(e?.expression??``,32),r=e?.element;return`${t}:${r?r.dataset?.perfid??r.id??r.dataset?.testid??this.getNodePath(r):`unknown`}:${n}`}recordEffectExecution(e,t){let n=this.buildEffectId(e),r=this._perfData.effects.get(n)??{count:0,totalTime:0};r.count++,r.totalTime+=t,this._perfData.effects.set(n,r)}getPerformanceReport(){let e=Array.from(this._perfData.effects.entries()),t={};for(let[n,r]of e){let e=n.split(`:`)[0];t[e]||(t[e]={count:0,totalTime:0}),t[e].count+=r.count,t[e].totalTime+=r.totalTime}let n=e.map(([e,t])=>({id:e,executionCount:t.count,totalTime:t.totalTime,avgTime:t.count>0?t.totalTime/t.count:0})).sort((e,t)=>t.totalTime-e.totalTime).slice(0,10);return{lifecycle:this._perfData.lifecycle,effects:{total:e.length,byDirective:t,slowest:n},observers:this.getObserverStats()}}effect(e,t){if(!this.shouldLog(`lifecycle`))return super.effect(e,t);let n=performance.now(),r=super.effect(e,t),i=performance.now()-n;return t&&this.recordEffectExecution(t,i),i>16&&console.warn(`Slow effect (${i.toFixed(1)}ms):`,this.buildEffectId(t)),this.shouldLog(`effects`)&&console.debug(`Effect (${i.toFixed(2)}ms):`,this.buildEffectId(t)),r}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
42
+ `;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var Ve=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;Ne(this._next??-1);)this._advance(!0);if(Le(this._next??-1))return this._tokenizeString();if(Pe(this._next??-1))return this._tokenizeIdentOrKeyword();if(I(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(Re(this._next??-1))return this._tokenizeOperator();if(ze(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=F(P.STRING,Be(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(Fe(this._next??-1));let e=this._getValue();return F(Ie(e)?P.KEYWORD:Te.has(e)?P.OPERATOR:P.IDENTIFIER,e,N[e]??0)}_tokenizeNumber(){do this._advance();while(I(this._next??-1));return this._next===46?this._tokenizeDot():F(P.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),I(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),F(P.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),F(P.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),F(P.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),F(P.COLON,`:`)}_tokenizeFraction(){do this._advance();while(I(this._next??-1));return F(P.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Me.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),F(P.ARROW,e);je.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?F(P.OPTIONAL_DOT,e,13):F(P.OPERATOR,e,N[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=F(P.GROUPER,e,N[e]);return this._advance(!0),t}};let He=(e,t)=>new Ue(e,t).parse();var Ue=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new Ve(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(P.DOT)||this._matches(P.OPTIONAL_DOT)){let t=this._kind===P.OPTIONAL_DOT;if(this._advance(),t&&this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(P.KEYWORD))break;else if(this._matches(P.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!De.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===P.OPERATOR||this._kind===P.DOT||this._kind===P.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(P.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(P.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(P.INTEGER))return this._parseInteger(e);if(this._matches(P.DECIMAL))return this._parseDecimal(e)}if(!e||!Ee.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(P.OPERATOR,`?`);let t=this._parseExpression();this._advance(P.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case P.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw we.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case P.IDENTIFIER:return this._parseInvokeOrIdentifier();case P.STRING:return this._parseString();case P.INTEGER:return this._parseInteger();case P.DECIMAL:return this._parseDecimal();case P.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case P.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`]`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`}`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(P.STRING)||this._matches(P.IDENTIFIER))&&this._advance(),this._matches(P.COLON)){this._advance(P.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(P.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(P.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(P.GROUPER,`)`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(P.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(P.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}};let L=Symbol(`__computed__`);function We(e){return typeof e==`object`&&!!e&&L in e&&e[L]===!0}let Ge=new Ae,R=`__is_proxy__`;function Ke(e){return e instanceof Ye||e[R]===!0}function qe(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return qe(n.get(`$parent`),t)}function z(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?z(n.get(`$parent`),t):null}function Je(e,t,n){let r=z(e,t);r?r._store.set(t,n):e._store.set(t,n)}var Ye=class e{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_store=new Map;_lock=Promise.resolve();_notify=new Map;constructor(e){for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapObject(e,t){return e==null||Ke(e)||Object.isFrozen(e)||Object.isSealed(e)||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof Promise||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||typeof Node<`u`&&e instanceof Node?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{if(Reflect.get(e,n,i)===r)return!0;typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,n,r)=>{if(n===R)return!0;let i=Reflect.get(e,n,r);if(typeof i==`object`&&i&&!Ke(i)){let a=this.wrapObject(i,t);if(a!==i)return Reflect.set(e,n,a,r),a}return i}})}watch(e,t){let n=z(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),Array.from(n.observers.get(e)||[]).some(e=>e.observer===t)||n.observers.get(e)?.add({observer:t,store:this})}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=z(this,e),r=Array.from(n?.observers.get(e)||[]),i=this._notify.get(e);if(i!==`executing`)return i&&clearTimeout(i),new Promise(n=>{this._notify.set(e,setTimeout(async()=>{this._notify.set(e,`executing`);try{await Promise.all(r.map(e=>e.observer.call(e.store.proxify(e.observer))))}finally{this._notify.delete(e)}n()},t))})}get(e,t){return t&&this.watch(e,t),qe(this,e)}setupComputed(e,t){let n=this;this.effect(function(){let r=t.call(this,this);if(n._store.get(e)!==r){Je(n,e,r);let t=z(n,e),i=Array.from(t?.observers.get(e)||[]);for(let e of i)e.observer.call(e.store.proxify(e.observer))}})}async set(e,t,n){if(We(t)){this.setupComputed(e,t.fn);return}if(this._store.has(e)&&t===this._store.get(e))return;let r=()=>this.notify(e);if(t&&typeof t==`object`&&(t=this.wrapObject(t,r)),n?this._store.set(e,t):Je(this,e,t),!n){for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t))}await r()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}getObserverStats(){let e={},t=0;for(let[n,r]of this.observers)e[n]=r.size,t+=r.size;return{totalKeys:this.observers.size,totalObservers:t,byKey:e}}effect(e,t){return e.call(this.proxify(e))}$computed(e){return{[L]:!0,fn:e}}proxify(t){let n=Array.from(this._store.entries()).map(([e])=>e),r=Object.fromEntries(n.map(e=>[e,null])),i=(e,t,n)=>typeof e==`function`&&t!==`constructor`?(...t)=>e.call(n,...t):e;return new Proxy(r,{has:(e,t)=>typeof t==`string`&&(z(this,t)||Reflect.has(this,t))?!0:Reflect.has(r,t),get:(n,r,a)=>{if(typeof r==`string`){if(z(this,r)){let n=this.get(r,t);return t&&n instanceof e?n.proxify(t):i(n,r,a)}if(t&&r!==R&&!Reflect.has(this,r))return this.set(r,void 0),this.get(r,t)}return r===`$`?this.proxify(t):i(Reflect.get(this,r,a),r,a)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=He(e,Ge),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},Xe=class e extends Ye{_debugLevel=`off`;dirpath=``;_perfData={lifecycle:{},effects:new Map};static DEBUG_LEVELS=[`off`,`lifecycle`,`effects`,`verbose`];_skipNodes=new Set;_customElements=new Map;_pendingValueRetries=[];debug(e){return typeof e==`boolean`?this._debugLevel=e?`lifecycle`:`off`:this._debugLevel=e,this}get debugging(){return this._debugLevel!==`off`}shouldLog(t){return e.DEBUG_LEVELS.indexOf(this._debugLevel)>=e.DEBUG_LEVELS.indexOf(t)}clearPerformanceReport(){this._perfData={lifecycle:{},effects:new Map}}getNodePath(e){let t=[],n=e;for(;n?.tagName;){let e=n.tagName.toLowerCase(),r=n.parentElement;if(r){let i=Array.from(r.children).filter(t=>t.tagName.toLowerCase()===e);if(i.length>1){let r=i.indexOf(n)+1;t.unshift(`${e}:nth-child(${r})`)}else t.unshift(e)}else t.unshift(e);n=r}return t.join(`>`)}buildEffectId(e){let t=e?.directive??`unknown`,n=D(e?.expression??``,32),r=e?.element;return`${t}:${r?r.dataset?.perfid??r.id??r.dataset?.testid??this.getNodePath(r):`unknown`}:${n}`}recordEffectExecution(e,t){let n=this.buildEffectId(e),r=this._perfData.effects.get(n)??{count:0,totalTime:0};r.count++,r.totalTime+=t,this._perfData.effects.set(n,r)}getPerformanceReport(){let e=Array.from(this._perfData.effects.entries()),t={};for(let[n,r]of e){let e=n.split(`:`)[0];t[e]||(t[e]={count:0,totalTime:0}),t[e].count+=r.count,t[e].totalTime+=r.totalTime}let n=e.map(([e,t])=>({id:e,executionCount:t.count,totalTime:t.totalTime,avgTime:t.count>0?t.totalTime/t.count:0})).sort((e,t)=>t.totalTime-e.totalTime).slice(0,10);return{lifecycle:this._perfData.lifecycle,effects:{total:e.length,byDirective:t,slowest:n},observers:this.getObserverStats()}}effect(e,t){if(!this.shouldLog(`lifecycle`))return super.effect(e,t);let n=performance.now(),r=super.effect(e,t),i=performance.now()-n;return t&&this.recordEffectExecution(t,i),i>16&&console.warn(`Slow effect (${i.toFixed(1)}ms):`,this.buildEffectId(t)),this.shouldLog(`effects`)&&console.debug(`Effect (${i.toFixed(2)}ms):`,this.buildEffectId(t)),r}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
43
43
  `,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:k(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}async preprocessLocal(e,t){let n=await this.fetchLocal(e,t);return this.preprocessString(n,{...t,dirpath:k(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}subrenderer(){let e=new this.constructor().debug(this.debugging);return e._store.set(`$parent`,this),e._store.set(`$rootRenderer`,this.get(`$rootRenderer`)??this),e._customElements=this._customElements,e}log(...e){this.shouldLog(`verbose`)&&console.debug(...e)}async preprocessNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;t={dirpath:this.dirpath,maxdepth:10,...t};let r=new A(p(e,this._skipNodes)).map(async e=>{this.log(`Preprocessing node:
44
44
  `,O(e,128)),await j.resolveIncludes.call(this,e,t),await j.rebaseRelativePaths.call(this,e,t),await j.registerCustomElements.call(this,e,t),await j.resolveCustomElements.call(this,e,t)});return await Promise.all(r.generator()),n&&(this._perfData.lifecycle.preprocessTime=(this._perfData.lifecycle.preprocessTime??0)+(performance.now()-n)),e}async renderNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;for(let n of p(e,this._skipNodes))this.log(`Rendering node:
45
- `,O(n,128)),await j.resolveForAttribute.call(this,n,t),await j.resolveRenderAttribute.call(this,n,t),await j.resolveDataAttribute.call(this,n,t),await j.resolveTextAttributes.call(this,n,t),await j.resolveHtmlAttribute.call(this,n,t),await j.resolveIfAttribute.call(this,n,t),await j.resolveShowAttribute.call(this,n,t),await j.resolveClassAttribute.call(this,n,t),await j.resolveBindAttribute.call(this,n,t),await j.resolveEventAttributes.call(this,n,t),await j.resolveTextNodeExpressions.call(this,n,t),await j.resolveCustomAttribute.call(this,n,t),await j.resolveCustomProperty.call(this,n,t),await j.stripTypes.call(this,n,t);for(let e of this._pendingValueRetries.splice(0))e();return n&&(this._perfData.lifecycle.renderTime=(this._perfData.lifecycle.renderTime??0)+(performance.now()-n)),e}async mount(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;n&&this.clearPerformanceReport(),t={...t,rootNode:e},x(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await Ce(this),await this.preprocessNode(e,t),await this.renderNode(e,t),n&&(this._perfData.lifecycle.mountTime=performance.now()-n)}};function Qe(){return se([f`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,f`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,f`body{margin:0;line-height:inherit}`,f`hr{height:0;color:inherit;border-top-width:1px}`,f`abbr:where([title]){text-decoration:underline dotted}`,f`b,strong{font-weight:bolder}`,f`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,f`small{font-size:80%}`,f`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,f`sub{bottom:-0.25em}`,f`sup{top:-0.5em}`,f`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,f`button,select{text-transform:none}`,f`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,f`:-moz-focusring{outline:auto}`,f`:-moz-ui-invalid{box-shadow:none}`,f`progress{vertical-align:baseline}`,f`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,f`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,f`::-webkit-search-decoration{-webkit-appearance:none}`,f`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,f`summary{display:list-item}`,f`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,f`fieldset{margin:0;padding:0}`,f`legend{padding:0}`,f`ol,ul,menu{list-style:none;margin:0;padding:0}`,f`textarea{resize:vertical}`,f`::placeholder{opacity:1;color:#9ca3af}`,f`button,[role="button"]{cursor:pointer}`,f`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,f`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,f`img,video{max-width:100%;height:auto}`,f`[hidden]{display:none}`,f`dialog{padding:0}`,f`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function $e(){return se([f`html{`,f`max-width: 70ch;`,f`padding: 2em 1em;`,f`margin: auto;`,f`line-height: 1.75;`,f`font-size: 1.25em;`,f`font-family: sans-serif;`,f`}`,f`h1,h2,h3,h4,h5,h6{`,f`margin: 1em 0 0.5em;`,f`}`,f`p,ul,ol{`,f`margin-bottom: 1em;`,f`color: #1d1d1d;`,f`}`])}let et={sm:640,md:768,lg:1024,xl:1280},tt=Object.entries(et),B=.25,V=[...Array(15)].map((e,t)=>t+1),nt=[16,20,24,28,32,36,40,48,56,64],rt=[72,80,96,128,160,192,256,320,384,512],H=[...V,...nt,...rt,...Object.values(et)],U=Array.from({length:20},(e,t)=>(t+1)*5),it=[0,10,20,30,40,50,60,70,80,90,100],at=[25,50,75,100,150,200,300,500,700,1e3],ot=[`hover`,`focus`,`disabled`],W={margin:`m`,padding:`p`},st={width:`w`,height:`h`},ct={top:`top`,right:`right`,bottom:`bottom`,left:`left`},lt={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},ut={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},dt=[`@keyframes spin {
45
+ `,O(n,128)),await j.resolveForAttribute.call(this,n,t),await j.resolveRenderAttribute.call(this,n,t),await j.resolveDataAttribute.call(this,n,t),await j.resolveTextAttributes.call(this,n,t),await j.resolveHtmlAttribute.call(this,n,t),await j.resolveIfAttribute.call(this,n,t),await j.resolveShowAttribute.call(this,n,t),await j.resolveClassAttribute.call(this,n,t),await j.resolveBindAttribute.call(this,n,t),await j.resolveEventAttributes.call(this,n,t),await j.resolveTextNodeExpressions.call(this,n,t),await j.resolveCustomAttribute.call(this,n,t),await j.resolveCustomProperty.call(this,n,t),await j.stripTypes.call(this,n,t);for(let e of this._pendingValueRetries.splice(0))e();return n&&(this._perfData.lifecycle.renderTime=(this._perfData.lifecycle.renderTime??0)+(performance.now()-n)),e}async mount(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;n&&this.clearPerformanceReport(),t={...t,rootNode:e},x(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await Ce(this),await this.preprocessNode(e,t),await this.renderNode(e,t),n&&(this._perfData.lifecycle.mountTime=performance.now()-n)}};function Ze(){return se([f`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,f`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,f`body{margin:0;line-height:inherit}`,f`hr{height:0;color:inherit;border-top-width:1px}`,f`abbr:where([title]){text-decoration:underline dotted}`,f`b,strong{font-weight:bolder}`,f`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,f`small{font-size:80%}`,f`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,f`sub{bottom:-0.25em}`,f`sup{top:-0.5em}`,f`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,f`button,select{text-transform:none}`,f`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,f`:-moz-focusring{outline:auto}`,f`:-moz-ui-invalid{box-shadow:none}`,f`progress{vertical-align:baseline}`,f`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,f`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,f`::-webkit-search-decoration{-webkit-appearance:none}`,f`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,f`summary{display:list-item}`,f`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,f`fieldset{margin:0;padding:0}`,f`legend{padding:0}`,f`ol,ul,menu{list-style:none;margin:0;padding:0}`,f`textarea{resize:vertical}`,f`::placeholder{opacity:1;color:#9ca3af}`,f`button,[role="button"]{cursor:pointer}`,f`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,f`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,f`img,video{max-width:100%;height:auto}`,f`[hidden]{display:none}`,f`dialog{padding:0}`,f`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function Qe(){return se([f`html{`,f`max-width: 70ch;`,f`padding: 2em 1em;`,f`margin: auto;`,f`line-height: 1.75;`,f`font-size: 1.25em;`,f`font-family: sans-serif;`,f`}`,f`h1,h2,h3,h4,h5,h6{`,f`margin: 1em 0 0.5em;`,f`}`,f`p,ul,ol{`,f`margin-bottom: 1em;`,f`color: #1d1d1d;`,f`}`])}let $e={sm:640,md:768,lg:1024,xl:1280},et=Object.entries($e),B=.25,V=[...Array(15)].map((e,t)=>t+1),tt=[16,20,24,28,32,36,40,48,56,64],nt=[72,80,96,128,160,192,256,320,384,512],H=[...V,...tt,...nt,...Object.values($e)],U=Array.from({length:20},(e,t)=>(t+1)*5),rt=[0,10,20,30,40,50,60,70,80,90,100],it=[25,50,75,100,150,200,300,500,700,1e3],at=[`hover`,`focus`,`disabled`],W={margin:`m`,padding:`p`},ot={width:`w`,height:`h`},st={top:`top`,right:`right`,bottom:`bottom`,left:`left`},ct={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},lt={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},ut=[`@keyframes spin {
46
46
  from { transform: rotate(0deg) }
47
47
  to { transform: rotate(360deg) }
48
48
  }`,`@keyframes ping {
@@ -53,5 +53,5 @@ let je=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Me=new Set([`===`,`!==
53
53
  }`,`@keyframes pulse {
54
54
  0%, 100% { opacity: 1 }
55
55
  50% { opacity: .5 }
56
- }`],ft={red:{50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`},pink:{50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`},purple:{50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`},"deep-purple":{50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`},indigo:{50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`},blue:{50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`},"light-blue":{50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`},cyan:{50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`},teal:{50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`},green:{50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`},"light-green":{50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`},lime:{50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`},yellow:{50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`},amber:{50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`},orange:{50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`},"deep-orange":{50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`},brown:{50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},gray:{50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`},"blue-gray":{50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`}};function G(e){return ot.map(t=>`.${t}\\:${e}:${t}`)}function pt(e,t){return tt.map(([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${e} { ${t} } }`)}function K(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${G(e).join(`,`)} { ${t} }`,...pt(e,t)])}function mt(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${G(e).join(`,`)} { ${t} }`])}function ht(e,t){let n=e[0]===`@`,r=t[0]===`@`;return n&&!r?1:!n&&r?-1:e.localeCompare(t)}function q(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100v${e.includes(`height`)?`h`:`w`}`],[`${t}-full`,`${e}: 100%`],...H.map(n=>[`${t}-${n}`,`${e}: ${n*B}rem`]),...H.map(n=>[`-${t}-${n}`,`${e}: -${n*B}rem`]),...H.map(n=>[`${t}-${n}px`,`${e}: ${n}px`]),...H.map(n=>[`-${t}-${n}px`,`${e}: -${n}px`]),...U.map(n=>[`${t}-${n}\\%`,`${e}: ${n}%`]),...U.map(n=>[`-${t}-${n}\\%`,`${e}: -${n}%`]),...tt.map(([n,r])=>[`${t}-${n}`,`${e}: ${r}px`])]))}function gt(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}-auto`,`${e}: auto`],[`${t}x-auto`,`${e}-left: auto; ${e}-right: auto;`],[`${t}y-auto`,`${e}-top: auto; ${e}-bottom: auto;`],[`${t}x-0`,`${e}-left: 0; ${e}-right: 0;`],[`${t}y-0`,`${e}-top: 0; ${e}-bottom: 0;`],...H.map(n=>[`${t}x-${n}`,`${e}-left: ${n*B}rem; ${e}-right: ${n*B}rem;`]),...H.map(n=>[`${t}y-${n}`,`${e}-top: ${n*B}rem; ${e}-bottom: ${n*B}rem;`]),...H.map(n=>[`${t}x-${n}px`,`${e}-left: ${n}px; ${e}-right: ${n}px;`]),...H.map(n=>[`${t}y-${n}px`,`${e}-top: ${n}px; ${e}-bottom: ${n}px;`]),...U.map(n=>[`${t}x-${n}\\%`,`${e}-left: ${n}%; ${e}-right: ${n}%;`]),...U.map(n=>[`${t}y-${n}\\%`,`${e}-top: ${n}%; ${e}-bottom: ${n}%;`])]))}function _t(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...[``,`-`].flatMap(n=>[...H.map(r=>[`${n}${t}t-${r}`,`${e}-top: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}b-${r}`,`${e}-bottom: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}l-${r}`,`${e}-left: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}r-${r}`,`${e}-right: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}t-${r}px`,`${e}-top: ${n}${r}px`]),...H.map(r=>[`${n}${t}b-${r}px`,`${e}-bottom: ${n}${r}px`]),...H.map(r=>[`${n}${t}l-${r}px`,`${e}-left: ${n}${r}px`]),...H.map(r=>[`${n}${t}r-${r}px`,`${e}-right: ${n}${r}px`]),...U.map(r=>[`${n}${t}t-${r}\\%`,`${e}-top: ${n}${r}%`]),...U.map(r=>[`${n}${t}b-${r}\\%`,`${e}-bottom: ${n}${r}%`]),...U.map(r=>[`${n}${t}l-${r}\\%`,`${e}-left: ${n}${r}%`]),...U.map(r=>[`${n}${t}r-${r}\\%`,`${e}-right: ${n}${r}%`])])]))}function vt(){return K([[`border`,`border: 1px`],[`border-x`,`border-inline-width: 1px`],[`border-y`,`border-block-width: 1px`],...[0,...V].map(e=>[`border-${e}`,`border-width: ${e}px`]),...[0,...V].map(e=>[`border-x-${e}`,`border-inline-width: ${e}px;`]),...[0,...V].map(e=>[`border-y-${e}`,`border-block-width: ${e}px;`]),...[`top`,`bottom`,`left`,`right`].flatMap(e=>[[`border-${e.slice(0,1)}`,`border-${e}: 1px`],...[0,...V].map(t=>[`border-${e.slice(0,1)}-${t}`,`border-${e}-width: ${t}px`])])])}function yt(){return K(U.map(e=>[`z-${e}`,`z-index: ${e}`]))}function bt(){return K(at.map(e=>[`duration-${e}`,`--transition-duration: ${e}ms; transition-duration: ${e}ms`]))}function xt(){return K([[`space-x-0 > *`,`margin-left: 0`],[`space-y-0 > *`,`margin-top: 0`],...H.map(e=>[`space-x-${e} > :not(:first-child)`,`margin-left: ${e*B}rem`]),...H.map(e=>[`space-y-${e} > :not(:first-child)`,`margin-top: ${e*B}rem`]),...H.map(e=>[`space-x-${e}px > :not(:first-child)`,`margin-left: ${e}px`]),...H.map(e=>[`space-y-${e}px > :not(:first-child)`,`margin-top: ${e}px`]),[`gap-0`,`gap: 0`],...H.map(e=>[`gap-${e}`,`gap: ${e*B}rem`]),...H.map(e=>[`gap-${e}px`,`gap: ${e}px`]),...H.map(e=>[`gap-x-${e}`,`column-gap: ${e*B}rem`]),...H.map(e=>[`gap-y-${e}`,`row-gap: ${e*B}rem`]),...H.map(e=>[`gap-x-${e}px`,`column-gap: ${e}px`]),...H.map(e=>[`gap-y-${e}px`,`row-gap: ${e}px`]),[`divide-x > :not(:last-child)`,`border-inline-end-width: 1px`],[`divide-y > :not(:last-child)`,`border-bottom-width: 1px`],[`divide-x-0 > :not(:last-child)`,`border-inline-end-width: 0px`],[`divide-y-0 > :not(:last-child)`,`border-bottom-width: 0px`],...[2,4,8].map(e=>[`divide-x-${e} > :not(:last-child)`,`border-inline-end-width: ${e}px`]),...[2,4,8].map(e=>[`divide-y-${e} > :not(:last-child)`,`border-bottom-width: ${e}px`]),[`divide-solid > :not(:last-child)`,`border-style: solid`],[`divide-dashed > :not(:last-child)`,`border-style: dashed`],[`divide-dotted > :not(:last-child)`,`border-style: dotted`],[`divide-none > :not(:last-child)`,`border-style: none`]])}function St(){return K([...Array.from({length:100},(e,t)=>[`text-${t}px`,`font-size: ${t}px`]),...Array.from({length:100},(e,t)=>[`text-${t*B}rem`,`font-size: ${t*B}rem`])])}function Ct(){return K([...Array.from({length:12},(e,t)=>t+1).map(e=>[`grid-cols-${e}`,`grid-template-columns: repeat(${e}, minmax(0, 1fr))`]),[`grid-cols-none`,`grid-template-columns: none`],...Array.from({length:12},(e,t)=>t+1).map(e=>[`col-span-${e}`,`grid-column: span ${e} / span ${e}`]),[`col-span-full`,`grid-column: 1 / -1`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-start-${e}`,`grid-column-start: ${e}`]),[`col-start-auto`,`grid-column-start: auto`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-end-${e}`,`grid-column-end: ${e}`]),[`col-end-auto`,`grid-column-end: auto`]])}function wt(){return Object.entries(ut).flatMap(([e,t])=>{let n=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`; `);return[`.${e} { ${n} }`,`${G(e).join(`,`)} { ${n} }`,...pt(e,n)]})}function Tt(e){let t=0,n=0,r=0;return e.length===4?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):e.length===7&&(t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),`${t} ${n} ${r}`}function Et(){let e=(e,t)=>{let n=[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]];if(t.startsWith(`#`)){let r=Tt(t);for(let t of it){let i=t/100;n.push([`text-${e}\\/${t}`,`color: rgb(${r} / ${i})`],[`bg-${e}\\/${t}`,`background-color: rgb(${r} / ${i})`],[`border-${e}\\/${t}`,`border-color: rgb(${r} / ${i})`])}}return n};return mt([...e(`white`,`#fff`),...e(`black`,`#000`),...e(`transparent`,`transparent`),...Object.entries(ft).flatMap(([t,n])=>[...e(t,n[500]),...Object.entries(n).flatMap(([n,r])=>e(`${t}-${n}`,r))])])}function Dt(){return K([[`opacity-0`,`opacity: 0`],...U.map(e=>[`opacity-${e}`,`opacity: ${e/100}`])])}let J=null;function Ot(){return J===null&&(J=[...dt,...wt(),...Et(),...Dt(),...yt(),...bt(),...q(ct),...q(st),...gt(st),..._t(W),...q(W),...gt(W),...xt(),...q(lt),...vt(),...St(),...Ct()].sort(ht).join(`
57
- `)),J}var Y=class extends Ze{impl=`browser`;dirpath=k(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return new DOMParser().parseFromString(e,`text/html`);{let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};new Y;function kt(e){for(let t of e){let e=document.createElement(`style`);switch(t){case`minimal`:oe(e,$e());break;case`basic`:oe(e,Qe());break;case`utils`:e.textContent=Ot();break;default:console.error(`Unknown style name: "${t}"`);continue}globalThis.document.head.appendChild(e)}}let X=`mancha-cloak`;function At(e,t){let n=`${e.join(`, `)} { opacity: 0 !important; ${t>0?`transition: opacity ${t}ms ease-in-out !important;`:``} }`,r=document.getElementById(X);r||(r=document.createElement(`style`),r.id=X,document.head.appendChild(r)),r.textContent=n}function jt(e){let t=!1;return async()=>{if(t)return;t=!0;let n=document.getElementById(X);if(n){if(e!==!1){let t=n.sheet;t&&t.cssRules.length>0&&t.cssRules[0].style.setProperty(`opacity`,`1`,`important`),await new Promise(t=>setTimeout(t,e))}n.remove()}}}async function Z(e={}){let t;document.documentElement.classList.add(`mancha-loading`);let n=e.cloak?e.cloak===!0?{}:e.cloak:void 0;if(n){let r=e.target?Array.isArray(e.target)?e.target:[e.target]:[`body`],i=n.selector&&(Array.isArray(n.selector)||typeof n.selector==`string`)?Array.isArray(n.selector)?n.selector:[n.selector]:r,a=n.duration??0;At(i,a),t=jt(a>0?a:!1)}else t=jt(!1);document.readyState===`loading`&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0})});let r=e.renderer??new Y;if(e.css&&e.css.length>0&&kt(e.css),e.debug&&r.debug(!0),e.state)for(let[t,n]of Object.entries(e.state))await r.set(t,n);try{if(e.callback)await e.callback(r);else if(e.target){let t=Array.isArray(e.target)?e.target:[e.target];for(let n of t){let t=globalThis.document.querySelector(n);t?await r.mount(t,{cache:e.cache}):console.error(`Target element not found: "${n}"`)}}}finally{document.documentElement.classList.remove(`mancha-loading`),t&&await t()}return r}let Q=globalThis.document?.currentScript,$=new Y;if($.initMancha=Z,globalThis.Mancha=$,Q?.hasAttribute(`init`)){let e=Q.hasAttribute(`debug`),t=Q.getAttribute(`cache`)||void 0,n=Q.getAttribute(`target`)?.split(`+`)||[`body`],r=Q.getAttribute(`css`)?.split(`+`),i,a=Q.getAttribute(`cloak`);if(a===`false`)i=void 0;else if(a&&!Number.isNaN(parseInt(a,10))){let e=parseInt(a,10);i=e>0?{duration:e}:!0}else i=!0;Z({renderer:$,css:r,target:n,debug:e,cache:t,cloak:i})}else if(Q?.hasAttribute(`css`)){let e=Q.getAttribute(`css`)?.split(`+`);Z({css:e})}return $})();
56
+ }`],dt={red:{50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`},pink:{50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`},purple:{50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`},"deep-purple":{50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`},indigo:{50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`},blue:{50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`},"light-blue":{50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`},cyan:{50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`},teal:{50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`},green:{50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`},"light-green":{50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`},lime:{50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`},yellow:{50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`},amber:{50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`},orange:{50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`},"deep-orange":{50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`},brown:{50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},gray:{50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`},"blue-gray":{50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`}};function G(e){return at.map(t=>`.${t}\\:${e}:${t}`)}function ft(e,t){return et.map(([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${e} { ${t} } }`)}function K(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${G(e).join(`,`)} { ${t} }`,...ft(e,t)])}function pt(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${G(e).join(`,`)} { ${t} }`])}function mt(e,t){let n=e[0]===`@`,r=t[0]===`@`;return n&&!r?1:!n&&r?-1:e.localeCompare(t)}function q(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100v${e.includes(`height`)?`h`:`w`}`],[`${t}-full`,`${e}: 100%`],...H.map(n=>[`${t}-${n}`,`${e}: ${n*B}rem`]),...H.map(n=>[`-${t}-${n}`,`${e}: -${n*B}rem`]),...H.map(n=>[`${t}-${n}px`,`${e}: ${n}px`]),...H.map(n=>[`-${t}-${n}px`,`${e}: -${n}px`]),...U.map(n=>[`${t}-${n}\\%`,`${e}: ${n}%`]),...U.map(n=>[`-${t}-${n}\\%`,`${e}: -${n}%`]),...et.map(([n,r])=>[`${t}-${n}`,`${e}: ${r}px`])]))}function ht(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}-auto`,`${e}: auto`],[`${t}x-auto`,`${e}-left: auto; ${e}-right: auto;`],[`${t}y-auto`,`${e}-top: auto; ${e}-bottom: auto;`],[`${t}x-0`,`${e}-left: 0; ${e}-right: 0;`],[`${t}y-0`,`${e}-top: 0; ${e}-bottom: 0;`],...H.map(n=>[`${t}x-${n}`,`${e}-left: ${n*B}rem; ${e}-right: ${n*B}rem;`]),...H.map(n=>[`${t}y-${n}`,`${e}-top: ${n*B}rem; ${e}-bottom: ${n*B}rem;`]),...H.map(n=>[`${t}x-${n}px`,`${e}-left: ${n}px; ${e}-right: ${n}px;`]),...H.map(n=>[`${t}y-${n}px`,`${e}-top: ${n}px; ${e}-bottom: ${n}px;`]),...U.map(n=>[`${t}x-${n}\\%`,`${e}-left: ${n}%; ${e}-right: ${n}%;`]),...U.map(n=>[`${t}y-${n}\\%`,`${e}-top: ${n}%; ${e}-bottom: ${n}%;`])]))}function gt(e){return K(Object.entries(e).flatMap(([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...[``,`-`].flatMap(n=>[...H.map(r=>[`${n}${t}t-${r}`,`${e}-top: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}b-${r}`,`${e}-bottom: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}l-${r}`,`${e}-left: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}r-${r}`,`${e}-right: ${n}${r*B}rem`]),...H.map(r=>[`${n}${t}t-${r}px`,`${e}-top: ${n}${r}px`]),...H.map(r=>[`${n}${t}b-${r}px`,`${e}-bottom: ${n}${r}px`]),...H.map(r=>[`${n}${t}l-${r}px`,`${e}-left: ${n}${r}px`]),...H.map(r=>[`${n}${t}r-${r}px`,`${e}-right: ${n}${r}px`]),...U.map(r=>[`${n}${t}t-${r}\\%`,`${e}-top: ${n}${r}%`]),...U.map(r=>[`${n}${t}b-${r}\\%`,`${e}-bottom: ${n}${r}%`]),...U.map(r=>[`${n}${t}l-${r}\\%`,`${e}-left: ${n}${r}%`]),...U.map(r=>[`${n}${t}r-${r}\\%`,`${e}-right: ${n}${r}%`])])]))}function _t(){return K([[`border`,`border: 1px`],[`border-x`,`border-inline-width: 1px`],[`border-y`,`border-block-width: 1px`],...[0,...V].map(e=>[`border-${e}`,`border-width: ${e}px`]),...[0,...V].map(e=>[`border-x-${e}`,`border-inline-width: ${e}px;`]),...[0,...V].map(e=>[`border-y-${e}`,`border-block-width: ${e}px;`]),...[`top`,`bottom`,`left`,`right`].flatMap(e=>[[`border-${e.slice(0,1)}`,`border-${e}: 1px`],...[0,...V].map(t=>[`border-${e.slice(0,1)}-${t}`,`border-${e}-width: ${t}px`])])])}function vt(){return K(U.map(e=>[`z-${e}`,`z-index: ${e}`]))}function yt(){return K(it.map(e=>[`duration-${e}`,`--transition-duration: ${e}ms; transition-duration: ${e}ms`]))}function bt(){return K([[`space-x-0 > *`,`margin-left: 0`],[`space-y-0 > *`,`margin-top: 0`],...H.map(e=>[`space-x-${e} > :not(:first-child)`,`margin-left: ${e*B}rem`]),...H.map(e=>[`space-y-${e} > :not(:first-child)`,`margin-top: ${e*B}rem`]),...H.map(e=>[`space-x-${e}px > :not(:first-child)`,`margin-left: ${e}px`]),...H.map(e=>[`space-y-${e}px > :not(:first-child)`,`margin-top: ${e}px`]),[`gap-0`,`gap: 0`],...H.map(e=>[`gap-${e}`,`gap: ${e*B}rem`]),...H.map(e=>[`gap-${e}px`,`gap: ${e}px`]),...H.map(e=>[`gap-x-${e}`,`column-gap: ${e*B}rem`]),...H.map(e=>[`gap-y-${e}`,`row-gap: ${e*B}rem`]),...H.map(e=>[`gap-x-${e}px`,`column-gap: ${e}px`]),...H.map(e=>[`gap-y-${e}px`,`row-gap: ${e}px`]),[`divide-x > :not(:last-child)`,`border-inline-end-width: 1px`],[`divide-y > :not(:last-child)`,`border-bottom-width: 1px`],[`divide-x-0 > :not(:last-child)`,`border-inline-end-width: 0px`],[`divide-y-0 > :not(:last-child)`,`border-bottom-width: 0px`],...[2,4,8].map(e=>[`divide-x-${e} > :not(:last-child)`,`border-inline-end-width: ${e}px`]),...[2,4,8].map(e=>[`divide-y-${e} > :not(:last-child)`,`border-bottom-width: ${e}px`]),[`divide-solid > :not(:last-child)`,`border-style: solid`],[`divide-dashed > :not(:last-child)`,`border-style: dashed`],[`divide-dotted > :not(:last-child)`,`border-style: dotted`],[`divide-none > :not(:last-child)`,`border-style: none`]])}function xt(){return K([...Array.from({length:100},(e,t)=>[`text-${t}px`,`font-size: ${t}px`]),...Array.from({length:100},(e,t)=>[`text-${t*B}rem`,`font-size: ${t*B}rem`])])}function St(){return K([...Array.from({length:12},(e,t)=>t+1).map(e=>[`grid-cols-${e}`,`grid-template-columns: repeat(${e}, minmax(0, 1fr))`]),[`grid-cols-none`,`grid-template-columns: none`],...Array.from({length:12},(e,t)=>t+1).map(e=>[`col-span-${e}`,`grid-column: span ${e} / span ${e}`]),[`col-span-full`,`grid-column: 1 / -1`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-start-${e}`,`grid-column-start: ${e}`]),[`col-start-auto`,`grid-column-start: auto`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-end-${e}`,`grid-column-end: ${e}`]),[`col-end-auto`,`grid-column-end: auto`]])}function Ct(){return Object.entries(lt).flatMap(([e,t])=>{let n=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`; `);return[`.${e} { ${n} }`,`${G(e).join(`,`)} { ${n} }`,...ft(e,n)]})}function wt(e){let t=0,n=0,r=0;return e.length===4?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):e.length===7&&(t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),`${t} ${n} ${r}`}function Tt(){let e=(e,t)=>{let n=[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]];if(t.startsWith(`#`)){let r=wt(t);for(let t of rt){let i=t/100;n.push([`text-${e}\\/${t}`,`color: rgb(${r} / ${i})`],[`bg-${e}\\/${t}`,`background-color: rgb(${r} / ${i})`],[`border-${e}\\/${t}`,`border-color: rgb(${r} / ${i})`])}}return n};return pt([...e(`white`,`#fff`),...e(`black`,`#000`),...e(`transparent`,`transparent`),...Object.entries(dt).flatMap(([t,n])=>[...e(t,n[500]),...Object.entries(n).flatMap(([n,r])=>e(`${t}-${n}`,r))])])}function Et(){return K([[`opacity-0`,`opacity: 0`],...U.map(e=>[`opacity-${e}`,`opacity: ${e/100}`])])}let J=null;function Dt(){return J===null&&(J=[...ut,...Ct(),...Tt(),...Et(),...vt(),...yt(),...q(st),...q(ot),...ht(ot),...gt(W),...q(W),...ht(W),...bt(),...q(ct),..._t(),...xt(),...St()].sort(mt).join(`
57
+ `)),J}var Y=class extends Xe{impl=`browser`;dirpath=k(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return new DOMParser().parseFromString(e,`text/html`);{let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};new Y;function Ot(e){for(let t of e){let e=document.createElement(`style`);switch(t){case`minimal`:oe(e,Qe());break;case`basic`:oe(e,Ze());break;case`utils`:e.textContent=Dt();break;default:console.error(`Unknown style name: "${t}"`);continue}globalThis.document.head.appendChild(e)}}let X=`mancha-cloak`;function kt(e,t){let n=`${e.join(`, `)} { opacity: 0 !important; ${t>0?`transition: opacity ${t}ms ease-in-out !important;`:``} }`,r=document.getElementById(X);r||(r=document.createElement(`style`),r.id=X,document.head.appendChild(r)),r.textContent=n}function At(e){let t=!1;return async()=>{if(t)return;t=!0;let n=document.getElementById(X);if(n){if(e!==!1){let t=n.sheet;t&&t.cssRules.length>0&&t.cssRules[0].style.setProperty(`opacity`,`1`,`important`),await new Promise(t=>setTimeout(t,e))}n.remove()}}}async function Z(e={}){let t;document.documentElement.classList.add(`mancha-loading`);let n=e.cloak?e.cloak===!0?{}:e.cloak:void 0;if(n){let r=e.target?Array.isArray(e.target)?e.target:[e.target]:[`body`],i=n.selector&&(Array.isArray(n.selector)||typeof n.selector==`string`)?Array.isArray(n.selector)?n.selector:[n.selector]:r,a=n.duration??0;kt(i,a),t=At(a>0?a:!1)}else t=At(!1);document.readyState===`loading`&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0})});let r=e.renderer??new Y;if(e.css&&e.css.length>0&&Ot(e.css),e.debug&&r.debug(!0),e.state)for(let[t,n]of Object.entries(e.state))await r.set(t,n);try{if(e.callback)await e.callback(r);else if(e.target){let t=Array.isArray(e.target)?e.target:[e.target];for(let n of t){let t=globalThis.document.querySelector(n);t?await r.mount(t,{cache:e.cache}):console.error(`Target element not found: "${n}"`)}}}finally{document.documentElement.classList.remove(`mancha-loading`),t&&await t()}return r}let Q=globalThis.document?.currentScript,$=new Y;if($.initMancha=Z,globalThis.Mancha=$,Q?.hasAttribute(`init`)){let e=Q.hasAttribute(`debug`),t=Q.getAttribute(`cache`)||void 0,n=Q.getAttribute(`target`)?.split(`+`)||[`body`],r=Q.getAttribute(`css`)?.split(`+`),i,a=Q.getAttribute(`cloak`);if(a===`false`)i=void 0;else if(a&&!Number.isNaN(parseInt(a,10))){let e=parseInt(a,10);i=e>0?{duration:e}:!0}else i=!0;Z({renderer:$,css:r,target:n,debug:e,cache:t,cloak:i})}else if(Q?.hasAttribute(`css`)){let e=Q.getAttribute(`css`)?.split(`+`);Z({css:e})}return $})();
@@ -1,5 +1,5 @@
1
- import{safeAnchorEl as e,safeAreaEl as t,safeElement as n}from"safevalues/dom";import{safeAttrPrefix as r}from"safevalues";const i=[r`:`,r`style`,r`class`];function*a(e,t=new Set){let n=new Set,r=Array.from(e.childNodes).filter(e=>!t.has(e));for(yield e;r.length;){let e=r.shift();n.has(e)||(n.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter(e=>!t.has(e)).forEach(e=>{r.push(e)})}}function o(e,t){return e?.[t]!==void 0}function s(e,t){return typeof e?.[t]==`function`}function c(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function l(e,t){return e.attribs?e.attribs[t]??null:e.getAttribute?.(t)??null}function u(e,t){return e.attribs?t in e.attribs:e.hasAttribute?.(t)??!1}function d(e,t,n=``){return l(e,n+t)||l(e,`data-${t}`)||(e.dataset?.[c(t)]??null)}function f(e,t,n){e.attribs?e.attribs[t]=n:e.setAttribute?.(t,n)}function p(e,t,r){e.attribs?e.attribs[t]=r:n.setPrefixedAttribute(i,e,t,r)}function m(e,t,n){switch(t){case`disabled`:e.disabled=n;return;case`selected`:e.selected=n;return;case`checked`:e.checked=n;return;default:e[t]=n}}function h(e,t){e.attribs?delete e.attribs[t]:e.removeAttribute?.(t)}function ee(e,t,n,r=``){u(e,`${r}${t}`)?f(e,`${r}${t}`,n):u(e,`data-${t}`)?f(e,`data-${t}`,n):f(e,`${r}${t}`,n)}function g(e,t,n=``){h(e,`${n}${t}`),h(e,`data-${t}`)}function _(e,t,n){if(e.attribs&&t.attribs)t.attribs[n]=e.attribs[n];else if(n.startsWith(`data-`)){let r=c(n.slice(5));t.dataset&&e.dataset&&(t.dataset[r]=e.dataset[r])}else{let r=e?.getAttribute?.(n);p(t,n,r||``)}}function v(e){return o(e,`firstElementChild`)?e.firstElementChild:Array.from(e.children).find(e=>e.nodeType===1)}function y(e,...t){if(s(e,`replaceWith`)){e.replaceWith(...t);return}else{let n=e,r=n.parentNode;if(!r)return;let i=Array.from(r.childNodes).indexOf(n);n.parentNode=null,t.forEach(e=>{e.parentNode=r}),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i),t,Array.from(r.childNodes).slice(i+1))}}function b(e,...t){s(e,`replaceChildren`)?e.replaceChildren(...t):(e.childNodes=t,t.forEach(t=>{t.parentNode=e}))}function x(e,t){return s(t,`appendChild`)?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function S(e,t){return s(t,`removeChild`)?e.removeChild(t):(b(e,...Array.from(e.childNodes).filter(e=>e!==t)),t)}function C(e,t,n){return n?s(e,`insertBefore`)?e.insertBefore(t,n):(y(n,t,n),t):x(e,t)}function w(e,t=0){return e?e.length<=t?e:`${e.slice(0,t-1)}…`:``}function T(e,t=0){return globalThis.DocumentFragment&&e instanceof DocumentFragment?Array.from(e.childNodes).map(e=>T(e,t)).join(``):w(e.outerHTML||e.nodeValue||String(e),t)}function E(e){return e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`):``}function D(e){return!e.includes(`://`)&&!e.startsWith(`/`)&&!e.startsWith(`#`)&&!e.startsWith(`data:`)}var O=class e{iterable;constructor(e){this.iterable=e}filter(t){return new e(e.filterGenerator(t,this.iterable))}map(t){return new e(e.mapGenerator(t,this.iterable))}find(e){for(let t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(let e of this.iterable)yield e}static*filterGenerator(e,t){for(let n of t)e(n)&&(yield n)}static*mapGenerator(e,t){for(let n of t)yield e(n)}static equals(e,t){let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(i.value!==a.value)return!1;i=n.next(),a=r.next()}return i.done===a.done}};let k;(function(n){n.resolveIncludes=async function(e,t){let n=e,r=n.tagName?.toLowerCase();if(![`include`,`link`].includes(r)||r===`link`&&l(n,`rel`)!==`subresource`)return;this.log(`include directive found in:
2
- `,T(e,128)),this.log(`include params:`,t);let i=n.tagName.toLocaleLowerCase()===`link`?`href`:`src`,a=l(n,i);if(!a)throw Error(`"${i}" attribute missing from ${T(e,128)}.`);let o=[];r===`include`&&o.push(`src`),r===`link`&&o.push(`rel`,`href`);let s=t=>{let r=v(t);for(let e of Array.from(n.attributes))r&&!o.includes(e.name)&&_(n,r,e.name);y(e,...t.childNodes)},c={...t,rootDocument:!1,maxdepth:(t?.maxdepth??100)-1};if(c.maxdepth===0)throw Error(`Maximum recursion depth reached.`);if(a.includes(`://`)||a.startsWith(`//`))this.log(`Including remote file from absolute path:`,a),await this.preprocessRemote(a,c).then(s);else if(t?.dirpath?.includes(`://`)||t?.dirpath?.startsWith(`//`)){let e=a.startsWith(`/`)?a:`${t.dirpath}/${a}`;this.log(`Including remote file from relative path:`,e),await this.preprocessRemote(e,c).then(s)}else if(a.charAt(0)===`/`)this.log(`Including local file from absolute path:`,a),await this.preprocessLocal(a,c).then(s);else{let e=t?.dirpath&&t?.dirpath!==`.`?`${t?.dirpath}/${a}`:a;this.log(`Including local file from relative path:`,e),await this.preprocessLocal(e,c).then(s)}},n.rebaseRelativePaths=function(n,r){let i=n,a=i.tagName?.toLowerCase();if(!r?.dirpath)return;let s=l(i,`src`),c=l(i,`href`),u=d(i,`render`,`:`),f=s||c||u;if(!f||!D(f))return;let m=`${r.dirpath}/${f}`;this.log(`Rebasing relative path as:`,m),u?ee(i,`render`,m,`:`):o(i,`attribs`)?p(i,s?`src`:`href`,m):a===`img`?i.src=m:a===`a`?e.setHref(i,m):a===`source`||a===`audio`||a===`video`||a===`track`||a===`input`?i.src=m:a===`area`?t.setHref(i,m):this.log(`Unable to rebase relative path for element:`,a)},n.registerCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=(l(n,`is`)||l(n,`alt`))?.toLowerCase();if([`template`,`div`].includes(r)&&i){if(r===`div`&&l(n,`role`)!==`template`)return;if(!this._customElements.has(i)){this.log(`Registering custom element: ${i}\n`,T(n,128));let e=n.content||n,r=Array.from(a(e));for(let e=1;e<r.length;e++)k.rebaseRelativePaths.call(this,r[e],t);this._customElements.set(i,n),n?.parentNode&&S(n.parentNode,n)}}},n.resolveCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=r;if(i===`div`&&(i=l(n,`role`)?.toLowerCase()||i),i&&this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,T(n,128));let t=this._customElements.get(i),o=(t.content||t).cloneNode(!0),s=v(o);if(s)for(let e of Array.from(n.attributes))(r!==`div`||e.name!==`role`)&&_(n,s,e.name);let c=new O(a(o)).find(e=>e.tagName?.toLowerCase()===`slot`);c&&y(c,...n.childNodes),y(e,...o.childNodes)}},n.resolveTextNodeExpressions=function(e,t){let n=e.nodeValue||``;if(e.nodeType!==3||!n?.trim())return;this.log(`Processing node content value:
1
+ import{safeAnchorEl as e,safeAreaEl as t,safeElement as n}from"safevalues/dom";import{safeAttrPrefix as r}from"safevalues";const i=[r`:`,r`style`,r`class`];function*a(e,t=new Set){let n=new Set,r=Array.from(e.childNodes).filter(e=>!t.has(e));for(yield e;r.length;){let e=r.shift();n.has(e)||(n.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter(e=>!t.has(e)).forEach(e=>{r.push(e)})}}function o(e,t){return e?.[t]!==void 0}function s(e,t){return typeof e?.[t]==`function`}function c(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function l(e,t){return e.attribs?e.attribs[t]??null:e.getAttribute?.(t)??null}function u(e,t){return e.attribs?t in e.attribs:e.hasAttribute?.(t)??!1}function d(e,t,n=``){return l(e,n+t)||l(e,`data-${t}`)||(e.dataset?.[c(t)]??null)}function f(e,t,n){e.attribs?e.attribs[t]=n:e.setAttribute?.(t,n)}function p(e,t,r){e.attribs?e.attribs[t]=r:n.setPrefixedAttribute(i,e,t,r)}function m(e,t,n){switch(t){case`disabled`:e.disabled=n;return;case`selected`:e.selected=n;return;case`checked`:e.checked=n;return;default:e[t]=n}}function h(e,t){e.attribs?delete e.attribs[t]:e.removeAttribute?.(t)}function ee(e,t,n,r=``){u(e,`${r}${t}`)?f(e,`${r}${t}`,n):u(e,`data-${t}`)?f(e,`data-${t}`,n):f(e,`${r}${t}`,n)}function g(e,t,n=``){h(e,`${n}${t}`),h(e,`data-${t}`)}function _(e,t,n){if(e.attribs&&t.attribs)t.attribs[n]=e.attribs[n];else if(n.startsWith(`data-`)){let r=c(n.slice(5));t.dataset&&e.dataset&&(t.dataset[r]=e.dataset[r])}else{let r=e?.getAttribute?.(n);p(t,n,r||``)}}function v(e){return o(e,`firstElementChild`)?e.firstElementChild:Array.from(e.children).find(e=>e.nodeType===1)}function y(e,...t){if(s(e,`replaceWith`)){e.replaceWith(...t);return}else{let n=e,r=n.parentNode;if(!r)return;let i=Array.from(r.childNodes).indexOf(n);n.parentNode=null,t.forEach(e=>{e.parentNode=r}),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i),t,Array.from(r.childNodes).slice(i+1))}}function b(e,...t){s(e,`replaceChildren`)?e.replaceChildren(...t):(e.childNodes=t,t.forEach(t=>{t.parentNode=e}))}function x(e,t){return s(t,`appendChild`)?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function S(e,t){return s(t,`removeChild`)?e.removeChild(t):(b(e,...Array.from(e.childNodes).filter(e=>e!==t)),t)}function C(e,t,n){return n?s(e,`insertBefore`)?e.insertBefore(t,n):(y(n,t,n),t):x(e,t)}function w(e,t=0){return e?e.length<=t?e:`${e.slice(0,t-1)}…`:``}function T(e,t=0){return globalThis.DocumentFragment&&e instanceof DocumentFragment?Array.from(e.childNodes).map(e=>T(e,t)).join(``):w(e.outerHTML||e.nodeValue||String(e),t)}function E(e){return e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`):``}function te(e){return!e.includes(`://`)&&!e.startsWith(`/`)&&!e.startsWith(`#`)&&!e.startsWith(`data:`)}var D=class e{iterable;constructor(e){this.iterable=e}filter(t){return new e(e.filterGenerator(t,this.iterable))}map(t){return new e(e.mapGenerator(t,this.iterable))}find(e){for(let t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(let e of this.iterable)yield e}static*filterGenerator(e,t){for(let n of t)e(n)&&(yield n)}static*mapGenerator(e,t){for(let n of t)yield e(n)}static equals(e,t){let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(i.value!==a.value)return!1;i=n.next(),a=r.next()}return i.done===a.done}};let O;(function(n){n.resolveIncludes=async function(e,t){let n=e,r=n.tagName?.toLowerCase();if(![`include`,`link`].includes(r)||r===`link`&&l(n,`rel`)!==`subresource`)return;this.log(`include directive found in:
2
+ `,T(e,128)),this.log(`include params:`,t);let i=n.tagName.toLocaleLowerCase()===`link`?`href`:`src`,a=l(n,i);if(!a)throw Error(`"${i}" attribute missing from ${T(e,128)}.`);let o=[];r===`include`&&o.push(`src`),r===`link`&&o.push(`rel`,`href`);let s=t=>{let r=v(t);for(let e of Array.from(n.attributes))r&&!o.includes(e.name)&&_(n,r,e.name);y(e,...t.childNodes)},c={...t,rootDocument:!1,maxdepth:(t?.maxdepth??100)-1};if(c.maxdepth===0)throw Error(`Maximum recursion depth reached.`);if(a.includes(`://`)||a.startsWith(`//`))this.log(`Including remote file from absolute path:`,a),await this.preprocessRemote(a,c).then(s);else if(t?.dirpath?.includes(`://`)||t?.dirpath?.startsWith(`//`)){let e=a.startsWith(`/`)?a:`${t.dirpath}/${a}`;this.log(`Including remote file from relative path:`,e),await this.preprocessRemote(e,c).then(s)}else if(a.charAt(0)===`/`)this.log(`Including local file from absolute path:`,a),await this.preprocessLocal(a,c).then(s);else{let e=t?.dirpath&&t?.dirpath!==`.`?`${t?.dirpath}/${a}`:a;this.log(`Including local file from relative path:`,e),await this.preprocessLocal(e,c).then(s)}},n.rebaseRelativePaths=function(n,r){let i=n,a=i.tagName?.toLowerCase();if(!r?.dirpath)return;let s=l(i,`src`),c=l(i,`href`),u=d(i,`render`,`:`),f=s||c||u;if(!f||!te(f))return;let m=`${r.dirpath}/${f}`;this.log(`Rebasing relative path as:`,m),u?ee(i,`render`,m,`:`):o(i,`attribs`)?p(i,s?`src`:`href`,m):a===`img`?i.src=m:a===`a`?e.setHref(i,m):a===`source`||a===`audio`||a===`video`||a===`track`||a===`input`?i.src=m:a===`area`?t.setHref(i,m):this.log(`Unable to rebase relative path for element:`,a)},n.registerCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=(l(n,`is`)||l(n,`alt`))?.toLowerCase();if([`template`,`div`].includes(r)&&i){if(r===`div`&&l(n,`role`)!==`template`)return;if(!this._customElements.has(i)){this.log(`Registering custom element: ${i}\n`,T(n,128));let e=n.content||n,r=Array.from(a(e));for(let e=1;e<r.length;e++)O.rebaseRelativePaths.call(this,r[e],t);this._customElements.set(i,n),n?.parentNode&&S(n.parentNode,n)}}},n.resolveCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=r;if(i===`div`&&(i=l(n,`role`)?.toLowerCase()||i),i&&this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,T(n,128));let t=this._customElements.get(i),o=(t.content||t).cloneNode(!0),s=v(o);if(s)for(let e of Array.from(n.attributes))(r!==`div`||e.name!==`role`)&&_(n,s,e.name);let c=new D(a(o)).find(e=>e.tagName?.toLowerCase()===`slot`);c&&y(c,...n.childNodes),y(e,...o.childNodes)}},n.resolveTextNodeExpressions=function(e,t){let n=e.nodeValue||``;if(e.nodeType!==3||!n?.trim())return;this.log(`Processing node content value:
3
3
  `,w(n,128));let r=new RegExp(/{{ ([^}]+) }}/gm),i=Array.from(n.matchAll(r)).map(e=>e[1]);return this.effect(function(){let t=n;for(let n of i){let r=this.eval(n,{$elem:e});t=t.replace(`{{ ${n} }}`,String(r))}e.nodeValue=t},{directive:`text`,element:e.parentElement??void 0,expression:i.join(`, `)})},n.resolveDataAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`data`,`:`);if(r){this.log(`:data attribute found in:
4
4
  `,T(e,128)),g(n,`data`,`:`);let i;o(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for node:`,T(e,64))):(i=this.subrenderer(),m(e,`renderer`,i),this.log(`Created and attached new subrenderer for node:`,T(e,64)));let s=i.eval(r,{$elem:e});if(await Promise.all(Object.entries(s).map(([e,t])=>e.startsWith(`$$`)?(i._store.get(`$rootRenderer`)||i).set(e,t):i.set(e,t,!0))),i===this)return;for(let t of a(e,this._skipNodes))this._skipNodes.add(t);await i.mount(e,t)}},n.resolveClassAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`class`,`:`);if(r){this.log(`:class attribute found in:
5
5
  `,T(e,128)),g(n,`class`,`:`);let t=l(n,`class`)||``;return this.effect(function(){let i=this.eval(r,{$elem:e});p(n,`class`,(i?`${t} ${i}`:t).trim())},{directive:`class`,element:n,expression:r})}},n.resolveTextAttributes=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`text`,`:`);if(r){this.log(`:text attribute found in:
@@ -13,7 +13,7 @@ import{safeAnchorEl as e,safeAreaEl as t,safeElement as n}from"safevalues/dom";i
13
13
  `,T(e,128)),g(n,`if`,`:`);let t=this.createComment(` :if placeholder `,e.ownerDocument);this.effect(function(){this.eval(r,{$elem:e})?!n.parentNode&&t.parentNode&&y(t,n):n.parentNode&&y(n,t)},{directive:`:if`,element:n,expression:r})}},n.resolveShowAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`show`,`:`);if(r){this.log(`:show attribute found in:
14
14
  `,T(e,128)),g(n,`show`,`:`);let t=n.style?.display===`none`?``:n.style?.display??l(n,`style`)?.split(`;`)?.find(e=>e.split(`:`)[0]===`display`)?.split(`:`)?.at(1)?.trim();this.effect(function(){let i=this.eval(r,{$elem:e});n.style?n.style.display=i?t:`none`:p(n,`style`,`display: ${i?t:`none`};`)},{directive:`:show`,element:n,expression:r})}},n.resolveCustomAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:attr:`,i=`data-attr-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`attribute found in:
15
15
  `,T(e,128)),h(n,t.name);let a=(t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``;this.effect(function(){f(n,a,this.eval(t.value,{$elem:e}))},{directive:`:attr:${a}`,element:n,expression:t.value})}}},n.resolveCustomProperty=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:prop:`,i=`data-prop-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`property found in:
16
- `,T(e,128)),h(n,t.name);let a=c((t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``);this.effect(function(){m(n,a,this.eval(t.value,{$elem:e}))},{directive:`:prop:${a}`,element:n,expression:t.value})}}},n.stripTypes=(e,t)=>{let n=e;l(n,`:types`)&&h(n,`:types`),l(n,`data-types`)&&h(n,`data-types`)},n.resolveRenderAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`render`,`:`);if(!r)return;this.log(`:render attribute found: ${r}`),g(n,`render`,`:`);let i;o(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for :render:`,T(e,64))):(i=this.subrenderer(),m(n,`renderer`,i)),await i.mount(e,t);for(let t of a(e,this._skipNodes))this._skipNodes.add(t);try{let e=await import(r);typeof e.default==`function`?await e.default(n,i):e.default!==void 0&&console.warn(`Module ${r} default export is not a function`)}catch(e){console.error(`Failed to execute render init from ${r}:`,e)}}})(k||={});function A(){return new URL(globalThis.window?.location?.href||`http://localhost/`)}function te(e){return e.substring(2)}function j(e){return`\$\$${e}`}function M(e){return e.keys().filter(e=>e.startsWith(`$$`))}async function ne(e,t){for(let[n,r]of t.searchParams.entries()){let t=j(n);e.get(t)!==r&&await e.set(t,r)}}function N(e,t,n){let r=te(t),i=!1;if(!n)e.searchParams.has(r)&&(e.searchParams.delete(r),i=!0);else{let t=String(n);e.searchParams.get(r)!==t&&(e.searchParams.set(r,t),i=!0)}return i}function P(e,t){let n=!1;for(let r of M(t))N(e,r,t.get(r))&&(n=!0);n&&globalThis.window?.history?.replaceState({},``,e.toString())}function F(e){return async()=>{let t=A(),n=new Set;for(let[r,i]of t.searchParams.entries()){let t=j(r);n.add(t),e.get(t)!==i&&e.set(t,i)}let r=M(e);for(let t of r)n.has(t)||e.del(t)}}async function re(e){let t=A();await ne(e,t),P(t,e),e.addKeyHandler(/^\$\$/,(e,t)=>{let n=A();N(n,e,t)&&globalThis.window?.history?.replaceState({},``,n.toString())}),globalThis.window?.addEventListener(`popstate`,F(e))}
16
+ `,T(e,128)),h(n,t.name);let a=c((t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``);this.effect(function(){m(n,a,this.eval(t.value,{$elem:e}))},{directive:`:prop:${a}`,element:n,expression:t.value})}}},n.stripTypes=(e,t)=>{let n=e;l(n,`:types`)&&h(n,`:types`),l(n,`data-types`)&&h(n,`data-types`)},n.resolveRenderAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=d(n,`render`,`:`);if(!r)return;this.log(`:render attribute found: ${r}`),g(n,`render`,`:`);let i;o(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for :render:`,T(e,64))):(i=this.subrenderer(),m(n,`renderer`,i)),await i.mount(e,t);for(let t of a(e,this._skipNodes))this._skipNodes.add(t);try{let e=await import(r);typeof e.default==`function`?await e.default(n,i):e.default!==void 0&&console.warn(`Module ${r} default export is not a function`)}catch(e){console.error(`Failed to execute render init from ${r}:`,e)}}})(O||={});function k(){return new URL(globalThis.window?.location?.href||`http://localhost/`)}function ne(e){return e.substring(2)}function A(e){return`\$\$${e}`}function j(e){return e.keys().filter(e=>e.startsWith(`$$`))}async function M(e,t){for(let[n,r]of t.searchParams.entries()){let t=A(n);e.get(t)!==r&&await e.set(t,r)}}function N(e,t,n){let r=ne(t),i=!1;if(!n)e.searchParams.has(r)&&(e.searchParams.delete(r),i=!0);else{let t=String(n);e.searchParams.get(r)!==t&&(e.searchParams.set(r,t),i=!0)}return i}function re(e,t){let n=!1;for(let r of j(t))N(e,r,t.get(r))&&(n=!0);n&&globalThis.window?.history?.replaceState({},``,e.toString())}function P(e){return async()=>{let t=k(),n=new Set;for(let[r,i]of t.searchParams.entries()){let t=A(r);n.add(t),e.get(t)!==i&&e.set(t,i)}let r=j(e);for(let t of r)n.has(t)||e.del(t)}}async function F(e){let t=k();await M(e,t),re(t,e),e.addKeyHandler(/^\$\$/,(e,t)=>{let n=k();N(n,e,t)&&globalThis.window?.history?.replaceState({},``,n.toString())}),globalThis.window?.addEventListener(`popstate`,P(e))}
17
17
  /*
18
18
  * @license
19
19
  * Portions Copyright (c) 2013, the Dart project authors.
@@ -24,7 +24,7 @@ const I=new Set([`this`,`typeof`]),ie=new Set([`in`]),ae=new Set([`+`,`-`,`!`,`t
24
24
  * Portions Copyright (c) 2013, the Dart project authors.
25
25
  */
26
26
  const B=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),V=new Set([`===`,`!==`]);let H=function(e){return e[e.STRING=1]=`STRING`,e[e.IDENTIFIER=2]=`IDENTIFIER`,e[e.DOT=3]=`DOT`,e[e.COMMA=4]=`COMMA`,e[e.COLON=5]=`COLON`,e[e.INTEGER=6]=`INTEGER`,e[e.DECIMAL=7]=`DECIMAL`,e[e.OPERATOR=8]=`OPERATOR`,e[e.GROUPER=9]=`GROUPER`,e[e.KEYWORD=10]=`KEYWORD`,e[e.ARROW=11]=`ARROW`,e[e.OPTIONAL_DOT=12]=`OPTIONAL_DOT`,e[e.SPREAD=13]=`SPREAD`,e}({});const U=(e,t,n=0)=>({kind:e,value:t,precedence:n}),W=e=>e===9||e===10||e===13||e===32,G=e=>{if(e===95||e===36)return!0;let t=e&-33;return 65<=t&&t<=90},ce=e=>G(e)||K(e),le=e=>I.has(e),ue=e=>e===34||e===39,K=e=>48<=e&&e<=57,de=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,fe=e=>e===40||e===41||e===91||e===93||e===123||e===125,pe=e=>e.replace(/\\(.)/g,(e,t)=>{switch(t){case`n`:return`
27
- `;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var me=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;W(this._next??-1);)this._advance(!0);if(ue(this._next??-1))return this._tokenizeString();if(G(this._next??-1))return this._tokenizeIdentOrKeyword();if(K(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(de(this._next??-1))return this._tokenizeOperator();if(fe(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=U(H.STRING,pe(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(ce(this._next??-1));let e=this._getValue();return U(le(e)?H.KEYWORD:ie.has(e)?H.OPERATOR:H.IDENTIFIER,e,L[e]??0)}_tokenizeNumber(){do this._advance();while(K(this._next??-1));return this._next===46?this._tokenizeDot():U(H.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),K(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),U(H.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),U(H.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),U(H.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),U(H.COLON,`:`)}_tokenizeFraction(){do this._advance();while(K(this._next??-1));return U(H.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(V.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),U(H.ARROW,e);B.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?U(H.OPTIONAL_DOT,e,13):U(H.OPERATOR,e,L[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=U(H.GROUPER,e,L[e]);return this._advance(!0),t}};const he=(e,t)=>new ge(e,t).parse();var ge=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new me(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(H.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(H.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(H.DOT)||this._matches(H.OPTIONAL_DOT)){let t=this._kind===H.OPTIONAL_DOT;if(this._advance(),t&&this._matches(H.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(H.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(H.KEYWORD))break;else if(this._matches(H.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!oe.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===H.OPERATOR||this._kind===H.DOT||this._kind===H.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(H.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(H.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(H.INTEGER))return this._parseInteger(e);if(this._matches(H.DECIMAL))return this._parseDecimal(e)}if(!e||!ae.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(H.OPERATOR,`?`);let t=this._parseExpression();this._advance(H.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case H.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw I.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case H.IDENTIFIER:return this._parseInvokeOrIdentifier();case H.STRING:return this._parseString();case H.INTEGER:return this._parseInteger();case H.DECIMAL:return this._parseDecimal();case H.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case H.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(H.GROUPER,`]`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(H.GROUPER,`}`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(H.STRING)||this._matches(H.IDENTIFIER))&&this._advance(),this._matches(H.COLON)){this._advance(H.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(H.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(H.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(H.GROUPER,`)`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(H.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(H.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}};const q=Symbol(`__computed__`);function _e(e){return typeof e==`object`&&!!e&&q in e&&e[q]===!0}var ve=class{timeouts=new Map;debounce(e,t){return new Promise((n,r)=>{let i=this.timeouts.get(t);i&&clearTimeout(i),this.timeouts.set(t,setTimeout(()=>{try{n(t()),this.timeouts.delete(t)}catch(e){r(e)}},e))})}};const ye=new z,J=`__is_proxy__`;function Y(e){return e instanceof $||e[J]===!0}function X(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return X(n.get(`$parent`),t)}function Z(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?Z(n.get(`$parent`),t):null}function Q(e,t,n){let r=Z(e,t);r?r._store.set(t,n):e._store.set(t,n)}var $=class e extends ve{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapObject(e,t){return e==null||Y(e)||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof Promise||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||typeof Node<`u`&&e instanceof Node?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{if(Reflect.get(e,n,i)===r)return!0;typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,n,r)=>{if(n===J)return!0;let i=Reflect.get(e,n,r);if(typeof i==`object`&&i&&!Y(i)){let a=this.wrapObject(i,t);if(a!==i)return Reflect.set(e,n,a,r),a}return i}})}watch(e,t){let n=Z(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),Array.from(n.observers.get(e)||[]).some(e=>e.observer===t)||n.observers.get(e)?.add({observer:t,store:this})}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=Z(this,e),r=Array.from(n?.observers.get(e)||[]);await this.debounce(t,()=>Promise.all(r.map(e=>e.observer.call(e.store.proxify(e.observer)))))}get(e,t){return t&&this.watch(e,t),X(this,e)}setupComputed(e,t){let n=this;this.effect(function(){let r=t.call(this,this);if(n._store.get(e)!==r){Q(n,e,r);let t=Z(n,e),i=Array.from(t?.observers.get(e)||[]);for(let e of i)e.observer.call(e.store.proxify(e.observer))}})}async set(e,t,n){if(_e(t)){this.setupComputed(e,t.fn);return}if(this._store.has(e)&&t===this._store.get(e))return;let r=()=>this.notify(e);if(t&&typeof t==`object`&&(t=this.wrapObject(t,r)),n?this._store.set(e,t):Q(this,e,t),!n){for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t))}await r()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}getObserverStats(){let e={},t=0;for(let[n,r]of this.observers)e[n]=r.size,t+=r.size;return{totalKeys:this.observers.size,totalObservers:t,byKey:e}}effect(e,t){return e.call(this.proxify(e))}$computed(e){return{[q]:!0,fn:e}}proxify(t){let n=Array.from(this._store.entries()).map(([e])=>e),r=Object.fromEntries(n.map(e=>[e,null])),i=(e,t,n)=>typeof e==`function`&&t!==`constructor`?(...t)=>e.call(n,...t):e;return new Proxy(r,{has:(e,t)=>typeof t==`string`&&(Z(this,t)||Reflect.has(this,t))?!0:Reflect.has(r,t),get:(n,r,a)=>{if(typeof r==`string`){if(Z(this,r)){let n=this.get(r,t);return t&&n instanceof e?n.proxify(t):i(n,r,a)}if(t&&r!==J&&!Reflect.has(this,r))return this.set(r,void 0),this.get(r,t)}return r===`$`?this.proxify(t):i(Reflect.get(this,r,a),r,a)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=he(e,ye),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},be=class e extends ${_debugLevel=`off`;dirpath=``;_perfData={lifecycle:{},effects:new Map};static DEBUG_LEVELS=[`off`,`lifecycle`,`effects`,`verbose`];_skipNodes=new Set;_customElements=new Map;_pendingValueRetries=[];debug(e){return typeof e==`boolean`?this._debugLevel=e?`lifecycle`:`off`:this._debugLevel=e,this}get debugging(){return this._debugLevel!==`off`}shouldLog(t){return e.DEBUG_LEVELS.indexOf(this._debugLevel)>=e.DEBUG_LEVELS.indexOf(t)}clearPerformanceReport(){this._perfData={lifecycle:{},effects:new Map}}getNodePath(e){let t=[],n=e;for(;n?.tagName;){let e=n.tagName.toLowerCase(),r=n.parentElement;if(r){let i=Array.from(r.children).filter(t=>t.tagName.toLowerCase()===e);if(i.length>1){let r=i.indexOf(n)+1;t.unshift(`${e}:nth-child(${r})`)}else t.unshift(e)}else t.unshift(e);n=r}return t.join(`>`)}buildEffectId(e){let t=e?.directive??`unknown`,n=w(e?.expression??``,32),r=e?.element;return`${t}:${r?r.dataset?.perfid??r.id??r.dataset?.testid??this.getNodePath(r):`unknown`}:${n}`}recordEffectExecution(e,t){let n=this.buildEffectId(e),r=this._perfData.effects.get(n)??{count:0,totalTime:0};r.count++,r.totalTime+=t,this._perfData.effects.set(n,r)}getPerformanceReport(){let e=Array.from(this._perfData.effects.entries()),t={};for(let[n,r]of e){let e=n.split(`:`)[0];t[e]||(t[e]={count:0,totalTime:0}),t[e].count+=r.count,t[e].totalTime+=r.totalTime}let n=e.map(([e,t])=>({id:e,executionCount:t.count,totalTime:t.totalTime,avgTime:t.count>0?t.totalTime/t.count:0})).sort((e,t)=>t.totalTime-e.totalTime).slice(0,10);return{lifecycle:this._perfData.lifecycle,effects:{total:e.length,byDirective:t,slowest:n},observers:this.getObserverStats()}}effect(e,t){if(!this.shouldLog(`lifecycle`))return super.effect(e,t);let n=performance.now(),r=super.effect(e,t),i=performance.now()-n;return t&&this.recordEffectExecution(t,i),i>16&&console.warn(`Slow effect (${i.toFixed(1)}ms):`,this.buildEffectId(t)),this.shouldLog(`effects`)&&console.debug(`Effect (${i.toFixed(2)}ms):`,this.buildEffectId(t)),r}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
28
- `,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:E(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}async preprocessLocal(e,t){let n=await this.fetchLocal(e,t);return this.preprocessString(n,{...t,dirpath:E(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}subrenderer(){let e=new this.constructor().debug(this.debugging);return e._store.set(`$parent`,this),e._store.set(`$rootRenderer`,this.get(`$rootRenderer`)??this),e._customElements=this._customElements,e}log(...e){this.shouldLog(`verbose`)&&console.debug(...e)}async preprocessNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;t={dirpath:this.dirpath,maxdepth:10,...t};let r=new O(a(e,this._skipNodes)).map(async e=>{this.log(`Preprocessing node:
29
- `,T(e,128)),await k.resolveIncludes.call(this,e,t),await k.rebaseRelativePaths.call(this,e,t),await k.registerCustomElements.call(this,e,t),await k.resolveCustomElements.call(this,e,t)});return await Promise.all(r.generator()),n&&(this._perfData.lifecycle.preprocessTime=(this._perfData.lifecycle.preprocessTime??0)+(performance.now()-n)),e}async renderNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;for(let n of a(e,this._skipNodes))this.log(`Rendering node:
30
- `,T(n,128)),await k.resolveForAttribute.call(this,n,t),await k.resolveRenderAttribute.call(this,n,t),await k.resolveDataAttribute.call(this,n,t),await k.resolveTextAttributes.call(this,n,t),await k.resolveHtmlAttribute.call(this,n,t),await k.resolveIfAttribute.call(this,n,t),await k.resolveShowAttribute.call(this,n,t),await k.resolveClassAttribute.call(this,n,t),await k.resolveBindAttribute.call(this,n,t),await k.resolveEventAttributes.call(this,n,t),await k.resolveTextNodeExpressions.call(this,n,t),await k.resolveCustomAttribute.call(this,n,t),await k.resolveCustomProperty.call(this,n,t),await k.stripTypes.call(this,n,t);for(let e of this._pendingValueRetries.splice(0))e();return n&&(this._perfData.lifecycle.renderTime=(this._perfData.lifecycle.renderTime??0)+(performance.now()-n)),e}async mount(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;n&&this.clearPerformanceReport(),t={...t,rootNode:e},m(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await re(this),await this.preprocessNode(e,t),await this.renderNode(e,t),n&&(this._perfData.lifecycle.mountTime=performance.now()-n)}};export{E as n,be as t};
27
+ `;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var me=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;W(this._next??-1);)this._advance(!0);if(ue(this._next??-1))return this._tokenizeString();if(G(this._next??-1))return this._tokenizeIdentOrKeyword();if(K(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(de(this._next??-1))return this._tokenizeOperator();if(fe(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=U(H.STRING,pe(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(ce(this._next??-1));let e=this._getValue();return U(le(e)?H.KEYWORD:ie.has(e)?H.OPERATOR:H.IDENTIFIER,e,L[e]??0)}_tokenizeNumber(){do this._advance();while(K(this._next??-1));return this._next===46?this._tokenizeDot():U(H.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),K(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),U(H.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),U(H.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),U(H.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),U(H.COLON,`:`)}_tokenizeFraction(){do this._advance();while(K(this._next??-1));return U(H.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(V.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),U(H.ARROW,e);B.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?U(H.OPTIONAL_DOT,e,13):U(H.OPERATOR,e,L[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=U(H.GROUPER,e,L[e]);return this._advance(!0),t}};const he=(e,t)=>new ge(e,t).parse();var ge=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new me(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(H.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(H.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(H.DOT)||this._matches(H.OPTIONAL_DOT)){let t=this._kind===H.OPTIONAL_DOT;if(this._advance(),t&&this._matches(H.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(H.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(H.KEYWORD))break;else if(this._matches(H.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!oe.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===H.OPERATOR||this._kind===H.DOT||this._kind===H.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(H.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(H.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(H.INTEGER))return this._parseInteger(e);if(this._matches(H.DECIMAL))return this._parseDecimal(e)}if(!e||!ae.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(H.OPERATOR,`?`);let t=this._parseExpression();this._advance(H.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case H.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw I.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case H.IDENTIFIER:return this._parseInvokeOrIdentifier();case H.STRING:return this._parseString();case H.INTEGER:return this._parseInteger();case H.DECIMAL:return this._parseDecimal();case H.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case H.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(H.GROUPER,`]`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(H.GROUPER,`}`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(H.STRING)||this._matches(H.IDENTIFIER))&&this._advance(),this._matches(H.COLON)){this._advance(H.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(H.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(H.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(H.GROUPER,`)`))break;if(this._matches(H.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(H.COMMA));return this._advance(H.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(H.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(H.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}};const q=Symbol(`__computed__`);function _e(e){return typeof e==`object`&&!!e&&q in e&&e[q]===!0}const ve=new z,J=`__is_proxy__`;function Y(e){return e instanceof $||e[J]===!0}function X(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return X(n.get(`$parent`),t)}function Z(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?Z(n.get(`$parent`),t):null}function Q(e,t,n){let r=Z(e,t);r?r._store.set(t,n):e._store.set(t,n)}var $=class e{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_store=new Map;_lock=Promise.resolve();_notify=new Map;constructor(e){for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapObject(e,t){return e==null||Y(e)||Object.isFrozen(e)||Object.isSealed(e)||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof Promise||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||typeof Node<`u`&&e instanceof Node?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{if(Reflect.get(e,n,i)===r)return!0;typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,n,r)=>{if(n===J)return!0;let i=Reflect.get(e,n,r);if(typeof i==`object`&&i&&!Y(i)){let a=this.wrapObject(i,t);if(a!==i)return Reflect.set(e,n,a,r),a}return i}})}watch(e,t){let n=Z(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),Array.from(n.observers.get(e)||[]).some(e=>e.observer===t)||n.observers.get(e)?.add({observer:t,store:this})}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=Z(this,e),r=Array.from(n?.observers.get(e)||[]),i=this._notify.get(e);if(i!==`executing`)return i&&clearTimeout(i),new Promise(n=>{this._notify.set(e,setTimeout(async()=>{this._notify.set(e,`executing`);try{await Promise.all(r.map(e=>e.observer.call(e.store.proxify(e.observer))))}finally{this._notify.delete(e)}n()},t))})}get(e,t){return t&&this.watch(e,t),X(this,e)}setupComputed(e,t){let n=this;this.effect(function(){let r=t.call(this,this);if(n._store.get(e)!==r){Q(n,e,r);let t=Z(n,e),i=Array.from(t?.observers.get(e)||[]);for(let e of i)e.observer.call(e.store.proxify(e.observer))}})}async set(e,t,n){if(_e(t)){this.setupComputed(e,t.fn);return}if(this._store.has(e)&&t===this._store.get(e))return;let r=()=>this.notify(e);if(t&&typeof t==`object`&&(t=this.wrapObject(t,r)),n?this._store.set(e,t):Q(this,e,t),!n){for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t))}await r()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}getObserverStats(){let e={},t=0;for(let[n,r]of this.observers)e[n]=r.size,t+=r.size;return{totalKeys:this.observers.size,totalObservers:t,byKey:e}}effect(e,t){return e.call(this.proxify(e))}$computed(e){return{[q]:!0,fn:e}}proxify(t){let n=Array.from(this._store.entries()).map(([e])=>e),r=Object.fromEntries(n.map(e=>[e,null])),i=(e,t,n)=>typeof e==`function`&&t!==`constructor`?(...t)=>e.call(n,...t):e;return new Proxy(r,{has:(e,t)=>typeof t==`string`&&(Z(this,t)||Reflect.has(this,t))?!0:Reflect.has(r,t),get:(n,r,a)=>{if(typeof r==`string`){if(Z(this,r)){let n=this.get(r,t);return t&&n instanceof e?n.proxify(t):i(n,r,a)}if(t&&r!==J&&!Reflect.has(this,r))return this.set(r,void 0),this.get(r,t)}return r===`$`?this.proxify(t):i(Reflect.get(this,r,a),r,a)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=he(e,ve),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},ye=class e extends ${_debugLevel=`off`;dirpath=``;_perfData={lifecycle:{},effects:new Map};static DEBUG_LEVELS=[`off`,`lifecycle`,`effects`,`verbose`];_skipNodes=new Set;_customElements=new Map;_pendingValueRetries=[];debug(e){return typeof e==`boolean`?this._debugLevel=e?`lifecycle`:`off`:this._debugLevel=e,this}get debugging(){return this._debugLevel!==`off`}shouldLog(t){return e.DEBUG_LEVELS.indexOf(this._debugLevel)>=e.DEBUG_LEVELS.indexOf(t)}clearPerformanceReport(){this._perfData={lifecycle:{},effects:new Map}}getNodePath(e){let t=[],n=e;for(;n?.tagName;){let e=n.tagName.toLowerCase(),r=n.parentElement;if(r){let i=Array.from(r.children).filter(t=>t.tagName.toLowerCase()===e);if(i.length>1){let r=i.indexOf(n)+1;t.unshift(`${e}:nth-child(${r})`)}else t.unshift(e)}else t.unshift(e);n=r}return t.join(`>`)}buildEffectId(e){let t=e?.directive??`unknown`,n=w(e?.expression??``,32),r=e?.element;return`${t}:${r?r.dataset?.perfid??r.id??r.dataset?.testid??this.getNodePath(r):`unknown`}:${n}`}recordEffectExecution(e,t){let n=this.buildEffectId(e),r=this._perfData.effects.get(n)??{count:0,totalTime:0};r.count++,r.totalTime+=t,this._perfData.effects.set(n,r)}getPerformanceReport(){let e=Array.from(this._perfData.effects.entries()),t={};for(let[n,r]of e){let e=n.split(`:`)[0];t[e]||(t[e]={count:0,totalTime:0}),t[e].count+=r.count,t[e].totalTime+=r.totalTime}let n=e.map(([e,t])=>({id:e,executionCount:t.count,totalTime:t.totalTime,avgTime:t.count>0?t.totalTime/t.count:0})).sort((e,t)=>t.totalTime-e.totalTime).slice(0,10);return{lifecycle:this._perfData.lifecycle,effects:{total:e.length,byDirective:t,slowest:n},observers:this.getObserverStats()}}effect(e,t){if(!this.shouldLog(`lifecycle`))return super.effect(e,t);let n=performance.now(),r=super.effect(e,t),i=performance.now()-n;return t&&this.recordEffectExecution(t,i),i>16&&console.warn(`Slow effect (${i.toFixed(1)}ms):`,this.buildEffectId(t)),this.shouldLog(`effects`)&&console.debug(`Effect (${i.toFixed(2)}ms):`,this.buildEffectId(t)),r}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
28
+ `,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:E(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}async preprocessLocal(e,t){let n=await this.fetchLocal(e,t);return this.preprocessString(n,{...t,dirpath:E(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}subrenderer(){let e=new this.constructor().debug(this.debugging);return e._store.set(`$parent`,this),e._store.set(`$rootRenderer`,this.get(`$rootRenderer`)??this),e._customElements=this._customElements,e}log(...e){this.shouldLog(`verbose`)&&console.debug(...e)}async preprocessNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;t={dirpath:this.dirpath,maxdepth:10,...t};let r=new D(a(e,this._skipNodes)).map(async e=>{this.log(`Preprocessing node:
29
+ `,T(e,128)),await O.resolveIncludes.call(this,e,t),await O.rebaseRelativePaths.call(this,e,t),await O.registerCustomElements.call(this,e,t),await O.resolveCustomElements.call(this,e,t)});return await Promise.all(r.generator()),n&&(this._perfData.lifecycle.preprocessTime=(this._perfData.lifecycle.preprocessTime??0)+(performance.now()-n)),e}async renderNode(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;for(let n of a(e,this._skipNodes))this.log(`Rendering node:
30
+ `,T(n,128)),await O.resolveForAttribute.call(this,n,t),await O.resolveRenderAttribute.call(this,n,t),await O.resolveDataAttribute.call(this,n,t),await O.resolveTextAttributes.call(this,n,t),await O.resolveHtmlAttribute.call(this,n,t),await O.resolveIfAttribute.call(this,n,t),await O.resolveShowAttribute.call(this,n,t),await O.resolveClassAttribute.call(this,n,t),await O.resolveBindAttribute.call(this,n,t),await O.resolveEventAttributes.call(this,n,t),await O.resolveTextNodeExpressions.call(this,n,t),await O.resolveCustomAttribute.call(this,n,t),await O.resolveCustomProperty.call(this,n,t),await O.stripTypes.call(this,n,t);for(let e of this._pendingValueRetries.splice(0))e();return n&&(this._perfData.lifecycle.renderTime=(this._perfData.lifecycle.renderTime??0)+(performance.now()-n)),e}async mount(e,t){let n=this.shouldLog(`lifecycle`)?performance.now():0;n&&this.clearPerformanceReport(),t={...t,rootNode:e},m(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await F(this),await this.preprocessNode(e,t),await this.renderNode(e,t),n&&(this._perfData.lifecycle.mountTime=performance.now()-n)}};export{E as n,ye as t};
@@ -1,4 +1,4 @@
1
- import { a as StoreState, i as IRenderer, n as RenderParams, t as ParserParams } from "./interfaces-BR8ZL61m.js";
1
+ import { a as StoreState, i as IRenderer, n as RenderParams, t as ParserParams } from "./interfaces-BcLK40e4.js";
2
2
 
3
3
  //#region src/safe_browser.d.ts
4
4
  declare class Renderer<T extends StoreState = StoreState> extends IRenderer<T> {
@@ -1 +1 @@
1
- import{n as e,t}from"./renderer-OrXcTBG0.js";import{safeDomParser as n}from"safevalues/dom";import{HtmlSanitizerBuilder as r}from"safevalues";const i=`:data,:for,:text,:html,:show,:if,:class,:bind,:render,:on:click,:on:click.prevent,:on:input,:on:input.prevent,:on:change,:on:change.prevent,:on:submit,:on:submit.prevent,:attr:src,:attr:href,:attr:title,:attr:data-testid,:prop:src,:prop:href,:prop:checked,:prop:selected,:prop:disabled`.split(`,`),a=e=>`data-${e.slice(1).replace(`:`,`-`)}`,o=i.map(e=>a(e)),s=[`data-testid`,`data-perfid`],c=[...o,...s];var l=class extends t{impl=`safe_browser`;dirpath=e(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){for(let t of i)e=e.replace(RegExp(`\\s:${t.slice(1)}=`,`g`),` data-${t.slice(1).replace(`:`,`-`)}=`);e=e.replace(/<include(.*) src="([^"]+)"(.*)><\/include>/g,`<link $1 rel="subresource" href="$2" $3>`),e=e.replace(/<template is="([^"]+)">([\s\S]*)<\/template>/g,`<div role="template" alt="$1">$2</div>`),e=e.replace(/<(\w+)-(\w+)(.*)>([\s\S]*)<\/(\w+)-(\w+)>/g,`<div role="$1-$2" $3>$4</div>`);let a=new r().allowDataAttributes(c).allowClassAttributes().allowStyleAttributes().build();if(this.log(`parseHTML`,e),this.log(`sanitized`,String(a.sanitize(e))),t.rootDocument){let t=new DOMParser;return n.parseFromString(t,a.sanitize(e),`text/html`)}else return a.sanitizeToFragment(e)}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};const u=new l;export{u as Mancha,l as Renderer};
1
+ import{n as e,t}from"./renderer-RfUkDfVD.js";import{safeDomParser as n}from"safevalues/dom";import{HtmlSanitizerBuilder as r}from"safevalues";const i=`:data,:for,:text,:html,:show,:if,:class,:bind,:render,:on:click,:on:click.prevent,:on:input,:on:input.prevent,:on:change,:on:change.prevent,:on:submit,:on:submit.prevent,:attr:src,:attr:href,:attr:title,:attr:data-testid,:prop:src,:prop:href,:prop:checked,:prop:selected,:prop:disabled`.split(`,`),a=e=>`data-${e.slice(1).replace(`:`,`-`)}`,o=i.map(e=>a(e)),s=[`data-testid`,`data-perfid`],c=[...o,...s];var l=class extends t{impl=`safe_browser`;dirpath=e(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){for(let t of i)e=e.replace(RegExp(`\\s:${t.slice(1)}=`,`g`),` data-${t.slice(1).replace(`:`,`-`)}=`);e=e.replace(/<include(.*) src="([^"]+)"(.*)><\/include>/g,`<link $1 rel="subresource" href="$2" $3>`),e=e.replace(/<template is="([^"]+)">([\s\S]*)<\/template>/g,`<div role="template" alt="$1">$2</div>`),e=e.replace(/<(\w+)-(\w+)(.*)>([\s\S]*)<\/(\w+)-(\w+)>/g,`<div role="$1-$2" $3>$4</div>`);let a=new r().allowDataAttributes(c).allowClassAttributes().allowStyleAttributes().build();if(this.log(`parseHTML`,e),this.log(`sanitized`,String(a.sanitize(e))),t.rootDocument){let t=new DOMParser;return n.parseFromString(t,a.sanitize(e),`text/html`)}else return a.sanitizeToFragment(e)}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};const u=new l;export{u as Mancha,l as Renderer};
package/dist/store.d.ts CHANGED
@@ -38,7 +38,6 @@ type SignalStoreProxy = SignalStore & InternalStoreState & {
38
38
  export type ReactiveContext<T extends StoreState = StoreState> = SignalStore<T> & InternalStoreState & T & Record<string, unknown>;
39
39
  type Observer<T> = (this: SignalStoreProxy) => T;
40
40
  type KeyValueHandler = (this: SignalStoreProxy, key: string, value: unknown) => void;
41
- type AnyFunction = (...args: unknown[]) => unknown;
42
41
  /** Symbol used to identify computed value markers. */
43
42
  declare const COMPUTED_MARKER: unique symbol;
44
43
  /** Function type for computed value definitions. Receives reactive context as `$` parameter. */
@@ -48,23 +47,24 @@ export interface ComputedMarker<R> {
48
47
  [COMPUTED_MARKER]: true;
49
48
  fn: ComputedFn<StoreState, R>;
50
49
  }
51
- declare abstract class IDebouncer {
52
- timeouts: Map<AnyFunction, ReturnType<typeof setTimeout>>;
53
- debounce<T>(millis: number, callback: () => T | Promise<T>): Promise<T>;
54
- }
55
- /** Default debouncer time in millis. */
50
+ /** Default notification debounce time in millis. */
56
51
  export declare const REACTIVE_DEBOUNCE_MILLIS = 10;
57
52
  export declare function getAncestorValue(store: SignalStore | null, key: string): unknown;
58
53
  export declare function getAncestorKeyStore(store: SignalStore | null, key: string): SignalStore | null;
59
54
  export declare function setAncestorValue(store: SignalStore, key: string, value: unknown): void;
60
55
  export declare function setNestedProperty(obj: Record<string, unknown>, path: string, value: unknown): void;
61
- export declare class SignalStore<T extends StoreState = StoreState> extends IDebouncer {
56
+ export declare class SignalStore<T extends StoreState = StoreState> {
62
57
  protected readonly evalkeys: string[];
63
58
  protected readonly expressionCache: Map<string, EvalFunction>;
64
59
  protected readonly observers: Map<string, Set<ObserverEntry>>;
65
60
  protected readonly keyHandlers: Map<RegExp, Set<KeyValueHandler>>;
66
61
  readonly _store: Map<string, unknown>;
67
62
  _lock: Promise<void>;
63
+ /**
64
+ * Notification state per key. Value is a pending timeout, or "executing"
65
+ * when observers are running. Used to debounce and prevent infinite loops.
66
+ */
67
+ private readonly _notify;
68
68
  constructor(data?: T);
69
69
  private wrapObject;
70
70
  watch<T>(key: string, observer: Observer<T>): void;
package/dist/store.js CHANGED
@@ -8,26 +8,7 @@ function isComputedMarker(value) {
8
8
  COMPUTED_MARKER in value &&
9
9
  value[COMPUTED_MARKER] === true);
10
10
  }
11
- class IDebouncer {
12
- timeouts = new Map();
13
- debounce(millis, callback) {
14
- return new Promise((resolve, reject) => {
15
- const timeout = this.timeouts.get(callback);
16
- if (timeout)
17
- clearTimeout(timeout);
18
- this.timeouts.set(callback, setTimeout(() => {
19
- try {
20
- resolve(callback());
21
- this.timeouts.delete(callback);
22
- }
23
- catch (exc) {
24
- reject(exc);
25
- }
26
- }, millis));
27
- });
28
- }
29
- }
30
- /** Default debouncer time in millis. */
11
+ /** Default notification debounce time in millis. */
31
12
  export const REACTIVE_DEBOUNCE_MILLIS = 10;
32
13
  /** Shared AST factory. */
33
14
  const AST_FACTORY = new expressions.EvalAstFactory();
@@ -79,15 +60,19 @@ export function setNestedProperty(obj, path, value) {
79
60
  }
80
61
  current[keys[keys.length - 1]] = value;
81
62
  }
82
- export class SignalStore extends IDebouncer {
63
+ export class SignalStore {
83
64
  evalkeys = ["$elem", "$event"];
84
65
  expressionCache = new Map();
85
66
  observers = new Map();
86
67
  keyHandlers = new Map();
87
68
  _store = new Map();
88
69
  _lock = Promise.resolve();
70
+ /**
71
+ * Notification state per key. Value is a pending timeout, or "executing"
72
+ * when observers are running. Used to debounce and prevent infinite loops.
73
+ */
74
+ _notify = new Map();
89
75
  constructor(data) {
90
- super();
91
76
  for (const [key, value] of Object.entries(data || {})) {
92
77
  // Use our set method to ensure that callbacks and wrappers are appropriately set, but ignore
93
78
  // the return value since we know that no observers will be triggered.
@@ -98,6 +83,10 @@ export class SignalStore extends IDebouncer {
98
83
  // Skip nulls and already-proxified objects.
99
84
  if (obj == null || isProxified(obj))
100
85
  return obj;
86
+ // Skip frozen/sealed objects - they can't be modified and proxying them would
87
+ // violate JS invariants (get trap must return actual value for non-configurable props).
88
+ if (Object.isFrozen(obj) || Object.isSealed(obj))
89
+ return obj;
101
90
  // Skip built-in types that don't work well with proxies (have internal slots).
102
91
  // User-defined class instances are allowed since their properties are just data.
103
92
  if (obj instanceof Date ||
@@ -173,11 +162,30 @@ export class SignalStore extends IDebouncer {
173
162
  this.keyHandlers.get(pattern)?.add(handler);
174
163
  }
175
164
  async notify(key, debounceMillis = REACTIVE_DEBOUNCE_MILLIS) {
165
+ // Capture observers NOW (at call time). This ensures constructor calls
166
+ // don't trigger effects registered later.
176
167
  const owner = getAncestorKeyStore(this, key);
177
168
  const entries = Array.from(owner?.observers.get(key) || []);
178
- await this.debounce(debounceMillis, () =>
179
- // Call each observer with its original store context to ensure proper binding.
180
- Promise.all(entries.map((entry) => entry.observer.call(entry.store.proxify(entry.observer)))));
169
+ const current = this._notify.get(key);
170
+ // Skip if observers are already executing for this key (prevents infinite loops).
171
+ if (current === "executing")
172
+ return;
173
+ // Clear any pending notification (debounce).
174
+ if (current)
175
+ clearTimeout(current);
176
+ // Schedule the notification.
177
+ return new Promise((resolve) => {
178
+ this._notify.set(key, setTimeout(async () => {
179
+ this._notify.set(key, "executing");
180
+ try {
181
+ await Promise.all(entries.map((entry) => entry.observer.call(entry.store.proxify(entry.observer))));
182
+ }
183
+ finally {
184
+ this._notify.delete(key);
185
+ }
186
+ resolve();
187
+ }, debounceMillis));
188
+ });
181
189
  }
182
190
  get(key, observer) {
183
191
  if (observer)
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAqDtD,sDAAsD;AACtD,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAc/C,2DAA2D;A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CAAC,OAAO,EAAE;aACf,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;aACvB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACd,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACd,KAAK,CAAC,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACb,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC;QAEJ,OAAO,KAAK,CAAC;IACd,CAAC;CACD"}
@@ -126,6 +126,43 @@ $.items = [];
126
126
  $.items.length = 0; // No observer triggered - already empty
127
127
  ```
128
128
 
129
+ ### Deep Reactivity
130
+
131
+ `mancha` supports deep reactivity for nested objects within arrays. When you modify a property of an object inside an array, observers are triggered automatically:
132
+
133
+ ```js
134
+ $.items = [
135
+ { name: "a", visible: false },
136
+ { name: "b", visible: true },
137
+ ];
138
+
139
+ // Modifying nested properties triggers observers
140
+ $.items[0].visible = true; // Observers triggered
141
+ $.items[1].name = "c"; // Observers triggered
142
+ ```
143
+
144
+ This also works with user-defined class instances:
145
+
146
+ ```js
147
+ class Item {
148
+ constructor(name, visible) {
149
+ this.name = name;
150
+ this.visible = visible;
151
+ }
152
+ toggle() {
153
+ this.visible = !this.visible;
154
+ }
155
+ }
156
+
157
+ $.items = [new Item("a", false), new Item("b", true)];
158
+
159
+ // Property changes trigger observers
160
+ $.items[0].visible = true; // Observers triggered
161
+
162
+ // Class methods work and trigger reactivity
163
+ $.items[0].toggle(); // Observers triggered
164
+ ```
165
+
129
166
  ### Replacing vs. Mutating
130
167
 
131
168
  When you assign a new array or object, observers always trigger because the reference changes:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mancha",
3
- "version": "0.20.5",
3
+ "version": "0.20.7",
4
4
  "description": "Javscript HTML rendering engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",