@vireo-ai/trellis-ui 0.1.46 → 0.1.48

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 (137) hide show
  1. package/package.json +1 -1
  2. package/packages/client/src/components/checkbox/styles.css +5 -0
  3. package/packages/client/src/components/sidebar/styles.css +8 -0
  4. package/packages/client/src/styles/generated/theme-fonts.css +1 -1
  5. package/packages/client/src/styles/generated/theme-palette.css +1 -1
  6. package/packages/client/src/styles/generated/theme-runtime.css +37 -37
  7. package/packages/client/src/styles/generated-sources.css +1 -1
  8. package/packages/client/src/styles/recipes/selection.css +0 -4
  9. package/packages/client/types/components/app/contract.d.ts +7 -7
  10. package/packages/client/types/components/box/contract.d.ts +2 -2
  11. package/packages/client/types/components/card/contract.d.ts +2 -2
  12. package/packages/client/types/components/container/contract.d.ts +2 -2
  13. package/packages/client/types/components/date-picker/contract.d.ts +2 -2
  14. package/packages/client/types/components/date-picker/machine.d.ts +4 -4
  15. package/packages/client/types/components/file-upload/contract.d.ts +1 -1
  16. package/packages/client/types/components/file-upload/index.d.ts +2 -0
  17. package/packages/client/types/components/file-upload/machine.d.ts +2 -1
  18. package/packages/client/types/components/flex/contract.d.ts +2 -2
  19. package/packages/client/types/components/frame/contract.d.ts +2 -2
  20. package/packages/client/types/components/grid/contract.d.ts +2 -2
  21. package/packages/client/types/components/layout.d.ts +2 -2
  22. package/packages/client/types/components/menu/contract.d.ts +2 -2
  23. package/packages/client/types/components/modal/contract.d.ts +2 -2
  24. package/packages/client/types/components/section/contract.d.ts +2 -2
  25. package/packages/client/types/components/select/contract.d.ts +2 -2
  26. package/packages/client/types/components/select/machine.d.ts +4 -4
  27. package/packages/client/types/components/sidebar/contract.d.ts +3 -3
  28. package/packages/client/types/components/sidebar/machine.d.ts +3 -3
  29. package/packages/client/types/components/stack/contract.d.ts +2 -2
  30. package/packages/client/types/components/tooltip/contract.d.ts +4 -4
  31. package/packages/client/types/motion/flip.d.ts +14 -0
  32. package/packages/client/types/motion/index.d.ts +2 -0
  33. package/packages/client/types/motion/size.d.ts +25 -0
  34. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +43 -42
  35. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  36. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +294 -280
  37. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
  38. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/shortcut.js +1 -1
  39. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
  40. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-C8JwDQHB.js +2 -0
  41. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-LgqzTNla.js.map → capability-motion-C8JwDQHB.js.map} +1 -1
  42. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-shortcut-Z-__iteD.js +2 -0
  43. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-shortcut-Z-__iteD.js.map +1 -0
  44. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-Ms02uATJ.js +3 -0
  45. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-DhIaUo4k.js.map → capability-sortable-Ms02uATJ.js.map} +1 -1
  46. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{controller-DsXbNzqk.js → controller-BOf7dxV2.js} +2 -2
  47. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{controller-DsXbNzqk.js.map → controller-BOf7dxV2.js.map} +1 -1
  48. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-DFCT8LQq.js → core-D_APohl9.js} +2 -2
  49. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-DFCT8LQq.js.map → core-D_APohl9.js.map} +1 -1
  50. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-invalidation-Dw6clnS4.js +2 -0
  51. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-invalidation-Dw6clnS4.js.map +1 -0
  52. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DnQY2zaY.js → entry.generated-6GztwKjx.js} +2 -2
  53. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DnQY2zaY.js.map → entry.generated-6GztwKjx.js.map} +1 -1
  54. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BK8q8vxJ.js +2 -0
  55. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BK8q8vxJ.js.map +1 -0
  56. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BNM7EWpC.js +2 -0
  57. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BNM7EWpC.js.map +1 -0
  58. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Bl38ruYD.js +2 -0
  59. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Bl38ruYD.js.map +1 -0
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DpIBgUZ3.js → entry.generated-C0kdsGqX.js} +2 -2
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DpIBgUZ3.js.map → entry.generated-C0kdsGqX.js.map} +1 -1
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C5kjUnFe.js +2 -0
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C5kjUnFe.js.map +1 -0
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CZWpqP88.js +2 -0
  65. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CZWpqP88.js.map +1 -0
  66. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6qaa8bk.js +2 -0
  67. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D6qaa8bk.js.map +1 -0
  68. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DRZyI4u3.js +2 -0
  69. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DRZyI4u3.js.map +1 -0
  70. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BTe_Q79G.js → entry.generated-DcCdeWRk.js} +2 -2
  71. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BTe_Q79G.js.map → entry.generated-DcCdeWRk.js.map} +1 -1
  72. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-pap9Z0I-.js → entry.generated-DckTWjSU.js} +2 -2
  73. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-pap9Z0I-.js.map → entry.generated-DckTWjSU.js.map} +1 -1
  74. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DVQC6yVd.js → entry.generated-DldFffYN.js} +2 -2
  75. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DVQC6yVd.js.map → entry.generated-DldFffYN.js.map} +1 -1
  76. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-OqzkZfIu.js +2 -0
  77. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-OqzkZfIu.js.map +1 -0
  78. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-XfwHguip.js → entry.generated-RR5GZAgO.js} +2 -2
  79. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-XfwHguip.js.map → entry.generated-RR5GZAgO.js.map} +1 -1
  80. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-dyQ_HJ8D.js +2 -0
  81. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-dyQ_HJ8D.js.map +1 -0
  82. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-jxSblEo7.js +2 -0
  83. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-jxSblEo7.js.map +1 -0
  84. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-BlyJpJAE.js +3 -0
  85. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-BlyJpJAE.js.map +1 -0
  86. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CfByjNaO.js +4 -0
  87. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CfByjNaO.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/direct-upload.js +1 -1
  93. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
  94. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/file-upload.js +1 -1
  95. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
  96. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/keybinding.js +1 -1
  97. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
  98. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
  99. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
  100. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
  101. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
  102. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
  103. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
  104. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
  105. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
  106. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
  107. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +125 -108
  108. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +9 -9
  109. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +9 -9
  110. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-LgqzTNla.js +0 -2
  111. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-shortcut-Br_XBf7u.js +0 -2
  112. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-shortcut-Br_XBf7u.js.map +0 -1
  113. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-DhIaUo4k.js +0 -3
  114. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B-PuCg-D.js +0 -2
  115. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B-PuCg-D.js.map +0 -1
  116. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B8aXTJK6.js +0 -2
  117. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B8aXTJK6.js.map +0 -1
  118. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B956G6Cz.js +0 -2
  119. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B956G6Cz.js.map +0 -1
  120. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B_xTkYSB.js +0 -2
  121. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B_xTkYSB.js.map +0 -1
  122. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CSgqcIg6.js +0 -2
  123. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CSgqcIg6.js.map +0 -1
  124. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DNtvOM3X.js +0 -2
  125. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DNtvOM3X.js.map +0 -1
  126. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-RnJw-Qs4.js +0 -2
  127. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-RnJw-Qs4.js.map +0 -1
  128. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-ifMDOEy_.js +0 -2
  129. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-ifMDOEy_.js.map +0 -1
  130. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-jP0UEZIS.js +0 -2
  131. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-jP0UEZIS.js.map +0 -1
  132. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CB866C3K.js +0 -2
  133. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CB866C3K.js.map +0 -1
  134. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-D2EM1olE.js +0 -3
  135. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-D2EM1olE.js.map +0 -1
  136. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CV0dnUFY.js +0 -4
  137. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CV0dnUFY.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.generated-DNtvOM3X.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/external/file.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-entering-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/external-adapter.js","../../../../../../../../client/src/components/file-upload/contract.ts","../../../../../../../../client/src/components/file-upload/machine.ts","../../../../../../../../client/src/components/file-upload/styles.ts","../../../../../../../../client/src/components/file-upload/index.ts","../../../../../../../../client/src/components/file-upload/entry.generated.ts"],"sourcesContent":["export function containsFiles(_ref) {\n var source = _ref.source;\n return source.types.includes('Files');\n}\n\n/** Obtain an array of the dragged `File`s */\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getFiles(_ref2) {\n var source = _ref2.source;\n return source.items\n // unlike other media types, for files:\n // item.kind is 'file'\n // item.type is the type of file eg 'image/jpg'\n // for other media types, item.type is the mime format\n .filter(function (item) {\n return item.kind === 'file';\n }).map(function (item) {\n return item.getAsFile();\n }).filter(function (file) {\n return file != null;\n });\n}","import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\nimport { isEnteringWindowInSafari } from './count-events-for-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\nexport function isEnteringWindow(_ref) {\n var dragEnter = _ref.dragEnter;\n var type = dragEnter.type,\n relatedTarget = dragEnter.relatedTarget;\n if (type !== 'dragenter') {\n return false;\n }\n if (isSafari()) {\n return isEnteringWindowInSafari({\n dragEnter: dragEnter\n });\n }\n\n // standard check\n if (relatedTarget == null) {\n return true;\n }\n\n /**\n * 🦊 Exception: `iframe` in Firefox (`125.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `relatedTarget` is the `iframe` element in the parent `window`\n * (foreign element)\n *\n * Case 2: child `iframe` → parent `window`\n * `relatedTarget` is an element inside the child `iframe`\n * (foreign element)\n */\n\n if (isFirefox()) {\n return isFromAnotherWindow(relatedTarget);\n }\n\n /**\n * 🌏 Exception: `iframe` in Chrome (`124.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `relatedTarget` is `null` *(standard check)*\n *\n * Case 2: child `iframe` → parent `window`\n * `relatedTarget` is the `iframe` element in the parent `window`\n */\n\n // Case 2\n // Using `instanceof` check as the element will be in the same `window`\n return relatedTarget instanceof HTMLIFrameElement;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bind, bindAll } from 'bind-event-listener';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { androidFallbackText } from '../util/android';\nimport { isEnteringWindow } from '../util/changing-window/is-entering-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { textMediaType } from '../util/media-types/text-media-type';\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\nexport function isAnAvailableType(_ref) {\n var type = _ref.type,\n value = _ref.value;\n // We don't want to expose our private elementAdapter key / value\n if (type === elementAdapterNativeDataKey) {\n return false;\n }\n // Not exposing \"text/plain\" if it contains the android fallback text\n // We _could_ add an `isAndroid()` check, but it's probably safest\n // to trim this data out, regardless of what OS we see it on.\n if (type === textMediaType && value === androidFallbackText) {\n return false;\n }\n return true;\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getAvailableTypes(transfer) {\n return Array.from(transfer.types).filter(function (type) {\n return isAnAvailableType({\n type: type,\n value: transfer.getData(type)\n });\n });\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function getAvailableItems(dataTransfer) {\n // item.kind is 'string' | 'file'\n // For 'string' item.type is the mimeType (eg 'text/plain')\n // For 'file' item.type is the file type (eg 'image/jpg')\n\n return Array.from(dataTransfer.items).filter(function (item) {\n return item.kind === 'file' || isAnAvailableType({\n type: item.type,\n value: dataTransfer.getData(item.type)\n });\n });\n}\nvar didDragStartLocally = false;\nvar adapter = makeAdapter({\n typeKey: 'external',\n // for external drags, we are generally making a copy of something that is being dragged\n defaultDropEffect: 'copy',\n mount: function mount(api) {\n // Binding to the `window` so that the element adapter\n // has a chance to get in first on the`document`.\n // We are giving preference to the element adapter.\n return bind(window, {\n type: 'dragenter',\n listener: function listener(event) {\n // drag operation was started within the document, it won't be an \"external\" drag\n if (didDragStartLocally) {\n return;\n }\n\n // Note: not checking if event was cancelled (`event.defaultPrevented`) as\n // cancelling a \"dragenter\" accepts the drag operation (not prevent it)\n\n // Something has gone wrong with our drag event\n if (!event.dataTransfer) {\n // Including this code on \"test\" and \"development\" environments:\n // - Browser tests commonly run against \"development\" builds\n // - Unit tests commonly run in \"test\"\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\"\\n It appears as though you have are not testing DragEvents correctly.\\n\\n - If you are unit testing, ensure you have polyfilled DragEvent.\\n - If you are browser testing, ensure you are dispatching drag events correctly.\\n\\n Please see our testing guides for more information:\\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\\n \".replace(/ {2}/g, ''));\n }\n return;\n }\n if (!api.canStart(event)) {\n return;\n }\n if (!isEnteringWindow({\n dragEnter: event\n })) {\n return;\n }\n\n // Note: not checking types for `elementAdapterNativeDataKey` as we expect to see that\n // key when pdnd started the drag in another document\n var types = getAvailableTypes(event.dataTransfer);\n if (!types.length) {\n return;\n }\n var locked = {\n types: types,\n items: [],\n getStringData: function getStringData() {\n return null;\n }\n };\n api.start({\n event: event,\n dragType: {\n type: 'external',\n startedFrom: 'external',\n payload: locked,\n getDropPayload: function getDropPayload(event) {\n // this would be a platform error\n // trying to handle it gracefully rather than throwing (for now)\n if (!event.dataTransfer) {\n return locked;\n }\n var items = getAvailableItems(event.dataTransfer);\n // need to use `.bind` as `getData` is required\n // to be run with `event.dataTransfer` as the \"this\" context\n var nativeGetData = event.dataTransfer.getData.bind(event.dataTransfer);\n return {\n types: types,\n items: items,\n // return `null` if there is no result, otherwise string\n getStringData: function getStringData(mediaType) {\n // not dragging the requested type\n // return `null` (no result)\n if (!types.includes(mediaType)) {\n return null;\n }\n\n // nativeGetData will return `\"\"` when there is no value,\n // but at this point we know we will only get explicitly set\n // values back as we have checked the `types`.\n // `\"\"` can be an explicitly set value.\n var value = nativeGetData(mediaType);\n\n // not exposing data for unavailable types\n if (!isAnAvailableType({\n type: mediaType,\n value: value\n })) {\n return null;\n }\n return value;\n }\n };\n }\n }\n });\n }\n });\n }\n});\n\n/**\n * Some events don't make sense for the external adapter\n *\n * `onGenerateDragPreview`\n * The browser creates the drag preview for external drags, so we don't\n * need an event to generate the preview for _monitors_ or the _dropTarget_\n *\n * `onDragStart`\n * An external drag can never start from in the `window`, so _dropTarget_'s\n * don't need `onDragStart`\n */\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function dropTargetForExternal(args) {\n // not removing unused events, just leaning on the type system\n return adapter.dropTarget(args);\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function monitorForExternal(args) {\n // not removing unused events, just leaning on the type system\n return adapter.monitor(args);\n}\n(function startup() {\n // server side rendering check\n if (typeof window === 'undefined') {\n return;\n }\n\n // A shared single usage registration as we want to capture\n // all external drag operations, even if there are no drop targets\n // on the page yet\n adapter.registerUsage();\n // independent of pdnd, we need to keep track of\n // all drag operations so that we can know if a drag operation\n // has started locally\n\n var idle = {\n type: 'idle'\n };\n var state = idle;\n function clear() {\n if (state.type !== 'dragging') {\n return;\n }\n didDragStartLocally = false;\n state.cleanup();\n state = idle;\n }\n function bindEndEvents() {\n return bindAll(window, [{\n type: 'dragend',\n listener: clear\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: clear\n }))),\n // we want to make sure we get all the events,\n // and this helps avoid not seeing events when folks stop\n // them later on the event path\n {\n capture: true\n });\n }\n\n // we always keep this event listener active\n bind(window, {\n type: 'dragstart',\n listener: function listener() {\n // something bad has happened if this is true!\n if (state.type !== 'idle') {\n return;\n }\n // set our global flag\n didDragStartLocally = true;\n state = {\n type: 'dragging',\n cleanup: bindEndEvents()\n };\n },\n // binding in the capture phase so these listeners are called\n // before our listeners in the adapters `mount` function\n options: {\n capture: true\n }\n });\n})();\n\n/** Common event payload for all events */\n\n/** A map containing payloads for all events */\n\n/** Common event payload for all drop target events */\n\n/** A map containing payloads for all events on drop targets */\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForExternal` */\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForExternal` */","import {bool, number, oneOf, string, type SchemaToProps} from '../../runtime';\n\nconst FILE_UPLOAD_LAYOUTS = ['stack', 'inline'] as const;\nconst FILE_UPLOAD_PREVIEWS = ['auto', 'image', 'none'] as const;\nconst FILE_UPLOAD_SIZES = ['sm', 'md', 'lg'] as const;\nconst FILE_UPLOAD_TRANSPORTS = ['native', 'direct'] as const;\n\ntype FileUploadLayout = (typeof FILE_UPLOAD_LAYOUTS)[number];\ntype FileUploadPreview = (typeof FILE_UPLOAD_PREVIEWS)[number];\ntype FileUploadSize = (typeof FILE_UPLOAD_SIZES)[number];\ntype FileUploadTransport = (typeof FILE_UPLOAD_TRANSPORTS)[number];\n\nconst fileUploadSchema = {\n name: string,\n accept: string,\n capture: string,\n multiple: bool,\n required: bool,\n disabled: bool,\n invalid: bool,\n preview: oneOf(FILE_UPLOAD_PREVIEWS, 'auto' as FileUploadPreview),\n layout: oneOf(FILE_UPLOAD_LAYOUTS, 'stack' as FileUploadLayout),\n size: oneOf(FILE_UPLOAD_SIZES, 'md' as FileUploadSize),\n heading: string.default('Drop files here or browse'),\n text: string,\n browseLabel: string,\n empty: string,\n maxItems: number.min(0).default(0),\n clearable: bool.default(true),\n transport: oneOf(FILE_UPLOAD_TRANSPORTS, 'native' as FileUploadTransport),\n rootClass: string,\n dropzoneClass: string,\n listClass: string,\n itemClass: string,\n class: string,\n};\n\nconst fileUploadDropzoneSchema = {\n heading: string.default('Drop files here or browse'),\n text: string,\n icon: string.default('cloud__upload'),\n layout: oneOf(FILE_UPLOAD_LAYOUTS, 'stack' as FileUploadLayout),\n size: oneOf(FILE_UPLOAD_SIZES, 'md' as FileUploadSize),\n disabled: bool,\n invalid: bool,\n class: string,\n};\n\nconst fileUploadListSchema = {\n class: string,\n};\n\nconst fileUploadItemSchema = {\n filename: string,\n filesize: string,\n mime: string,\n preview: string,\n icon: string.default('document__blank'),\n invalid: bool,\n error: string,\n class: string,\n};\n\nconst fileUploadRemoveSchema = {\n label: string.default('Remove file'),\n class: string,\n};\n\ntype FileUploadProps = SchemaToProps<typeof fileUploadSchema>;\n\nexport {\n FILE_UPLOAD_LAYOUTS,\n FILE_UPLOAD_PREVIEWS,\n FILE_UPLOAD_SIZES,\n FILE_UPLOAD_TRANSPORTS,\n fileUploadDropzoneSchema,\n fileUploadItemSchema,\n fileUploadListSchema,\n fileUploadRemoveSchema,\n fileUploadSchema,\n};\nexport type {\n FileUploadLayout,\n FileUploadPreview,\n FileUploadProps,\n FileUploadSize,\n FileUploadTransport,\n};\n","import {\n createMachine,\n type Machine,\n type MachineEventObject,\n type MachineScope,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport type {FileUploadProps} from './contract';\n\ntype FileSelectionSource = 'picker' | 'drop' | 'remove' | 'props' | 'clear';\ntype FileTransferStatus = 'selected' | 'uploading' | 'complete' | 'failed' | 'canceled';\n\ntype FileUploadMetadata = {\n id: string;\n name: string;\n bytes: number;\n size: string;\n type: string;\n};\n\ntype FileUploadRecord = FileUploadMetadata & {\n status: FileTransferStatus;\n progress: number;\n};\n\ntype FileUploadContext = {\n selection: {\n files: FileUploadMetadata[];\n limitReached: boolean;\n rejectedCount: number;\n limitRejectedCount: number;\n source: FileSelectionSource;\n };\n existing: {present: boolean; cleared: boolean};\n transfer: {\n status: 'native' | 'idle' | 'uploading' | 'complete' | 'failed' | 'canceled';\n activeIds: string[];\n progress: Record<string, number>;\n results: Record<string, Exclude<FileTransferStatus, 'selected' | 'uploading'>>;\n error: string;\n };\n};\n\ntype FileUploadMachineEffects = {\n commitSelection(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n resetSelection(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncProps(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncDragging(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n clearExisting(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n syncTransfer(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitComplete(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitError(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n emitCancel(scope: MachineScope<FileUploadContext, FileUploadProps>): void;\n};\n\ntype CreateFileUploadMachineOptions = {\n props: FileUploadProps;\n context: FileUploadContext;\n effects: FileUploadMachineEffects;\n};\n\ntype FileRecordsEvent = MachineEventObject & {\n records: FileUploadMetadata[];\n append?: boolean;\n source?: FileSelectionSource;\n};\n\nconst uploadingHook = defineHook({\n name: 'uploading',\n state: 'transfer.direct.uploading',\n project: (snapshot) => ({\n files: snapshot.context.selection.files.filter(({id}) => snapshot.context.transfer.activeIds.includes(id)),\n }),\n onDone: 'UPLOADING_DONE',\n onError: 'UPLOADING_ERROR',\n required: true,\n sends: {\n progress: (id: string, loaded: number, total: number) => ({type: 'UPLOAD_PROGRESS', id, loaded, total}),\n cancel: () => ({type: 'CANCEL_UPLOAD'}),\n },\n} satisfies TransitionHookDefinition<\n FileUploadContext,\n FileUploadProps,\n {files: FileUploadMetadata[]},\n 'uploading'\n>);\n\nconst fileUploadHooks = [uploadingHook] as const;\n\nconst recordsEvent = (event: MachineEventObject): FileRecordsEvent => event as FileRecordsEvent;\nconst eventSource = (event: MachineEventObject): FileSelectionSource => {\n const source = event.source;\n return source === 'picker' || source === 'drop' || source === 'remove' || source === 'props' ? source : 'clear';\n};\n\nconst acceptedByAccept = (file: FileUploadMetadata, accept: string): boolean => {\n const tokens = accept.split(',').map((token) => token.trim().toLowerCase()).filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return tokens.some((token) => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return type.startsWith(token.slice(0, -1));\n return token.includes('/') && type === token;\n });\n};\n\nconst selectionPlan = (\n context: Readonly<FileUploadContext>,\n props: Readonly<FileUploadProps>,\n event: MachineEventObject,\n): FileUploadContext['selection'] => {\n const candidate = recordsEvent(event).records ?? [];\n const accepted = candidate.filter((file) => acceptedByAccept(file, props.accept));\n const base = recordsEvent(event).append && props.multiple ? [...context.selection.files] : [];\n const combined = props.multiple ? [...base, ...accepted] : accepted.slice(0, 1);\n const files = props.maxItems > 0 ? combined.slice(0, props.maxItems) : combined;\n return {\n files,\n limitReached: props.maxItems > 0 && files.length >= props.maxItems,\n rejectedCount: candidate.length - accepted.length + combined.length - files.length,\n limitRejectedCount: combined.length - files.length,\n source: eventSource(event),\n };\n};\n\nconst plannedFiles = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>): FileUploadMetadata[] => (\n selectionPlan(context, props, event).files\n);\nconst planIsEmpty = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => plannedFiles(scope).length === 0;\nconst planIsCapped = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n selectionPlan(context, props, event).limitReached\n);\nconst canMutate = ({context, props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n !props.disabled && context.transfer.status !== 'uploading'\n);\nconst isDirect = ({props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => props.transport === 'direct';\nconst isNative = ({props}: MachineScope<FileUploadContext, FileUploadProps>): boolean => props.transport === 'native';\nconst shouldUpload = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => (\n isDirect(scope)\n && (eventSource(scope.event) === 'picker' || eventSource(scope.event) === 'drop')\n && plannedFiles(scope).length > 0\n);\n\nconst planSelection = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>) => ({\n context: {selection: selectionPlan(context, props, event)},\n});\nconst clearSelection = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({\n context: {selection: {...context.selection, files: [], limitReached: false, rejectedCount: 0, limitRejectedCount: 0, source: 'clear' as const}},\n});\nconst beginUpload = ({context, props, event}: MachineScope<FileUploadContext, FileUploadProps>) => {\n const files = selectionPlan(context, props, event).files;\n const previousIds = new Set(context.selection.files.map(({id}) => id));\n const activeIds = recordsEvent(event).append ? files.filter(({id}) => !previousIds.has(id)).map(({id}) => id) : files.map(({id}) => id);\n return {context: {transfer: {\n ...context.transfer,\n status: 'uploading' as const,\n activeIds,\n progress: {...context.transfer.progress, ...Object.fromEntries(activeIds.map((id) => [id, 0]))},\n error: '',\n }}};\n};\nconst setTransferStatus = (\n context: Readonly<FileUploadContext>,\n status: 'native' | 'idle' | 'complete' | 'failed' | 'canceled',\n error = '',\n): FileUploadContext['transfer'] => ({...context.transfer, status, error});\nconst finishUpload = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'complete'),\n progress: {...context.transfer.progress, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 1]))},\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'complete' as const]))},\n}}});\nconst failUpload = ({context, event}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'failed', event.error instanceof Error ? event.error.message : String(event.error ?? 'Upload failed.')),\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'failed' as const]))},\n}}});\nconst cancelUpload = ({context}: MachineScope<FileUploadContext, FileUploadProps>) => ({context: {transfer: {\n ...setTransferStatus(context, 'canceled'),\n results: {...context.transfer.results, ...Object.fromEntries(context.transfer.activeIds.map((id) => [id, 'canceled' as const]))},\n}}});\nconst updateProgress = ({context, event}: MachineScope<FileUploadContext, FileUploadProps>) => {\n const id = typeof event.id === 'string' ? event.id : '';\n if (!context.transfer.activeIds.includes(id)) return;\n const loaded = Number(event.loaded);\n const total = Number(event.total);\n const progress = Number.isFinite(loaded) && Number.isFinite(total) && total > 0 ? Math.min(1, Math.max(0, loaded / total)) : 0;\n return {context: {transfer: {...context.transfer, progress: {...context.transfer.progress, [id]: progress}}}};\n};\n\nconst canMutateToEmpty = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => canMutate(scope) && planIsEmpty(scope);\nconst canMutateToCapped = (scope: MachineScope<FileUploadContext, FileUploadProps>): boolean => canMutate(scope) && planIsCapped(scope);\n\nconst inventoryTransitions = [\n {target: '#inventory-empty', guard: canMutateToEmpty, reduce: 'planSelection', effects: 'commitSelection'},\n {target: '#inventory-capped', guard: canMutateToCapped, reduce: 'planSelection', effects: 'commitSelection'},\n {target: '#inventory-populated', guard: canMutate, reduce: 'planSelection', effects: 'commitSelection'},\n];\n\nconst createFileUploadMachine = ({props, context, effects}: CreateFileUploadMachineOptions): Machine<FileUploadContext, FileUploadProps> => createMachine<FileUploadContext, FileUploadProps>({\n type: 'parallel',\n on: {PROPS_CHANGED: {reduce: 'replaceProps', effects: 'syncProps'}},\n states: {\n interaction: {\n initial: 'idle',\n states: {\n idle: {on: {DRAG_ENTER: {target: 'dragging', guard: canMutate, effects: 'syncDragging'}}},\n dragging: {tags: ['dragging'], on: {\n DRAG_LEAVE: {target: 'idle', effects: 'syncDragging'},\n DROP: {target: 'idle', effects: 'syncDragging'},\n RECONCILE: {target: 'idle', guard: ({props: currentProps}) => currentProps.disabled, effects: 'syncDragging'},\n }},\n },\n },\n inventory: {\n initial: 'empty',\n on: {\n FILES_CHANGED: inventoryTransitions,\n RECONCILE: inventoryTransitions,\n FILES_RESET: {target: '#inventory-empty', guard: canMutate, reduce: 'clearSelection', effects: 'resetSelection'},\n CLEAR_EXISTING: {guard: canMutate, reduce: 'clearExisting', effects: 'clearExisting'},\n },\n states: {\n empty: {id: 'inventory-empty', tags: ['empty']},\n populated: {id: 'inventory-populated', tags: ['has-files']},\n capped: {id: 'inventory-capped', tags: ['has-files', 'limit-reached']},\n },\n },\n transfer: {\n initial: 'inactive',\n states: {\n inactive: {on: {\n RECONCILE: [{target: '#transfer-direct-idle', guard: isDirect, reduce: 'setDirectIdle', effects: 'syncTransfer'}, {target: '#transfer-native', reduce: 'setNative', effects: 'syncTransfer'}],\n }},\n native: {id: 'transfer-native', on: {\n RECONCILE: {target: '#transfer-direct-idle', guard: isDirect, reduce: 'setDirectIdle', effects: 'syncTransfer'},\n }},\n direct: {\n initial: 'idle',\n on: {RECONCILE: {target: '#transfer-native', guard: isNative, reduce: 'setNative', effects: 'syncTransfer'}},\n states: {\n idle: {id: 'transfer-direct-idle', on: {FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'}}},\n uploading: {id: 'transfer-uploading', tags: ['uploading'], on: {\n UPLOAD_PROGRESS: {reduce: 'updateProgress', effects: 'syncTransfer'},\n UPLOADING_DONE: {target: 'complete', reduce: 'finishUpload', effects: ['syncTransfer', 'emitComplete']},\n UPLOADING_ERROR: {target: 'failed', reduce: 'failUpload', effects: ['syncTransfer', 'emitError']},\n CANCEL_UPLOAD: {target: 'canceled', reduce: 'cancelUpload', effects: ['syncTransfer', 'emitCancel']},\n RECONCILE: {target: 'canceled', guard: ({props: currentProps}) => currentProps.disabled || currentProps.transport !== 'direct', reduce: 'cancelUpload', effects: ['syncTransfer', 'emitCancel']},\n }},\n complete: {on: {FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'}}},\n failed: {tags: ['upload-failed'], on: {\n RETRY_UPLOAD: {target: 'uploading', reduce: 'retryUpload', effects: 'syncTransfer'},\n FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'},\n }},\n canceled: {on: {\n RETRY_UPLOAD: {target: 'uploading', reduce: 'retryUpload', effects: 'syncTransfer'},\n FILES_CHANGED: {target: 'uploading', guard: shouldUpload, reduce: 'beginUpload', effects: 'syncTransfer'},\n }},\n },\n },\n },\n },\n },\n}, {\n context,\n props,\n reducers: {\n replaceProps: ({event, props: currentProps}) => ({props: event.props as FileUploadProps ?? currentProps}),\n planSelection,\n clearSelection,\n clearExisting: ({context: current}) => ({context: {existing: {...current.existing, cleared: true}}}),\n beginUpload,\n retryUpload: ({context: current}) => ({context: {transfer: {...current.transfer, status: 'uploading', error: '', activeIds: current.selection.files.filter(({id}) => current.transfer.results[id] !== 'complete').map(({id}) => id)}}}),\n finishUpload,\n failUpload,\n cancelUpload,\n updateProgress,\n setNative: ({context: current}) => ({context: {transfer: setTransferStatus(current, 'native')}}),\n setDirectIdle: ({context: current}) => ({context: {transfer: setTransferStatus(current, 'idle')}}),\n },\n effects: {\n commitSelection: effects.commitSelection,\n resetSelection: effects.resetSelection,\n syncProps: effects.syncProps,\n syncDragging: effects.syncDragging,\n clearExisting: effects.clearExisting,\n syncTransfer: effects.syncTransfer,\n emitComplete: effects.emitComplete,\n emitError: effects.emitError,\n emitCancel: effects.emitCancel,\n },\n});\n\nconst recordsFromSnapshot = (context: Readonly<FileUploadContext>): FileUploadRecord[] => context.selection.files.map((file) => ({\n ...file,\n status: context.transfer.activeIds.includes(file.id) && context.transfer.status === 'uploading'\n ? 'uploading'\n : context.transfer.results[file.id] ?? 'selected',\n progress: context.transfer.progress[file.id] ?? 0,\n}));\n\nexport {createFileUploadMachine, fileUploadHooks, recordsFromSnapshot};\nexport type {\n CreateFileUploadMachineOptions,\n FileSelectionSource,\n FileTransferStatus,\n FileUploadContext,\n FileUploadMachineEffects,\n FileUploadMetadata,\n FileUploadRecord,\n};\n","import {defineStyles} from '../../runtime';\n\nconst fileUploadStyles = defineStyles({definition: {\n component: 'ui.file-upload',\n parts: {\n root: {\n base: [\n 'grid w-full min-w-0 gap-3',\n ],\n },\n control: {\n base: 'relative grid min-w-0 gap-3',\n },\n input: {\n base: 'sr-only',\n },\n dropzone: {\n base: [\n 'relative grid min-w-0 overflow-hidden rounded-surface-md text-inherit outline-none',\n ],\n variants: {\n layout: {\n stack: 'justify-items-center text-center',\n inline: 'grid-cols-[auto_minmax(0,1fr)_auto] items-center text-left',\n },\n size: {\n sm: 'gap-2 p-3',\n md: 'gap-3 p-4',\n lg: 'gap-3 p-5',\n },\n },\n defaults: {\n layout: 'stack',\n size: 'md',\n },\n },\n icon: {\n base: 'size-icon-lg shrink-0 fill-current text-surface-ink-muted',\n },\n body: {\n base: 'grid min-w-0 gap-1',\n },\n heading: {\n base: 'text-sm font-medium text-inherit',\n },\n text: {\n base: 'text-xs font-normal text-surface-ink-muted',\n },\n browse: {\n base: [\n 'inline-flex min-w-0 items-center justify-center rounded-control-md px-2 py-1 text-xs font-medium',\n ],\n },\n list: {\n base: 'grid min-w-0 gap-2',\n },\n empty: {\n base: 'text-xs text-surface-ink-muted',\n },\n item: {\n base: [\n 'grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-surface-sm px-3 py-2',\n ],\n },\n preview: {\n base: 'flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-surface-xs bg-interaction-hover text-surface-ink-muted',\n },\n previewImage: {\n base: 'size-full',\n },\n itemIcon: {\n base: 'size-icon fill-current',\n },\n itemBody: {\n base: 'grid min-w-0 gap-0.5',\n },\n itemName: {\n base: 'truncate text-sm font-medium text-inherit',\n },\n itemMeta: {\n base: 'truncate text-xs font-normal text-surface-ink-muted',\n },\n itemError: {\n base: 'truncate text-xs font-normal text-intent-danger-text',\n },\n remove: {\n base: [\n 'relative z-20 inline-flex size-control-sm shrink-0 items-center justify-center rounded-control-md border-0 bg-transparent',\n 'text-surface-ink-muted outline-none',\n ],\n },\n removeIcon: {\n base: 'size-icon-xs fill-current leading-none',\n },\n clear: {\n base: 'sr-only',\n },\n },\n}});\n\nexport {fileUploadStyles};\n","import {containsFiles, getFiles} from '@atlaskit/pragmatic-drag-and-drop/external/file';\nimport {dropTargetForExternal, monitorForExternal, type ExternalDropTargetEventPayloadMap} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport type Alpine from 'alpinejs';\n\nimport {\n createAlpineMachine,\n defineAlpineData,\n type AlpineMachine,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {syncControlPresence, syncNativeControl} from '@client/runtime/form-control';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {addListener, dispatch, setPresence, type CleanupStack} from '@client/utils';\nimport {fileUploadSchema, type FileUploadProps} from './contract';\nimport {\n createFileUploadMachine,\n fileUploadHooks,\n recordsFromSnapshot,\n type FileSelectionSource,\n type FileTransferStatus,\n type FileUploadContext,\n type FileUploadMetadata,\n type FileUploadRecord,\n} from './machine';\nimport {fileUploadStyles} from './styles';\n\ntype FileUploadTransitionName = (typeof fileUploadHooks)[number]['name'];\ntype FileUploadTransition<TName extends FileUploadTransitionName = FileUploadTransitionName> = TransitionForHook<\n Extract<(typeof fileUploadHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\n/**\n * Public Alpine API for `ui.file-upload`.\n *\n * @public\n */\ninterface UiFileUploadApi {\n /** Serializable metadata for the current pending or transferred files. */\n readonly files: readonly FileUploadRecord[];\n /** Whether pending or existing file content is present. */\n readonly hasFiles: boolean;\n /** Whether an external file is over the drop target. */\n readonly isDragging: boolean;\n /** Whether the direct transport hook is pending. */\n readonly isUploading: boolean;\n /** Whether the configured client-side item limit is full. */\n readonly isLimitReached: boolean;\n /** Opens the native file picker when interaction is available. */\n browse(): void;\n /** Removes a pending file by its stable record id. */\n remove(id: string): void;\n /** Retries failed or canceled direct-upload records. */\n retry(): void;\n /** Cancels the active direct-upload batch. */\n cancel(): void;\n /** Returns the original browser File for transport code without cloning it. */\n file(id: string): File | null;\n}\n\ntype FileUploadData = AlpineMachine<FileUploadContext, FileUploadProps, typeof fileUploadHooks> & UiFileUploadApi & {\n init(): void;\n destroy(): void;\n};\n\nconst formatBytes = (bytes: number): string => {\n if (bytes === 0) return '0 B';\n const units = ['B', 'KB', 'MB', 'GB'];\n const unitIndex = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);\n const value = bytes / (1024 ** unitIndex);\n const display = value >= 10 || unitIndex === 0 ? Math.round(value) : Number(value.toFixed(1));\n return `${display} ${units[unitIndex]}`;\n};\n\nconst filesFromList = (list: FileList | null): File[] => list ? Array.from(list) : [];\nconst isImageFile = (file: File): boolean => file.type.startsWith('image/');\nconst canPreviewFile = (file: File, preview: FileUploadProps['preview']): boolean => preview !== 'none' && (preview === 'image' || isImageFile(file));\n\nconst toFileList = (files: File[]): FileList | null => {\n if (typeof DataTransfer === 'undefined') return null;\n const transfer = new DataTransfer();\n files.forEach((file) => transfer.items.add(file));\n return transfer.files;\n};\n\nconst setInputFiles = (input: HTMLInputElement, files: File[]): boolean => {\n const list = toFileList(files);\n if (!list) return false;\n try {\n input.files = list;\n return true;\n } catch {\n return false;\n }\n};\n\nconst iconSvg = (pathData: string, className: string): SVGSVGElement => {\n const namespace = 'http://www.w3.org/2000/svg';\n const icon = document.createElementNS(namespace, 'svg');\n const path = document.createElementNS(namespace, 'path');\n icon.setAttribute('viewBox', '0 0 32 32');\n icon.setAttribute('aria-hidden', 'true');\n icon.setAttribute('class', className);\n path.setAttribute('d', pathData);\n icon.append(path);\n return icon;\n};\n\nconst closeIcon = (className: string): SVGSVGElement => {\n const namespace = 'http://www.w3.org/2000/svg';\n const icon = document.createElementNS(namespace, 'svg');\n const polygon = document.createElementNS(namespace, 'polygon');\n icon.setAttribute('viewBox', '0 0 32 32');\n icon.setAttribute('aria-hidden', 'true');\n icon.setAttribute('class', className);\n polygon.setAttribute('points', '17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16');\n icon.append(polygon);\n return icon;\n};\n\nconst UiFileUpload = (): TrellisAlpineComponent<FileUploadData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let cleanup: CleanupStack = [];\n let ignoreNativeChange = false;\n let fileSequence = 0;\n const rawFiles = new Map<string, File>();\n const previewUrls = new Map<string, string>();\n\n const root = (): HTMLElement => {\n if (!rootEl) throw new Error('File upload has not been initialized.');\n return rootEl;\n };\n const input = (): HTMLInputElement => {\n const control = root().querySelector<HTMLInputElement>('[data-ui-file-upload-input]');\n if (!control) throw new Error('File upload requires a native file input.');\n return control;\n };\n const dropzone = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-file-upload-dropzone]');\n const list = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-file-upload-list]');\n const currentProps = (): Readonly<FileUploadProps> => bridge.getSnapshot().props;\n const currentContext = (): Readonly<FileUploadContext> => bridge.getSnapshot().context;\n\n const metadataFor = (file: File): FileUploadMetadata => ({\n id: `file-${++fileSequence}`,\n name: file.name,\n bytes: file.size,\n size: formatBytes(file.size),\n type: file.type || 'File',\n });\n const registerFiles = (files: File[]): FileUploadMetadata[] => files.map((file) => {\n const metadata = metadataFor(file);\n rawFiles.set(metadata.id, file);\n return metadata;\n });\n const revokePreview = (id: string): void => {\n const url = previewUrls.get(id);\n if (url) URL.revokeObjectURL(url);\n previewUrls.delete(id);\n };\n const dispatchNativeChange = (): void => {\n ignoreNativeChange = true;\n input().dispatchEvent(new Event('input', {bubbles: true}));\n input().dispatchEvent(new Event('change', {bubbles: true}));\n };\n const sendFiles = (records: FileUploadMetadata[], source: FileSelectionSource, append = false): void => {\n if (currentProps().disabled || bridge.hasTag('uploading')) return;\n bridge.send({type: 'FILES_CHANGED', records, source, append});\n };\n\n const renderFiles = (context: Readonly<FileUploadContext>, props: Readonly<FileUploadProps>): void => {\n const container = list();\n if (!container) return;\n container.querySelectorAll('[data-ui-file-upload-pending]').forEach((item) => item.remove());\n const records = recordsFromSnapshot(context);\n const selectedIds = new Set(records.map(({id}) => id));\n [...previewUrls.keys()].filter((id) => !selectedIds.has(id)).forEach(revokePreview);\n [...rawFiles.keys()].filter((id) => !selectedIds.has(id)).forEach((id) => rawFiles.delete(id));\n const existing = container.querySelector<HTMLElement>('[data-existing-file]:not([hidden])');\n const empty = container.querySelector<HTMLElement>('[data-ui-file-upload-empty]');\n if (empty) empty.hidden = records.length > 0 || Boolean(existing);\n\n const itemClass = resolveStyle({part: fileUploadStyles.parts.item, className: props.itemClass});\n const previewClass = resolveStyle({part: fileUploadStyles.parts.preview});\n const imageClass = resolveStyle({part: fileUploadStyles.parts.previewImage});\n const bodyClass = resolveStyle({part: fileUploadStyles.parts.itemBody});\n const nameClass = resolveStyle({part: fileUploadStyles.parts.itemName});\n const metaClass = resolveStyle({part: fileUploadStyles.parts.itemMeta});\n const removeClass = resolveStyle({part: fileUploadStyles.parts.remove});\n const removeIconClass = resolveStyle({part: fileUploadStyles.parts.removeIcon});\n const itemIconClass = resolveStyle({part: fileUploadStyles.parts.itemIcon});\n\n records.forEach((record) => {\n const item = document.createElement('li');\n item.dataset.uiFileUploadItem = '';\n item.dataset.uiFileUploadPending = '';\n item.dataset.fileId = record.id;\n item.dataset.status = record.status;\n item.dataset.progress = String(record.progress);\n item.className = itemClass;\n\n const preview = document.createElement('span');\n preview.dataset.uiFileUploadPreview = '';\n preview.className = previewClass;\n preview.setAttribute('aria-hidden', 'true');\n const file = rawFiles.get(record.id);\n if (file && canPreviewFile(file, props.preview)) {\n let url = previewUrls.get(record.id);\n if (!url) {\n url = URL.createObjectURL(file);\n previewUrls.set(record.id, url);\n }\n const image = document.createElement('img');\n image.src = url;\n image.alt = '';\n image.loading = 'lazy';\n image.decoding = 'async';\n image.className = `outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 block size-full object-cover ${imageClass}`;\n preview.append(image);\n } else {\n preview.append(iconSvg('M25.7,9.3l-7-7A.9078.9078,0,0,0,18,2H8A2.0059,2.0059,0,0,0,6,4V28a2.0059,2.0059,0,0,0,2,2H24a2.0059,2.0059,0,0,0,2-2V10A.9078.9078,0,0,0,25.7,9.3ZM18,4.4,23.6,10H18ZM24,28H8V4h8v6a2.0059,2.0059,0,0,0,2,2h6Z', itemIconClass));\n }\n\n const body = document.createElement('span');\n body.className = bodyClass;\n const name = document.createElement('span');\n name.dataset.uiFileUploadItemName = '';\n name.className = nameClass;\n name.textContent = record.name;\n const meta = document.createElement('span');\n meta.dataset.uiFileUploadItemMeta = '';\n meta.className = metaClass;\n meta.textContent = [record.size, record.type].filter(Boolean).join(' · ');\n body.append(name, meta);\n\n const remove = document.createElement('button');\n remove.type = 'button';\n remove.dataset.uiFileUploadRemove = '';\n remove.dataset.fileId = record.id;\n remove.className = removeClass;\n remove.disabled = bridge.hasTag('uploading');\n remove.setAttribute('aria-label', `Remove ${record.name}`);\n remove.append(closeIcon(removeIconClass));\n item.append(preview, body, remove);\n container.append(item);\n });\n };\n\n const syncDom = (\n context: Readonly<FileUploadContext> = currentContext(),\n props: Readonly<FileUploadProps> = currentProps(),\n ): void => {\n const records = recordsFromSnapshot(context);\n const existing = context.existing.present && !context.existing.cleared;\n const hasFiles = records.length > 0 || existing;\n const unavailable = props.disabled || context.selection.limitReached || context.transfer.status === 'uploading';\n const control = input();\n syncNativeControl({input: control, state: {disabled: props.disabled, required: props.required, invalid: props.invalid}});\n if (props.transport === 'native' && props.name) control.name = props.name;\n else control.removeAttribute('name');\n control.multiple = props.multiple;\n props.accept ? control.setAttribute('accept', props.accept) : control.removeAttribute('accept');\n props.capture ? control.setAttribute('capture', props.capture) : control.removeAttribute('capture');\n if (unavailable && !props.disabled) {\n control.setAttribute('aria-disabled', 'true');\n control.tabIndex = -1;\n } else if (!props.disabled) {\n control.removeAttribute('aria-disabled');\n control.removeAttribute('tabindex');\n }\n if (control.form) control.form.enctype = 'multipart/form-data';\n\n syncControlPresence({el: root(), state: props, value: 'true'});\n setPresence({el: root(), attr: 'data-empty', present: !hasFiles, value: 'true'});\n setPresence({el: root(), attr: 'data-has-files', present: hasFiles, value: 'true'});\n setPresence({el: root(), attr: 'data-multiple', present: props.multiple, value: 'true'});\n setPresence({el: root(), attr: 'data-max-items-reached', present: context.selection.limitReached, value: 'true'});\n setPresence({el: root(), attr: 'data-has-existing-file', present: existing, value: 'true'});\n root().dataset.transport = props.transport;\n root().dataset.transferState = context.transfer.status;\n const zone = dropzone();\n if (zone) {\n syncControlPresence({el: zone, state: {disabled: unavailable, invalid: props.invalid}, value: 'true'});\n setPresence({el: zone, attr: 'data-multiple', present: props.multiple, value: 'true'});\n setPresence({el: zone, attr: 'data-has-files', present: hasFiles, value: 'true'});\n setPresence({el: zone, attr: 'data-max-items-reached', present: context.selection.limitReached, value: 'true'});\n }\n renderFiles(context, props);\n };\n\n const initialContext = (props: FileUploadProps): FileUploadContext => ({\n selection: {files: [], limitReached: false, rejectedCount: 0, limitRejectedCount: 0, source: 'clear'},\n existing: {present: Boolean(root().querySelector('[data-ui-file-upload-item][data-existing-file]')), cleared: false},\n transfer: {status: props.transport === 'native' ? 'native' : 'idle', activeIds: [], progress: {}, results: {}, error: ''},\n });\n\n const bridge = createAlpineMachine({\n schema: fileUploadSchema,\n hooks: fileUploadHooks,\n createMachine: ({props}) => createFileUploadMachine({\n props,\n context: initialContext(props),\n effects: {\n commitSelection: (scope) => {\n const selected = scope.context.selection.files;\n const selectedFiles = selected.flatMap(({id}) => rawFiles.get(id) ?? []);\n if (!setInputFiles(input(), selectedFiles)) {\n input().value = '';\n bridge.send('FILES_RESET');\n return;\n }\n syncDom(scope.context, scope.props);\n if (scope.context.selection.limitRejectedCount > 0) {\n dispatch({el: root(), name: 'ui:file-upload-limit', detail: {rejectedCount: scope.context.selection.limitRejectedCount}});\n }\n if (scope.context.selection.source !== 'picker') dispatchNativeChange();\n dispatch({\n el: root(),\n name: 'ui:file-upload-change',\n detail: {files: recordsFromSnapshot(scope.context), source: scope.context.selection.source},\n });\n },\n resetSelection: (scope) => { input().value = ''; syncDom(scope.context, scope.props); },\n syncProps: (scope) => {\n syncDom(scope.context, scope.props);\n bridge.send({type: 'RECONCILE', records: scope.context.selection.files, source: 'props'});\n },\n syncDragging: (scope) => {\n const dragging = scope.snapshot.tags.includes('dragging');\n setPresence({el: root(), attr: 'data-dragging', present: dragging, value: 'true'});\n const zone = dropzone();\n if (zone) setPresence({el: zone, attr: 'data-dragging', present: dragging, value: 'true'});\n },\n clearExisting: (scope) => {\n const clear = root().querySelector<HTMLInputElement>('[data-ui-file-upload-clear]');\n if (clear) {\n clear.checked = true;\n clear.dispatchEvent(new Event('change', {bubbles: true}));\n }\n const existing = root().querySelector<HTMLElement>('[data-ui-file-upload-item][data-existing-file]');\n if (existing) existing.hidden = true;\n syncDom(scope.context, scope.props);\n dispatch({\n el: root(),\n name: 'ui:file-upload-change',\n detail: {files: recordsFromSnapshot(scope.context), source: scope.context.selection.source},\n });\n },\n syncTransfer: (scope) => syncDom(scope.context, scope.props),\n emitComplete: (scope) => dispatch({el: root(), name: 'ui:file-upload-complete', detail: {files: recordsFromSnapshot(scope.context)}}),\n emitError: (scope) => dispatch({el: root(), name: 'ui:file-upload-error', detail: {files: recordsFromSnapshot(scope.context), error: scope.context.transfer.error}}),\n emitCancel: (scope) => dispatch({el: root(), name: 'ui:file-upload-cancel', detail: {files: recordsFromSnapshot(scope.context)}}),\n },\n }),\n });\n\n const component: TrellisAlpineComponent<FileUploadData> = {\n ...bridge,\n get files() { return this.snapshot.current ? recordsFromSnapshot(this.snapshot.current.context) : []; },\n get hasFiles() { return (this.snapshot.current?.context.selection.files.length ?? 0) > 0 || Boolean(this.snapshot.current?.context.existing.present && !this.snapshot.current.context.existing.cleared); },\n get isDragging() { return this.snapshot.current?.tags.includes('dragging') ?? false; },\n get isUploading() { return this.snapshot.current?.tags.includes('uploading') ?? false; },\n get isLimitReached() { return this.snapshot.current?.context.selection.limitReached ?? false; },\n init() {\n rootEl = this.$el;\n bridge.connect(this.$el, this.snapshot);\n const control = input();\n addListener({target: control, event: 'change', handler: () => {\n if (ignoreNativeChange) { ignoreNativeChange = false; return; }\n sendFiles(registerFiles(filesFromList(control.files)), 'picker');\n }, cleanup});\n addListener({target: root(), event: 'click', handler: (event) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n const remove = target.closest<HTMLElement>('[data-ui-file-upload-remove][data-file-id]');\n if (remove?.dataset.fileId) { event.preventDefault(); component.remove(remove.dataset.fileId); return; }\n const existing = target.closest('[data-ui-file-upload-remove][data-existing-file]');\n if (existing) { event.preventDefault(); bridge.send('CLEAR_EXISTING'); }\n }, cleanup});\n const zone = dropzone();\n if (zone) {\n cleanup.push(dropTargetForExternal({\n element: zone,\n canDrop: ({source}) => !currentProps().disabled && !bridge.hasTag('uploading') && containsFiles({source}),\n getDropEffect: () => 'copy',\n onDragEnter: () => bridge.send('DRAG_ENTER'),\n onDragLeave: () => bridge.send('DRAG_LEAVE'),\n onDrop: ({source}: ExternalDropTargetEventPayloadMap['onDrop']) => {\n bridge.send('DROP');\n if (!containsFiles({source})) return;\n sendFiles(registerFiles(getFiles({source})), 'drop', currentProps().multiple);\n },\n }));\n cleanup.push(monitorForExternal({canMonitor: ({source}) => containsFiles({source}), onDrop: () => bridge.send('DRAG_LEAVE')}));\n }\n syncDom();\n bridge.send({type: 'RECONCILE', records: [], source: 'props'});\n },\n destroy() {\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\n previewUrls.forEach((url) => URL.revokeObjectURL(url));\n previewUrls.clear();\n rawFiles.clear();\n bridge.disconnect();\n rootEl = null;\n },\n browse() { if (!currentProps().disabled && !bridge.hasTag('uploading')) input().click(); },\n remove(id) {\n if (currentProps().disabled || bridge.hasTag('uploading') || !rawFiles.has(id)) return;\n const records = currentContext().selection.files.filter((record) => record.id !== id);\n sendFiles(records, 'remove');\n },\n retry() { bridge.send('RETRY_UPLOAD'); },\n cancel() { bridge.send('CANCEL_UPLOAD'); },\n file(id) { return rawFiles.get(id) ?? null; },\n };\n return component;\n};\n\nconst registerFileUpload = defineAlpineData('UiFileUpload', UiFileUpload);\n\nexport {registerFileUpload, UiFileUpload};\nexport type {\n FileTransferStatus,\n FileUploadData,\n FileUploadMetadata,\n FileUploadRecord,\n FileUploadTransition,\n UiFileUploadApi,\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';\n\nimport {registerFileUpload as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerFileUpload = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n\n registerComponent(AlpineInstance);\n};\n\nexport {registerFileUpload};\nexport default registerFileUpload;\nexport * from './index';\n"],"x_google_ignoreList":[0,1,2],"mappings":"udAAA,SAAgB,EAAc,EAAM,CAElC,OADa,EAAK,OACJ,MAAM,SAAS,OAAO,CACtC,CAIA,SAAgB,GAAS,EAAO,CAE9B,OADa,EAAM,OACL,MAKb,OAAO,SAAU,EAAM,CACtB,OAAO,EAAK,OAAS,MACvB,CAAC,EAAE,IAAI,SAAU,EAAM,CACrB,OAAO,EAAK,UAAU,CACxB,CAAC,EAAE,OAAO,SAAU,EAAM,CACxB,OAAO,GAAQ,IACjB,CAAC,CACH,WCjBA,SAAA,EAAA,EAAA,+IA+CA,CC3CA,SAAgB,EAAkB,EAAM,CACtC,IAAI,EAAO,EAAK,KACd,EAAQ,EAAK,MAWf,MAHA,EANI,IAAA,wBAMA,IAAA,cAA0B,IAAA,wBAIhC,CAGA,SAAgB,EAAkB,EAAU,CAC1C,OAAO,MAAM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CACX,EAEM,GAAqB,EAAiB,eAAgB,CAAY,EC9ZlE,EAAa,IAAI,QAEjB,GAAsB,GAAqC,CACzD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAE7B,GAAkB,CAAc,EACpC"}
@@ -1,2 +0,0 @@
1
- import{_ as e,c as t,d as n,h as r,p as i,u as a}from"./motion-D2EM1olE.js";import{t as o}from"./capability-motion-LgqzTNla.js";import{a as s,f as c,l,n as u}from"./codecs-Cb1ns_47.js";import{i as d,r as ee,s as f,t as te}from"./dom-qAeVl7dc.js";import{i as p,t as ne}from"./alpine-machine-BS13dbK4.js";import{t as m}from"./alpine-data-CytyCyfk.js";import{n as h,t as g}from"./styles-TfvwVPGw.js";import{t as re}from"./merge-bindings-C8ewA_FD.js";import{t as _}from"./machine-Dqut4h89.js";import{i as ie}from"./focus-scope-DtaPVNl5.js";import{t as ae}from"./semantic-observer-BUswpsNx.js";import{t as oe}from"./drag-and-drop-DHq3udf7.js";import{t as v}from"./capability-resizable-Bga8TngJ.js";var se=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(`--breakpoint-${t}`),r=Number.parseFloat(n);return Number.isFinite(r)?r:1/0},y=[`horizontal`,`vertical`],b=[`div`,`section`,`aside`,`main`,`nav`],x=[`1`,`2`,`3`,`4`,`5`,`6`,`fill`],ce=[`none`,`start`,`end`],S=[`toggle`,`expand`,`collapse`],le={id:c.default(`ui-panels`),orientation:l(y,`horizontal`),persist:u,divider:u.default(!0),class:c},ue={id:c,as:l(b,`section`),size:l(x,`fill`),resize:l(ce,`none`),collapsible:u,defaultCollapsed:u,class:c},C={target:c,action:l(S,`toggle`),icon:c.default(`menu`),label:c.default(`Expand`),class:c},de=[p({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})}}),p({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})}}),p({name:`sizing`,state:`sizing`,projectEach:e=>e.context.sizing.changes,onDone:`SIZE_DONE`,onError:`SIZE_ERROR`}),p({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`})],w=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],T=e=>typeof e.panelId==`string`?e.panelId:``,E=e=>typeof e==`number`&&Number.isFinite(e)?e:null,D=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=E(t.from),i=E(t.to),a=t.reset===!0;return n&&r!==null&&i!==null&&(r!==i||a)?[{panelId:n,from:r,to:i,...a?{reset:!0}:{}}]:[]}),O=(e,t)=>typeof e.props==`object`&&e.props!==null?e.props:t,k=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),A=e=>{let t=T(e.event),n=e.context.layout.collapsedIds;switch(e.event.type){case`COLLAPSE`:return e.context.collection.collapsibleIds.includes(t)&&!n.includes(t)?e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;case`EXPAND`:return n.filter(e=>e!==t);case`TOGGLE`:return e.context.collection.collapsibleIds.includes(t)?n.includes(t)?n.filter(e=>e!==t):e.context.collection.ids.filter(e=>n.includes(e)||e===t):n;default:return n}},j=e=>{let t=T(e.event);return e.context.collection.ids.includes(t)&&!k(e.context.layout.collapsedIds,A(e))},M=e=>{let t=T(e.event);return e.context.collection.resizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t)&&E(e.event.size)!==null},N=e=>{let t=D(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&!e.context.layout.collapsedIds.includes(t))},P=e=>{let t=D(e.event);return t.length>0&&t.every(({panelId:t})=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t))},fe=e=>{let t=w(e.event.ids);return t.length>0&&t.every(t=>e.context.collection.sizableIds.includes(t)&&e.context.layout.collapsedIds.includes(t)&&Object.hasOwn(e.context.layout.committedSizes,t))},F=e=>{let t=D(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},sizing:{changes:t}}}},I=e=>{let t=D(e.event);return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...e.context.layout.committedSizes,...Object.fromEntries(t.map(({panelId:e,to:t})=>[e,t]))}}}}},L=e=>{let t={...e.context.layout.committedSizes};return w(e.event.ids).forEach(e=>delete t[e]),{context:{...e.context,layout:{...e.context.layout,committedSizes:t}}}},R=e=>{let t=A(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))}}}},z=e=>{let t=w(e.event.ids),n=w(e.event.collapsibleIds).filter(e=>t.includes(e)),r=w(e.event.sizableIds).filter(e=>t.includes(e)),i=w(e.event.resizableIds).filter(e=>t.includes(e)),a=w(e.event.authoredCollapsedIds).filter(e=>n.includes(e)),o=new Set(e.context.collection.ids),s=t.filter(t=>(e.context.layout.collapsedIds.includes(t)||!o.has(t)&&a.includes(t))&&n.includes(t)),c=Object.fromEntries(Object.entries(e.context.layout.committedSizes).filter(([e])=>t.includes(e)&&r.includes(e))),l=t.includes(e.context.resize.activeId)&&i.includes(e.context.resize.activeId);return{context:{...e.context,collection:{ids:t,collapsibleIds:n,sizableIds:r,resizableIds:i},layout:{collapsedIds:s,committedSizes:c},authored:{collapsedIds:a},resize:l?e.context.resize:{activeId:``,initialSize:null,previewSize:null}}}},B=e=>{let t=w(e.event.ids),n=w(e.event.resizableIds);return!t.includes(e.context.resize.activeId)||!n.includes(e.context.resize.activeId)},pe=({props:e,context:t,effects:n})=>_({initial:`stable`,on:{DOM_INVALIDATED:{effects:`sync`}},states:{stable:{tags:[`stable`],on:{COLLAPSE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},SIZE:{target:`sizing`,guard:N,reduce:F,effects:`prepareSizing`},RESTORE_HIDDEN_SIZES:{guard:P,reduce:I},RESET_HIDDEN_SIZES:{target:`persisting`,guard:fe,reduce:L,effects:[`sync`,`persist`]},RESIZE_START:{target:`resizing`,guard:M,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:z,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:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},PANELS_CHANGED:{reduce:z,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:N,reduce:F,effects:`prepareSizing`},RESIZE_START:{target:`resizing`,guard:M,reduce:`startResize`,effects:`beginResize`},PANELS_CHANGED:{reduce:z,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:B,reduce:z,effects:[`cancelResize`,`sync`]},{reduce:z,effects:`sync`}],PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}},persisting:{tags:[`persisting`],on:{PERSIST_DONE:`stable`,PERSIST_ERROR:`stable`,COLLAPSE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},EXPAND:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},TOGGLE:{target:`changing`,guard:j,reduce:R,effects:`prepareChange`},SIZE:{target:`sizing`,guard:N,reduce:F,effects:`prepareSizing`},PANELS_CHANGED:{reduce:z,effects:`sync`},PROPS_CHANGED:{reduce:`replaceProps`,effects:`sync`}}}}},{props:e,context:t,reducers:{replaceProps:e=>({props:O(e.event,e.props)}),startResize:e=>{let t=E(e.event.size);return{context:{...e.context,resize:{activeId:T(e.event),initialSize:t,previewSize:t}}}},previewResize:e=>({context:{...e.context,resize:{...e.context.resize,previewSize:E(e.event.size)}}}),commitResize:e=>{let t=T(e.event),n=E(e.event.size);if(n!==null)return{context:{...e.context,layout:{...e.context.layout,committedSizes:{...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=>T(e.event)===e.context.resize.activeId&&E(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}}),V=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`}}}}),H=new Set,U=e=>e instanceof CustomEvent&&e.detail&&typeof e.detail==`object`?e.detail:{},me=(()=>{let e=!1;return()=>{if(e||typeof document>`u`)return;let t=e=>t=>{let n=U(t);n.__panelsNotification||!n.panelId||H.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=U(e);t.__panelsNotification||!t.panelId||!Number.isFinite(t.size)||H.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=U(e);t.__panelsNotification||H.forEach(e=>{t.groupId&&t.groupId!==e.id||t.panelId&&!e.hasPanel(t.panelId)||e.reset(t.panelId)})}),e=!0}})(),he=e=>`trellis-ui:panels:${e}:v1`,ge=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`&&Number.isFinite(e[1]))),W=()=>{let o=null,c=null,l=null,u=`wide`,p=[],m=new Set,g=new Set,_=new Map,v=new Map,y=new Map,b=new Map,x=()=>{if(!o)throw Error(`Panels has not been initialized.`);return o},ce=e=>e.closest(`[data-ui-panels]`)===x(),S=()=>Array.from(x().children).flatMap(e=>{if(!(e instanceof HTMLElement)||!e.hasAttribute(`data-ui-panel`))return[];let t=e.querySelector(`:scope > [data-ui-panel-expanded]`);return!t||!ce(t)?[]:[{panel:e,expanded:t,collapsed:e.querySelector(`:scope > [data-ui-panel-collapsed]`),handle:e.querySelector(`:scope > [data-ui-panel-resize-handle]`),props:s({el:e,schema:ue})}]}),C=e=>S().find(t=>t.props.id===e)??null,w=()=>Q.getCommittedSnapshot().context,T=()=>Q.getCommittedSnapshot().props,E=e=>w().layout.collapsedIds.includes(e),D=()=>T().orientation===`horizontal`&&u===`stacked`,O=()=>D()?`vertical`:T().orientation,k=()=>x().dataset.orientation===`vertical`?`vertical`:`horizontal`,A=e=>{let t=e.getBoundingClientRect();return k()===`horizontal`?t.width:t.height},j=()=>{let e=S(),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{ids:e.map(({props:e})=>e.id).filter(Boolean),collapsibleIds:e.filter(({props:e})=>e.id&&e.collapsible).map(({props:e})=>e.id),sizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`).map(({props:e})=>e.id),resizableIds:e.filter(({props:e})=>e.id&&e.size!==`fill`&&e.resize!==`none`).map(({props:e})=>e.id),authoredCollapsedIds:e.filter(({props:e})=>e.id&&e.collapsible&&e.defaultCollapsed).map(({props:e})=>e.id)}},M=e=>{let t=document.createElement(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none;inset:0 auto auto 0;`,k()===`horizontal`?t.style.width=`var(${e})`:t.style.height=`var(${e})`,x().append(t);let n=A(t);return t.remove(),n},N=e=>e.props.size===`fill`?{minimum:0,maximum:1/0}:{minimum:M(`--spacing-panel-${e.props.size}-min`),maximum:M(`--spacing-panel-${e.props.size}-max`)},P=(e,t)=>{let{minimum:n,maximum:r}=N(e);return Math.min(r,Math.max(n,t))},fe=()=>{let e=j();return{collection:{ids:e.ids,collapsibleIds:e.collapsibleIds,sizableIds:e.sizableIds,resizableIds:e.resizableIds},layout:{collapsedIds:[...e.authoredCollapsedIds],committedSizes:{}},authored:{collapsedIds:e.authoredCollapsedIds},change:{openingIds:[],closingIds:[]},resize:{activeId:``,initialSize:null,previewSize:null},sizing:{changes:[]}}},F=(e,t,n)=>{k()===`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=``)},I=e=>{e.style.flex=``,e.style.minWidth=``,e.style.maxWidth=``,e.style.minHeight=``,e.style.maxHeight=``},L=(e,t)=>{if(D()){I(e.panel);return}if(t!==void 0){e.panel.style.flex=`0 0 ${t}px`,F(e.panel,`0px`,`none`);return}if(E(e.props.id)){if(w().authored.collapsedIds.includes(e.props.id)){I(e.panel);return}let t=e.collapsed?`var(--spacing-panel-collapsed)`:`0px`;e.panel.style.flex=`0 0 ${t}`,F(e.panel,t,t);return}if(e.props.size===`fill`){I(e.panel);return}let n=w().resize.activeId===e.props.id?w().resize.previewSize:w().layout.committedSizes[e.props.id];if(n==null){I(e.panel);return}let r=`${P(e,n)}px`;e.panel.style.flex=`0 1 ${r}`,F(e.panel,`var(--spacing-panel-${e.props.size}-min)`,`var(--spacing-panel-${e.props.size}-max)`)},R=(e,t)=>{e.toggleAttribute(`inert`,t),e.setAttribute(`aria-hidden`,t?`true`:`false`)},z=e=>{let t=T(),n=O(),r=E(e.props.id),i=Q.hasTag(`changing`)&&w().change.openingIds.includes(e.props.id),a=Q.hasTag(`changing`)&&w().change.closingIds.includes(e.props.id),o=!(r&&!a),s=r&&!a&&!i&&e.collapsed!==null;if(e.panel.dataset.state=r?`collapsed`:`expanded`,e.panel.dataset.orientation=n,e.panel.dataset.size=e.props.size,e.panel.dataset.resize=e.props.resize,e.panel.className=h({part:V.parts.panel,props:{orientation:n,divider:t.divider,resize:e.props.resize},className:e.props.class}),f({el:e.panel,attr:`data-collapsible`,present:e.props.collapsible}),f({el:e.panel,attr:`data-resizing`,present:w().resize.activeId===e.props.id}),L(e),e.expanded.hidden=!o,R(e.expanded,!o),e.collapsed&&(e.collapsed.hidden=!s,R(e.collapsed,!s)),e.handle){let t=D()||r||e.props.size===`fill`||e.props.resize===`none`;e.handle.dataset.orientation=n,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=D(),e.handle.className=h({part:V.parts.resizeHandle,props:{orientation:n,edge:e.props.resize},className:e.handle.dataset.class??``})}},B=e=>{e.forEach((t,n)=>{let r=e[n+1],i=t.props.resize===`end`||r?.props.resize===`start`;f({el:t.panel,attr:`data-divider`,present:T().divider&&r!==void 0&&!i})})},U=e=>{let t=e.dataset.target||``;if(!t){let t=e.closest(`[data-ui-panel]`),n=t?.closest(`[data-ui-panels]`),r=[...H].find(e=>e.id===n?.id),i=t&&r===$?C(t.id):null;return i&&r?{record:i,controller:r}:null}let n=e.dataset.groupId||e.closest(`[data-ui-panels]`)?.id,r=[...H].filter(e=>!n||e.id===n).find(e=>e.hasPanel(t)),i=r===$?C(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=E(t.record.props.id);e.dataset.target=t.record.props.id,e.dataset.groupId=T().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)})},G=()=>{let e=T(),t=O();x().dataset.responsiveMode=u,x().dataset.layoutOrientation=t,x().style.flexDirection=t===`horizontal`?`row`:`column`,x().className=h({part:V.parts.root,props:{...e,orientation:t},className:e.class}),f({el:x(),attr:`data-resizing`,present:Q.hasTag(`resizing`)}),f({el:x(),attr:`data-transitioning`,present:Q.hasTag(`transitioning`)});let n=S();n.forEach(z),B(n),W()},_e=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.collapsed?.contains(n)))return;let r=y.get(e.props.id);r?.isConnected&&e.expanded.contains(r)?r.focus({preventScroll:!0}):(e.expanded.tabIndex=-1,e.expanded.focus({preventScroll:!0}))},K=(e,t=!1)=>{let n=document.activeElement;if(!t&&(!(n instanceof HTMLElement)||!e.expanded.contains(n)))return;let r=e.collapsed?ie(e.collapsed)[0]:void 0,i=b.get(e.props.id),a=i?.isConnected&&!e.panel.contains(i)?i:void 0;r?r.focus({preventScroll:!0}):a?a.focus({preventScroll:!0}):(x().tabIndex=-1,x().focus({preventScroll:!0}))},ve=()=>{let e=[...w().change.openingIds,...w().change.closingIds],t=new Set(w().change.openingIds.filter(e=>{let t=C(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=C(e);if(!t)return[];if(w().change.closingIds.includes(e)){let n=document.activeElement;n instanceof HTMLElement&&t.expanded.contains(n)&&y.set(e,n)}return[[e,A(t.panel)]]}));G(),w().change.openingIds.forEach(e=>{let n=C(e);n&&_e(n,t.has(e))}),e.forEach(e=>{let t=C(e),r=n.get(e);if(!t||r===void 0)return;let i=A(t.panel);v.set(e,{from:r,to:i}),L(t,r)})},ye=()=>{let e=[...w().change.openingIds],t=[...w().change.closingIds],n=new Set(t.filter(e=>{let t=C(e),n=document.activeElement;return t!==null&&n instanceof HTMLElement&&t.expanded.contains(n)}));S().forEach(e=>L(e)),G(),t.forEach(e=>{let t=C(e);t&&K(t,n.has(e))}),e.forEach(e=>q(`ui:panel-expand`,e)),t.forEach(e=>q(`ui:panel-collapse`,e)),[...e,...t].forEach(e=>v.delete(e))},q=(e,t,n={})=>{ee({el:x(),name:e,detail:{groupId:T().id,panelId:t,__panelsNotification:!0,...n}})},be=()=>{let e=w().layout;if(T().persist)try{localStorage.setItem(he(T().id),JSON.stringify({collapsed:e.collapsedIds,sizes:e.committedSizes}))}catch{}ee({el:x(),name:`ui:panels-layout-change`,detail:{groupId:T().id,collapsed:[...e.collapsedIds],sizes:{...e.committedSizes},__panelsNotification:!0}})},J=e=>{if(!o)return;if(Q.hasTag(`stable`)){e();return}let t=window.setTimeout(()=>{m.delete(t),J(e)},16);m.add(t)},Y=(e,t)=>{let n=e.find(e=>t(e)!==E(e));n&&(Q.send({type:t(n)?`COLLAPSE`:`EXPAND`,panelId:n}),J(()=>Y(e,t)))},xe=()=>{if(!T().persist)return;let e;try{e=JSON.parse(localStorage.getItem(he(T().id))??`null`)}catch{return}if(typeof e!=`object`||!e)return;let t=j(),n=new Set((Array.isArray(e.collapsed)?e.collapsed:[]).filter(e=>typeof e==`string`&&t.collapsibleIds.includes(e))),r=ge(e.sizes),i=()=>{Y(t.collapsibleIds,e=>n.has(e))},a=()=>{let e=t.sizableIds.flatMap(e=>{let t=C(e),n=r[e];if(!t||n===void 0)return[];let i=A(t.panel),a=P(t,n);return Math.abs(i-a)<.5?[]:[{panelId:e,from:i,to:a}]});if(D()){e.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:e}),i();return}let n=e.filter(({panelId:e})=>E(e)),a=e.filter(({panelId:e})=>!E(e));if(n.length>0&&Q.send({type:`RESTORE_HIDDEN_SIZES`,changes:n}),a.length>0){Q.send({type:`SIZE`,changes:a}),J(i);return}i()},o=t.collapsibleIds.filter(e=>E(e)&&!n.has(e));o.length>0?(Y(o,()=>!1),J(a)):a()},Se=()=>{let e=requestAnimationFrame(()=>{g.delete(e);let t=requestAnimationFrame(()=>{g.delete(t),xe()});g.add(t)});g.add(e)},Ce=e=>{let t=j(),n=e?t.ids.filter(t=>t===e):t.ids;if(n.length===0)return;let r=()=>{Y(n.filter(e=>t.collapsibleIds.includes(e)),e=>w().authored.collapsedIds.includes(e))},i=n.filter(e=>t.sizableIds.includes(e)&&Object.hasOwn(w().layout.committedSizes,e));if(D()){i.length>0?(Q.send({type:`RESET_HIDDEN_SIZES`,ids:i}),J(r)):r();return}let a=i.filter(E);a.length>0&&Q.send({type:`RESET_HIDDEN_SIZES`,ids:a});let o=i.filter(e=>!E(e)).flatMap(e=>{let t=C(e);return!t||t.props.size===`fill`?[]:[{panelId:e,from:A(t.panel),to:M(`--spacing-panel-${t.props.size}`),reset:!0}]});if(o.length>0){Q.send({type:`SIZE`,changes:o}),J(r);return}r()},we=()=>{w().sizing.changes.forEach(({panelId:e,from:t})=>{let n=C(e);n&&L(n,t)})},Te=()=>{w().sizing.changes.forEach(({panelId:e,to:t})=>{let n=C(e);n&&(L(n),q(`ui:panel-resize-end`,e,{size:t}))}),G()},Ee=e=>{if(O()===`vertical`)return e===`start`?`negative`:`positive`;let t=d({el:x()});return e===`start`?t?`positive`:`negative`:t?`negative`:`positive`},X=()=>{let e=new Set(S().map(({panel:e})=>e));_.forEach((t,n)=>{e.has(n)||(t(),_.delete(n))}),S().forEach(e=>{if(_.has(e.panel)||!e.handle||e.props.size===`fill`||e.props.resize===`none`)return;let t=N(e),n=M(`--spacing-panel-resize-handle`),r=M(`--spacing-panel-resize-handle-coarse`);_.set(e.panel,oe({element:e.panel,handle:e.handle,axis:O()===`horizontal`?`x`:`y`,direction:Ee(e.props.resize),min:t.minimum,max:t.maximum,mode:`onChange`,hitArea:n,coarseHitArea:r,disabled:()=>D()||E(e.props.id),onStart:t=>Q.send({type:`RESIZE_START`,panelId:e.props.id,size:Z(t)}),onResize:t=>Q.send({type:`RESIZE`,panelId:e.props.id,size:Z(t)}),onEnd:t=>Q.send({type:`RESIZE_END`,panelId:e.props.id,size:Z(t)})}))})},De=()=>{_.forEach(e=>e()),_.clear(),X()},Z=e=>O()===`horizontal`?e.previewWidth:e.previewHeight,Oe=e=>{let t=T().orientation===`horizontal`&&e<se(x(),`sm`)?`stacked`:`wide`;t!==u&&(u=t,G(),De())},Q=ne({schema:le,hooks:de,resolveTransitionElement:({data:e})=>{let t=e?.panelId;return t?C(t)?.panel??null:x()},createMachine:({props:e})=>pe({props:e,context:fe(),effects:{prepareChange:ve,finishChange:ye,sync:()=>{G(),De()},beginResize:()=>{G()},previewResize:()=>{let e=w().resize.activeId,t=C(e);t&&L(t);let n=w().resize.previewSize;n!==null&&q(`ui:panel-resize`,e,{size:n})},commitResize:e=>{G();let t=typeof e.event.panelId==`string`?e.event.panelId:``,n=w().layout.committedSizes[t];t&&n!==void 0&&q(`ui:panel-resize-end`,t,{size:n})},cancelResize:G,prepareSizing:we,finishSizing:Te,persist:be}})}),ke=()=>{let e=j();Q.send({type:`PANELS_CHANGED`,...e}),X()},Ae=()=>{c=ae({targets:x(),read:j,onChange:ke,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`id`,`data-size`,`data-resize`,`data-collapsible`,`data-default-collapsed`]}})},$;return $={...Q,get id(){return x().id||T().id},get orientation(){return O()},get collapsed(){return[...w().layout.collapsedIds]},get sizes(){return{...w().layout.committedSizes}},get root(){let e=this.snapshot.current?.props??T();return re({inputs:[h({part:V.parts.root,props:e,className:e.class}),{"data-ui-panels":``}]})},init(){o=this.$el,Q.connect(this.$el,this.snapshot),x().id||=T().id,u=T().orientation===`horizontal`&&x().getBoundingClientRect().width<se(x(),`sm`)?`stacked`:`wide`,H.add($),me(),G(),X(),l=new ResizeObserver(e=>{Oe(e[0]?.contentRect.width??x().clientWidth)}),l.observe(x()),Ae(),T().persist&&Se(),p.push(te({target:x(),event:`keydown`,handler:()=>W()}))},destroy(){H.delete($),c?.(),c=null,l?.disconnect(),l=null,_.forEach(e=>e()),_.clear(),p.forEach(e=>e()),p=[],m.forEach(e=>window.clearTimeout(e)),m.clear(),g.forEach(e=>cancelAnimationFrame(e)),g.clear(),Q.disconnect(),o=null},transitionPanel(o){let s=o.data.panelId,c=C(s),l=v.get(s);if(!c||!l||l.from===l.to||t())return c&&L(c,l?.to),i();let u=()=>{};return n(c.panel,()=>{let t=e(l.from);return u=t.on(`change`,e=>L(c,e)),L(c,l.from),r(t,l.to,a.layout)},new Set([`layout`]),o.signal,()=>{u(),L(c)})},transitionPanelSize(o){let{panelId:s,from:c,to:l}=o.data,u=C(s);if(!u||c===l||t())return u&&L(u),i();let d=()=>{};return n(u.panel,()=>{let t=e(c);return d=t.on(`change`,e=>L(u,e)),L(u,c),r(t,l,a.layoutQuick)},new Set([`layout`]),o.signal,()=>{d(),L(u)})},hasPanel(e){return C(e)!==null},isCollapsed:E,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=C(e);if(D()||!n||n.props.size===`fill`||E(e)||!Number.isFinite(t))return;let r=A(n.panel),i=P(n,t);Math.abs(r-i)<.5||Q.send({type:`SIZE`,panelId:e,from:r,to:i})},reset(e){Ce(e)},perform(e,t,n){n&&b.set(t,n),{collapse:this.collapse,expand:this.expand,toggle:this.toggle}[e](t)},syncToggles:W},$},G=()=>{let e={};return{get props(){return e},init(){e=s({el:this.$el,schema:C})},destroy(){},get root(){return re({inputs:[h({part:V.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=>{m(`UiPanels`,W)(e),m(`UiPanelToggle`,G)(e)},K=new WeakSet,ve=e=>{K.has(e)||(K.add(e),o(e),v(e),_e(e))};export{G as n,W as r,ve as t};
2
- //# sourceMappingURL=entry.generated-RnJw-Qs4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.generated-RnJw-Qs4.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 PanelsContext = {\n collection: {\n ids: string[];\n collapsibleIds: string[];\n sizableIds: string[];\n resizableIds: string[];\n };\n layout: {\n collapsedIds: string[];\n committedSizes: Record<string, number>;\n };\n authored: {collapsedIds: string[]};\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);\n\nconst requestedCollapsed = (scope: MachineScope<PanelsContext, PanelsProps>): string[] => {\n const id = panelId(scope.event);\n const current = scope.context.layout.collapsedIds;\n switch (scope.event.type) {\n case 'COLLAPSE':\n return scope.context.collection.collapsibleIds.includes(id) && !current.includes(id)\n ? scope.context.collection.ids.filter((item) => current.includes(item) || item === id)\n : current;\n case 'EXPAND':\n return current.filter((item) => item !== id);\n case 'TOGGLE':\n if (!scope.context.collection.collapsibleIds.includes(id)) return current;\n return current.includes(id)\n ? current.filter((item) => item !== id)\n : scope.context.collection.ids.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 scope.context.collection.ids.includes(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 return scope.context.collection.resizableIds.includes(id)\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 return changes.length > 0 && changes.every(({panelId: id}) => (\n scope.context.collection.sizableIds.includes(id)\n && !scope.context.layout.collapsedIds.includes(id)\n ));\n};\n\nconst hiddenSizingAllowed = (scope: MachineScope<PanelsContext, PanelsProps>): boolean => {\n const changes = sizingChanges(scope.event);\n return changes.length > 0 && changes.every(({panelId: id}) => (\n scope.context.collection.sizableIds.includes(id)\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 return ids.length > 0 && ids.every((id) => (\n scope.context.collection.sizableIds.includes(id)\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,\n },\n sizing: {changes},\n }};\n};\n\nconst commitHiddenSizes = (scope: MachineScope<PanelsContext, PanelsProps>) => {\n const changes = sizingChanges(scope.event);\n return {context: {\n ...scope.context,\n layout: {\n ...scope.context.layout,\n committedSizes: {\n ...scope.context.layout.committedSizes,\n ...Object.fromEntries(changes.map(({panelId: id, to}) => [id, to])),\n },\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: {...scope.context.layout, committedSizes},\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 ids = strings(scope.event.ids);\n const collapsibleIds = strings(scope.event.collapsibleIds).filter((id) => ids.includes(id));\n const sizableIds = strings(scope.event.sizableIds).filter((id) => ids.includes(id));\n const resizableIds = strings(scope.event.resizableIds).filter((id) => ids.includes(id));\n const authoredCollapsedIds = strings(scope.event.authoredCollapsedIds).filter((id) => collapsibleIds.includes(id));\n const known = new Set(scope.context.collection.ids);\n const collapsedIds = ids.filter((id) => (\n scope.context.layout.collapsedIds.includes(id) || (!known.has(id) && authoredCollapsedIds.includes(id))\n ) && collapsibleIds.includes(id));\n const committedSizes = Object.fromEntries(Object.entries(scope.context.layout.committedSizes).filter(([id]) => (\n ids.includes(id) && sizableIds.includes(id)\n )));\n const activeExists = ids.includes(scope.context.resize.activeId) && resizableIds.includes(scope.context.resize.activeId);\n return {context: {\n ...scope.context,\n collection: {ids, collapsibleIds, sizableIds, resizableIds},\n layout: {collapsedIds, committedSizes},\n authored: {collapsedIds: authoredCollapsedIds},\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 ids = strings(scope.event.ids);\n const resizableIds = strings(scope.event.resizableIds);\n return !ids.includes(scope.context.resize.activeId) || !resizableIds.includes(scope.context.resize.activeId);\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: {...scope.context.layout.committedSizes, [id]: size},\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 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';\nimport {animate, motionValue} from 'motion';\n\nimport {\n type AlpineMachine,\n createAlpineMachine,\n createResizable,\n decodeProps,\n defineAlpineData,\n focusableElements,\n isRtl,\n mergeBindings,\n observeSemanticChanges,\n resolveStyle,\n type BindingObject,\n type CleanupStack,\n type ResizeDirection,\n type ResizeEvent,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {noopHandle} from '@client/motion/animate';\nimport {ownMotion} from '@client/motion/owned';\nimport {roles, shouldReduceMotion, type MotionHandle, type MotionTransitionSubject} from '@client/motion';\nimport {compositionBreakpointPixels} from '@client/runtime/composition-breakpoint';\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 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 PanelCollectionState = {\n ids: string[];\n collapsibleIds: string[];\n sizableIds: string[];\n resizableIds: string[];\n authoredCollapsedIds: string[];\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: CleanupStack = [];\n const deferredTimers = new Set<number>();\n const restoreFrames = new Set<number>();\n const resizeCleanups = new Map<HTMLElement, () => void>();\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 = (): PanelCollectionState => {\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 {\n ids: items.map(({props}) => props.id).filter(Boolean),\n collapsibleIds: items.filter(({props}) => props.id && props.collapsible).map(({props}) => props.id),\n sizableIds: items.filter(({props}) => props.id && props.size !== 'fill').map(({props}) => props.id),\n resizableIds: items.filter(({props}) => (\n props.id && props.size !== 'fill' && props.resize !== 'none'\n )).map(({props}) => props.id),\n authoredCollapsedIds: items.filter(({props}) => (\n props.id && props.collapsible && props.defaultCollapsed\n )).map(({props}) => props.id),\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 ids: collection.ids,\n collapsibleIds: collection.collapsibleIds,\n sizableIds: collection.sizableIds,\n resizableIds: collection.resizableIds,\n },\n layout: {collapsedIds: [...collection.authoredCollapsedIds], committedSizes: {}},\n authored: {collapsedIds: collection.authoredCollapsedIds},\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().authored.collapsedIds.includes(record.props.id)) {\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 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)) remembered.focus({preventScroll: true});\n else {\n record.expanded.tabIndex = -1;\n record.expanded.focus({preventScroll: true});\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 ? focusableElements(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) collapsedTarget.focus({preventScroll: true});\n else if (fallback) fallback.focus({preventScroll: true});\n else {\n root().tabIndex = -1;\n root().focus({preventScroll: true});\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 desiredCollapsed = new Set(\n (Array.isArray(stored.collapsed) ? stored.collapsed : [])\n .filter((id): id is string => typeof id === 'string' && collection.collapsibleIds.includes(id)),\n );\n const desiredSizes = numericRecord(stored.sizes);\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(collection.collapsibleIds, (id) => desiredCollapsed.has(id));\n };\n\n const restoreSizes = (): void => {\n const changes = collection.sizableIds.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 = collection.collapsibleIds.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 targetIds = panelId ? collection.ids.filter((id) => id === panelId) : collection.ids;\n if (targetIds.length === 0) return;\n\n const restoreCollapsedState = (): void => {\n reconcileCollapsedState(\n targetIds.filter((id) => collection.collapsibleIds.includes(id)),\n (id) => context().authored.collapsedIds.includes(id),\n );\n };\n\n const sizedIds = targetIds.filter((id) => (\n collection.sizableIds.includes(id) && Object.hasOwn(context().layout.committedSizes, id)\n ));\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 currentPanels = new Set(records().map(({panel}) => panel));\n resizeCleanups.forEach((dispose, panel) => {\n if (currentPanels.has(panel)) return;\n dispose();\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 resizeCleanups.set(record.panel, 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 });\n };\n\n const reinitializeResizeHandles = (): void => {\n resizeCleanups.forEach((dispose) => dispose());\n resizeCleanups.clear();\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 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 cleanup.push(addListener({target: root(), event: 'keydown', handler: () => syncToggles()}));\n },\n destroy(): void {\n controllers.delete(component);\n disconnectObserver?.();\n disconnectObserver = null;\n resizeObserver?.disconnect();\n resizeObserver = null;\n resizeCleanups.forEach((dispose) => dispose());\n resizeCleanups.clear();\n cleanup.forEach((dispose) => dispose());\n cleanup = [];\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 || shouldReduceMotion()) {\n if (record) applyGeometry(record, geometry?.to);\n return noopHandle();\n }\n let unbind = (): void => {};\n return ownMotion(record.panel, () => {\n const value = motionValue(geometry.from);\n unbind = value.on('change', (size) => applyGeometry(record, size));\n applyGeometry(record, geometry.from);\n return animate(value, geometry.to, roles.layout);\n }, new Set(['layout']), transition.signal, () => {\n unbind();\n 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 || shouldReduceMotion()) {\n if (record) applyGeometry(record);\n return noopHandle();\n }\n let unbind = (): void => {};\n return ownMotion(record.panel, () => {\n const value = motionValue(from);\n unbind = value.on('change', (size) => applyGeometry(record, size));\n applyGeometry(record, from);\n return animate(value, to, roles.layoutQuick);\n }, new Set(['layout']), transition.signal, () => {\n unbind();\n 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":"qrBAEA,IAAM,IACF,EACA,IACS,CACT,IAAM,EAAQ,iBAAiB,CAAS,EAAE,iBAAiB,gBAAgB,GAAY,EACjF,EAAS,OAAO,WAAW,CAAK,EACtC,OAAO,OAAO,SAAS,CAAM,EAAI,EAAS,GAC9C,ECPM,EAAsB,CAAC,aAAc,UAAU,EAC/C,EAAkB,CAAC,MAAO,UAAW,QAAS,OAAQ,KAAK,EAC3D,EAAc,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,MAAM,EACnD,GAAqB,CAAC,OAAQ,QAAS,KAAK,EAC5C,EAAuB,CAAC,SAAU,SAAU,UAAU,EAEtD,GAAe,CACjB,GAAI,EAAO,QAAQ,WAAW,EAC9B,YAAa,EAAM,EAAqB,YAAY,EACpD,QAAS,EACT,QAAS,EAAK,QAAQ,EAAI,EAC1B,MAAO,CACX,EAEM,GAAc,CAChB,GAAI,EACJ,GAAI,EAAM,EAAiB,SAAS,EACpC,KA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Ac,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,EAAE,CAAc,EACrD,EAAiB,gBAAiB,CAAa,EAAE,CAAc,CACnE,ECz+BM,EAAa,IAAI,QAEjB,GAAkB,GAAqC,CACrD,EAAW,IAAI,CAAc,IACjC,EAAW,IAAI,CAAc,EAC7B,EAAyB,CAAc,EACvC,EAA4B,CAAc,EAC1C,GAAkB,CAAc,EACpC"}
@@ -1,2 +0,0 @@
1
- import{c as e,d as t,l as n,m as r,p as i,v as a}from"./motion-D2EM1olE.js";import{t as o}from"./capability-motion-LgqzTNla.js";import{f as s,l as c,n as l}from"./codecs-Cb1ns_47.js";import{i as u,n as d,r as f,s as p}from"./dom-qAeVl7dc.js";import{i as m,t as h}from"./alpine-machine-BS13dbK4.js";import{t as g}from"./alpine-data-CytyCyfk.js";import{t as _}from"./collection-navigation-CfTZUJrL.js";import{t as v}from"./machine-Dqut4h89.js";import{n as y,t as b}from"./props-change-2xfsIAEN.js";import{t as ee}from"./semantic-observer-BUswpsNx.js";import{A as x,P as S}from"./common-Dfj6NCjU.js";var C=[`manual`,`automatic`],w=S;[...w];var T=[`auto`,...x],te={id:s.default(`ui-tabs`),animate:l,defaultValue:s,value:s,activation:c(C,`manual`),orientation:c(w,`horizontal`),gap:c(T,`auto`),loop:l.default(!0),panels:s,class:s},ne=[m({name:`switching`,state:`switching`,project:e=>e.context.change,onDone:`SWITCH_DONE`,onError:`SWITCH_ERROR`,sends:{select:e=>({type:`SELECT`,value:e})}})],E=e=>typeof e==`string`?e:``,D=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],O=e=>!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`)),k=e=>y(e.event)?.props??e.props,A=e=>e.event.type===`ITEMS_CHANGED`?{values:D(e.event.values),disabledValues:D(e.event.disabledValues),panelIds:O(e.event.panelIds)}:e.context.collection,j=(e,t)=>e&&t.values.includes(e)&&!t.disabledValues.includes(e)?e:t.values.find(e=>!t.disabledValues.includes(e))??``,M=e=>{let t=A(e);if(e.event.type===`SELECT`){let n=E(e.event.value);return n&&t.values.includes(n)&&!t.disabledValues.includes(n)?n:e.context.selection.value}return e.event.type===`PROPS_CHANGED`&&b(e.event,`value`)?j(k(e).value,t):j(e.context.selection.value,t)},N=e=>e.context.selection.value!==M(e),P=(e,t)=>({target:e,guard:N,reduce:`applySwitch`,effects:t}),re=({props:e,context:t,effects:n})=>v({initial:`stable`,on:{DOM_INVALIDATED:{effects:`syncDom`}},states:{stable:{tags:[`stable`],on:{SELECT:P(`switching`,`prepareSwitch`),PROPS_CHANGED:[P(`switching`,`prepareSwitch`),{reduce:`reconcile`,effects:`syncProps`}],ITEMS_CHANGED:[P(`switching`,`prepareSwitch`),{reduce:`reconcile`,effects:`syncItems`}]}},switching:{tags:[`switching`,`transitioning`],on:{SWITCH_DONE:{target:`stable`,effects:`finishSwitch`},SWITCH_ERROR:{target:`stable`,effects:`finishSwitch`},SELECT:P(`switching`,`prepareSwitch`),PROPS_CHANGED:[P(`switching`,`prepareSwitch`),{reduce:`reconcile`,effects:`syncProps`}],ITEMS_CHANGED:[P(`switching`,`prepareSwitch`),{reduce:`reconcile`,effects:`syncItems`}]}}}},{context:t,props:e,reducers:{applySwitch:e=>{let t=A(e),n=M(e);return{props:k(e),context:{...e.context,selection:{value:n},change:{previousValue:e.context.selection.value,value:n,panelId:t.panelIds[n]??``},collection:t}}},reconcile:e=>({props:k(e),context:{...e.context,collection:A(e),selection:{value:M(e)}}})},effects:{prepareSwitch:n.prepareSwitch,finishSwitch:n.finishSwitch,syncDom:n.syncDom,syncProps:n.syncProps,syncItems:n.syncItems}}),ie=`ui-tabs`,F=e=>e?`active`:`inactive`,I=e=>e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)||`tab`,L=(e,t)=>`${e}-tab-${I(t)}`,R=(e,t)=>`${e}-panel-${I(t)}`,z=e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement,B=e=>Array.from(new Set(e)),V=()=>{let o=null,s=null,c=null,l=null,m=null,g,v=null,y=()=>{if(!o)throw Error(`Tabs has not been initialized.`);return o},b=()=>y().id||y().dataset.id||y().dataset.owner||ie,x=e=>e.closest(`[data-ui-tabs]`)===y(),S=e=>d({value:e}),C=()=>Array.from(y().querySelectorAll(`[data-ui-tabs-list]`)).find(x)??null,w=e=>{let t=(e??C())?.dataset.variant;return t===`subtle`||t===`segmented`||t===`pills`?t:`line`},T=e=>(e??C())?.dataset.size===`sm`?`sm`:`md`,E=e=>{let t=(e??C())?.dataset.orientation;return t===`vertical`||t===`horizontal`?t:P().orientation},D=()=>{let e=b(),t=t=>t.dataset.uiTabsOwner===e||t.dataset.owner===e,n=Array.from(y().querySelectorAll(`[data-ui-tabs-panel]`)).filter(x),r=P().panels;if(r){let e=document.querySelector(r);e&&n.push(...Array.from(e.querySelectorAll(`[data-ui-tabs-panel]`)).filter(t))}return n.push(...Array.from(document.querySelectorAll(`[data-ui-tabs-panel][data-ui-tabs-owner="${CSS.escape(e)}"]`)).filter(t)),B(n)},O=e=>D().find(t=>t.dataset.value===e)??null,k=()=>Array.from(y().querySelectorAll(`[data-ui-tabs-tab]`)).filter(x).map((e,t)=>z(e)?(e.dataset.value||=`tab-${t+1}`,{tab:e,value:e.dataset.value,disabled:S(e.dataset.disabled)||e.hasAttribute(`disabled`),panel:O(e.dataset.value)}):null).filter(e=>e!==null),A=e=>k().find(t=>t.value===e)??null,j=e=>{if(!(e instanceof Element))return null;let t=e.closest(`[data-ui-tabs-tab]`);return t&&x(t)?k().find(e=>e.tab===t)??null:null},M=()=>{let e=k();return{values:e.map(e=>e.value),disabledValues:e.filter(e=>e.disabled).map(e=>e.value),panelIds:Object.fromEntries(e.map(e=>[e.value,e.panel?.id||R(e.tab.dataset.uiTabsOwner||e.tab.dataset.owner||b(),e.value)]))}},N=e=>{let t=M(),n=k().find(e=>S(e.tab.dataset.selected)||e.tab.getAttribute(`aria-selected`)===`true`),r=D().find(e=>S(e.dataset.selected)),i=e.value||e.defaultValue||n?.value||r?.dataset.value||``,a=i&&t.values.includes(i)&&!t.disabledValues.includes(i)?i:t.values.find(e=>!t.disabledValues.includes(e))??``;return{selection:{value:a},change:{previousValue:``,value:a,panelId:t.panelIds[a]??``},collection:t}},P=()=>v??J.getCommittedSnapshot().props,I=()=>J.getCommittedSnapshot().context,V=()=>I().selection.value,H=()=>{let e=k();return e.find(e=>document.activeElement===e.tab||e.tab.dataset.active===`true`)?.tab??e.find(e=>e.value===V())?.tab??null},U=e=>e.querySelector(`:scope > [data-ui-tabs-indicator]`),W=e=>{if(!(e instanceof HTMLElement))return null;let t=e.closest(`[data-ui-tabs-list]`),n=t?U(t):null;if(!t||!n)return null;n.hidden=!1;let r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),a=t.dataset.orientation===`vertical`,o=t.dataset.variant===`line`,s=o&&a?2:i.width,c=o&&!a?2:i.height,l=o?Number.parseFloat(getComputedStyle(t).getPropertyValue(`--border-width-edge-separator`))||1:0,u=o&&a?r.left-(s-l)/2:i.left,d=o&&!a?r.bottom-(c+l)/2:i.top;return{indicator:n,styles:{height:c,left:u-r.left,top:d-r.top,width:s}}},G=e=>{let t=U(e);if(!t)return;let n=k().find(t=>t.value===V()&&t.tab.closest(`[data-ui-tabs-list]`)===e);if(!n){t.hidden=!0,e.dataset.uiTabsReady=``;return}let r=W(n.tab);r&&(r.indicator.style.height=`${r.styles.height}px`,r.indicator.style.left=`${r.styles.left}px`,r.indicator.style.top=`${r.styles.top}px`,r.indicator.style.width=`${r.styles.width}px`),e.dataset.uiTabsReady=``},ae=()=>{let e=P();!y().id&&e.id&&(y().id=e.id),y().dataset.orientation=e.orientation,y().dataset.activation=e.activation,y().dataset.value=V(),p({el:y(),attr:`data-animate`,present:e.animate})},oe=e=>{let t=E(e);e.setAttribute(`role`,`tablist`),e.dataset.orientation=t,t===`vertical`?e.setAttribute(`aria-orientation`,`vertical`):e.removeAttribute(`aria-orientation`)},se=e=>{let t=e.value===V(),n=e.tab.closest(`[data-ui-tabs-list]`),r=E(n),i=w(n),a=T(n),o=e.tab.dataset.uiTabsOwner||e.tab.dataset.owner||b(),s=e.tab.querySelector(`[data-ui-tabs-tab-selected-icon]`),c=F(t),l=H();e.tab.id||=L(o,e.value),e.tab.dataset.state=c,e.tab.dataset.orientation=r,e.tab.dataset.variant=i,e.tab.dataset.size=a,e.tab.setAttribute(`role`,`tab`),e.tab.setAttribute(`aria-selected`,t?`true`:`false`),e.tab.setAttribute(`aria-controls`,e.panel?.id||R(o,e.value)),e.tab.tabIndex=e.tab===l?0:-1,p({el:e.tab,attr:`data-selected`,present:t}),s&&(s.style.visibility=t?`visible`:`hidden`),p({el:e.tab,attr:`data-disabled`,present:e.disabled}),e.disabled?(e.tab.setAttribute(`aria-disabled`,`true`),e.tab.tabIndex=-1):e.tab.removeAttribute(`aria-disabled`),e.tab instanceof HTMLButtonElement&&(e.tab.disabled=e.disabled)},ce=e=>{let t=e.dataset.value||``,n=t===V(),r=e.dataset.uiTabsOwner||e.dataset.owner||b(),i=R(r,t);t&&!e.id&&(e.id=i),t&&!e.hasAttribute(`data-ui-key`)&&e.setAttribute(`data-ui-key`,e.id||i),e.dataset.state=F(n),e.dataset.orientation=P().orientation,e.setAttribute(`role`,`tabpanel`),e.setAttribute(`aria-labelledby`,L(r,t)),e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hidden=!n,p({el:e,attr:`data-selected`,present:n})},K=({indicator:e=!1}={})=>{ae();let t=C();t&&oe(t),k().forEach(se),D().forEach(ce),e&&t&&G(t)},le=()=>{f({el:y(),name:`ui:change`,detail:{value:V()}})},ue=(e,t)=>{f({el:e,name:`ui:tabs:activate`,detail:{value:t,panelId:O(t)?.id??``}})},q=()=>{K({indicator:!0}),Z(),Q()},J=h({schema:te,hooks:ne,resolveTransitionElement:({data:e})=>A(e.value)?.tab??null,createMachine:({props:e})=>{v=e;let t=N(e);return v=null,re({props:e,context:t,effects:{prepareSwitch:({event:e})=>{K(),e.type===`SELECT`&&le()},finishSwitch:()=>K(),syncDom:q,syncProps:q,syncItems:()=>{K({indicator:!0}),Q()}}})}}),Y=()=>{if(!s)throw Error(`Tabs navigation has not been initialized.`);return s},X=(e,{tab:t,motion:n=!0}={})=>{let r=V();J.send({type:`SELECT`,value:e,motion:n}),V()!==r&&t&&ue(t,V())},de=e=>{let t=j(e.target);if(!t)return;if(t.disabled){e.preventDefault();return}let n=!(e instanceof MouseEvent)||e.detail>0;X(t.value,{tab:t.tab,motion:n})},fe=e=>{m=j(e.target)?.tab??null,window.clearTimeout(g),g=window.setTimeout(()=>{m=null,g=void 0})},pe=e=>{let t=j(e.target);!t||e.target!==t.tab||t.disabled||(Y().activateItem({el:t.tab}),P().activation===`automatic`&&m!==t.tab?X(t.value,{tab:t.tab,motion:!1}):K())},me=e=>{let t=j(e.target);if(!t||e.target!==t.tab)return;if(e.key===` `&&t.tab instanceof HTMLAnchorElement){e.preventDefault(),X(t.value,{tab:t.tab,motion:!1});return}let n=E(t.tab.closest(`[data-ui-tabs-list]`));if(e.key===`Home`){e.preventDefault(),Y().focusFirst();return}if(e.key===`End`){e.preventDefault(),Y().focusLast();return}if(n===`vertical`){e.key===`ArrowDown`?(e.preventDefault(),Y().focusNext()):e.key===`ArrowUp`&&(e.preventDefault(),Y().focusPrevious());return}e.key===`ArrowRight`?(e.preventDefault(),u({el:y()})?Y().focusPrevious():Y().focusNext()):e.key===`ArrowLeft`&&(e.preventDefault(),u({el:y()})?Y().focusNext():Y().focusPrevious())},he=()=>{let e=M();J.send({type:`ITEMS_CHANGED`,...e})},Z=()=>{c?.();let e=[y()],t=P().panels;if(t){let n=document.querySelector(t);n&&e.push(n)}c=ee({targets:B(e),read:M,onChange:he,observer:{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-value`,`data-disabled`,`disabled`,`data-ui-tabs-owner`,`data-owner`,`data-variant`,`data-size`,`data-orientation`,`data-gap`,`id`]}})},Q=()=>{if(l?.disconnect(),typeof ResizeObserver>`u`)return;l=new ResizeObserver(()=>{if(!o)return;let e=C();e&&G(e)});let e=C();e&&l.observe(e),k().forEach(e=>l?.observe(e.tab))},$;return $={...J,get value(){return this.snapshot.current?.context.selection.value??``},init(){o=this.$el,J.connect(this.$el,this.snapshot),s=_({root:y,itemSelector:`[data-ui-tabs-tab]`,isDisabled:e=>!x(e)||S(e.dataset.disabled)||e.hasAttribute(`disabled`),loop:()=>P().loop}),K({indicator:!0}),Z(),Q()},destroy(){c?.(),c=null,l?.disconnect(),l=null,window.clearTimeout(g),m=null,g=void 0,J.disconnect(),s=null,o=null},transitionIndicator(o){if(!(o.el instanceof Element))return Promise.resolve();let s=W(o.el);return s?!o.props.animate||o.event.motion===!1||e()?(G(o.el.closest(`[data-ui-tabs-list]`)),i()):t(s.indicator,()=>{let{ease:e,...t}=n(s.indicator,`layout`);return r(s.indicator,s.styles,{...t,...`bounce`in t?{}:{bounce:0},type:a})},new Set([`layout`]),o.signal):Promise.resolve()},get root(){return{"data-ui-tabs":``,":data-orientation":()=>P().orientation,":data-activation":()=>P().activation,":data-animate":()=>P().animate?``:void 0,"@pointerdown":fe,"@click":de,"@focusin":pe,"@keydown":e=>{e instanceof KeyboardEvent&&me(e)}}},select(e){X(e)},isActive(e){return this.snapshot.current?.context.selection.value===e}},$},H=g(`UiTabs`,V),U=new WeakSet,W=e=>{U.has(e)||(U.add(e),o(e),H(e))};export{V as n,W as t};
2
- //# sourceMappingURL=entry.generated-ifMDOEy_.js.map