@vireo-ai/trellis-ui 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/package.json +1 -1
  2. package/packages/client/src/components/data-grid/styles.css +0 -16
  3. package/packages/client/src/components/panels/styles.css +2 -10
  4. package/packages/client/src/styles/components.css +1 -1
  5. package/packages/client/src/styles/generated/theme-fonts.css +1 -1
  6. package/packages/client/src/styles/generated/theme-palette.css +275 -59
  7. package/packages/client/src/styles/generated/theme-runtime.css +1007 -24
  8. package/packages/client/src/styles/generated-sources.css +1 -1
  9. package/packages/client/src/styles/recipes/selection.css +62 -12
  10. package/packages/client/src/styles/theme-support.css +23 -2
  11. package/packages/client/types/components/accordion/index.d.ts +3 -3
  12. package/packages/client/types/components/accordion/machine.d.ts +11 -7
  13. package/packages/client/types/components/app/contract.d.ts +5 -5
  14. package/packages/client/types/components/box/contract.d.ts +2 -2
  15. package/packages/client/types/components/card/contract.d.ts +2 -2
  16. package/packages/client/types/components/common.d.ts +3 -3
  17. package/packages/client/types/components/container/contract.d.ts +1 -1
  18. package/packages/client/types/components/date-picker/contract.d.ts +2 -2
  19. package/packages/client/types/components/date-picker/machine.d.ts +2 -2
  20. package/packages/client/types/components/flex/contract.d.ts +1 -1
  21. package/packages/client/types/components/frame/contract.d.ts +2 -2
  22. package/packages/client/types/components/grid/contract.d.ts +1 -1
  23. package/packages/client/types/components/layout.d.ts +2 -2
  24. package/packages/client/types/components/menu/contract.d.ts +4 -2
  25. package/packages/client/types/components/modal/contract.d.ts +2 -2
  26. package/packages/client/types/components/section/contract.d.ts +1 -1
  27. package/packages/client/types/components/select/contract.d.ts +2 -2
  28. package/packages/client/types/components/select/machine.d.ts +2 -2
  29. package/packages/client/types/components/sidebar/contract.d.ts +3 -3
  30. package/packages/client/types/components/stack/contract.d.ts +1 -1
  31. package/packages/client/types/components/tooltip/contract.d.ts +2 -2
  32. package/packages/client/types/runtime/engine/stream.d.ts +1 -0
  33. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +3278 -265
  34. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  35. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +343 -342
  36. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
  37. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
  38. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-B7n3PcSH.js → capability-motion-BGVnZE_T.js} +2 -2
  39. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-B7n3PcSH.js.map → capability-motion-BGVnZE_T.js.map} +1 -1
  40. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-BgPVyFfh.js → capability-sortable-ehmPfdn1.js} +2 -2
  41. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-BgPVyFfh.js.map → capability-sortable-ehmPfdn1.js.map} +1 -1
  42. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-CBK89mIt.js +2 -0
  43. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-CBK89mIt.js.map +1 -0
  44. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-CYvnO__o.js → core-Ybm_WmKr.js} +2 -2
  45. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-CYvnO__o.js.map → core-Ybm_WmKr.js.map} +1 -1
  46. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BAghaHV-.js +2 -0
  47. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BAghaHV-.js.map +1 -0
  48. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D-2vjhTV.js → entry.generated-BREj4oHG.js} +2 -2
  49. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BREj4oHG.js.map +1 -0
  50. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DSWnCzSX.js → entry.generated-BZWdGtgg.js} +2 -2
  51. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DSWnCzSX.js.map → entry.generated-BZWdGtgg.js.map} +1 -1
  52. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CwuIK_Zx.js → entry.generated-COp9wMCd.js} +2 -2
  53. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CwuIK_Zx.js.map → entry.generated-COp9wMCd.js.map} +1 -1
  54. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dfm1775-.js → entry.generated-CVOYoh61.js} +2 -2
  55. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dfm1775-.js.map → entry.generated-CVOYoh61.js.map} +1 -1
  56. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-d1MxpnFh.js → entry.generated-CVWqQEed.js} +2 -2
  57. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-d1MxpnFh.js.map → entry.generated-CVWqQEed.js.map} +1 -1
  58. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BXvp4vUv.js → entry.generated-C_ObpRjR.js} +2 -2
  59. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BXvp4vUv.js.map → entry.generated-C_ObpRjR.js.map} +1 -1
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BLduYCHm.js → entry.generated-C_SxTqg5.js} +2 -2
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BLduYCHm.js.map → entry.generated-C_SxTqg5.js.map} +1 -1
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B4lDxzh9.js → entry.generated-Cb-VMAE1.js} +2 -2
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-B4lDxzh9.js.map → entry.generated-Cb-VMAE1.js.map} +1 -1
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaC7gw-h.js → entry.generated-CfYgsDun.js} +2 -2
  65. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaC7gw-h.js.map → entry.generated-CfYgsDun.js.map} +1 -1
  66. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dcm3s3ey.js → entry.generated-D2es_Wi2.js} +2 -2
  67. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Dcm3s3ey.js.map → entry.generated-D2es_Wi2.js.map} +1 -1
  68. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6ai6meC.js +2 -0
  69. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6ai6meC.js.map +1 -0
  70. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CheA8dXD.js → entry.generated-DYQxGle9.js} +2 -2
  71. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CheA8dXD.js.map → entry.generated-DYQxGle9.js.map} +1 -1
  72. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_jeOgRf.js +2 -0
  73. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_jeOgRf.js.map +1 -0
  74. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DuY9bHje.js → entry.generated-DqL-zI7j.js} +2 -2
  75. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DuY9bHje.js.map → entry.generated-DqL-zI7j.js.map} +1 -1
  76. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C3y5qBcc.js → entry.generated-EqHVGr1d.js} +2 -2
  77. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C3y5qBcc.js.map → entry.generated-EqHVGr1d.js.map} +1 -1
  78. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-z3EbXrD0.js +2 -0
  79. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-z3EbXrD0.js.map +1 -0
  80. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-BGTjVnQy.js → flip-Bzn312Nc.js} +2 -2
  81. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-BGTjVnQy.js.map → flip-Bzn312Nc.js.map} +1 -1
  82. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-fU4E5Q4w.js → motion-DI5H1Js0.js} +3 -3
  83. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-fU4E5Q4w.js.map → motion-DI5H1Js0.js.map} +1 -1
  84. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-C9PrQrca.js → styles-CQDZhwd_.js} +2 -2
  85. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-C9PrQrca.js.map → styles-CQDZhwd_.js.map} +1 -1
  86. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{ui-B3f-Nt9P.js → ui-CTQoglp3.js} +2 -2
  87. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CTQoglp3.js.map +1 -0
  88. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
  89. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/checkbox.js +1 -1
  90. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
  91. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
  92. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
  93. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/field.js +1 -1
  94. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
  95. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/input.js +1 -1
  96. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
  97. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
  98. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
  99. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
  100. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
  101. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/slider.js +1 -1
  102. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/switch.js +1 -1
  103. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
  104. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
  105. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
  106. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
  107. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
  108. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +129 -129
  109. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +5 -5
  110. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +5 -5
  111. package/packages/client/src/styles/layout-participation.css +0 -17
  112. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js +0 -2
  113. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js.map +0 -1
  114. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BlsLkwW8.js +0 -2
  115. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BlsLkwW8.js.map +0 -1
  116. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CC-C5gQn.js +0 -2
  117. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CC-C5gQn.js.map +0 -1
  118. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D-2vjhTV.js.map +0 -1
  119. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QFVPoffg.js +0 -2
  120. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-QFVPoffg.js.map +0 -1
  121. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-pfUkaGe1.js +0 -2
  122. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-pfUkaGe1.js.map +0 -1
  123. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-B3f-Nt9P.js.map +0 -1
@@ -1,17 +0,0 @@
1
- @layer components {
2
- [data-ui-layout-participation="shrink"] {
3
- flex: 0 1 auto;
4
- min-block-size: 0;
5
- min-inline-size: 0;
6
- }
7
-
8
- [data-ui-layout-participation="fill"] {
9
- flex: 1 1 0%;
10
- min-block-size: 0;
11
- min-inline-size: 0;
12
- }
13
-
14
- [data-ui-layout-participation="fixed"] {
15
- flex: 0 0 auto;
16
- }
17
- }
@@ -1,2 +0,0 @@
1
- var e=[`xs`,`sm`,`md`,`lg`,`xlg`],t=[`outline`,`filled`,`plain`],n=[`outline`,`solid`,`mini`,`micro`],r=[`button`,`submit`,`reset`],i=[`start`,`center`,`end`],a=[`bottom`,`top`,`left`,`right`],o=[`top`,`right`,`bottom`,`left`],s=[`vertical`,`horizontal`],c=[`leading`,`trailing`,`center`,`top-leading`,`top-trailing`,`bottom-leading`,`bottom-trailing`],l=[`default`],u=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],d=[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`,`13`],f={inherit:`text-inherit`,muted:`text-surface-ink-muted`,subtle:`text-surface-ink-muted`,accent:`text-intent-accent-text`,danger:`text-intent-danger-text`};Object.fromEntries(d.map(e=>[e,`text-${e}`])),f.muted,f.subtle,f.accent,f.danger;var p=[`0`,`0.5`,`1`,`1.5`,`2`,`2.5`,`3`,`3.5`,`4`,`4.5`,`5`,`5.5`,`6`,`6.5`,`7`,`7.5`,`8`,`8.5`,`9`,`9.5`,`10`,`10.5`,`11`,`11.5`,`12`],m=e=>Object.fromEntries(p.map(t=>[t,t===`0`?``:`${e}-${t}`])),h=m(`gap`),g=m(`gap-x`),_=m(`gap-y`),v=m(`p`),y=m(`px`),b=m(`py`),x=m(`m`),S=m(`mx`),C=m(`my`),w=[`none`,`xs`,`sm`,`md`,`lg`,`full`],T=[`inherit`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`+1`,`+2`,`+3`,`+4`,`+5`,`+6`,`+7`,`+8`],E=[`none`,`match`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`],D=e=>Object.fromEntries(E.map(t=>[t,`[${e}:${t===`none`?`var(--shadow-elevation-0)`:t===`match`?`var(--ui-matched-elevation)`:`var(--shadow-elevation-${t})`}]`])),O={none:``,xs:`rounded-control-xs`,sm:`rounded-control-sm`,md:`rounded-control-md`,lg:`rounded-control-lg`,full:`rounded-full`},k={xs:`font-control text-control-xs [font-weight:var(--font-weight-control-xs)]`,sm:`font-control text-control-sm [font-weight:var(--font-weight-control-sm)]`,md:`font-control text-control-md [font-weight:var(--font-weight-control-md)]`,lg:`font-control text-control-lg [font-weight:var(--font-weight-control-lg)]`,xlg:`font-control text-control-xlg [font-weight:var(--font-weight-control-xlg)]`};`${k.xs}`,`${k.sm}`,`${k.md}`,`${k.lg}`,`${k.xlg}`;var A={xs:`min-h-control-xs px-control-padding-xs ${k.xs}`,sm:`min-h-control-sm px-control-padding-sm ${k.sm}`,md:`min-h-control-md px-control-padding-md ${k.md}`,lg:`min-h-control-lg px-control-padding-lg ${k.lg}`,xlg:`min-h-control-xlg px-control-padding-xlg ${k.xlg}`};`${k.xs}`,`${k.sm}`,`${k.md}`,`${k.lg}`,`${k.xlg}`;var j=[`flex w-full min-w-0 items-center gap-control-gap outline-none`],M=[`border-0 bg-transparent p-0 text-inherit outline-none`],N=[`inline-flex size-control-xs shrink-0 items-center justify-center rounded-control-sm border-0 bg-transparent`,`text-current outline-none`],P=[`w-full border-0 bg-transparent text-inherit outline-none`],F=[`absolute left-0 top-0 z-popover m-0 grid h-auto`,`outline-none`],I=[`ui-interactive:hover:bg-interaction-hover`,`ui-interactive:ui-active:bg-interaction-pressed`,`ui-interactive:ui-selected:bg-interaction-selected`,`ui-interactive:ui-selected:hover:bg-interaction-selected-hover`],L=[`neutral`,`accent`],R=[`tonal`,`edge`,`combined`],z=[`flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-control-sm px-menu-item-padding-inline`,`text-left font-menu-item text-menu-item [font-weight:var(--font-weight-menu-item)] outline-none`,`data-disabled:pointer-events-none`],B=`size-icon shrink-0 fill-current text-current opacity-70`,V=`ml-auto shrink-0 font-metadata text-metadata [font-weight:var(--font-weight-metadata)] text-current opacity-70`,H=`ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100`;export{p as A,D as B,_ as C,v as D,C as E,s as F,F as I,a as L,H as M,z as N,y as O,V as P,L as R,g as S,S as T,n as _,O as a,I as b,t as c,E as d,N as f,u as g,j as h,A as i,B as j,b as k,l,P as m,r as n,e as o,M as p,w as r,k as s,i as t,o as u,c as v,x as w,h as x,R as y,T as z};
2
- //# sourceMappingURL=common-De1R7Xh6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-De1R7Xh6.js","names":[],"sources":["../../../../../../../../client/src/components/common.ts"],"sourcesContent":["const CONTROL_SIZES = ['xs', 'sm', 'md', 'lg', 'xlg'] as const;\nconst CONTROL_VARIANTS = ['outline', 'filled', 'plain'] as const;\nconst ICON_VARIANTS = ['outline', 'solid', 'mini', 'micro'] as const;\nconst BUTTON_TYPES = ['button', 'submit', 'reset'] as const;\nconst ALIGNMENTS = ['start', 'center', 'end'] as const;\nconst POSITIONS = ['bottom', 'top', 'left', 'right'] as const;\nconst EDGE_POSITIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ORIENTATIONS = ['vertical', 'horizontal'] as const;\nconst INDICATOR_PLACEMENTS = ['leading', 'trailing', 'center', 'top-leading', 'top-trailing', 'bottom-leading', 'bottom-trailing'] as const;\nconst DEFAULT_VARIANTS = ['default'] as const;\nconst HEADING_LEVELS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nconst TYPOGRAPHY_SIZES = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'] as const;\nconst TYPOGRAPHY_WEIGHTS = ['normal', 'medium', 'semibold', 'bold'] as const;\nconst TYPOGRAPHY_FONTS = ['body', 'heading', 'mono'] as const;\nconst TEXT_FONTS = ['body', 'mono'] as const;\nconst TYPOGRAPHY_COLORS = ['inherit', 'muted', 'subtle', 'accent', 'danger'] as const;\nconst ICON_COLORS = TYPOGRAPHY_COLORS;\ntype TypographyColor = typeof TYPOGRAPHY_COLORS[number];\ntype IconColor = typeof ICON_COLORS[number];\nconst TYPOGRAPHY_COLOR_CLASSES = {\n inherit: 'text-inherit',\n muted: 'text-surface-ink-muted',\n subtle: 'text-surface-ink-muted',\n accent: 'text-intent-accent-text',\n danger: 'text-intent-danger-text',\n} as const satisfies Record<TypographyColor, string>;\ntype TypographySize = typeof TYPOGRAPHY_SIZES[number];\ntype TypographyWeight = typeof TYPOGRAPHY_WEIGHTS[number];\ntype TypographyFont = typeof TYPOGRAPHY_FONTS[number];\ntype TextFont = typeof TEXT_FONTS[number];\nconst TYPOGRAPHY_SIZE_CLASSES = Object.fromEntries(\n TYPOGRAPHY_SIZES.map((size) => [size, `text-${size}`]),\n) as Record<TypographySize, string>;\nconst TYPOGRAPHY_WEIGHT_CLASSES = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n} as const satisfies Record<TypographyWeight, string>;\nconst TYPOGRAPHY_FONT_CLASSES = {\n body: 'font-body',\n heading: 'font-heading',\n mono: 'font-mono',\n} as const satisfies Record<TypographyFont, string>;\nconst ICON_COLOR_CLASSES = {\n inherit: 'text-current',\n muted: TYPOGRAPHY_COLOR_CLASSES.muted,\n subtle: TYPOGRAPHY_COLOR_CLASSES.subtle,\n accent: TYPOGRAPHY_COLOR_CLASSES.accent,\n danger: TYPOGRAPHY_COLOR_CLASSES.danger,\n} as const satisfies Record<IconColor, string>;\nconst LAYOUT_SPACES = [\n '0', '0.5', '1', '1.5', '2', '2.5', '3', '3.5', '4', '4.5', '5', '5.5', '6', '6.5',\n '7', '7.5', '8', '8.5', '9', '9.5', '10', '10.5', '11', '11.5', '12',\n] as const;\ntype LayoutSpace = typeof LAYOUT_SPACES[number];\nconst layoutSpaceClasses = (prefix: string): Record<LayoutSpace, string> => Object.fromEntries(\n LAYOUT_SPACES.map((space) => [space, space === '0' ? '' : `${prefix}-${space}`]),\n) as Record<LayoutSpace, string>;\nconst LAYOUT_GAP_CLASSES = layoutSpaceClasses('gap');\nconst LAYOUT_GAP_X_CLASSES = layoutSpaceClasses('gap-x');\nconst LAYOUT_GAP_Y_CLASSES = layoutSpaceClasses('gap-y');\nconst LAYOUT_PADDING_CLASSES = layoutSpaceClasses('p');\nconst LAYOUT_PADDING_X_CLASSES = layoutSpaceClasses('px');\nconst LAYOUT_PADDING_Y_CLASSES = layoutSpaceClasses('py');\nconst LAYOUT_MARGIN_CLASSES = layoutSpaceClasses('m');\nconst LAYOUT_MARGIN_X_CLASSES = layoutSpaceClasses('mx');\nconst LAYOUT_MARGIN_Y_CLASSES = layoutSpaceClasses('my');\nconst COMPONENT_RADII = ['none', 'xs', 'sm', 'md', 'lg', 'full'] as const;\nconst ABSOLUTE_SURFACE_REFERENCES = ['0', '1', '2', '3', '4', '5', '6', '7', '8'] as const;\nconst SURFACE_REFERENCES = [\n 'inherit', ...ABSOLUTE_SURFACE_REFERENCES,\n '+1', '+2', '+3', '+4', '+5', '+6', '+7', '+8',\n] as const;\nconst ELEVATION_REFERENCES = ['none', 'match', '1', '2', '3', '4', '5', '6', '7', '8'] as const;\ntype SurfaceReference = typeof SURFACE_REFERENCES[number];\ntype AbsoluteSurfaceReference = typeof ABSOLUTE_SURFACE_REFERENCES[number];\ntype ElevationReference = typeof ELEVATION_REFERENCES[number];\nconst elevationReferenceClasses = (property: `--${string}`): Record<ElevationReference, string> => Object.fromEntries(\n ELEVATION_REFERENCES.map((reference) => {\n const value = reference === 'none'\n ? 'var(--shadow-elevation-0)'\n : reference === 'match'\n ? 'var(--ui-matched-elevation)'\n : `var(--shadow-elevation-${reference})`;\n return [reference, `[${property}:${value}]`];\n }),\n) as Record<ElevationReference, string>;\nconst SURFACE_RADIUS_CLASSES = {\n none: '',\n xs: 'rounded-surface-xs',\n sm: 'rounded-surface-sm',\n md: 'rounded-surface-md',\n lg: 'rounded-surface-lg',\n full: 'rounded-full',\n} as const satisfies Record<typeof COMPONENT_RADII[number], string>;\nconst CONTROL_RADIUS_CLASSES = {\n none: '',\n xs: 'rounded-control-xs',\n sm: 'rounded-control-sm',\n md: 'rounded-control-md',\n lg: 'rounded-control-lg',\n full: 'rounded-full',\n} as const satisfies Record<typeof COMPONENT_RADII[number], string>;\nconst CONTROL_TYPOGRAPHY_CLASSES = {\n xs: 'font-control text-control-xs [font-weight:var(--font-weight-control-xs)]',\n sm: 'font-control text-control-sm [font-weight:var(--font-weight-control-sm)]',\n md: 'font-control text-control-md [font-weight:var(--font-weight-control-md)]',\n lg: 'font-control text-control-lg [font-weight:var(--font-weight-control-lg)]',\n xlg: 'font-control text-control-xlg [font-weight:var(--font-weight-control-xlg)]',\n} as const;\nconst CONTROL_SIZE_CLASSES = {\n xs: `h-control-xs px-control-padding-xs ${CONTROL_TYPOGRAPHY_CLASSES.xs}`,\n sm: `h-control-sm px-control-padding-sm ${CONTROL_TYPOGRAPHY_CLASSES.sm}`,\n md: `h-control-md px-control-padding-md ${CONTROL_TYPOGRAPHY_CLASSES.md}`,\n lg: `h-control-lg px-control-padding-lg ${CONTROL_TYPOGRAPHY_CLASSES.lg}`,\n xlg: `h-control-xlg px-control-padding-xlg ${CONTROL_TYPOGRAPHY_CLASSES.xlg}`,\n};\nconst CONTROL_MIN_SIZE_CLASSES = {\n xs: `min-h-control-xs px-control-padding-xs ${CONTROL_TYPOGRAPHY_CLASSES.xs}`,\n sm: `min-h-control-sm px-control-padding-sm ${CONTROL_TYPOGRAPHY_CLASSES.sm}`,\n md: `min-h-control-md px-control-padding-md ${CONTROL_TYPOGRAPHY_CLASSES.md}`,\n lg: `min-h-control-lg px-control-padding-lg ${CONTROL_TYPOGRAPHY_CLASSES.lg}`,\n xlg: `min-h-control-xlg px-control-padding-xlg ${CONTROL_TYPOGRAPHY_CLASSES.xlg}`,\n};\nconst CONTROL_MULTILINE_SIZE_CLASSES = {\n xs: `min-h-control-multiline-xs px-control-padding-xs py-1 ${CONTROL_TYPOGRAPHY_CLASSES.xs}`,\n sm: `min-h-control-multiline-sm px-control-padding-sm py-1.5 ${CONTROL_TYPOGRAPHY_CLASSES.sm}`,\n md: `min-h-control-multiline-md px-control-padding-md py-2 ${CONTROL_TYPOGRAPHY_CLASSES.md}`,\n lg: `min-h-control-multiline-lg px-control-padding-lg py-2 ${CONTROL_TYPOGRAPHY_CLASSES.lg}`,\n xlg: `min-h-control-multiline-xlg px-control-padding-xlg py-2 ${CONTROL_TYPOGRAPHY_CLASSES.xlg}`,\n};\nconst FIELD_CONTROL_ROOT_CLASSES = [\n 'flex w-full min-w-0 items-center gap-control-gap outline-none',\n];\nconst FIELD_CONTROL_MULTILINE_ROOT_CLASSES = [\n 'flex w-full min-w-0 gap-control-gap outline-none',\n];\nconst FIELD_CONTROL_INPUT_CLASSES = [\n 'border-0 bg-transparent p-0 text-inherit outline-none',\n];\nconst FIELD_CONTROL_ACTION_CLASSES = [\n 'inline-flex size-control-xs shrink-0 items-center justify-center rounded-control-sm border-0 bg-transparent',\n 'text-current outline-none',\n];\nconst FIELD_CONTROL_NATIVE_CLASSES = [\n 'w-full border-0 bg-transparent text-inherit outline-none',\n];\nconst FIELD_LABEL_CLASSES = 'font-label text-label [font-weight:var(--font-weight-label)] text-label-ink';\nconst FIELD_DESCRIPTION_CLASSES = 'font-description text-description [font-weight:var(--font-weight-description)] text-surface-ink-muted';\nconst POPOVER_GEOMETRY_CLASSES = [\n 'absolute left-0 top-0 z-popover m-0 grid h-auto',\n 'outline-none',\n];\nconst INTERACTIVE_ITEM_CLASSES = [\n 'ui-interactive:hover:bg-interaction-hover',\n 'ui-interactive:ui-active:bg-interaction-pressed',\n 'ui-interactive:ui-selected:bg-interaction-selected',\n 'ui-interactive:ui-selected:hover:bg-interaction-selected-hover',\n];\nconst SELECTION_COLORS = ['neutral', 'accent'] as const;\nconst INTERACTION_TREATMENTS = ['tonal', 'edge', 'combined'] as const;\nconst OPTION_ITEM_CLASSES = [\n 'flex h-menu-item w-full cursor-default select-none items-center gap-2 rounded-control-sm px-menu-item-padding-inline',\n 'text-left font-menu-item text-menu-item [font-weight:var(--font-weight-menu-item)] outline-none',\n 'data-disabled:pointer-events-none',\n];\nconst OPTION_ICON_CLASSES = 'size-icon shrink-0 fill-current text-current opacity-70';\nconst OPTION_META_CLASSES = 'ml-auto shrink-0 font-metadata text-metadata [font-weight:var(--font-weight-metadata)] text-current opacity-70';\nconst OPTION_INDICATOR_CLASSES = 'ml-auto size-icon shrink-0 fill-current text-current opacity-0 data-selected:opacity-100';\n\ntype ControlSize = typeof CONTROL_SIZES[number];\ntype ControlVariant = typeof CONTROL_VARIANTS[number];\ntype IconVariant = typeof ICON_VARIANTS[number];\ntype CommonButtonType = typeof BUTTON_TYPES[number];\ntype Alignment = typeof ALIGNMENTS[number];\ntype Position = typeof POSITIONS[number];\ntype EdgePosition = typeof EDGE_POSITIONS[number];\ntype Orientation = typeof ORIENTATIONS[number];\ntype IndicatorPlacement = typeof INDICATOR_PLACEMENTS[number];\ntype SelectionColor = typeof SELECTION_COLORS[number];\ntype InteractionTreatment = typeof INTERACTION_TREATMENTS[number];\ntype DefaultVariant = typeof DEFAULT_VARIANTS[number];\ntype HeadingLevel = typeof HEADING_LEVELS[number];\ntype ComponentRadius = typeof COMPONENT_RADII[number];\n\nexport {\n ABSOLUTE_SURFACE_REFERENCES,\n ALIGNMENTS,\n BUTTON_TYPES,\n COMPONENT_RADII,\n CONTROL_RADIUS_CLASSES,\n CONTROL_MIN_SIZE_CLASSES,\n CONTROL_MULTILINE_SIZE_CLASSES,\n CONTROL_SIZES,\n CONTROL_SIZE_CLASSES,\n CONTROL_TYPOGRAPHY_CLASSES,\n CONTROL_VARIANTS,\n DEFAULT_VARIANTS,\n EDGE_POSITIONS,\n ELEVATION_REFERENCES,\n FIELD_CONTROL_ACTION_CLASSES,\n FIELD_CONTROL_INPUT_CLASSES,\n FIELD_CONTROL_MULTILINE_ROOT_CLASSES,\n FIELD_CONTROL_NATIVE_CLASSES,\n FIELD_CONTROL_ROOT_CLASSES,\n FIELD_DESCRIPTION_CLASSES,\n FIELD_LABEL_CLASSES,\n elevationReferenceClasses,\n HEADING_LEVELS,\n ICON_COLORS,\n ICON_COLOR_CLASSES,\n ICON_VARIANTS,\n INDICATOR_PLACEMENTS,\n INTERACTION_TREATMENTS,\n INTERACTIVE_ITEM_CLASSES,\n LAYOUT_GAP_CLASSES,\n LAYOUT_GAP_X_CLASSES,\n LAYOUT_GAP_Y_CLASSES,\n LAYOUT_MARGIN_CLASSES,\n LAYOUT_MARGIN_X_CLASSES,\n LAYOUT_MARGIN_Y_CLASSES,\n LAYOUT_PADDING_CLASSES,\n LAYOUT_PADDING_X_CLASSES,\n LAYOUT_PADDING_Y_CLASSES,\n LAYOUT_SPACES,\n OPTION_ICON_CLASSES,\n OPTION_INDICATOR_CLASSES,\n OPTION_ITEM_CLASSES,\n OPTION_META_CLASSES,\n ORIENTATIONS,\n POPOVER_GEOMETRY_CLASSES,\n POSITIONS,\n SELECTION_COLORS,\n SURFACE_RADIUS_CLASSES,\n SURFACE_REFERENCES,\n TEXT_FONTS,\n TYPOGRAPHY_COLOR_CLASSES,\n TYPOGRAPHY_COLORS,\n TYPOGRAPHY_FONT_CLASSES,\n TYPOGRAPHY_FONTS,\n TYPOGRAPHY_SIZE_CLASSES,\n TYPOGRAPHY_SIZES,\n TYPOGRAPHY_WEIGHT_CLASSES,\n TYPOGRAPHY_WEIGHTS,\n};\nexport type {InteractionTreatment, SelectionColor};\nexport type {\n AbsoluteSurfaceReference,\n Alignment,\n CommonButtonType,\n ComponentRadius,\n ControlSize,\n ControlVariant,\n DefaultVariant,\n EdgePosition,\n ElevationReference,\n HeadingLevel,\n IconColor,\n IconVariant,\n IndicatorPlacement,\n LayoutSpace,\n Orientation,\n Position,\n SurfaceReference,\n TextFont,\n TypographyColor,\n TypographyFont,\n TypographySize,\n TypographyWeight,\n};\n"],"mappings":"AAAA,IAAM,EAAgB,CAAC,KAAM,KAAM,KAAM,KAAM,KAAK,EAC9C,EAAmB,CAAC,UAAW,SAAU,OAAO,EAChD,EAAgB,CAAC,UAAW,QAAS,OAAQ,OAAO,EACpD,EAAe,CAAC,SAAU,SAAU,OAAO,EAC3C,EAAa,CAAC,QAAS,SAAU,KAAK,EACtC,EAAY,CAAC,SAAU,MAAO,OAAQ,OAAO,EAC7C,EAAiB,CAAC,MAAO,QAAS,SAAU,MAAM,EAClD,EAAe,CAAC,WAAY,YAAY,EACxC,EAAuB,CAAC,UAAW,WAAY,SAAU,cAAe,eAAgB,iBAAkB,iBAAiB,E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,EAAqB,IAAK,GAMf,CAAC,EAAW,IAAI,EAAS,GALlB,IAAc,OACtB,4BACA,IAAc,QACV,8BACA,0BAA0B,EAAU,GACL,EAAE,CAC9C,CACL,EASM,EAAyB,CAC3B,KAAM,GACN,GAAI,qBACJ,GAAI,qBACJ,GAAI,qBACJ,GAAI,qBACJ,KAAM,cACV,EACM,EAA6B,CAC/B,GAAI,2EACJ,GAAI,2EACJ,GAAI,2EACJ,GAAI,2EACJ,IAAK,4EACT,EAEQ,GAAsC,EAA2B,GAAjE,EACA,GAAsC,EAA2B,GAAjE,EACA,GAAsC,EAA2B,GAAjE,EACA,GAAsC,EAA2B,GAAjE,EACC,GAAwC,EAA2B,IAAnE,EAET,IAAM,EAA2B,CAC7B,GAAI,0CAA0C,EAA2B,KACzE,GAAI,0CAA0C,EAA2B,KACzE,GAAI,0CAA0C,EAA2B,KACzE,GAAI,0CAA0C,EAA2B,KACzE,IAAK,4CAA4C,EAA2B,KAChF,EAEQ,GAAyD,EAA2B,GAApF,EACA,GAA2D,EAA2B,GAAtF,EACA,GAAyD,EAA2B,GAApF,EACA,GAAyD,EAA2B,GAApF,EACC,GAA2D,EAA2B,IAAtF,EAET,IAAM,EAA6B,CAC/B,+DACJ,EAIM,EAA8B,CAChC,uDACJ,EACM,EAA+B,CACjC,8GACA,2BACJ,EACM,EAA+B,CACjC,0DACJ,EAGM,EAA2B,CAC7B,kDACA,cACJ,EACM,EAA2B,CAC7B,4CACA,kDACA,qDACA,gEACJ,EACM,EAAmB,CAAC,UAAW,QAAQ,EACvC,EAAyB,CAAC,QAAS,OAAQ,UAAU,EACrD,EAAsB,CACxB,uHACA,kGACA,mCACJ,EACM,EAAsB,0DACtB,EAAsB,iHACtB,EAA2B"}
@@ -1,2 +0,0 @@
1
- import{i as e,r as t,s as n,t as r}from"./dom-DiTFTWeR.js";import{f as i,s as a}from"./motion-fU4E5Q4w.js";import{t as o}from"./capability-motion-B7n3PcSH.js";import{n as s}from"./morph-Cq3V_23_.js";import{a as c,f as l,l as u,n as d}from"./codecs-CQ7olTJL.js";import{i as f,t as ee}from"./alpine-machine-CE2UN4Qu.js";import{t as p}from"./focus-pk_lz9sg.js";import{t as m}from"./cleanup-manager-D9QiZF_Q.js";import{n as h,t as te}from"./alpine-data-Dvc_bXq6.js";import{n as g,t as _}from"./styles-CX2j92ex.js";import{t as ne}from"./merge-bindings-BtqW3UgP.js";import{t as v}from"./machine-CNnHDbyo.js";import{r as re}from"./focus-scope-BrYxsrhc.js";import{t as ie}from"./semantic-observer-CIoriWtV.js";import{n as ae,t as y}from"./capability-resizable-ByUbMIHF.js";var oe=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(`--breakpoint-${t}`),r=Number.parseFloat(n);return Number.isFinite(r)?r:1/0},b=[`horizontal`,`vertical`],x=[`div`,`section`,`aside`,`main`,`nav`],S=[`1`,`2`,`3`,`4`,`5`,`6`,`fill`],C=[`none`,`start`,`end`],se=[`toggle`,`expand`,`collapse`],ce={id:l.default(`ui-panels`),orientation:u(b,`horizontal`),persist:d,divider:d.default(!0),class:l},le={id:l,as:u(x,`section`),size:u(S,`fill`),resize:u(C,`none`),collapsible:d,defaultCollapsed:d,class:l},w={target:l,action:u(se,`toggle`),icon:l.default(`menu`),label:l.default(`Expand`),class:l},ue=[f({name:`opening`,state:`changing`,projectEach:e=>e.context.change.openingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),f({name:`closing`,state:`changing`,projectEach:e=>e.context.change.closingIds.map(e=>({panelId:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{expand:e=>({type:`EXPAND`,panelId:e}),collapse:e=>({type:`COLLAPSE`,panelId:e}),toggle:e=>({type:`TOGGLE`,panelId:e})}}),f({name:`sizing`,state:`sizing`,projectEach:e=>e.context.sizing.changes,onDone:`SIZE_DONE`,onError:`SIZE_ERROR`}),f({name:`persisting`,state:`persisting`,project:e=>({groupId:e.props.id,collapsed:[...e.context.layout.collapsedIds],sizes:{...e.context.layout.committedSizes}}),onDone:`PERSIST_DONE`,onError:`PERSIST_ERROR`})],T=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],E=e=>typeof e.panelId==`string`?e.panelId:``,D=e=>typeof e==`number`&&Number.isFinite(e)?e:null,O=e=>(Array.isArray(e.changes)?e.changes:[e]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=typeof t.panelId==`string`?t.panelId:``,r=D(t.from),i=D(t.to),a=t.reset===!0;return n&&r!==null&&i!==null&&(r!==i||a)?[{panelId:n,from:r,to:i,...a?{reset:!0}:{}}]:[]}),k=(e,t)=>typeof e.props==`object`&&e.props!==null?e.props:t,A=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),j=e=>{if(!Array.isArray(e))return[];let t=[];return e.forEach(e=>{if(typeof e!=`object`||!e)return;let n=e;if(typeof n.id!=`string`||!n.id)return;let r=n.collapsible===!0?{collapsible:!0,defaultCollapsed:n.defaultCollapsed===!0}:{collapsible:!1,defaultCollapsed:!1};n.kind===`fill`&&t.push({id:n.id,kind:`fill`,...r}),n.kind===`bounded`&&t.push({id:n.id,kind:`bounded`,resizable:n.resizable===!0,...r})}),t},M=e=>new Map(e.map(e=>[e.id,e])),N=(e,t)=>Object.fromEntries(e.flatMap(e=>e.kind===`bounded`&&Object.hasOwn(t,e.id)?[[e.id,t[e.id]]]:[])),P=e=>{let t=E(e.event),n=e.context.layout.collapsedIds,r=e.context.collection,i=M(r).get(t);switch(e.event.type){case`COLLAPSE`:return i?.collapsible&&!n.includes(t)?r.map(e=>e.id).filter(e=>n.includes(e)||e===t):n;case`EXPAND`:return n.filter(e=>e!==t);case`TOGGLE`:return i?.collapsible?n.includes(t)?n.filter(e=>e!==t):r.map(e=>e.id).filter(e=>n.includes(e)||e===t):n;default:return n}},F=e=>{let t=E(e.event);return M(e.context.collection).has(t)&&!A(e.context.layout.collapsedIds,P(e))},I=e=>{let t=E(e.event),n=M(e.context.collection).get(t);return n?.kind===`bounded`&&n.resizable&&!e.context.layout.collapsedIds.includes(t)&&D(e.event.size)!==null},L=e=>{let t=O(e.event),n=M(e.context.collection);return t.length>0&&t.every(({panelId:t})=>n.get(t)?.kind===`bounded`&&!e.context.layout.collapsedIds.includes(t))},R=e=>{let t=O(e.event),n=M(e.context.collection);return t.length>0&&t.every(({panelId:t})=>n.get(t)?.kind===`bounded`&&e.context.layout.collapsedIds.includes(t))},z=e=>{let t=T(e.event.ids),n=M(e.context.collection);return t.length>0&&t.every(t=>n.get(t)?.kind===`bounded`&&e.context.layout.collapsedIds.includes(t)&&Object.hasOwn(e.context.layout.committedSizes,t))},B=e=>{let t=O(e.event),n={...e.context.layout.committedSizes};return t.forEach(({panelId:e,to:t,reset:r})=>{r?delete n[e]:n[e]=t}),{context:{...e.context,layout:{...e.context.layout,committedSizes:N(e.context.collection,n)},sizing:{changes:t}}}},V=e=>{let t=O(e.event),n={...e.context.layout.committedSizes,...Object.fromEntries(t.map(({panelId:e,to:t})=>[e,t]))};return{context:{...e.context,layout:{...e.context.layout,committedSizes:N(e.context.collection,n)}}}},de=e=>{let t={...e.context.layout.committedSizes};return T(e.event.ids).forEach(e=>delete t[e]),{context:{...e.context,layout:{...e.context.layout,committedSizes:N(e.context.collection,t)}}}},H=e=>{let t=P(e),n=e.context.layout.collapsedIds;return{context:{...e.context,layout:{...e.context.layout,collapsedIds:t},change:{openingIds:n.filter(e=>!t.includes(e)),closingIds:t.filter(e=>!n.includes(e))}}}},U=e=>{let t=j(e.event.collection),n=M(e.context.collection),r=t.filter(t=>(e.context.layout.collapsedIds.includes(t.id)||!n.has(t.id)&&t.defaultCollapsed)&&t.collapsible).map(e=>e.id),i=N(t,e.context.layout.committedSizes),a=M(t).get(e.context.resize.activeId),o=a?.kind===`bounded`&&a.resizable;return{context:{...e.context,collection:t,layout:{collapsedIds:r,committedSizes:i},resize:o?e.context.resize:{activeId:``,initialSize:null,previewSize:null}}}},W=e=>{let t=M(j(e.event.collection)).get(e.context.resize.activeId);return t?.kind!==`bounded`||!t.resizable},fe=({props:e,context:t,effects:n})=>v({initial:`stable`,on:{DOM_INVALIDATED:{effects:`sync`}},states:{stable:{tags:[`stable`],on:{COLLAPSE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},EXPAND:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},SIZE:{target:`sizing`,guard:L,reduce:B,effects:`prepareSizing`},RESTORE_HIDDEN_SIZES:{guard:R,reduce:V},RESET_HIDDEN_SIZES:{target:`persisting`,guard:z,reduce:de,effects:[`sync`,`persist`]},RESIZE_START:{target:`resizing`,guard:I,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:U,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},changing:{tags:[`changing`,`transitioning`],on:{CHANGE_DONE:{target:`persisting`,effects:[`finishChange`,`persist`]},CHANGE_ERROR:{target:`persisting`,effects:[`finishChange`,`persist`]},COLLAPSE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},EXPAND:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},PANELS_CHANGED:{reduce:U,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},sizing:{tags:[`sizing`,`transitioning`],on:{SIZE_DONE:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE_ERROR:{target:`persisting`,effects:[`finishSizing`,`persist`]},SIZE:{target:`sizing`,guard:L,reduce:B,effects:`prepareSizing`},RESIZE_START:{target:`resizing`,guard:I,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:U,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},resizing:{tags:[`resizing`],on:{RESIZE:{guard:`activeResize`,reduce:`previewResize`,effects:`previewResize`},RESIZE_END:{target:`persisting`,guard:`activeResize`,reduce:`commitResize`,effects:[`commitResize`,`persist`]},RESIZE_CANCEL:{target:`stable`,reduce:`clearResize`,effects:`cancelResize`},PANELS_CHANGED:[{target:`stable`,guard:W,reduce:U,effects:[`cancelResize`,`sync`]},{reduce:U,effects:`sync`}],PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},persisting:{tags:[`persisting`],on:{PERSIST_DONE:`stable`,PERSIST_ERROR:`stable`,COLLAPSE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},EXPAND:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:F,reduce:H,effects:`prepareChange`},SIZE:{target:`sizing`,guard:L,reduce:B,effects:`prepareSizing`},PANELS_CHANGED:{reduce:U,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}}}},{props:e,context:t,reducers:{replaceProps:e=>({props:k(e.event,e.props)}),startResize:e=>{let t=D(e.event.size);return{context:{...e.context,resize:{activeId:E(e.event),initialSize:t,previewSize:t}}}},previewResize:e=>({context:{...e.context,resize:{...e.context.resize,previewSize:D(e.event.size)}}}),commitResize:e=>{let t=E(e.event),n=D(e.event.size);if(n!==null)return{context:{...e.context,layout:{...e.context.layout,committedSizes:N(e.context.collection,{...e.context.layout.committedSizes,[t]:n})},resize:{activeId:``,initialSize:null,previewSize:null}}}},clearResize:e=>({context:{...e.context,resize:{activeId:``,initialSize:null,previewSize:null}}})},guards:{activeResize:e=>E(e.event)===e.context.resize.activeId&&D(e.event.size)!==null},effects:{prepareChange:n.prepareChange,finishChange:n.finishChange,sync:n.sync,beginResize:n.beginResize,previewResize:n.previewResize,commitResize:n.commitResize,cancelResize:n.cancelResize,prepareSizing:n.prepareSizing,finishSizing:n.finishSizing,persist:n.persist}}),G=_({definition:{component:`ui.panels`,parts:{root:{base:`relative flex h-full min-h-0 w-full min-w-0`,variants:{orientation:{horizontal:`flex-row`,vertical:`flex-col`}},defaults:{orientation:`horizontal`}},panel:{base:`relative min-w-0 overflow-hidden`,variants:{orientation:{horizontal:`h-full`,vertical:`w-full`},divider:{true:``,false:``},resize:{none:``,start:``,end:``}},defaults:{orientation:`horizontal`,divider:!0,resize:`none`}},expanded:{base:`h-full min-h-0 w-full min-w-0`},collapsed:{base:`flex h-full min-h-0 w-full min-w-0 items-center justify-center overflow-hidden`},resizeHandle:{base:[`absolute z-20 touch-none border-transparent outline-none`,`hover:border-intent-neutral-edge-hover focus-visible:ui-focus-ring-inset`,`data-resizing:border-intent-neutral-edge-strong`],variants:{orientation:{horizontal:`inset-y-0 w-panel-resize-handle cursor-col-resize`,vertical:`inset-x-0 h-panel-resize-handle cursor-row-resize`},edge:{start:``,end:``}},defaults:{orientation:`horizontal`,edge:`end`}},toggle:{base:`inline-flex size-control-md items-center justify-center outline-none focus-visible:ui-focus-ring-inset`},toggleIcon:{base:`size-icon-md shrink-0`}}}}),K=new Set,q=e=>e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:{},pe=(()=>{let e=!1;return()=>{if(e||typeof document>`u`)return;let t=e=>t=>{let n=q(t);!n.__panelsNotification&&n.panelId&&K.forEach(t=>{n.groupId&&n.groupId!==t.id||t.hasPanel(n.panelId)&&t.perform(n.action??e,n.panelId,n.trigger)})};document.addEventListener(`ui:panel-collapse`,t(`collapse`)),document.addEventListener(`ui:panel-expand`,t(`expand`)),document.addEventListener(`ui:panel-toggle`,t(`toggle`)),document.addEventListener(`ui:panel-size`,e=>{let t=q(e);!t.__panelsNotification&&t.panelId&&Number.isFinite(t.size)&&K.forEach(e=>{t.groupId&&t.groupId!==e.id||e.hasPanel(t.panelId)&&e.resize(t.panelId,t.size)})}),document.addEventListener(`ui:panels-reset`,e=>{let t=q(e);t.__panelsNotification||K.forEach(e=>{t.groupId&&t.groupId!==e.id||(!t.panelId||e.hasPanel(t.panelId))&&e.reset(t.panelId)})}),e=!0}})(),me=e=>`trellis-ui:panels:${e}:v1`,he=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`&&Number.isFinite(e[1]))),J=()=>{let o=null,l=null,u=null,d=`wide`,f,h=null,_=new Set,v=new Set,y=new Map,b=new Map,x=new Map,S=new Map,C=()=>{if(!o)throw Error(`Panels has not been initialized.`);return o},se=e=>e.closest(`[data-ui-panels]`)===C(),w=()=>Array.from(C().children).flatMap(e=>{if(!(e instanceof HTMLElement)||!e.hasAttribute(`data-ui-panel`))return[];let t=e.querySelector(`:scope > [data-ui-panel-expanded]`);return!t||!se(t)?[]:[{panel:e,expanded:t,collapsed:e.querySelector(`:scope > [data-ui-panel-collapsed]`),handle:e.querySelector(`:scope > [data-ui-panel-resize-handle]`),props:c({el:e,schema:le})}]}),T=e=>w().find(t=>t.props.id===e)??null,E=()=>Q.getCommittedSnapshot().context,D=()=>Q.getCommittedSnapshot().props,O=e=>E().layout.collapsedIds.includes(e),k=()=>D().orientation===`horizontal`&&d===`stacked`,A=()=>k()?`vertical`:D().orientation,j=()=>C().dataset.orientation===`vertical`?`vertical`:`horizontal`,M=e=>{let t=e.getBoundingClientRect();return j()===`horizontal`?t.width:t.height},N=()=>{let e=w(),t=e.map(({props:e})=>e.id);if(t.some(e=>!e))throw Error(`Every Panel requires a stable id.`);if(new Set(t).size!==t.length)throw Error(`Panel ids must be unique within a Panels group.`);if(e.length>0&&!e.some(({props:e})=>e.size===`fill`))throw Error(`A Panels group requires at least one size="fill" Panel.`);if(e.some(({props:e})=>e.size===`fill`&&e.resize!==`none`))throw Error(`A size="fill" Panel cannot own a resize handle.`);return e.map(({props:e})=>{let t=e.collapsible?{collapsible:!0,defaultCollapsed:e.defaultCollapsed}:{collapsible:!1,defaultCollapsed:!1};return e.size===`fill`?{id:e.id,kind:`fill`,...t}:{id:e.id,kind:`bounded`,resizable:e.resize!==`none`,...t}})},P=e=>{let t=document.createElement(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;`,j()===`horizontal`?t.style.width=`var(${e})`:t.style.height=`var(${e})`,C().append(t);let n=M(t);return t.remove(),n},F=e=>e.props.size===`fill`?{minimum:0,maximum:1/0}:{minimum:P(`--spacing-panel-${e.props.size}-min`),maximum:P(`--spacing-panel-${e.props.size}-max`)},I=(e,t)=>{let{minimum:n,maximum:r}=F(e);return Math.min(r,Math.max(n,t))},L=()=>{let e=N();return{collection:e,layout:{collapsedIds:e.filter(e=>e.defaultCollapsed).map(({id:e})=>e),committedSizes:{}},change:{openingIds:[],closingIds:[]},resize:{activeId:``,initialSize:null,previewSize:null},sizing:{changes:[]}}},R=(e,t,n)=>{j()===`horizontal`?(e.style.minWidth=t,e.style.maxWidth=n,e.style.minHeight=``,e.style.maxHeight=``):(e.style.minHeight=t,e.style.maxHeight=n,e.style.minWidth=``,e.style.maxWidth=``)},z=e=>{e.style.flex=``,e.style.minWidth=``,e.style.maxWidth=``,e.style.minHeight=``,e.style.maxHeight=``},B=(e,t)=>{if(k()){z(e.panel);return}if(t!==void 0){e.panel.style.flex=`0 0 ${t}px`,R(e.panel,`0px`,`none`);return}if(O(e.props.id)){if(E().collection.find(({id:t})=>t===e.props.id)?.defaultCollapsed){z(e.panel);return}let t=e.collapsed?`var(--spacing-panel-collapsed)`:`0px`;e.panel.style.flex=`0 0 ${t}`,R(e.panel,t,t);return}if(e.props.size===`fill`){z(e.panel);return}let n=E().resize.activeId===e.props.id?E().resize.previewSize:E().layout.committedSizes[e.props.id];if(n==null){z(e.panel);return}let r=`${I(e,n)}px`;e.panel.style.flex=`0 1 ${r}`,R(e.panel,`var(--spacing-panel-${e.props.size}-min)`,`var(--spacing-panel-${e.props.size}-max)`)},V=(e,t)=>{e.toggleAttribute(`inert`,t),e.setAttribute(`aria-hidden`,t?`true`:`false`)},de=e=>{let t=D(),r=A(),i=O(e.props.id),a=Q.hasTag(`changing`)&&E().change.openingIds.includes(e.props.id),o=Q.hasTag(`changing`)&&E().change.closingIds.includes(e.props.id),s=!(i&&!o),c=i&&!o&&!a&&e.collapsed!==null;if(e.panel.dataset.state=i?`collapsed`:`expanded`,e.panel.dataset.orientation=r,e.panel.dataset.size=e.props.size,e.panel.dataset.resize=e.props.resize,e.panel.className=g({part:G.parts.panel,props:{orientation:r,divider:t.divider,resize:e.props.resize},className:e.props.class}),n({el:e.panel,attr:`data-collapsible`,present:e.props.collapsible}),n({el:e.panel,attr:`data-resizing`,present:E().resize.activeId===e.props.id}),B(e),e.expanded.hidden=!s,V(e.expanded,!s),e.collapsed&&(e.collapsed.hidden=!c,V(e.collapsed,!c)),e.handle){let t=k()||i||e.props.size===`fill`||e.props.resize===`none`;e.handle.dataset.orientation=r,e.handle.dataset.resizeEdge=e.props.resize,e.handle.setAttribute(`aria-label`,`Resize ${e.props.id} panel`),e.handle.toggleAttribute(`data-resize-disabled`,t),e.handle.hidden=k(),e.handle.className=g({part:G.parts.resizeHandle,props:{orientation:r,edge:e.props.resize},className:e.handle.dataset.class??``})}},H=e=>{e.forEach((t,r)=>{let i=e[r+1],a=t.props.resize===`end`||i?.props.resize===`start`;s(t.panel,`data-divider`),n({el:t.panel,attr:`data-divider`,present:D().divider&&i!==void 0&&!a})})},U=e=>{let t=e.dataset.target||``;if(!t){let t=e.closest(`[data-ui-panel]`),n=t?.closest(`[data-ui-panels]`),r=[...K].find(e=>e.id===n?.id),i=t&&r===$?T(t.id):null;return i&&r?{record:i,controller:r}:null}let n=e.dataset.groupId||e.closest(`[data-ui-panels]`)?.id,r=[...K].filter(e=>!n||e.id===n).find(e=>e.hasPanel(t)),i=r===$?T(t):null;return i&&r?{record:i,controller:r}:null},W=()=>{document.querySelectorAll(`[data-ui-panel-toggle]`).forEach(e=>{let t=U(e);if(!t||t.controller!==$)return;let n=O(t.record.props.id);e.dataset.target=t.record.props.id,e.dataset.groupId=D().id,e.dataset.state=n?`collapsed`:`expanded`,e.setAttribute(`aria-controls`,t.record.panel.id),e.setAttribute(`aria-expanded`,n?`false`:`true`),e.toggleAttribute(`disabled`,!t.record.props.collapsible)})},q=()=>{let e=D(),t=A();C().dataset.responsiveMode=d,C().dataset.layoutOrientation=t,C().style.flexDirection=t===`horizontal`?`row`:`column`,C().className=g({part:G.parts.root,props:{...e,orientation:t},className:e.class}),n({el:C(),attr:`data-resizing`,present:Q.hasTag(`resizing`)}),n({el:C(),attr:`data-transitioning`,present:Q.hasTag(`transitioning`)});let r=w();r.forEach(de),H(r),W()},J=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.collapsed?.contains(n)))return;let r=x.get(e.props.id);r?.isConnected&&e.expanded.contains(r)?p(r):(e.expanded.tabIndex=-1,p(e.expanded))},ge=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.expanded.contains(n)))return;let r=e.collapsed?re(e.collapsed)[0]:void 0,i=S.get(e.props.id),a=i?.isConnected&&!e.panel.contains(i)?i:void 0;r?p(r):a?p(a):(C().tabIndex=-1,p(C()))},_e=()=>{let e=[...E().change.openingIds,...E().change.closingIds],t=new Set(E().change.openingIds.filter(e=>{let t=T(e),n=document.activeElement;return t!==null&&t.collapsed!==null&&n instanceof HTMLElement&&t.collapsed.contains(n)})),n=new Map(e.flatMap(e=>{let t=T(e);if(!t)return[];if(E().change.closingIds.includes(e)){let n=document.activeElement;n instanceof HTMLElement&&t.expanded.contains(n)&&x.set(e,n)}return[[e,M(t.panel)]]}));q(),E().change.openingIds.forEach(e=>{let n=T(e);n&&J(n,t.has(e))}),e.forEach(e=>{let t=T(e),r=n.get(e);if(!t||r===void 0)return;let i=M(t.panel);b.set(e,{from:r,to:i}),B(t,r)})},ve=()=>{let e=[...E().change.openingIds],t=[...E().change.closingIds],n=new Set(t.filter(e=>{let t=T(e),n=document.activeElement;return t!==null&&n instanceof HTMLElement&&t.expanded.contains(n)}));w().forEach(e=>B(e)),q(),t.forEach(e=>{let t=T(e);t&&ge(t,n.has(e))}),e.forEach(e=>Y(`ui:panel-expand`,e)),t.forEach(e=>Y(`ui:panel-collapse`,e)),[...e,...t].forEach(e=>b.delete(e))},Y=(e,n,r={})=>{t({el:C(),name:e,detail:{groupId:D().id,panelId:n,__panelsNotification:!0,...r}})},ye=()=>{let e=E().layout;if(D().persist)try{localStorage.setItem(me(D().id),JSON.stringify({collapsed:e.collapsedIds,sizes:e.committedSizes}))}catch{}t({el:C(),name:`ui:panels-layout-change`,detail:{groupId:D().id,collapsed:[...e.collapsedIds],sizes:{...e.committedSizes},__panelsNotification:!0}})},X=e=>{if(!o)return;if(Q.hasTag(`stable`)){e();return}let t=window.setTimeout(()=>{_.delete(t),X(e)},16);_.add(t)},Z=(e,t)=>{let n=e.find(e=>t(e)!==O(e));n&&(Q.send({type:t(n)?`COLLAPSE`:`EXPAND`,panelId:n}),X(()=>Z(e,t)))},be=()=>{if(!D().persist)return;let e;try{e=JSON.parse(localStorage.getItem(me(D().id))??`null`)}catch{return}if(typeof e!=`object`||!e)return;let t=N(),n=t.filter(e=>e.collapsible),r=new Set((Array.isArray(e.collapsed)?e.collapsed:[]).filter(e=>typeof e==`string`&&n.some(t=>t.id===e))),i=he(e.sizes),a=()=>{Z(n.map(({id:e})=>e),e=>r.has(e))},o=()=>{let e=t.filter(e=>e.kind===`bounded`).flatMap(({id:e})=>{let t=T(e),n=i[e];if(!t||n===void 0)return[];let r=M(t.panel),a=I(t,n);return Math.abs(r-a)<.5?[]:[{panelId:e,from:r,to:a}]});if(k()){e.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:e}),a();return}let n=e.filter(({panelId:e})=>O(e)),r=e.filter(({panelId:e})=>!O(e));if(n.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:n}),r.length>0){Q.send({type:`SIZE`,changes:r}),X(a);return}a()},s=n.map(({id:e})=>e).filter(e=>O(e)&&!r.has(e));s.length>0?(Z(s,()=>!1),X(o)):o()},xe=()=>{let e=requestAnimationFrame(()=>{v.delete(e);let t=requestAnimationFrame(()=>{v.delete(t),be()});v.add(t)});v.add(e)},Se=e=>{let t=N(),n=e?t.filter(({id:t})=>t===e):t;if(n.length===0)return;let r=()=>{Z(n.filter(e=>e.collapsible).map(({id:e})=>e),e=>t.find(t=>t.id===e)?.defaultCollapsed===!0)},i=n.filter(e=>e.kind===`bounded`).map(({id:e})=>e).filter(e=>Object.hasOwn(E().layout.committedSizes,e));if(k()){i.length>0?(Q.send({type:`RESET_HIDDEN_SIZES`,ids:i}),X(r)):r();return}let a=i.filter(O);a.length>0&&Q.send({type:`RESET_HIDDEN_SIZES`,ids:a});let o=i.filter(e=>!O(e)).flatMap(e=>{let t=T(e);return!t||t.props.size===`fill`?[]:[{panelId:e,from:M(t.panel),to:P(`--spacing-panel-${t.props.size}`),reset:!0}]});if(o.length>0){Q.send({type:`SIZE`,changes:o}),X(r);return}r()},Ce=()=>{E().sizing.changes.forEach(({panelId:e,from:t})=>{let n=T(e);n&&B(n,t)})},we=()=>{E().sizing.changes.forEach(({panelId:e,to:t})=>{let n=T(e);n&&(B(n),Y(`ui:panel-resize-end`,e,{size:t}))}),q()},Te=t=>{if(A()===`vertical`)return t===`start`?`negative`:`positive`;let n=e({el:C()});return t===`start`?n?`positive`:`negative`:n?`negative`:`positive`},Ee=()=>{let e=h;if(!e)return;let t=new Set(w().map(({panel:e})=>e));y.forEach((e,n)=>{t.has(n)||(e.run(),y.delete(n))}),w().forEach(t=>{if(y.has(t.panel)||!t.handle||t.props.size===`fill`||t.props.resize===`none`)return;let n=F(t),r=P(`--spacing-panel-resize-handle`),i=P(`--spacing-panel-resize-handle-coarse`),a=new m;e.addChild(a),a.add(ae({element:t.panel,handle:t.handle,axis:A()===`horizontal`?`x`:`y`,direction:Te(t.props.resize),min:n.minimum,max:n.maximum,mode:`onChange`,hitArea:r,coarseHitArea:i,disabled:()=>k()||O(t.props.id),onStart:e=>Q.send({type:`RESIZE_START`,panelId:t.props.id,size:Oe(e)}),onResize:e=>Q.send({type:`RESIZE`,panelId:t.props.id,size:Oe(e)}),onEnd:e=>Q.send({type:`RESIZE_END`,panelId:t.props.id,size:Oe(e)})})),y.set(t.panel,a)})},De=()=>{h?.run(),y.clear(),h=new m,f.addChild(h),Ee()},Oe=e=>A()===`horizontal`?e.previewWidth:e.previewHeight,ke=e=>{let t=D().orientation===`horizontal`&&e<oe(C(),`sm`)?`stacked`:`wide`;t!==d&&(d=t,q(),De())},Q=ee({schema:ce,hooks:ue,resolveTransitionElement:({data:e})=>{let t=e?.panelId;return t?T(t)?.panel??null:C()},createMachine:({props:e})=>fe({props:e,context:L(),effects:{prepareChange:_e,finishChange:ve,sync:()=>{q(),De()},beginResize:()=>{q()},previewResize:()=>{let e=E().resize.activeId,t=T(e);t&&B(t);let n=E().resize.previewSize;n!==null&&Y(`ui:panel-resize`,e,{size:n})},commitResize:e=>{q();let t=typeof e.event.panelId==`string`?e.event.panelId:``,n=E().layout.committedSizes[t];t&&n!==void 0&&Y(`ui:panel-resize-end`,t,{size:n})},cancelResize:q,prepareSizing:Ce,finishSizing:we,persist:ye}})}),Ae=()=>{let e=N();Q.send({type:`PANELS_CHANGED`,collection:e}),Ee()},je=()=>{l=ie({targets:C(),read:N,onChange:Ae,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`id`,`data-size`,`data-resize`,`data-collapsible`,`data-default-collapsed`]}})},$;return $={...Q,get id(){return C().id||D().id},get orientation(){return A()},get collapsed(){return[...E().layout.collapsedIds]},get sizes(){return{...E().layout.committedSizes}},get root(){let e=this.snapshot.current?.props??D();return ne({inputs:[g({part:G.parts.root,props:e,className:e.class}),{"data-ui-panels":``}]})},init(){f=te(this),h=new m,f.addChild(h),o=this.$el,Q.connect(this.$el,this.snapshot),C().id||=D().id,d=D().orientation===`horizontal`&&C().getBoundingClientRect().width<oe(C(),`sm`)?`stacked`:`wide`,K.add($),pe(),q(),Ee(),u=new ResizeObserver(e=>{ke(e[0]?.contentRect.width??C().clientWidth)}),u.observe(C()),je(),D().persist&&xe(),r({target:C(),event:`keydown`,handler:()=>W(),cleanup:f})},destroy(){K.delete($),l?.(),l=null,u?.disconnect(),u=null,y.clear(),h=null,_.forEach(e=>window.clearTimeout(e)),_.clear(),v.forEach(e=>cancelAnimationFrame(e)),v.clear(),Q.disconnect(),o=null},transitionPanel(e){let t=e.data.panelId,n=T(t),r=b.get(t);return!n||!r||r.from===r.to?(n&&B(n,r?.to),i()):a(e,{target:n.panel,keyframes:{flexBasis:[`${r.from}px`,`${r.to}px`]},role:`layout`,cleanup:()=>B(n)})},transitionPanelSize(e){let{panelId:t,from:n,to:r}=e.data,o=T(t);return!o||n===r?(o&&B(o),i()):a(e,{target:o.panel,keyframes:{flexBasis:[`${n}px`,`${r}px`]},role:`layoutQuick`,cleanup:()=>B(o)})},hasPanel(e){return T(e)!==null},isCollapsed:O,collapse(e){Q.send({type:`COLLAPSE`,panelId:e})},expand(e){Q.send({type:`EXPAND`,panelId:e})},toggle(e){Q.send({type:`TOGGLE`,panelId:e})},resize(e,t){let n=T(e);if(k()||!n||n.props.size===`fill`||O(e)||!Number.isFinite(t))return;let r=M(n.panel),i=I(n,t);Math.abs(r-i)<.5||Q.send({type:`SIZE`,panelId:e,from:r,to:i})},reset(e){Se(e)},perform(e,t,n){n&&S.set(t,n),{collapse:this.collapse,expand:this.expand,toggle:this.toggle}[e](t)},syncToggles:W},$},ge=()=>{let e={};return{get props(){return e},init(){e=c({el:this.$el,schema:w})},destroy(){},get root(){return ne({inputs:[g({part:G.parts.toggle,props:{},className:e.class}),{"data-ui-panel-toggle":``,":data-target":()=>e.target||void 0,":data-action":()=>e.action,"@click":e=>this.trigger(e)}]})},trigger(t){t?.preventDefault();let n=this.$el,r=n.closest(`[data-ui-panel]`),i=r?.closest(`[data-ui-panels]`),a=e.target||r?.id||``;a&&document.dispatchEvent(new CustomEvent(`ui:panel-toggle`,{detail:{panelId:a,groupId:i?.id,action:e.action,trigger:n}}))}}},_e=e=>{h(`UiPanels`,J)(e),h(`UiPanelToggle`,ge)(e)},ve=new WeakSet,Y=e=>{ve.has(e)||(ve.add(e),o(e),y(e),_e(e))};export{ge as n,J as r,Y as t};
2
- //# sourceMappingURL=entry.generated-BlsLkwW8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.generated-BlsLkwW8.js","names":[],"sources":["../../../../../../../../client/src/runtime/composition-breakpoint.ts","../../../../../../../../client/src/components/panels/contract.ts","../../../../../../../../client/src/components/panels/machine.ts","../../../../../../../../client/src/components/panels/styles.ts","../../../../../../../../client/src/components/panels/index.ts","../../../../../../../../client/src/components/panels/entry.generated.ts"],"sourcesContent":["type CompositionBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nconst compositionBreakpointPixels = (\n reference: HTMLElement,\n breakpoint: CompositionBreakpoint,\n): number => {\n const value = getComputedStyle(reference).getPropertyValue(`--breakpoint-${breakpoint}`);\n const pixels = Number.parseFloat(value);\n return Number.isFinite(pixels) ? pixels : Number.POSITIVE_INFINITY;\n};\n\nexport {compositionBreakpointPixels};\nexport type {CompositionBreakpoint};\n","import {bool, oneOf, string, type SchemaToProps} from '../../runtime';\n\nconst PANELS_ORIENTATIONS = ['horizontal', 'vertical'] as const;\nconst PANEL_AS_VALUES = ['div', 'section', 'aside', 'main', 'nav'] as const;\nconst PANEL_SIZES = ['1', '2', '3', '4', '5', '6', 'fill'] as const;\nconst PANEL_RESIZE_EDGES = ['none', 'start', 'end'] as const;\nconst PANEL_TOGGLE_ACTIONS = ['toggle', 'expand', 'collapse'] as const;\n\nconst panelsSchema = {\n id: string.default('ui-panels'),\n orientation: oneOf(PANELS_ORIENTATIONS, 'horizontal'),\n persist: bool,\n divider: bool.default(true),\n class: string,\n};\n\nconst panelSchema = {\n id: string,\n as: oneOf(PANEL_AS_VALUES, 'section'),\n size: oneOf(PANEL_SIZES, 'fill'),\n resize: oneOf(PANEL_RESIZE_EDGES, 'none'),\n collapsible: bool,\n defaultCollapsed: bool,\n class: string,\n};\n\nconst panelToggleSchema = {\n target: string,\n action: oneOf(PANEL_TOGGLE_ACTIONS, 'toggle'),\n icon: string.default('menu'),\n label: string.default('Expand'),\n class: string,\n};\n\ntype PanelsOrientation = typeof PANELS_ORIENTATIONS[number];\ntype PanelAs = typeof PANEL_AS_VALUES[number];\ntype PanelSize = typeof PANEL_SIZES[number];\ntype PanelResizeEdge = typeof PANEL_RESIZE_EDGES[number];\ntype PanelToggleAction = typeof PANEL_TOGGLE_ACTIONS[number];\ntype PanelsProps = SchemaToProps<typeof panelsSchema>;\ntype PanelProps = SchemaToProps<typeof panelSchema>;\ntype PanelToggleProps = SchemaToProps<typeof panelToggleSchema>;\n\nexport {\n PANEL_AS_VALUES,\n PANEL_RESIZE_EDGES,\n PANEL_SIZES,\n PANEL_TOGGLE_ACTIONS,\n PANELS_ORIENTATIONS,\n panelSchema,\n panelToggleSchema,\n panelsSchema,\n};\nexport type {\n PanelAs,\n PanelProps,\n PanelResizeEdge,\n PanelSize,\n PanelToggleAction,\n PanelToggleProps,\n PanelsOrientation,\n PanelsProps,\n};\n","import {createMachine, type Machine, type MachineEventObject, type MachineScope} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {PanelsProps} from './contract';\n\ntype PanelCollapseCapability =\n | {collapsible: false; defaultCollapsed: false}\n | {collapsible: true; defaultCollapsed: boolean};\n\ntype PanelDescriptor = PanelCollapseCapability & (\n | {id: string; kind: 'fill'}\n | {id: string; kind: 'bounded'; resizable: boolean}\n);\n\ntype PanelsContext = {\n collection: PanelDescriptor[];\n layout: {\n collapsedIds: string[];\n committedSizes: Record<string, number>;\n };\n change: {\n openingIds: string[];\n closingIds: string[];\n };\n resize: {\n activeId: string;\n initialSize: number | null;\n previewSize: number | null;\n };\n sizing: {\n changes: PanelSizingTransitionData[];\n };\n};\n\ntype PanelTransitionData = {panelId: string};\ntype PanelSizingTransitionData = {panelId: string; from: number; to: number; reset?: boolean};\ntype PanelsPersistTransitionData = {\n groupId: string;\n collapsed: string[];\n sizes: Record<string, number>;\n};\n\ntype PanelsMachineEffects = {\n prepareChange(scope: MachineScope<PanelsContext, PanelsProps>): void;\n finishChange(scope: MachineScope<PanelsContext, PanelsProps>): void;\n sync(scope: MachineScope<PanelsContext, PanelsProps>): void;\n beginResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n previewResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n commitResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n cancelResize(scope: MachineScope<PanelsContext, PanelsProps>): void;\n prepareSizing(scope: MachineScope<PanelsContext, PanelsProps>): void;\n finishSizing(scope: MachineScope<PanelsContext, PanelsProps>): void;\n persist(scope: MachineScope<PanelsContext, PanelsProps>): void;\n};\n\ntype CreatePanelsMachineOptions = {\n props: PanelsProps;\n context: PanelsContext;\n effects: PanelsMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.openingIds.map((panelId) => ({panelId})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n expand: (panelId: string) => ({type: 'EXPAND', panelId}),\n collapse: (panelId: string) => ({type: 'COLLAPSE', panelId}),\n toggle: (panelId: string) => ({type: 'TOGGLE', panelId}),\n },\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelTransitionData, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.closingIds.map((panelId) => ({panelId})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n expand: (panelId: string) => ({type: 'EXPAND', panelId}),\n collapse: (panelId: string) => ({type: 'COLLAPSE', panelId}),\n toggle: (panelId: string) => ({type: 'TOGGLE', panelId}),\n },\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelTransitionData, 'closing'>);\n\nconst sizingHook = defineHook({\n name: 'sizing',\n state: 'sizing',\n projectEach: (snapshot) => snapshot.context.sizing.changes,\n onDone: 'SIZE_DONE',\n onError: 'SIZE_ERROR',\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelSizingTransitionData, 'sizing'>);\n\nconst persistingHook = defineHook({\n name: 'persisting',\n state: 'persisting',\n project: (snapshot) => ({\n groupId: snapshot.props.id,\n collapsed: [...snapshot.context.layout.collapsedIds],\n sizes: {...snapshot.context.layout.committedSizes},\n }),\n onDone: 'PERSIST_DONE',\n onError: 'PERSIST_ERROR',\n} satisfies TransitionHookDefinition<PanelsContext, PanelsProps, PanelsPersistTransitionData, 'persisting'>);\n\nconst panelsHooks = [openingHook, closingHook, sizingHook, persistingHook] as const;\n\nconst strings = (value: unknown): string[] => Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string')\n : [];\nconst panelId = (event: MachineEventObject): string => typeof event.panelId === 'string' ? event.panelId : '';\nconst finiteSize = (value: unknown): number | null => typeof value === 'number' && Number.isFinite(value) ? value : null;\nconst sizingChanges = (event: MachineEventObject): PanelSizingTransitionData[] => {\n const candidates = Array.isArray(event.changes) ? event.changes : [event];\n return candidates.flatMap((candidate) => {\n if (typeof candidate !== 'object' || candidate === null) return [];\n const change = candidate as Record<string, unknown>;\n const id = typeof change.panelId === 'string' ? change.panelId : '';\n const from = finiteSize(change.from);\n const to = finiteSize(change.to);\n const reset = change.reset === true;\n return id && from !== null && to !== null && (from !== to || reset)\n ? [{panelId: id, from, to, ...(reset ? {reset: true} : {})}]\n : [];\n });\n};\nconst propsFrom = (event: MachineEventObject, fallback: PanelsProps): PanelsProps => (\n typeof event.props === 'object' && event.props !== null ? event.props as PanelsProps : fallback\n);\nconst sameStrings = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((value, index) => value === right[index])\n);\nconst descriptors = (value: unknown): PanelDescriptor[] => {\n if (!Array.isArray(value)) return [];\n const result: PanelDescriptor[] = [];\n value.forEach((candidate) => {\n if (typeof candidate !== 'object' || candidate === null) return;\n const descriptor = candidate as Record<string, unknown>;\n if (typeof descriptor.id !== 'string' || !descriptor.id) return;\n const collapse: PanelCollapseCapability = descriptor.collapsible === true\n ? {collapsible: true, defaultCollapsed: descriptor.defaultCollapsed === true}\n : {collapsible: false, defaultCollapsed: false};\n if (descriptor.kind === 'fill') result.push({id: descriptor.id, kind: 'fill', ...collapse});\n if (descriptor.kind === 'bounded') {\n result.push({\n id: descriptor.id,\n kind: 'bounded',\n resizable: descriptor.resizable === true,\n ...collapse,\n });\n }\n });\n return result;\n};\nconst descriptorMap = (collection: readonly PanelDescriptor[]): Map<string, PanelDescriptor> => (\n new Map(collection.map((descriptor) => [descriptor.id, descriptor]))\n);\nconst orderedSizes = (\n collection: readonly PanelDescriptor[],\n sizes: Readonly<Record<string, number>>,\n): Record<string, number> => Object.fromEntries(collection.flatMap((descriptor) => (\n descriptor.kind === 'bounded' && Object.hasOwn(sizes, descriptor.id)\n ? [[descriptor.id, sizes[descriptor.id]!]]\n : []\n)));\n\nconst requestedCollapsed = (scope: MachineScope<PanelsContext, PanelsProps>): string[] => {\n const id = panelId(scope.event);\n const current = scope.context.layout.collapsedIds;\n const collection = scope.context.collection;\n const descriptor = descriptorMap(collection).get(id);\n switch (scope.event.type) {\n case 'COLLAPSE':\n return descriptor?.collapsible && !current.includes(id)\n ? collection.map((item) => item.id).filter((item) => current.includes(item) || item === id)\n : current;\n case 'EXPAND':\n return current.filter((item) => item !== id);\n case 'TOGGLE':\n if (!descriptor?.collapsible) return current;\n return current.includes(id)\n ? current.filter((item) => item !== id)\n : collection.map((item) => item.id).filter((item) => current.includes(item) || item === id);\n default:\n return current;\n }\n};\n\nconst changeAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const id = panelId(scope.event);\n return descriptorMap(scope.context.collection).has(id)\n && !sameStrings(scope.context.layout.collapsedIds, requestedCollapsed(scope));\n};\n\nconst resizeAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const id = panelId(scope.event);\n const descriptor = descriptorMap(scope.context.collection).get(id);\n return descriptor?.kind === 'bounded'\n && descriptor.resizable\n && !scope.context.layout.collapsedIds.includes(id)\n && finiteSize(scope.event.size) !== null;\n};\n\nconst sizingAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const changes = sizingChanges(scope.event);\n const collection = descriptorMap(scope.context.collection);\n return changes.length > 0 && changes.every(({panelId: id}) => (\n collection.get(id)?.kind === 'bounded'\n && !scope.context.layout.collapsedIds.includes(id)\n ));\n};\n\nconst hiddenSizingAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const changes = sizingChanges(scope.event);\n const collection = descriptorMap(scope.context.collection);\n return changes.length > 0 && changes.every(({panelId: id}) => (\n collection.get(id)?.kind === 'bounded'\n && scope.context.layout.collapsedIds.includes(id)\n ));\n};\n\nconst hiddenResetAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const ids = strings(scope.event.ids);\n const collection = descriptorMap(scope.context.collection);\n return ids.length > 0 && ids.every((id) => (\n collection.get(id)?.kind === 'bounded'\n && scope.context.layout.collapsedIds.includes(id)\n && Object.hasOwn(scope.context.layout.committedSizes, id)\n ));\n};\n\nconst applySizing = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const changes = sizingChanges(scope.event);\n const committedSizes = {...scope.context.layout.committedSizes};\n changes.forEach(({panelId: id, to, reset}) => {\n if (reset) delete committedSizes[id];\n else committedSizes[id] = to;\n });\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: orderedSizes(scope.context.collection, committedSizes),\n },\n sizing: {changes},\n }};\n};\n\nconst commitHiddenSizes = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const changes = sizingChanges(scope.event);\n const committedSizes = {\n ...scope.context.layout.committedSizes,\n ...Object.fromEntries(changes.map(({panelId: id, to}) => [id, to])),\n };\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: orderedSizes(scope.context.collection, committedSizes),\n },\n }};\n};\n\nconst resetHiddenSizes = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const committedSizes = {...scope.context.layout.committedSizes};\n strings(scope.event.ids).forEach((id) => delete committedSizes[id]);\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: orderedSizes(scope.context.collection, committedSizes),\n },\n }};\n};\n\nconst applyChange = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const collapsedIds = requestedCollapsed(scope);\n const previous = scope.context.layout.collapsedIds;\n return {context: {\n ...scope.context,\n layout: {...scope.context.layout, collapsedIds},\n change: {\n openingIds: previous.filter((id) => !collapsedIds.includes(id)),\n closingIds: collapsedIds.filter((id) => !previous.includes(id)),\n },\n }};\n};\n\nconst reconcile = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const collection = descriptors(scope.event.collection);\n const known = descriptorMap(scope.context.collection);\n const collapsedIds = collection.filter((descriptor) => (\n scope.context.layout.collapsedIds.includes(descriptor.id)\n || (!known.has(descriptor.id) && descriptor.defaultCollapsed)\n ) && descriptor.collapsible).map((descriptor) => descriptor.id);\n const committedSizes = orderedSizes(collection, scope.context.layout.committedSizes);\n const active = descriptorMap(collection).get(scope.context.resize.activeId);\n const activeExists = active?.kind === 'bounded' && active.resizable;\n return {context: {\n ...scope.context,\n collection,\n layout: {collapsedIds, committedSizes},\n resize: activeExists\n ? scope.context.resize\n : {activeId: '', initialSize: null, previewSize: null},\n }};\n};\n\nconst activeRemoved = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const active = descriptorMap(descriptors(scope.event.collection)).get(scope.context.resize.activeId);\n return active?.kind !== 'bounded' || !active.resizable;\n};\n\nconst createPanelsMachine = ({\n props,\n context,\n effects,\n}: CreatePanelsMachineOptions): Machine<PanelsContext, PanelsProps> => createMachine<PanelsContext, PanelsProps>({\n initial: 'stable',\n on: {\n DOM_INVALIDATED: {effects: 'sync'},\n },\n states: {\n stable: {\n tags: ['stable'],\n on: {\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n RESTORE_HIDDEN_SIZES: {guard: hiddenSizingAllowed, reduce: commitHiddenSizes},\n RESET_HIDDEN_SIZES: {\n target: 'persisting',\n guard: hiddenResetAllowed,\n reduce: resetHiddenSizes,\n effects: ['sync', 'persist'],\n },\n RESIZE_START: {target: 'resizing', guard: resizeAllowed, reduce: 'startResize', effects: 'beginResize'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n changing: {\n tags: ['changing', 'transitioning'],\n on: {\n CHANGE_DONE: {target: 'persisting', effects: ['finishChange', 'persist']},\n CHANGE_ERROR: {target: 'persisting', effects: ['finishChange', 'persist']},\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n sizing: {\n tags: ['sizing', 'transitioning'],\n on: {\n SIZE_DONE: {target: 'persisting', effects: ['finishSizing', 'persist']},\n SIZE_ERROR: {target: 'persisting', effects: ['finishSizing', 'persist']},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n RESIZE_START: {target: 'resizing', guard: resizeAllowed, reduce: 'startResize', effects: 'beginResize'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n resizing: {\n tags: ['resizing'],\n on: {\n RESIZE: {guard: 'activeResize', reduce: 'previewResize', effects: 'previewResize'},\n RESIZE_END: {target: 'persisting', guard: 'activeResize', reduce: 'commitResize', effects: ['commitResize', 'persist']},\n RESIZE_CANCEL: {target: 'stable', reduce: 'clearResize', effects: 'cancelResize'},\n PANELS_CHANGED: [\n {target: 'stable', guard: activeRemoved, reduce: reconcile, effects: ['cancelResize', 'sync']},\n {reduce: reconcile, effects: 'sync'},\n ],\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n persisting: {\n tags: ['persisting'],\n on: {\n PERSIST_DONE: 'stable',\n PERSIST_ERROR: 'stable',\n COLLAPSE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n EXPAND: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: changeAllowed, reduce: applyChange, effects: 'prepareChange'},\n SIZE: {target: 'sizing', guard: sizingAllowed, reduce: applySizing, effects: 'prepareSizing'},\n PANELS_CHANGED: {reduce: reconcile, effects: 'sync'},\n PROPS_CHANGED: {reduce: 'replaceProps', effects: 'sync'},\n },\n },\n },\n}, {\n props,\n context,\n reducers: {\n replaceProps: (scope) => ({props: propsFrom(scope.event, scope.props)}),\n startResize: (scope) => {\n const size = finiteSize(scope.event.size);\n return {context: {\n ...scope.context,\n resize: {activeId: panelId(scope.event), initialSize: size, previewSize: size},\n }};\n },\n previewResize: (scope) => ({context: {\n ...scope.context,\n resize: {...scope.context.resize, previewSize: finiteSize(scope.event.size)},\n }}),\n commitResize: (scope) => {\n const id = panelId(scope.event);\n const size = finiteSize(scope.event.size);\n if (size === null) return;\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: orderedSizes(scope.context.collection, {\n ...scope.context.layout.committedSizes,\n [id]: size,\n }),\n },\n resize: {activeId: '', initialSize: null, previewSize: null},\n }};\n },\n clearResize: (scope) => ({context: {\n ...scope.context,\n resize: {activeId: '', initialSize: null, previewSize: null},\n }}),\n },\n guards: {\n activeResize: (scope) => panelId(scope.event) === scope.context.resize.activeId\n && finiteSize(scope.event.size) !== null,\n },\n effects: {\n prepareChange: effects.prepareChange,\n finishChange: effects.finishChange,\n sync: effects.sync,\n beginResize: effects.beginResize,\n previewResize: effects.previewResize,\n commitResize: effects.commitResize,\n cancelResize: effects.cancelResize,\n prepareSizing: effects.prepareSizing,\n finishSizing: effects.finishSizing,\n persist: effects.persist,\n },\n});\n\nexport {createPanelsMachine, panelsHooks};\nexport type {\n CreatePanelsMachineOptions,\n PanelDescriptor,\n PanelsContext,\n PanelsMachineEffects,\n PanelsPersistTransitionData,\n PanelSizingTransitionData,\n PanelTransitionData,\n};\n","import {defineStyles} from '../../runtime';\n\nconst panelsStyles = defineStyles({definition: {\n component: 'ui.panels',\n parts: {\n root: {\n base: 'relative flex h-full min-h-0 w-full min-w-0',\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col',\n },\n },\n defaults: {orientation: 'horizontal'},\n },\n panel: {\n base: 'relative min-w-0 overflow-hidden',\n variants: {\n orientation: {\n horizontal: 'h-full',\n vertical: 'w-full',\n },\n divider: {\n true: '',\n false: '',\n },\n resize: {\n none: '',\n start: '',\n end: '',\n },\n },\n defaults: {orientation: 'horizontal', divider: true, resize: 'none'},\n },\n expanded: {base: 'h-full min-h-0 w-full min-w-0'},\n collapsed: {base: 'flex h-full min-h-0 w-full min-w-0 items-center justify-center overflow-hidden'},\n resizeHandle: {\n base: [\n 'absolute z-20 touch-none border-transparent outline-none',\n 'hover:border-intent-neutral-edge-hover focus-visible:ui-focus-ring-inset',\n 'data-resizing:border-intent-neutral-edge-strong',\n ],\n variants: {\n orientation: {\n horizontal: 'inset-y-0 w-panel-resize-handle cursor-col-resize',\n vertical: 'inset-x-0 h-panel-resize-handle cursor-row-resize',\n },\n edge: {\n start: '',\n end: '',\n },\n },\n defaults: {orientation: 'horizontal', edge: 'end'},\n },\n toggle: {base: 'inline-flex size-control-md items-center justify-center outline-none focus-visible:ui-focus-ring-inset'},\n toggleIcon: {base: 'size-icon-md shrink-0'},\n },\n}});\n\nexport {panelsStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n type AlpineMachine,\n createAlpineMachine,\n createResizable,\n decodeProps,\n defineAlpineData,\n focusElement,\n isRtl,\n mergeBindings,\n observeSemanticChanges,\n resolveStyle,\n type BindingObject,\n type ResizeDirection,\n type ResizeEvent,\n type TransitionForHook,\n type TrellisAlpineComponent,\n tabbableElements,\n} from '@client/runtime';\nimport {cleanupManagerFor} from '@client/runtime/alpine-data';\nimport {CleanupManager} from '@client/runtime/cleanup-manager';\nimport {animateSize, type MotionHandle, type MotionTransitionSubject} from '@client/motion';\nimport {noopHandle} from '@client/motion/animate';\nimport {compositionBreakpointPixels} from '@client/runtime/composition-breakpoint';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {addListener, asBool, dispatch, setPresence} from '@client/utils';\nimport {\n panelSchema,\n panelToggleSchema,\n panelsSchema,\n type PanelProps,\n type PanelResizeEdge,\n type PanelToggleAction,\n type PanelToggleProps,\n type PanelsOrientation,\n type PanelsProps,\n} from './contract';\nimport {\n createPanelsMachine,\n panelsHooks,\n type PanelDescriptor,\n type PanelsContext,\n type PanelsPersistTransitionData,\n type PanelSizingTransitionData,\n type PanelTransitionData,\n} from './machine';\nimport {panelsStyles} from './styles';\n\ntype PanelsTransitionName = (typeof panelsHooks)[number]['name'];\ntype PanelsTransition<TName extends PanelsTransitionName = PanelsTransitionName> = TransitionForHook<\n Extract<(typeof panelsHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype PanelRecord = {\n panel: HTMLElement;\n expanded: HTMLElement;\n collapsed: HTMLElement | null;\n handle: HTMLElement | null;\n props: PanelProps;\n};\n\ntype PanelEventDetail = {\n panelId?: string;\n groupId?: string;\n size?: number;\n action?: PanelToggleAction;\n trigger?: HTMLElement | null;\n __panelsNotification?: boolean;\n};\n\ntype PanelTransitionGeometry = {from: number; to: number};\ntype PanelsResponsiveMode = 'stacked' | 'wide';\ntype PanelMotionTransition = MotionTransitionSubject & Readonly<{\n data: PanelTransitionData;\n}>;\ntype PanelSizingMotionTransition = MotionTransitionSubject & Readonly<{\n data: PanelSizingTransitionData;\n}>;\n\ntype PanelsController = {\n readonly id: string;\n hasPanel(panelId: string): boolean;\n perform(action: PanelToggleAction, panelId: string, trigger?: HTMLElement | null): void;\n resize(panelId: string, size: number): void;\n reset(panelId?: string): void;\n syncToggles(): void;\n};\n\n/** Public Alpine API for `ui.panels`. @public */\ninterface UiPanelsApi {\n /** Stable group id used by explicit controls, named events, and persistence. */\n readonly id: string;\n /** Current main axis along which direct panels negotiate space. */\n readonly orientation: 'horizontal' | 'vertical';\n /** Stable ids of panels whose collapsed representation is active. */\n readonly collapsed: readonly string[];\n /** User-committed pixel measures keyed by stable panel id. */\n readonly sizes: Readonly<Record<string, number>>;\n /** Returns whether a named panel is currently collapsed. */\n isCollapsed(id: string): boolean;\n /** Collapses a named collapsible panel. */\n collapse(id: string): void;\n /** Expands a named collapsed panel. */\n expand(id: string): void;\n /** Reverses the collapsed state of a named collapsible panel. */\n toggle(id: string): void;\n /** Moves an expanded bounded panel to a clamped pixel size through the sizing transition. */\n resize(id: string, size: number): void;\n /** Restores one panel or the whole group to its authored layout. */\n reset(id?: string): void;\n}\n\ntype PanelsData = AlpineMachine<PanelsContext, PanelsProps, typeof panelsHooks> & UiPanelsApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n perform(action: PanelToggleAction, panelId: string, trigger?: HTMLElement | null): void;\n syncToggles(): void;\n hasPanel(panelId: string): boolean;\n transitionPanel(transition: PanelMotionTransition): MotionHandle;\n transitionPanelSize(transition: PanelSizingMotionTransition): MotionHandle;\n};\n\nconst controllers = new Set<PanelsController>();\n\nconst eventDetail = (event: Event): PanelEventDetail => (\n event instanceof CustomEvent && event.detail && typeof event.detail === 'object'\n ? event.detail as PanelEventDetail\n : {}\n);\n\nconst registerDocumentListeners = (() => {\n let registered = false;\n return (): void => {\n if (registered || typeof document === 'undefined') return;\n const route = (action: PanelToggleAction) => (event: Event): void => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification || !detail.panelId) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (!controller.hasPanel(detail.panelId!)) return;\n controller.perform(detail.action ?? action, detail.panelId!, detail.trigger);\n });\n };\n document.addEventListener('ui:panel-collapse', route('collapse'));\n document.addEventListener('ui:panel-expand', route('expand'));\n document.addEventListener('ui:panel-toggle', route('toggle'));\n document.addEventListener('ui:panel-size', (event) => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification || !detail.panelId || !Number.isFinite(detail.size)) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (!controller.hasPanel(detail.panelId!)) return;\n controller.resize(detail.panelId!, detail.size!);\n });\n });\n document.addEventListener('ui:panels-reset', (event) => {\n const detail = eventDetail(event);\n if (detail.__panelsNotification) return;\n controllers.forEach((controller) => {\n if (detail.groupId && detail.groupId !== controller.id) return;\n if (detail.panelId && !controller.hasPanel(detail.panelId)) return;\n controller.reset(detail.panelId);\n });\n });\n registered = true;\n };\n})();\n\nconst storageKey = (id: string): string => `trellis-ui:panels:${id}:v1`;\nconst numericRecord = (value: unknown): Record<string, number> => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return {};\n return Object.fromEntries(Object.entries(value).filter((entry): entry is [string, number] => (\n typeof entry[1] === 'number' && Number.isFinite(entry[1])\n )));\n};\n\nconst UiPanels = (): TrellisAlpineComponent<PanelsData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let disconnectObserver: (() => void) | null = null;\n let resizeObserver: ResizeObserver | null = null;\n let responsiveMode: PanelsResponsiveMode = 'wide';\n let cleanup: CleanupManager;\n let resizeCleanup: CleanupManager | null = null;\n const deferredTimers = new Set<number>();\n const restoreFrames = new Set<number>();\n const resizeCleanups = new Map<HTMLElement, CleanupManager>();\n const transitionGeometry = new Map<string, PanelTransitionGeometry>();\n const rememberedFocus = new Map<string, HTMLElement>();\n const activeTriggers = new Map<string, HTMLElement>();\n\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Panels has not been initialized.');\n return rootEl;\n };\n const owns = (element: Element): boolean => element.closest('[data-ui-panels]') === root();\n const records = (): PanelRecord[] => Array.from(root().children).flatMap((child) => {\n if (!(child instanceof HTMLElement) || !child.hasAttribute('data-ui-panel')) return [];\n const expanded = child.querySelector<HTMLElement>(':scope > [data-ui-panel-expanded]');\n if (!expanded || !owns(expanded)) return [];\n return [{\n panel: child,\n expanded,\n collapsed: child.querySelector<HTMLElement>(':scope > [data-ui-panel-collapsed]'),\n handle: child.querySelector<HTMLElement>(':scope > [data-ui-panel-resize-handle]'),\n props: decodeProps({el: child, schema: panelSchema}),\n }];\n });\n const recordFor = (id: string): PanelRecord | null => records().find((record) => record.props.id === id) ?? null;\n const context = (): Readonly<PanelsContext> => bridge.getCommittedSnapshot().context;\n const currentProps = (): Readonly<PanelsProps> => bridge.getCommittedSnapshot().props;\n const isCollapsed = (id: string): boolean => context().layout.collapsedIds.includes(id);\n const isResponsiveStacked = (): boolean => (\n currentProps().orientation === 'horizontal' && responsiveMode === 'stacked'\n );\n const effectiveOrientation = (): PanelsOrientation => (\n isResponsiveStacked() ? 'vertical' : currentProps().orientation\n );\n const renderedOrientation = (): PanelsOrientation => root().dataset.orientation === 'vertical' ? 'vertical' : 'horizontal';\n const mainSize = (element: Element): number => {\n const rect = element.getBoundingClientRect();\n return renderedOrientation() === 'horizontal' ? rect.width : rect.height;\n };\n\n const collectionState = (): PanelDescriptor[] => {\n const items = records();\n const ids = items.map(({props}) => props.id);\n if (ids.some((id) => !id)) throw new Error('Every Panel requires a stable id.');\n if (new Set(ids).size !== ids.length) throw new Error('Panel ids must be unique within a Panels group.');\n if (items.length > 0 && !items.some(({props}) => props.size === 'fill')) {\n throw new Error('A Panels group requires at least one size=\"fill\" Panel.');\n }\n if (items.some(({props}) => props.size === 'fill' && props.resize !== 'none')) {\n throw new Error('A size=\"fill\" Panel cannot own a resize handle.');\n }\n return items.map(({props}): PanelDescriptor => {\n const collapse = props.collapsible\n ? {collapsible: true as const, defaultCollapsed: props.defaultCollapsed}\n : {collapsible: false as const, defaultCollapsed: false as const};\n return props.size === 'fill'\n ? {id: props.id, kind: 'fill', ...collapse}\n : {id: props.id, kind: 'bounded', resizable: props.resize !== 'none', ...collapse};\n });\n };\n\n const cssLength = (token: string): number => {\n const probe = document.createElement('div');\n probe.style.cssText = 'position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;';\n if (renderedOrientation() === 'horizontal') probe.style.width = `var(${token})`;\n else probe.style.height = `var(${token})`;\n root().append(probe);\n const value = mainSize(probe);\n probe.remove();\n return value;\n };\n\n const boundsFor = (record: PanelRecord): {minimum: number; maximum: number} => {\n if (record.props.size === 'fill') return {minimum: 0, maximum: Number.POSITIVE_INFINITY};\n return {\n minimum: cssLength(`--spacing-panel-${record.props.size}-min`),\n maximum: cssLength(`--spacing-panel-${record.props.size}-max`),\n };\n };\n\n const clampPanelSize = (record: PanelRecord, value: number): number => {\n const {minimum, maximum} = boundsFor(record);\n return Math.min(maximum, Math.max(minimum, value));\n };\n\n const initialContext = (): PanelsContext => {\n const collection = collectionState();\n return {\n collection,\n layout: {\n collapsedIds: collection.filter((descriptor) => descriptor.defaultCollapsed).map(({id}) => id),\n committedSizes: {},\n },\n change: {openingIds: [], closingIds: []},\n resize: {activeId: '', initialSize: null, previewSize: null},\n sizing: {changes: []},\n };\n };\n\n const setMainConstraints = (element: HTMLElement, minimum: string, maximum: string): void => {\n if (renderedOrientation() === 'horizontal') {\n element.style.minWidth = minimum;\n element.style.maxWidth = maximum;\n element.style.minHeight = '';\n element.style.maxHeight = '';\n } else {\n element.style.minHeight = minimum;\n element.style.maxHeight = maximum;\n element.style.minWidth = '';\n element.style.maxWidth = '';\n }\n };\n\n const clearGeometry = (element: HTMLElement): void => {\n element.style.flex = '';\n element.style.minWidth = '';\n element.style.maxWidth = '';\n element.style.minHeight = '';\n element.style.maxHeight = '';\n };\n\n const applyGeometry = (record: PanelRecord, transitionSize?: number): void => {\n if (isResponsiveStacked()) {\n clearGeometry(record.panel);\n return;\n }\n if (transitionSize !== undefined) {\n record.panel.style.flex = `0 0 ${transitionSize}px`;\n setMainConstraints(record.panel, '0px', 'none');\n return;\n }\n if (isCollapsed(record.props.id)) {\n if (context().collection.find(({id}) => id === record.props.id)?.defaultCollapsed) {\n clearGeometry(record.panel);\n return;\n }\n const collapsedSize = record.collapsed ? 'var(--spacing-panel-collapsed)' : '0px';\n record.panel.style.flex = `0 0 ${collapsedSize}`;\n setMainConstraints(record.panel, collapsedSize, collapsedSize);\n return;\n }\n if (record.props.size === 'fill') {\n clearGeometry(record.panel);\n return;\n }\n const committed = context().resize.activeId === record.props.id\n ? context().resize.previewSize\n : context().layout.committedSizes[record.props.id];\n if (committed === undefined || committed === null) {\n clearGeometry(record.panel);\n return;\n }\n const basis = `${clampPanelSize(record, committed)}px`;\n record.panel.style.flex = `0 1 ${basis}`;\n setMainConstraints(\n record.panel,\n `var(--spacing-panel-${record.props.size}-min)`,\n `var(--spacing-panel-${record.props.size}-max)`,\n );\n };\n\n const setInert = (element: HTMLElement, inert: boolean): void => {\n element.toggleAttribute('inert', inert);\n element.setAttribute('aria-hidden', inert ? 'true' : 'false');\n };\n\n const syncPanel = (record: PanelRecord): void => {\n const props = currentProps();\n const orientation = effectiveOrientation();\n const collapsed = isCollapsed(record.props.id);\n const opening = bridge.hasTag('changing') && context().change.openingIds.includes(record.props.id);\n const closing = bridge.hasTag('changing') && context().change.closingIds.includes(record.props.id);\n const finalCollapsed = collapsed && !closing;\n const showExpanded = !finalCollapsed;\n const showCollapsed = collapsed && !closing && !opening && record.collapsed !== null;\n\n record.panel.dataset.state = collapsed ? 'collapsed' : 'expanded';\n record.panel.dataset.orientation = orientation;\n record.panel.dataset.size = record.props.size;\n record.panel.dataset.resize = record.props.resize;\n record.panel.className = resolveStyle({\n part: panelsStyles.parts.panel,\n props: {orientation, divider: props.divider, resize: record.props.resize},\n className: record.props.class,\n });\n setPresence({el: record.panel, attr: 'data-collapsible', present: record.props.collapsible});\n setPresence({el: record.panel, attr: 'data-resizing', present: context().resize.activeId === record.props.id});\n applyGeometry(record);\n\n record.expanded.hidden = !showExpanded;\n setInert(record.expanded, !showExpanded);\n if (record.collapsed) {\n record.collapsed.hidden = !showCollapsed;\n setInert(record.collapsed, !showCollapsed);\n }\n if (record.handle) {\n const disabled = isResponsiveStacked()\n || collapsed\n || record.props.size === 'fill'\n || record.props.resize === 'none';\n record.handle.dataset.orientation = orientation;\n record.handle.dataset.resizeEdge = record.props.resize;\n record.handle.setAttribute('aria-label', `Resize ${record.props.id} panel`);\n record.handle.toggleAttribute('data-resize-disabled', disabled);\n record.handle.hidden = isResponsiveStacked();\n record.handle.className = resolveStyle({\n part: panelsStyles.parts.resizeHandle,\n props: {orientation, edge: record.props.resize},\n className: record.handle.dataset.class ?? '',\n });\n }\n };\n\n const syncDividers = (items: PanelRecord[]): void => {\n items.forEach((record, index) => {\n const next = items[index + 1];\n const interactive = record.props.resize === 'end' || next?.props.resize === 'start';\n declareMorphAttributes(record.panel, 'data-divider');\n setPresence({\n el: record.panel,\n attr: 'data-divider',\n present: currentProps().divider && next !== undefined && !interactive,\n });\n });\n };\n\n const targetForToggle = (toggle: HTMLElement): {record: PanelRecord; controller: PanelsController} | null => {\n const explicit = toggle.dataset.target || '';\n if (!explicit) {\n const panel = toggle.closest<HTMLElement>('[data-ui-panel]');\n const group = panel?.closest<HTMLElement>('[data-ui-panels]');\n const controller = [...controllers].find((item) => item.id === group?.id);\n const record = panel && controller === component ? recordFor(panel.id) : null;\n return record && controller ? {record, controller} : null;\n }\n const groupId = toggle.dataset.groupId || toggle.closest<HTMLElement>('[data-ui-panels]')?.id;\n const candidates = [...controllers].filter((item) => !groupId || item.id === groupId);\n const controller = candidates.find((item) => item.hasPanel(explicit));\n const record = controller === component ? recordFor(explicit) : null;\n return record && controller ? {record, controller} : null;\n };\n\n const syncToggles = (): void => {\n document.querySelectorAll<HTMLElement>('[data-ui-panel-toggle]').forEach((toggle) => {\n const target = targetForToggle(toggle);\n if (!target || target.controller !== component) return;\n const collapsed = isCollapsed(target.record.props.id);\n toggle.dataset.target = target.record.props.id;\n toggle.dataset.groupId = currentProps().id;\n toggle.dataset.state = collapsed ? 'collapsed' : 'expanded';\n toggle.setAttribute('aria-controls', target.record.panel.id);\n toggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true');\n toggle.toggleAttribute('disabled', !target.record.props.collapsible);\n });\n };\n\n const syncAll = (): void => {\n const props = currentProps();\n const orientation = effectiveOrientation();\n root().dataset.responsiveMode = responsiveMode;\n root().dataset.layoutOrientation = orientation;\n root().style.flexDirection = orientation === 'horizontal' ? 'row' : 'column';\n root().className = resolveStyle({\n part: panelsStyles.parts.root,\n props: {...props, orientation},\n className: props.class,\n });\n setPresence({el: root(), attr: 'data-resizing', present: bridge.hasTag('resizing')});\n setPresence({el: root(), attr: 'data-transitioning', present: bridge.hasTag('transitioning')});\n const items = records();\n items.forEach(syncPanel);\n syncDividers(items);\n syncToggles();\n };\n\n const focusExpanded = (record: PanelRecord, force = false): void => {\n const active = document.activeElement;\n if (!force && (!(active instanceof HTMLElement) || !record.collapsed?.contains(active))) return;\n const remembered = rememberedFocus.get(record.props.id);\n if (remembered?.isConnected && record.expanded.contains(remembered)) focusElement(remembered);\n else {\n record.expanded.tabIndex = -1;\n focusElement(record.expanded);\n }\n };\n\n const focusCollapsed = (record: PanelRecord, force = false): void => {\n const active = document.activeElement;\n if (!force && (!(active instanceof HTMLElement) || !record.expanded.contains(active))) return;\n const collapsedTarget = record.collapsed ? tabbableElements(record.collapsed)[0] : undefined;\n const external = activeTriggers.get(record.props.id);\n const fallback = external?.isConnected && !record.panel.contains(external) ? external : undefined;\n if (collapsedTarget) focusElement(collapsedTarget);\n else if (fallback) focusElement(fallback);\n else {\n root().tabIndex = -1;\n focusElement(root());\n }\n };\n\n const prepareChange = (): void => {\n const changed = [...context().change.openingIds, ...context().change.closingIds];\n const openingNeedsFocus = new Set(context().change.openingIds.filter((id) => {\n const record = recordFor(id);\n const active = document.activeElement;\n return record !== null\n && record.collapsed !== null\n && active instanceof HTMLElement\n && record.collapsed.contains(active);\n }));\n const from = new Map(changed.flatMap((id) => {\n const record = recordFor(id);\n if (!record) return [];\n if (context().change.closingIds.includes(id)) {\n const active = document.activeElement;\n if (active instanceof HTMLElement && record.expanded.contains(active)) rememberedFocus.set(id, active);\n }\n return [[id, mainSize(record.panel)] as const];\n }));\n syncAll();\n context().change.openingIds.forEach((id) => {\n const record = recordFor(id);\n if (record) focusExpanded(record, openingNeedsFocus.has(id));\n });\n changed.forEach((id) => {\n const record = recordFor(id);\n const start = from.get(id);\n if (!record || start === undefined) return;\n const target = mainSize(record.panel);\n transitionGeometry.set(id, {from: start, to: target});\n applyGeometry(record, start);\n });\n };\n\n const finishChange = (): void => {\n const opening = [...context().change.openingIds];\n const closing = [...context().change.closingIds];\n const closingNeedsFocus = new Set(closing.filter((id) => {\n const record = recordFor(id);\n const active = document.activeElement;\n return record !== null && active instanceof HTMLElement && record.expanded.contains(active);\n }));\n records().forEach((record) => applyGeometry(record));\n syncAll();\n closing.forEach((id) => {\n const record = recordFor(id);\n if (record) focusCollapsed(record, closingNeedsFocus.has(id));\n });\n opening.forEach((panelId) => emitPanelEvent('ui:panel-expand', panelId));\n closing.forEach((panelId) => emitPanelEvent('ui:panel-collapse', panelId));\n [...opening, ...closing].forEach((id) => transitionGeometry.delete(id));\n };\n\n const emitPanelEvent = (name: string, panelId: string, detail: Record<string, unknown> = {}): void => {\n dispatch({el: root(), name, detail: {\n groupId: currentProps().id,\n panelId,\n __panelsNotification: true,\n ...detail,\n }});\n };\n\n const persist = (): void => {\n const layout = context().layout;\n if (currentProps().persist) {\n try {\n localStorage.setItem(storageKey(currentProps().id), JSON.stringify({\n collapsed: layout.collapsedIds,\n sizes: layout.committedSizes,\n }));\n } catch {\n // Persistence is optional; layout state remains committed in memory.\n }\n }\n dispatch({el: root(), name: 'ui:panels-layout-change', detail: {\n groupId: currentProps().id,\n collapsed: [...layout.collapsedIds],\n sizes: {...layout.committedSizes},\n __panelsNotification: true,\n }});\n };\n\n const runWhenStable = (callback: () => void): void => {\n if (!rootEl) return;\n if (bridge.hasTag('stable')) {\n callback();\n return;\n }\n const timer = window.setTimeout(() => {\n deferredTimers.delete(timer);\n runWhenStable(callback);\n }, 16);\n deferredTimers.add(timer);\n };\n\n const reconcileCollapsedState = (\n ids: readonly string[],\n wantsCollapsed: (id: string) => boolean,\n ): void => {\n const next = ids.find((id) => wantsCollapsed(id) !== isCollapsed(id));\n if (!next) return;\n bridge.send({type: wantsCollapsed(next) ? 'COLLAPSE' : 'EXPAND', panelId: next});\n runWhenStable(() => reconcileCollapsedState(ids, wantsCollapsed));\n };\n\n const restorePersistedLayout = (): void => {\n if (!currentProps().persist) return;\n let stored: {collapsed?: unknown; sizes?: unknown};\n try {\n stored = JSON.parse(localStorage.getItem(storageKey(currentProps().id)) ?? 'null') as {\n collapsed?: unknown;\n sizes?: unknown;\n };\n } catch {\n return;\n }\n if (typeof stored !== 'object' || stored === null) return;\n\n const collection = collectionState();\n const collapsible = collection.filter((descriptor) => descriptor.collapsible);\n const desiredCollapsed = new Set(\n (Array.isArray(stored.collapsed) ? stored.collapsed : [])\n .filter((id): id is string => (\n typeof id === 'string' && collapsible.some((descriptor) => descriptor.id === id)\n )),\n );\n const desiredSizes = numericRecord(stored.sizes);\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(collapsible.map(({id}) => id), (id) => desiredCollapsed.has(id));\n };\n\n const restoreSizes = (): void => {\n const changes = collection.filter((descriptor) => descriptor.kind === 'bounded')\n .flatMap(({id}): PanelSizingTransitionData[] => {\n const record = recordFor(id);\n const storedSize = desiredSizes[id];\n if (!record || storedSize === undefined) return [];\n const from = mainSize(record.panel);\n const to = clampPanelSize(record, storedSize);\n return Math.abs(from - to) < 0.5 ? [] : [{panelId: id, from, to}];\n });\n if (isResponsiveStacked()) {\n if (changes.length > 0) bridge.send({type: 'RESTORE_HIDDEN_SIZES', changes});\n restoreCollapsedState();\n return;\n }\n const hidden = changes.filter(({panelId: id}) => isCollapsed(id));\n const visible = changes.filter(({panelId: id}) => !isCollapsed(id));\n if (hidden.length > 0) bridge.send({type: 'RESTORE_HIDDEN_SIZES', changes: hidden});\n if (visible.length > 0) {\n bridge.send({type: 'SIZE', changes: visible});\n runWhenStable(restoreCollapsedState);\n return;\n }\n restoreCollapsedState();\n };\n\n const opening = collapsible.map(({id}) => id)\n .filter((id) => isCollapsed(id) && !desiredCollapsed.has(id));\n if (opening.length > 0) {\n reconcileCollapsedState(opening, () => false);\n runWhenStable(restoreSizes);\n } else restoreSizes();\n };\n\n const schedulePersistedRestore = (): void => {\n const first = requestAnimationFrame(() => {\n restoreFrames.delete(first);\n const second = requestAnimationFrame(() => {\n restoreFrames.delete(second);\n restorePersistedLayout();\n });\n restoreFrames.add(second);\n });\n restoreFrames.add(first);\n };\n\n const resetLayout = (panelId?: string): void => {\n const collection = collectionState();\n const targets = panelId ? collection.filter(({id}) => id === panelId) : collection;\n if (targets.length === 0) return;\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(\n targets.filter((descriptor) => descriptor.collapsible).map(({id}) => id),\n (id) => collection.find((descriptor) => descriptor.id === id)?.defaultCollapsed === true,\n );\n };\n\n const sizedIds = targets.filter((descriptor) => descriptor.kind === 'bounded')\n .map(({id}) => id)\n .filter((id) => Object.hasOwn(context().layout.committedSizes, id));\n if (isResponsiveStacked()) {\n if (sizedIds.length > 0) {\n bridge.send({type: 'RESET_HIDDEN_SIZES', ids: sizedIds});\n runWhenStable(restoreCollapsedState);\n } else restoreCollapsedState();\n return;\n }\n const hiddenIds = sizedIds.filter(isCollapsed);\n if (hiddenIds.length > 0) bridge.send({type: 'RESET_HIDDEN_SIZES', ids: hiddenIds});\n\n const visible = sizedIds.filter((id) => !isCollapsed(id)).flatMap((id): PanelSizingTransitionData[] => {\n const record = recordFor(id);\n if (!record || record.props.size === 'fill') return [];\n return [{\n panelId: id,\n from: mainSize(record.panel),\n to: cssLength(`--spacing-panel-${record.props.size}`),\n reset: true,\n }];\n });\n if (visible.length > 0) {\n bridge.send({type: 'SIZE', changes: visible});\n runWhenStable(restoreCollapsedState);\n return;\n }\n restoreCollapsedState();\n };\n\n const prepareSizing = (): void => {\n context().sizing.changes.forEach(({panelId: id, from}) => {\n const record = recordFor(id);\n if (record) applyGeometry(record, from);\n });\n };\n\n const finishSizing = (): void => {\n context().sizing.changes.forEach(({panelId: id, to}) => {\n const record = recordFor(id);\n if (!record) return;\n applyGeometry(record);\n emitPanelEvent('ui:panel-resize-end', id, {size: to});\n });\n syncAll();\n };\n\n const resizeDirection = (edge: PanelResizeEdge): ResizeDirection => {\n if (effectiveOrientation() === 'vertical') return edge === 'start' ? 'negative' : 'positive';\n const rtl = isRtl({el: root()});\n return edge === 'start' ? rtl ? 'positive' : 'negative' : rtl ? 'negative' : 'positive';\n };\n\n const initializeResizeHandles = (): void => {\n const group = resizeCleanup;\n if (!group) return;\n const currentPanels = new Set(records().map(({panel}) => panel));\n resizeCleanups.forEach((owner, panel) => {\n if (currentPanels.has(panel)) return;\n owner.run();\n resizeCleanups.delete(panel);\n });\n records().forEach((record) => {\n if (resizeCleanups.has(record.panel) || !record.handle || record.props.size === 'fill' || record.props.resize === 'none') return;\n const bounds = boundsFor(record);\n const handleSize = cssLength('--spacing-panel-resize-handle');\n const coarseHandleSize = cssLength('--spacing-panel-resize-handle-coarse');\n const owner = new CleanupManager();\n group.addChild(owner);\n owner.add(createResizable({\n element: record.panel,\n handle: record.handle,\n axis: effectiveOrientation() === 'horizontal' ? 'x' : 'y',\n direction: resizeDirection(record.props.resize),\n min: bounds.minimum,\n max: bounds.maximum,\n mode: 'onChange',\n hitArea: handleSize,\n coarseHitArea: coarseHandleSize,\n disabled: () => isResponsiveStacked() || isCollapsed(record.props.id),\n onStart: (event) => bridge.send({type: 'RESIZE_START', panelId: record.props.id, size: resizeValue(event)}),\n onResize: (event) => bridge.send({type: 'RESIZE', panelId: record.props.id, size: resizeValue(event)}),\n onEnd: (event) => bridge.send({type: 'RESIZE_END', panelId: record.props.id, size: resizeValue(event)}),\n }));\n resizeCleanups.set(record.panel, owner);\n });\n };\n\n const reinitializeResizeHandles = (): void => {\n resizeCleanup?.run();\n resizeCleanups.clear();\n resizeCleanup = new CleanupManager();\n cleanup.addChild(resizeCleanup);\n initializeResizeHandles();\n };\n\n const resizeValue = (event: ResizeEvent): number => effectiveOrientation() === 'horizontal'\n ? event.previewWidth\n : event.previewHeight;\n\n const reconcileResponsiveMode = (width: number): void => {\n const next: PanelsResponsiveMode = currentProps().orientation === 'horizontal'\n && width < compositionBreakpointPixels(root(), 'sm')\n ? 'stacked'\n : 'wide';\n if (next === responsiveMode) return;\n responsiveMode = next;\n syncAll();\n reinitializeResizeHandles();\n };\n\n const bridge = createAlpineMachine({\n schema: panelsSchema,\n hooks: panelsHooks,\n resolveTransitionElement: ({data}) => {\n const panelId = (data as PanelTransitionData | undefined)?.panelId;\n return panelId ? recordFor(panelId)?.panel ?? null : root();\n },\n createMachine: ({props}) => createPanelsMachine({\n props,\n context: initialContext(),\n effects: {\n prepareChange,\n finishChange,\n sync: () => {\n syncAll();\n reinitializeResizeHandles();\n },\n beginResize: () => {\n syncAll();\n },\n previewResize: () => {\n const id = context().resize.activeId;\n const record = recordFor(id);\n if (record) applyGeometry(record);\n const size = context().resize.previewSize;\n if (size !== null) emitPanelEvent('ui:panel-resize', id, {size});\n },\n commitResize: (scope) => {\n syncAll();\n const id = typeof scope.event.panelId === 'string' ? scope.event.panelId : '';\n const size = context().layout.committedSizes[id];\n if (id && size !== undefined) emitPanelEvent('ui:panel-resize-end', id, {size});\n },\n cancelResize: syncAll,\n prepareSizing,\n finishSizing,\n persist,\n },\n }),\n });\n\n const sendPanelsChanged = (): void => {\n const collection = collectionState();\n bridge.send({type: 'PANELS_CHANGED', collection});\n initializeResizeHandles();\n };\n\n const setupObserver = (): void => {\n disconnectObserver = observeSemanticChanges({\n targets: root(),\n read: collectionState,\n onChange: sendPanelsChanged,\n observer: {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\n 'id', 'data-size', 'data-resize', 'data-collapsible', 'data-default-collapsed',\n ],\n },\n });\n };\n\n let component!: TrellisAlpineComponent<PanelsData>;\n component = {\n ...bridge,\n get id() { return root().id || currentProps().id; },\n get orientation() { return effectiveOrientation(); },\n get collapsed() { return [...context().layout.collapsedIds]; },\n get sizes() { return {...context().layout.committedSizes}; },\n get root(): BindingObject {\n const props = this.snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: panelsStyles.parts.root, props, className: props.class}),\n {'data-ui-panels': ''},\n ]});\n },\n init(): void {\n cleanup = cleanupManagerFor(this);\n resizeCleanup = new CleanupManager();\n cleanup.addChild(resizeCleanup);\n rootEl = this.$el;\n bridge.connect(this.$el, this.snapshot);\n root().id ||= currentProps().id;\n responsiveMode = currentProps().orientation === 'horizontal'\n && root().getBoundingClientRect().width < compositionBreakpointPixels(root(), 'sm')\n ? 'stacked'\n : 'wide';\n controllers.add(component);\n registerDocumentListeners();\n syncAll();\n initializeResizeHandles();\n resizeObserver = new ResizeObserver((entries) => {\n reconcileResponsiveMode(entries[0]?.contentRect.width ?? root().clientWidth);\n });\n resizeObserver.observe(root());\n setupObserver();\n if (currentProps().persist) schedulePersistedRestore();\n addListener({target: root(), event: 'keydown', handler: () => syncToggles(), cleanup});\n },\n destroy(): void {\n controllers.delete(component);\n disconnectObserver?.();\n disconnectObserver = null;\n resizeObserver?.disconnect();\n resizeObserver = null;\n resizeCleanups.clear();\n resizeCleanup = null;\n deferredTimers.forEach((timer) => window.clearTimeout(timer));\n deferredTimers.clear();\n restoreFrames.forEach((frame) => cancelAnimationFrame(frame));\n restoreFrames.clear();\n bridge.disconnect();\n rootEl = null;\n },\n transitionPanel(transition: PanelMotionTransition): MotionHandle {\n const id = transition.data.panelId;\n const record = recordFor(id);\n const geometry = transitionGeometry.get(id);\n if (!record || !geometry || geometry.from === geometry.to) {\n if (record) applyGeometry(record, geometry?.to);\n return noopHandle();\n }\n return animateSize(transition, {\n target: record.panel,\n keyframes: {flexBasis: [`${geometry.from}px`, `${geometry.to}px`]},\n role: 'layout',\n cleanup: () => applyGeometry(record),\n });\n },\n transitionPanelSize(transition: PanelSizingMotionTransition): MotionHandle {\n const {panelId: id, from, to} = transition.data;\n const record = recordFor(id);\n if (!record || from === to) {\n if (record) applyGeometry(record);\n return noopHandle();\n }\n return animateSize(transition, {\n target: record.panel,\n keyframes: {flexBasis: [`${from}px`, `${to}px`]},\n role: 'layoutQuick',\n cleanup: () => applyGeometry(record),\n });\n },\n hasPanel(id: string): boolean { return recordFor(id) !== null; },\n isCollapsed,\n collapse(id: string): void { bridge.send({type: 'COLLAPSE', panelId: id}); },\n expand(id: string): void { bridge.send({type: 'EXPAND', panelId: id}); },\n toggle(id: string): void { bridge.send({type: 'TOGGLE', panelId: id}); },\n resize(id: string, size: number): void {\n const record = recordFor(id);\n if (\n isResponsiveStacked()\n || !record\n || record.props.size === 'fill'\n || isCollapsed(id)\n || !Number.isFinite(size)\n ) return;\n const from = mainSize(record.panel);\n const to = clampPanelSize(record, size);\n if (Math.abs(from - to) < 0.5) return;\n bridge.send({type: 'SIZE', panelId: id, from, to});\n },\n reset(id?: string): void { resetLayout(id); },\n perform(action: PanelToggleAction, id: string, trigger?: HTMLElement | null): void {\n if (trigger) activeTriggers.set(id, trigger);\n ({collapse: this.collapse, expand: this.expand, toggle: this.toggle})[action](id);\n },\n syncToggles,\n };\n\n return component;\n};\n\nconst UiPanelToggle = (): TrellisAlpineComponent<{\n props: PanelToggleProps;\n readonly root: BindingObject;\n trigger(event?: Event): void;\n}> => {\n let props = {} as PanelToggleProps;\n return {\n get props() { return props; },\n init() { props = decodeProps({el: this.$el, schema: panelToggleSchema}); },\n destroy() {},\n get root() {\n return mergeBindings({inputs: [\n resolveStyle({part: panelsStyles.parts.toggle, props: {}, className: props.class}),\n {\n 'data-ui-panel-toggle': '',\n ':data-target': () => props.target || undefined,\n ':data-action': () => props.action,\n '@click': (event: Event) => this.trigger(event),\n },\n ]});\n },\n trigger(event?: Event) {\n event?.preventDefault();\n const button = this.$el as HTMLElement;\n const closestPanel = button.closest<HTMLElement>('[data-ui-panel]');\n const closestGroup = closestPanel?.closest<HTMLElement>('[data-ui-panels]');\n const target = props.target || closestPanel?.id || '';\n if (!target) return;\n document.dispatchEvent(new CustomEvent('ui:panel-toggle', {detail: {\n panelId: target,\n groupId: closestGroup?.id,\n action: props.action,\n trigger: button,\n }}));\n },\n };\n};\n\nconst registerPanels = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiPanels', UiPanels)(AlpineInstance);\n defineAlpineData('UiPanelToggle', UiPanelToggle)(AlpineInstance);\n};\n\nexport {registerPanels, UiPanels, UiPanelToggle};\nexport type {\n PanelEventDetail,\n PanelsData,\n PanelsPersistTransitionData,\n PanelSizingTransitionData,\n PanelsTransition,\n UiPanelsApi,\n};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerResizableCapability} from '../../capabilities/resizable';\nimport {registerPanels as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerPanels = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerResizableCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerPanels};\nexport default registerPanels;\nexport * from './index';\n"],"mappings":"6vBAEA,IAAM,IACF,EACA,IACS,CACT,IAAM,EAAQ,iBAAiB,CAAS,CAAC,CA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G,EACzE,SAAU,CAAC,EACX,IAAI,MAAO,CACP,OAAO,GAAc,CAAC,OAAQ,CAC1B,EAAa,CAAC,KAAM,EAAa,MAAM,OAAQ,MAAO,CAAC,EAAG,UAAW,EAAM,KAAK,CAAC,EACjF,CACI,uBAAwB,GACxB,mBAAsB,EAAM,QAAU,IAAA,GACtC,mBAAsB,EAAM,OAC5B,SAAW,GAAiB,KAAK,QAAQ,CAAK,CAClD,CACJ,CAAC,CAAC,CACN,EACA,QAAQ,EAAe,CACnB,GAAO,eAAe,EACtB,IAAM,EAAS,KAAK,IACd,EAAe,EAAO,QAAqB,iBAAiB,EAC5D,EAAe,GAAc,QAAqB,kBAAkB,EACpE,EAAS,EAAM,QAAU,GAAc,IAAM,GAC9C,GACL,SAAS,cAAc,IAAI,YAAY,kBAAmB,CAAC,OAAQ,CAC/D,QAAS,EACT,QAAS,GAAc,GACvB,OAAQ,EAAM,OACd,QAAS,CACb,CAAC,CAAC,CAAC,CACP,CACJ,CACJ,EAEM,GAAkB,GAAwC,CAC5D,EAAiB,WAAY,CAAQ,CAAC,CAAC,CAAc,EACrD,EAAiB,gBAAiB,EAAa,CAAC,CAAC,CAAc,CACnE,ECp+BM,GAAa,IAAI,QAEjB,EAAkB,GAAqC,CACrD,GAAW,IAAI,CAAc,IACjC,GAAW,IAAI,CAAc,EAC7B,EAAyB,CAAc,EACvC,EAA4B,CAAc,EAC1C,GAAkB,CAAc,EACpC"}
@@ -1,2 +0,0 @@
1
- import{i as e,n as t,r as n}from"./dom-DiTFTWeR.js";import{t as r}from"./capability-motion-B7n3PcSH.js";import{f as i,l as a,n as o,u as s}from"./codecs-CQ7olTJL.js";import{i as c,t as l}from"./alpine-machine-CE2UN4Qu.js";import{n as u}from"./alpine-data-Dvc_bXq6.js";import{t as d}from"./collection-navigation-hTbwy6oQ.js";import{n as f,t as p}from"./styles-CX2j92ex.js";import{t as m}from"./merge-bindings-BtqW3UgP.js";import{t as h}from"./machine-CNnHDbyo.js";import{n as g,t as _}from"./props-change-2xfsIAEN.js";import{t as v}from"./semantic-observer-CIoriWtV.js";import{F as y,g as b}from"./common-De1R7Xh6.js";var x=[`single`,`multiple`],S=y,C=[`trailing`,`leading`];[...C];var w=b;[...w];var T={mode:a(x,`single`),animate:o,collapsible:o,disabled:o,orientation:a(S,`vertical`),defaultValue:i,defaultValues:i,value:i,values:i,loop:o.default(!0),iconPosition:a(C,`trailing`),headingAs:a(w,`h3`),class:i},E=[c({name:`opening`,state:`changing`,projectEach:e=>e.context.change.openingValues.map(e=>({value:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{open:e=>({type:`OPEN`,value:e}),close:e=>({type:`CLOSE`,value:e}),toggle:e=>({type:`TOGGLE`,value:e}),setValues:e=>({type:`SET_VALUES`,values:e})}}),c({name:`closing`,state:`changing`,projectEach:e=>e.context.change.closingValues.map(e=>({value:e})),onDone:`CHANGE_DONE`,onError:`CHANGE_ERROR`,sends:{open:e=>({type:`OPEN`,value:e}),close:e=>({type:`CLOSE`,value:e}),toggle:e=>({type:`TOGGLE`,value:e}),setValues:e=>({type:`SET_VALUES`,values:e})}})],D=e=>typeof e==`string`?e:``,O=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],k=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),A=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),j=(e,t,n)=>{let r=new Set(e.filter(e=>n.values.includes(e))),i=n.values.filter(e=>r.has(e));return t.mode===`single`?i.slice(0,1):i},M=e=>e.mode===`multiple`?k(e.values||e.value):e.value?[e.value]:[],N=e=>g(e.event)?.props??e.props,P=e=>e.event.type===`ITEMS_CHANGED`?{values:O(e.event.values),disabledValues:O(e.event.disabledValues)}:e.context.collection,F=(e,t,n)=>{let r=e.context.selection.values,i=D(e.event.value);switch(e.event.type){case`OPEN`:return!i||n.disabledValues.includes(i)?r:t.mode===`single`?[i]:[...r,i];case`CLOSE`:return!i||n.disabledValues.includes(i)||t.mode===`single`&&!t.collapsible&&r.includes(i)?r:r.filter(e=>e!==i);case`TOGGLE`:return!i||n.disabledValues.includes(i)?r:r.includes(i)?t.mode===`single`&&!t.collapsible?r:r.filter(e=>e!==i):t.mode===`single`?[i]:[...r,i];case`SET_VALUES`:return O(e.event.values);case`PROPS_CHANGED`:return _(e.event,`value`,`values`)?M(t):r;case`ITEMS_CHANGED`:return r;default:return r}},I=e=>{let t=N(e),n=P(e);return j(F(e,t,n),t,n)},L=e=>!([`OPEN`,`CLOSE`,`TOGGLE`,`SET_VALUES`].includes(e.event.type)&&e.props.disabled)&&!A(e.context.selection.values,I(e)),R=({props:e,context:t,effects:n})=>h({initial:`stable`,states:{stable:{tags:[`stable`],on:{OPEN:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},CLOSE:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},SET_VALUES:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},PROPS_CHANGED:[{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},{reduce:`reconcile`,effects:`syncProps`}],ITEMS_CHANGED:[{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},{reduce:`reconcile`,effects:`syncItems`}]}},changing:{tags:[`changing`,`transitioning`],on:{CHANGE_DONE:{target:`stable`,effects:`finishChange`},CHANGE_ERROR:{target:`stable`,effects:`finishChange`},OPEN:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},CLOSE:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},SET_VALUES:{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},PROPS_CHANGED:[{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},{reduce:`reconcile`,effects:`syncProps`}],ITEMS_CHANGED:[{target:`changing`,guard:L,reduce:`applyChange`,effects:`prepareChange`},{reduce:`reconcile`,effects:`syncItems`}]}}}},{context:t,props:e,reducers:{applyChange:e=>{let t=I(e),n=e.context.selection.values;return{props:N(e),context:{...e.context,selection:{values:t},change:{openingValues:t.filter(e=>!n.includes(e)),closingValues:n.filter(e=>!t.includes(e))},collection:P(e)}}},reconcile:e=>({props:N(e),context:{...e.context,collection:P(e),selection:{values:I(e)}}})},effects:{prepareChange:n.prepareChange,finishChange:n.finishChange,syncProps:n.syncProps,syncItems:n.syncItems}}),z=p({definition:{component:`ui.accordion`,parts:{root:{base:`grid w-full min-w-0 gap-0`,variants:{orientation:{vertical:``,horizontal:`gap-2 md:grid-flow-col md:auto-cols-fr`}},defaults:{orientation:`vertical`}},item:{base:`min-w-0 border-b-edge-separator border-separator last:border-b-0 data-disabled:opacity-50`},heading:{base:`block text-surface-ink`},trigger:{base:[`flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-control-sm border border-transparent px-3 py-2`,`text-left text-sm font-medium text-surface-ink outline-none`,`focus-visible:ui-focus-ring`,`data-disabled:pointer-events-none data-disabled:opacity-50`]},triggerLabel:{base:`min-w-0 flex-1`},icon:{base:`size-icon shrink-0 fill-current text-icon`},content:{base:`overflow-hidden text-sm text-surface-ink-muted`},contentInner:{base:`min-w-0 px-3 pb-3 pt-1`}}}}),B=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),V=e=>e?`open`:`closed`,H=e=>e.trim().replace(/[^a-zA-Z0-9_-]+/g,`-`)||`item`,U=()=>{let r=null,i=null,a=null,o=e=>e,c=()=>{if(!r)throw Error(`Accordion has not been initialized.`);return r},u=e=>e.closest(`[data-ui-accordion]`)===c(),p=()=>Array.from(c().querySelectorAll(`[data-ui-accordion-item]`)).filter(u).map((e,n)=>{let r=e.querySelector(`[data-ui-accordion-trigger]`),i=e.querySelector(`[data-ui-accordion-content]`);return!(r instanceof HTMLButtonElement)||!i||!u(r)||!u(i)?null:(e.dataset.value||=`item-${n+1}`,{item:e,heading:e.querySelector(`[data-ui-accordion-heading]`),trigger:r,content:i,value:e.dataset.value,disabled:t({value:e.dataset.itemDisabled})})}).filter(e=>e!==null),h=e=>p().find(t=>t.value===e)??null,g=e=>{if(!(e instanceof Element))return null;let t=e.closest(`[data-ui-accordion-item]`);return t&&u(t)?p().find(e=>e.item===t)??null:null},_=()=>{let e=p();return{values:e.map(e=>e.value),disabledValues:e.filter(e=>e.disabled).map(e=>e.value)}},y=(e,t,n)=>{let r=new Set(e),i=n.filter(e=>r.has(e));return t.mode===`single`?i.slice(0,1):i},b=e=>{let n=_(),r=e.mode===`multiple`?B(e.values||e.value):e.value?[e.value]:[],i=e.mode===`multiple`?B(e.defaultValues):e.defaultValue?[e.defaultValue]:[],a=p().filter(e=>t({value:e.item.dataset.open})).map(e=>e.value),o=r.length>0?r:i.length>0?i:a;return{selection:{values:y(o,e,n.values)},change:{openingValues:[],closingValues:[]},collection:n}},x=()=>N.getCommittedSnapshot().props,S=()=>N.getCommittedSnapshot().context,C=e=>S().selection.values.includes(e.value),w=e=>x().disabled||e.disabled,D=e=>x().mode===`multiple`||x().collapsible||!C(e),O=()=>{let e=x(),t=S().selection.values;s({el:c(),schema:T,key:`value`,value:e.mode===`single`?t[0]??``:``}),s({el:c(),schema:T,key:`values`,value:e.mode===`multiple`?t.join(`,`):``}),c().dataset.orientation=e.orientation,c().dataset.iconPosition=e.iconPosition,c().dataset.mode=e.mode,e.disabled?c().setAttribute(`data-disabled`,``):c().removeAttribute(`data-disabled`)},k,A=e=>{let t=x(),n=C(e),r=V(n),i=w(e),a=N.hasTag(`changing`)&&S().change.closingValues.includes(e.value);e.item.dataset.state=r,e.item.dataset.orientation=t.orientation,e.item.className=f({part:z.parts.item,props:t,className:e.item.dataset.class??``}),e.heading?.setAttribute(`data-state`,r),e.heading?.setAttribute(`data-orientation`,t.orientation);let s=H(e.value);e.trigger.id||=o(`accordion-trigger-${s}`),e.content.id||=o(`accordion-content-${s}`),e.trigger.type=`button`,e.trigger.dataset.state=r,e.trigger.dataset.orientation=t.orientation,e.trigger.className=f({part:z.parts.trigger,props:t,className:e.trigger.dataset.class??``}),e.trigger.setAttribute(`aria-expanded`,n?`true`:`false`),e.trigger.setAttribute(`aria-controls`,e.content.id),e.content.dataset.state=r,e.content.dataset.orientation=t.orientation,e.content.setAttribute(`aria-labelledby`,e.trigger.id),e.content.hidden=!n&&!a,[e.item,e.heading,e.trigger,e.content].forEach(e=>{e&&(i?e.setAttribute(`data-disabled`,``):e.removeAttribute(`data-disabled`))}),e.trigger.disabled=i,i||n&&!D(e)?e.trigger.setAttribute(`aria-disabled`,`true`):e.trigger.removeAttribute(`aria-disabled`)},j=()=>{O(),p().forEach(A)},M=()=>{let e=[...S().selection.values];n({el:c(),name:`ui:change`,detail:{value:x().mode===`single`?e[0]??``:``,values:e}})},N=l({schema:T,hooks:E,resolveTransitionElement:({data:e})=>{let t=e.value;return h(t)?.content??null},createMachine:({props:e})=>R({props:e,context:b(e),effects:{prepareChange:()=>{j(),M()},finishChange:()=>{j()},syncProps:j,syncItems:j}})}),P=()=>{if(!i)throw Error(`Accordion navigation has not been initialized.`);return i},F=()=>{let e=_();N.send({type:`ITEMS_CHANGED`,...e})},I=(e,t)=>{t?.preventDefault(),!w(e)&&N.send({type:`TOGGLE`,value:e.value,motion:!(t instanceof KeyboardEvent)})},L=e=>{let t=g(e.target);t&&e.target instanceof Node&&t.trigger.contains(e.target)&&I(t,e)},U=t=>{let n=g(t.target);if(n&&t.target===n.trigger){if(t.key===`Enter`||t.key===` `){I(n,t);return}if(t.key===`Home`){t.preventDefault(),P().focusFirst();return}if(t.key===`End`){t.preventDefault(),P().focusLast();return}if(x().orientation===`vertical`){t.key===`ArrowDown`?(t.preventDefault(),P().focusNext()):t.key===`ArrowUp`&&(t.preventDefault(),P().focusPrevious());return}t.key===`ArrowRight`?(t.preventDefault(),e({el:c()})?P().focusPrevious():P().focusNext()):t.key===`ArrowLeft`&&(t.preventDefault(),e({el:c()})?P().focusNext():P().focusPrevious())}},W=e=>{let t=g(e.target);t&&e.target===t.trigger&&!w(t)&&P().activateItem({el:t.trigger})},G=()=>{a=v({targets:c(),read:_,onChange:F,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-value`,`data-item-disabled`]}})};return k={...N,get value(){return x().mode===`single`?this.snapshot.current?.context.selection.values[0]??``:``},get values(){return[...this.snapshot.current?.context.selection.values??[]]},init(){r=this.$el,o=this.$id.bind(this),N.connect(this.$el,this.snapshot),i=d({root:c,itemSelector:`[data-ui-accordion-trigger]`,isDisabled:e=>e.hasAttribute(`disabled`),loop:()=>x().loop}),j(),G()},destroy(){a?.(),a=null,N.disconnect(),i=null,r=null},get root(){let e=this.snapshot.current?.props??x();return m({inputs:[f({part:z.parts.root,props:e,className:e.class}),{"data-ui-accordion":``,":data-orientation":()=>x().orientation,":data-disabled":()=>x().disabled?``:void 0,"@click":L,"@keydown":e=>{e instanceof KeyboardEvent&&U(e)},"@focusin":W}]})},open(e){N.send({type:`OPEN`,value:e})},close(e){N.send({type:`CLOSE`,value:e})},toggle(e,t){let n=h(e);n&&I(n,t)},isOpen(e){return this.snapshot.current?.context.selection.values.includes(e)??!1}},k},W=u(`UiAccordion`,U),G=new WeakSet,K=e=>{G.has(e)||(G.add(e),r(e),W(e))};export{U as n,K as t};
2
- //# sourceMappingURL=entry.generated-CC-C5gQn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.generated-CC-C5gQn.js","names":[],"sources":["../../../../../../../../client/src/components/accordion/contract.ts","../../../../../../../../client/src/components/accordion/machine.ts","../../../../../../../../client/src/components/accordion/styles.ts","../../../../../../../../client/src/components/accordion/index.ts","../../../../../../../../client/src/components/accordion/entry.generated.ts"],"sourcesContent":["import {bool, oneOf, string, type SchemaToProps} from '../../runtime';\nimport {HEADING_LEVELS, ORIENTATIONS, type HeadingLevel, type Orientation} from '../common';\n\nconst ACCORDION_MODES = ['single', 'multiple'] as const;\nconst ACCORDION_ORIENTATIONS = ORIENTATIONS;\nconst ACCORDION_ICON_POSITIONS = ['trailing', 'leading'] as const;\nconst ACCORDION_ITEM_ICON_POSITIONS = ['inherit', ...ACCORDION_ICON_POSITIONS] as const;\nconst ACCORDION_HEADING_AS = HEADING_LEVELS;\nconst ACCORDION_ITEM_HEADING_AS = ['inherit', ...ACCORDION_HEADING_AS] as const;\n\nconst accordionSchema = {\n mode: oneOf(ACCORDION_MODES, 'single'),\n animate: bool,\n collapsible: bool,\n disabled: bool,\n orientation: oneOf(ACCORDION_ORIENTATIONS, 'vertical'),\n defaultValue: string,\n defaultValues: string,\n value: string,\n values: string,\n loop: bool.default(true),\n iconPosition: oneOf(ACCORDION_ICON_POSITIONS, 'trailing'),\n headingAs: oneOf(ACCORDION_HEADING_AS, 'h3'),\n class: string,\n};\n\ntype AccordionMode = typeof ACCORDION_MODES[number];\ntype AccordionOrientation = Orientation;\ntype AccordionIconPosition = typeof ACCORDION_ICON_POSITIONS[number];\ntype AccordionItemIconPosition = typeof ACCORDION_ITEM_ICON_POSITIONS[number];\ntype AccordionHeadingAs = HeadingLevel;\ntype AccordionItemHeadingAs = typeof ACCORDION_ITEM_HEADING_AS[number];\ntype AccordionProps = SchemaToProps<typeof accordionSchema>;\n\nexport {\n ACCORDION_HEADING_AS,\n ACCORDION_ICON_POSITIONS,\n ACCORDION_ITEM_HEADING_AS,\n ACCORDION_ITEM_ICON_POSITIONS,\n ACCORDION_ORIENTATIONS,\n ACCORDION_MODES,\n accordionSchema,\n};\nexport type {\n AccordionHeadingAs,\n AccordionIconPosition,\n AccordionItemHeadingAs,\n AccordionItemIconPosition,\n AccordionOrientation,\n AccordionProps,\n AccordionMode,\n};\n","import {\n createMachine,\n propsChanged,\n propsChangedEvent,\n type Machine,\n type MachineEventObject,\n type MachineScope,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {AccordionProps} from './contract';\n\ntype AccordionContext = {\n selection: {values: string[]};\n change: {openingValues: string[]; closingValues: string[]};\n collection: {values: string[]; disabledValues: string[]};\n};\n\ntype AccordionTransitionData = {value: string};\n\ntype AccordionMachineEffects = {\n prepareChange(scope: MachineScope<AccordionContext, AccordionProps>): void;\n finishChange(scope: MachineScope<AccordionContext, AccordionProps>): void;\n syncProps(scope: MachineScope<AccordionContext, AccordionProps>): void;\n syncItems(scope: MachineScope<AccordionContext, AccordionProps>): void;\n};\n\ntype CreateAccordionMachineOptions = {\n props: AccordionProps;\n context: AccordionContext;\n effects: AccordionMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.openingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'changing',\n projectEach: (snapshot) => snapshot.context.change.closingValues.map((value) => ({value})),\n onDone: 'CHANGE_DONE',\n onError: 'CHANGE_ERROR',\n sends: {\n open: (value: string) => ({type: 'OPEN', value}),\n close: (value: string) => ({type: 'CLOSE', value}),\n toggle: (value: string) => ({type: 'TOGGLE', value}),\n setValues: (values: string[]) => ({type: 'SET_VALUES', values}),\n },\n} satisfies TransitionHookDefinition<AccordionContext, AccordionProps, AccordionTransitionData, 'closing'>);\n\nconst accordionHooks = [openingHook, closingHook] as const;\n\nconst stringValue = (value: unknown): string => typeof value === 'string' ? value : '';\nconst stringValues = (value: unknown): string[] => Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string')\n : [];\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst sameValues = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((value, index) => value === right[index])\n);\n\nconst normalizeValues = (\n values: readonly string[],\n props: AccordionProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const requested = new Set(values.filter((value) => collection.values.includes(value)));\n const ordered = collection.values.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n};\n\nconst controlledValues = (props: AccordionProps): string[] => (\n props.mode === 'multiple' ? splitValues(props.values || props.value) : props.value ? [props.value] : []\n);\n\nconst nextProps = (scope: MachineScope<AccordionContext, AccordionProps>): AccordionProps => (\n propsChangedEvent<AccordionProps>(scope.event)?.props ?? scope.props\n);\n\nconst nextCollection = (\n scope: MachineScope<AccordionContext, AccordionProps>,\n): AccordionContext['collection'] => {\n if (scope.event.type !== 'ITEMS_CHANGED') return scope.context.collection;\n return {\n values: stringValues(scope.event.values),\n disabledValues: stringValues(scope.event.disabledValues),\n };\n};\n\nconst requestedValues = (\n scope: MachineScope<AccordionContext, AccordionProps>,\n props: AccordionProps,\n collection: AccordionContext['collection'],\n): string[] => {\n const current = scope.context.selection.values;\n const value = stringValue(scope.event.value);\n switch (scope.event.type) {\n case 'OPEN':\n if (!value || collection.disabledValues.includes(value)) return current;\n return props.mode === 'single' ? [value] : [...current, value];\n case 'CLOSE':\n if (\n !value\n || collection.disabledValues.includes(value)\n || (props.mode === 'single' && !props.collapsible && current.includes(value))\n ) return current;\n return current.filter((item) => item !== value);\n case 'TOGGLE':\n if (!value || collection.disabledValues.includes(value)) return current;\n if (!current.includes(value)) return props.mode === 'single' ? [value] : [...current, value];\n if (props.mode === 'single' && !props.collapsible) return current;\n return current.filter((item) => item !== value);\n case 'SET_VALUES':\n return stringValues(scope.event.values);\n case 'PROPS_CHANGED':\n if (propsChanged<AccordionProps>(scope.event, 'value', 'values')) return controlledValues(props);\n return current;\n case 'ITEMS_CHANGED':\n return current;\n default:\n return current;\n }\n};\n\nconst nextValues = (scope: MachineScope<AccordionContext, AccordionProps>): string[] => {\n const props = nextProps(scope);\n const collection = nextCollection(scope);\n return normalizeValues(requestedValues(scope, props, collection), props, collection);\n};\n\nconst selectionChanges = (scope: MachineScope<AccordionContext, AccordionProps>): boolean => (\n !(\n ['OPEN', 'CLOSE', 'TOGGLE', 'SET_VALUES'].includes(scope.event.type)\n && scope.props.disabled\n ) && !sameValues(scope.context.selection.values, nextValues(scope))\n);\n\nconst createAccordionMachine = ({\n props,\n context,\n effects,\n}: CreateAccordionMachineOptions): Machine<AccordionContext, AccordionProps> => createMachine<AccordionContext, AccordionProps>({\n initial: 'stable',\n states: {\n stable: {\n tags: ['stable'],\n on: {\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n changing: {\n tags: ['changing', 'transitioning'],\n on: {\n CHANGE_DONE: {target: 'stable', effects: 'finishChange'},\n CHANGE_ERROR: {target: 'stable', effects: 'finishChange'},\n OPEN: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n CLOSE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n TOGGLE: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n SET_VALUES: {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n PROPS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncProps'},\n ],\n ITEMS_CHANGED: [\n {target: 'changing', guard: selectionChanges, reduce: 'applyChange', effects: 'prepareChange'},\n {reduce: 'reconcile', effects: 'syncItems'},\n ],\n },\n },\n },\n}, {\n context,\n props,\n reducers: {\n applyChange: (scope) => {\n const values = nextValues(scope);\n const previous = scope.context.selection.values;\n return {\n props: nextProps(scope),\n context: {\n ...scope.context,\n selection: {values},\n change: {\n openingValues: values.filter((value) => !previous.includes(value)),\n closingValues: previous.filter((value) => !values.includes(value)),\n },\n collection: nextCollection(scope),\n },\n };\n },\n reconcile: (scope) => ({\n props: nextProps(scope),\n context: {\n ...scope.context,\n collection: nextCollection(scope),\n selection: {values: nextValues(scope)},\n },\n }),\n },\n effects: {\n prepareChange: effects.prepareChange,\n finishChange: effects.finishChange,\n syncProps: effects.syncProps,\n syncItems: effects.syncItems,\n },\n});\n\nexport {accordionHooks, createAccordionMachine};\nexport type {\n AccordionContext,\n AccordionMachineEffects,\n AccordionTransitionData,\n CreateAccordionMachineOptions,\n};\n","import {defineStyles} from '../../runtime';\n\nconst accordionStyles = defineStyles({definition: {\n component: 'ui.accordion',\n parts: {\n root: {\n base: 'grid w-full min-w-0 gap-0',\n variants: {\n orientation: {\n vertical: '',\n horizontal: 'gap-2 md:grid-flow-col md:auto-cols-fr',\n },\n },\n defaults: {\n orientation: 'vertical',\n },\n },\n item: {\n base: 'min-w-0 border-b-edge-separator border-separator last:border-b-0 data-disabled:opacity-50',\n },\n heading: {\n base: 'block text-surface-ink',\n },\n trigger: {\n base: [\n 'flex min-h-control-xlg w-full min-w-0 items-center gap-2 rounded-control-sm border border-transparent px-3 py-2',\n 'text-left text-sm font-medium text-surface-ink outline-none',\n 'focus-visible:ui-focus-ring',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n ],\n },\n triggerLabel: {\n base: 'min-w-0 flex-1',\n },\n icon: {\n base: 'size-icon shrink-0 fill-current text-icon',\n },\n content: {\n base: 'overflow-hidden text-sm text-surface-ink-muted',\n },\n contentInner: {\n base: 'min-w-0 px-3 pb-3 pt-1',\n },\n },\n}});\n\nexport {accordionStyles};\n","import type Alpine from 'alpinejs';\n\nimport {\n type AlpineMachine,\n createAlpineMachine,\n type BindingObject,\n createCollectionNavigation,\n type CollectionNavigation,\n defineAlpineData,\n mergeBindings,\n type MachineSnapshot,\n observeSemanticChanges,\n reflectSchemaProp,\n resolveStyle,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {asBool, dispatch, isRtl} from '@client/utils';\nimport {accordionSchema, type AccordionMode, type AccordionProps} from './contract';\nimport {\n accordionHooks,\n createAccordionMachine,\n type AccordionContext,\n type AccordionTransitionData,\n} from './machine';\nimport {accordionStyles} from './styles';\n\ntype AccordionTransitionName = (typeof accordionHooks)[number]['name'];\ntype AccordionTransition<TName extends AccordionTransitionName = AccordionTransitionName> = TransitionForHook<\n Extract<(typeof accordionHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype AccordionItemRecord = {\n item: HTMLElement;\n heading: HTMLElement | null;\n trigger: HTMLButtonElement;\n content: HTMLElement;\n value: string;\n disabled: boolean;\n};\n\n/**\n * Public Alpine API for `ui.accordion`.\n *\n * @public\n */\ninterface UiAccordionApi {\n /** Open value in single mode, otherwise an empty string. */\n readonly value: string;\n\n /** Open values in document order. */\n readonly values: readonly string[];\n\n /** Opens an enabled item. In single mode it replaces the current value. */\n open(value: string): void;\n\n /** Closes an item when the current mode permits it. */\n close(value: string): void;\n\n /** Reverses an item's current disclosure state. */\n toggle(value: string, event?: Event): void;\n\n /** Whether an item belongs to the current open-value set. */\n isOpen(value: string): boolean;\n}\n\ntype AccordionData = AlpineMachine<AccordionContext, AccordionProps, typeof accordionHooks> & UiAccordionApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst splitValues = (value: string): string[] => value.split(',').map((item) => item.trim()).filter(Boolean);\nconst stateFor = (open: boolean): 'open' | 'closed' => open ? 'open' : 'closed';\nconst safeIdPart = (value: string): string => value.trim().replace(/[^a-zA-Z0-9_-]+/g, '-') || 'item';\n\nconst UiAccordion = (): TrellisAlpineComponent<AccordionData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let collection: CollectionNavigation | null = null;\n let disconnectObserver: (() => void) | null = null;\n let idFor = (key: string): string => key;\n\n const root = (): HTMLElement & Alpine.ElementWithXAttributes => {\n if (!rootEl) throw new Error('Accordion has not been initialized.');\n return rootEl;\n };\n\n const owns = (element: Element): boolean => element.closest('[data-ui-accordion]') === root();\n\n const items = (): AccordionItemRecord[] => Array.from(\n root().querySelectorAll<HTMLElement>('[data-ui-accordion-item]'),\n ).filter(owns).map((item, index) => {\n const trigger = item.querySelector<HTMLElement>('[data-ui-accordion-trigger]');\n const content = item.querySelector<HTMLElement>('[data-ui-accordion-content]');\n if (!(trigger instanceof HTMLButtonElement) || !content || !owns(trigger) || !owns(content)) return null;\n item.dataset.value ||= `item-${index + 1}`;\n return {\n item,\n heading: item.querySelector<HTMLElement>('[data-ui-accordion-heading]'),\n trigger,\n content,\n value: item.dataset.value,\n disabled: asBool({value: item.dataset.itemDisabled}),\n } satisfies AccordionItemRecord;\n }).filter((item): item is AccordionItemRecord => item !== null);\n\n const itemForValue = (value: string): AccordionItemRecord | null => (\n items().find((item) => item.value === value) ?? null\n );\n\n const itemFrom = (target: EventTarget | null): AccordionItemRecord | null => {\n if (!(target instanceof Element)) return null;\n const itemEl = target.closest<HTMLElement>('[data-ui-accordion-item]');\n return itemEl && owns(itemEl) ? items().find((item) => item.item === itemEl) ?? null : null;\n };\n\n const collectionContext = (): AccordionContext['collection'] => {\n const records = items();\n return {\n values: records.map((item) => item.value),\n disabledValues: records.filter((item) => item.disabled).map((item) => item.value),\n };\n };\n\n const normalize = (\n values: readonly string[],\n props: AccordionProps,\n itemValues: readonly string[],\n ): string[] => {\n const requested = new Set(values);\n const ordered = itemValues.filter((value) => requested.has(value));\n return props.mode === 'single' ? ordered.slice(0, 1) : ordered;\n };\n\n const initialContext = (props: AccordionProps): AccordionContext => {\n const collectionState = collectionContext();\n const controlled = props.mode === 'multiple'\n ? splitValues(props.values || props.value)\n : props.value ? [props.value] : [];\n const defaults = props.mode === 'multiple'\n ? splitValues(props.defaultValues)\n : props.defaultValue ? [props.defaultValue] : [];\n const authored = items().filter((item) => asBool({value: item.item.dataset.open})).map((item) => item.value);\n const requested = controlled.length > 0 ? controlled : defaults.length > 0 ? defaults : authored;\n return {\n selection: {values: normalize(requested, props, collectionState.values)},\n change: {openingValues: [], closingValues: []},\n collection: collectionState,\n };\n };\n\n const currentProps = (): Readonly<AccordionProps> => bridge.getCommittedSnapshot().props;\n const currentContext = (): Readonly<AccordionContext> => bridge.getCommittedSnapshot().context;\n\n const itemIsOpen = (item: AccordionItemRecord): boolean => currentContext().selection.values.includes(item.value);\n const itemIsDisabled = (item: AccordionItemRecord): boolean => currentProps().disabled || item.disabled;\n const canCollapse = (item: AccordionItemRecord): boolean => (\n currentProps().mode === 'multiple' || currentProps().collapsible || !itemIsOpen(item)\n );\n\n const syncRoot = (): void => {\n const props = currentProps();\n const values = currentContext().selection.values;\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'value',\n value: props.mode === 'single' ? values[0] ?? '' : '',\n });\n reflectSchemaProp({\n el: root(),\n schema: accordionSchema,\n key: 'values',\n value: props.mode === 'multiple' ? values.join(',') : '',\n });\n root().dataset.orientation = props.orientation;\n root().dataset.iconPosition = props.iconPosition;\n root().dataset.mode = props.mode;\n if (props.disabled) root().setAttribute('data-disabled', '');\n else root().removeAttribute('data-disabled');\n };\n\n let component!: TrellisAlpineComponent<AccordionData>;\n\n const syncItem = (item: AccordionItemRecord): void => {\n const props = currentProps();\n const open = itemIsOpen(item);\n const state = stateFor(open);\n const disabled = itemIsDisabled(item);\n const closing = bridge.hasTag('changing') && currentContext().change.closingValues.includes(item.value);\n\n item.item.dataset.state = state;\n item.item.dataset.orientation = props.orientation;\n item.item.className = resolveStyle({\n part: accordionStyles.parts.item,\n props,\n className: item.item.dataset.class ?? '',\n });\n item.heading?.setAttribute('data-state', state);\n item.heading?.setAttribute('data-orientation', props.orientation);\n\n const idPart = safeIdPart(item.value);\n item.trigger.id ||= idFor(`accordion-trigger-${idPart}`);\n item.content.id ||= idFor(`accordion-content-${idPart}`);\n item.trigger.type = 'button';\n item.trigger.dataset.state = state;\n item.trigger.dataset.orientation = props.orientation;\n item.trigger.className = resolveStyle({\n part: accordionStyles.parts.trigger,\n props,\n className: item.trigger.dataset.class ?? '',\n });\n item.trigger.setAttribute('aria-expanded', open ? 'true' : 'false');\n item.trigger.setAttribute('aria-controls', item.content.id);\n item.content.dataset.state = state;\n item.content.dataset.orientation = props.orientation;\n item.content.setAttribute('aria-labelledby', item.trigger.id);\n item.content.hidden = !open && !closing;\n\n [item.item, item.heading, item.trigger, item.content].forEach((element) => {\n if (!element) return;\n if (disabled) element.setAttribute('data-disabled', '');\n else element.removeAttribute('data-disabled');\n });\n item.trigger.disabled = disabled;\n if (disabled || (open && !canCollapse(item))) item.trigger.setAttribute('aria-disabled', 'true');\n else item.trigger.removeAttribute('aria-disabled');\n };\n\n const syncAll = (): void => {\n syncRoot();\n items().forEach(syncItem);\n };\n\n const emitChange = (): void => {\n const values = [...currentContext().selection.values];\n dispatch({el: root(), name: 'ui:change', detail: {\n value: currentProps().mode === 'single' ? values[0] ?? '' : '',\n values,\n }});\n };\n\n const bridge = createAlpineMachine({\n schema: accordionSchema,\n hooks: accordionHooks,\n resolveTransitionElement: ({data}) => {\n const value = (data as AccordionTransitionData).value;\n return itemForValue(value)?.content ?? null;\n },\n createMachine: ({props}) => createAccordionMachine({\n props,\n context: initialContext(props),\n effects: {\n prepareChange: () => {\n syncAll();\n emitChange();\n },\n finishChange: () => {\n syncAll();\n },\n syncProps: syncAll,\n syncItems: syncAll,\n },\n }),\n });\n\n const collectionNav = (): CollectionNavigation => {\n if (!collection) throw new Error('Accordion navigation has not been initialized.');\n return collection;\n };\n\n const sendItemsChanged = (): void => {\n const next = collectionContext();\n bridge.send({type: 'ITEMS_CHANGED', ...next});\n };\n\n const handleToggle = (item: AccordionItemRecord, event?: Event): void => {\n event?.preventDefault();\n if (itemIsDisabled(item)) return;\n bridge.send({type: 'TOGGLE', value: item.value, motion: !(event instanceof KeyboardEvent)});\n };\n\n const handleClick = (event: Event): void => {\n const item = itemFrom(event.target);\n if (!item || !(event.target instanceof Node) || !item.trigger.contains(event.target)) return;\n handleToggle(item, event);\n };\n\n const handleKeydown = (event: KeyboardEvent): void => {\n const item = itemFrom(event.target);\n if (!item || event.target !== item.trigger) return;\n if (event.key === 'Enter' || event.key === ' ') {\n handleToggle(item, event);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n collectionNav().focusFirst();\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n collectionNav().focusLast();\n return;\n }\n if (currentProps().orientation === 'vertical') {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n collectionNav().focusNext();\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n collectionNav().focusPrevious();\n }\n return;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusPrevious();\n else collectionNav().focusNext();\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (isRtl({el: root()})) collectionNav().focusNext();\n else collectionNav().focusPrevious();\n }\n };\n\n const handleFocus = (event: Event): void => {\n const item = itemFrom(event.target);\n if (item && event.target === item.trigger && !itemIsDisabled(item)) {\n collectionNav().activateItem({el: item.trigger});\n }\n };\n\n const setupObserver = (): void => {\n disconnectObserver = observeSemanticChanges({\n targets: root(),\n read: collectionContext,\n onChange: sendItemsChanged,\n observer: {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-value', 'data-item-disabled'],\n },\n });\n };\n\n component = {\n ...bridge,\n get value(): string {\n return currentProps().mode === 'single' ? this.snapshot.current?.context.selection.values[0] ?? '' : '';\n },\n get values(): readonly string[] {\n return [...this.snapshot.current?.context.selection.values ?? []];\n },\n init(): void {\n rootEl = this.$el;\n idFor = this.$id.bind(this);\n bridge.connect(this.$el, this.snapshot);\n collection = createCollectionNavigation({\n root,\n itemSelector: '[data-ui-accordion-trigger]',\n isDisabled: (el) => el.hasAttribute('disabled'),\n loop: () => currentProps().loop,\n });\n syncAll();\n setupObserver();\n },\n destroy(): void {\n disconnectObserver?.();\n disconnectObserver = null;\n bridge.disconnect();\n collection = null;\n rootEl = null;\n },\n get root(): BindingObject {\n const props = this.snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: accordionStyles.parts.root, props, className: props.class}),\n {\n 'data-ui-accordion': '',\n ':data-orientation': () => currentProps().orientation,\n ':data-disabled': () => currentProps().disabled ? '' : undefined,\n '@click': handleClick,\n '@keydown': (event: Event) => {\n if (event instanceof KeyboardEvent) handleKeydown(event);\n },\n '@focusin': handleFocus,\n },\n ]});\n },\n open(value: string): void {\n bridge.send({type: 'OPEN', value});\n },\n close(value: string): void {\n bridge.send({type: 'CLOSE', value});\n },\n toggle(value: string, event?: Event): void {\n const item = itemForValue(value);\n if (item) handleToggle(item, event);\n },\n isOpen(value: string): boolean {\n return this.snapshot.current?.context.selection.values.includes(value) ?? false;\n },\n };\n\n return component;\n};\n\nconst registerAccordion = defineAlpineData('UiAccordion', UiAccordion);\n\nexport {registerAccordion, UiAccordion};\nexport type {AccordionData, AccordionMode, AccordionTransition, UiAccordionApi};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerAccordion as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerAccordion = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nexport {registerAccordion};\nexport default registerAccordion;\nexport * from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