@editora/ui-core 0.1.19 → 0.1.20

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 (299) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-orbiter.d.ts.map +1 -1
  57. package/dist/components/ui-skeleton.d.ts.map +1 -1
  58. package/dist/components/ui-split-button.d.ts +1 -0
  59. package/dist/components/ui-split-button.d.ts.map +1 -1
  60. package/dist/components/ui-time-picker.d.ts.map +1 -1
  61. package/dist/container.cjs.js +2 -2
  62. package/dist/container.esm.js +2 -3
  63. package/dist/context-menu.cjs.js +8 -8
  64. package/dist/context-menu.esm.js +157 -219
  65. package/dist/control-group.cjs.js +1 -1
  66. package/dist/control-group.esm.js +2 -3
  67. package/dist/data-table.cjs.js +4 -4
  68. package/dist/data-table.esm.js +299 -381
  69. package/dist/date-field.cjs.js +3 -3
  70. package/dist/date-field.esm.js +68 -80
  71. package/dist/date-picker.cjs.js +9 -9
  72. package/dist/date-picker.esm.js +69 -97
  73. package/dist/date-range-picker.cjs.js +3 -3
  74. package/dist/date-range-picker.esm.js +32 -56
  75. package/dist/date-range-time-picker.cjs.js +9 -9
  76. package/dist/date-range-time-picker.esm.js +111 -140
  77. package/dist/date-time-picker.cjs.js +4 -4
  78. package/dist/date-time-picker.esm.js +112 -144
  79. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  80. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  81. package/dist/description.cjs.js +1 -1
  82. package/dist/description.esm.js +3 -5
  83. package/dist/dialog.cjs.js +12 -12
  84. package/dist/dialog.esm.js +44 -63
  85. package/dist/direction-provider.cjs.js +1 -1
  86. package/dist/direction-provider.esm.js +2 -3
  87. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  88. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  89. package/dist/dismissable-layer.cjs.js +2 -2
  90. package/dist/dismissable-layer.esm.js +4 -6
  91. package/dist/dock.cjs.js +5 -5
  92. package/dist/dock.esm.js +134 -155
  93. package/dist/drawer.cjs.js +2 -2
  94. package/dist/drawer.esm.js +18 -35
  95. package/dist/dropdown.cjs.js +2 -2
  96. package/dist/dropdown.esm.js +119 -149
  97. package/dist/dropzone.cjs.js +1 -1
  98. package/dist/dropzone.esm.js +0 -1
  99. package/dist/empty-state.cjs.js +1 -1
  100. package/dist/empty-state.esm.js +1 -1
  101. package/dist/field-error.cjs.js +1 -1
  102. package/dist/field-error.esm.js +3 -5
  103. package/dist/field.cjs.js +5 -5
  104. package/dist/field.esm.js +27 -34
  105. package/dist/fieldset.cjs.js +4 -4
  106. package/dist/fieldset.esm.js +19 -24
  107. package/dist/file-upload.cjs.js +4 -4
  108. package/dist/file-upload.esm.js +69 -93
  109. package/dist/flex.cjs.js +1 -1
  110. package/dist/flex.esm.js +5 -9
  111. package/dist/floating-toolbar.cjs.js +4 -4
  112. package/dist/floating-toolbar.esm.js +60 -85
  113. package/dist/focus-scope-Bwug2gDv.js +1 -0
  114. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  115. package/dist/focus-scope.cjs.js +2 -2
  116. package/dist/focus-scope.esm.js +15 -20
  117. package/dist/form.cjs.js +2 -2
  118. package/dist/form.esm.js +26 -53
  119. package/dist/gantt.cjs.js +43 -43
  120. package/dist/gantt.esm.js +295 -322
  121. package/dist/grid.cjs.js +1 -1
  122. package/dist/grid.esm.js +5 -9
  123. package/dist/hover-card.cjs.js +4 -4
  124. package/dist/hover-card.esm.js +22 -28
  125. package/dist/icon-cloud.cjs.js +7 -7
  126. package/dist/icon-cloud.esm.js +48 -62
  127. package/dist/icon.cjs.js +1 -1
  128. package/dist/icon.esm.js +2 -4
  129. package/dist/index.cjs.js +1 -1
  130. package/dist/index.esm.js +378 -390
  131. package/dist/inline-edit.cjs.js +11 -11
  132. package/dist/inline-edit.esm.js +32 -36
  133. package/dist/input.cjs.js +17 -17
  134. package/dist/input.esm.js +50 -63
  135. package/dist/label.cjs.js +2 -2
  136. package/dist/label.esm.js +8 -17
  137. package/dist/layout.cjs.js +2 -2
  138. package/dist/layout.esm.js +20 -26
  139. package/dist/listbox-B6QgECax.js +46 -0
  140. package/dist/listbox-DJamVeFj.mjs +200 -0
  141. package/dist/listbox.cjs.js +1 -1
  142. package/dist/listbox.esm.js +2 -4
  143. package/dist/marquee.cjs.js +5 -5
  144. package/dist/marquee.esm.js +33 -50
  145. package/dist/masonry-grid.cjs.js +1 -1
  146. package/dist/masonry-grid.esm.js +5 -9
  147. package/dist/menu.cjs.js +3 -3
  148. package/dist/menu.esm.js +106 -126
  149. package/dist/menubar.cjs.js +5 -5
  150. package/dist/menubar.esm.js +118 -164
  151. package/dist/meter.cjs.js +2 -2
  152. package/dist/meter.esm.js +4 -4
  153. package/dist/multi-select.cjs.js +4 -4
  154. package/dist/multi-select.esm.js +120 -140
  155. package/dist/navigation-menu.cjs.js +4 -4
  156. package/dist/navigation-menu.esm.js +44 -55
  157. package/dist/number-field.cjs.js +2 -2
  158. package/dist/number-field.esm.js +73 -98
  159. package/dist/number-ticker.cjs.js +3 -3
  160. package/dist/number-ticker.esm.js +22 -43
  161. package/dist/odometer.cjs.js +1 -1
  162. package/dist/odometer.esm.js +5 -9
  163. package/dist/orbiter.cjs.js +13 -13
  164. package/dist/orbiter.esm.js +79 -90
  165. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  166. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  167. package/dist/pagination.cjs.js +2 -2
  168. package/dist/pagination.esm.js +14 -18
  169. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  170. package/dist/panel-group-CaD0_KQf.js +36 -0
  171. package/dist/panel-group.cjs.js +1 -1
  172. package/dist/panel-group.esm.js +2 -5
  173. package/dist/panel.cjs.js +4 -4
  174. package/dist/panel.esm.js +8 -10
  175. package/dist/password-field.cjs.js +9 -9
  176. package/dist/password-field.esm.js +62 -82
  177. package/dist/pin-input.cjs.js +3 -3
  178. package/dist/pin-input.esm.js +33 -39
  179. package/dist/placement-grid.cjs.js +4 -4
  180. package/dist/placement-grid.esm.js +108 -131
  181. package/dist/plugin-panel.cjs.js +7 -7
  182. package/dist/plugin-panel.esm.js +13 -15
  183. package/dist/popover.cjs.js +2 -2
  184. package/dist/popover.esm.js +21 -31
  185. package/dist/portal-DgpQ3Jo1.js +1 -0
  186. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  187. package/dist/portal.cjs.js +2 -2
  188. package/dist/portal.esm.js +10 -19
  189. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  190. package/dist/positioner-D_fqyx_j.js +1 -0
  191. package/dist/positioner.cjs.js +2 -2
  192. package/dist/positioner.esm.js +11 -18
  193. package/dist/presence.cjs.js +1 -1
  194. package/dist/presence.esm.js +7 -13
  195. package/dist/progress.cjs.js +1 -1
  196. package/dist/progress.esm.js +5 -9
  197. package/dist/quick-actions.cjs.js +6 -6
  198. package/dist/quick-actions.esm.js +52 -62
  199. package/dist/radio-group.cjs.js +13 -13
  200. package/dist/radio-group.esm.js +39 -51
  201. package/dist/radio.cjs.js +1 -1
  202. package/dist/radio.esm.js +5 -9
  203. package/dist/rating.cjs.js +1 -1
  204. package/dist/rating.esm.js +12 -23
  205. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  206. package/dist/roving-focus-group.cjs.js +1 -1
  207. package/dist/roving-focus-group.esm.js +3 -5
  208. package/dist/runtime-CTaOSmBj.js +1 -0
  209. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  210. package/dist/runtime.cjs.js +1 -1
  211. package/dist/runtime.esm.js +6 -6
  212. package/dist/scroll-area.cjs.js +3 -3
  213. package/dist/scroll-area.esm.js +38 -46
  214. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  215. package/dist/section.cjs.js +1 -1
  216. package/dist/section.esm.js +1 -1
  217. package/dist/select.cjs.js +7 -7
  218. package/dist/select.esm.js +67 -97
  219. package/dist/selection-popup.cjs.js +1 -1
  220. package/dist/selection-popup.esm.js +8 -15
  221. package/dist/separator.cjs.js +1 -1
  222. package/dist/separator.esm.js +1 -1
  223. package/dist/sidebar.cjs.js +18 -18
  224. package/dist/sidebar.esm.js +117 -139
  225. package/dist/skeleton.cjs.js +11 -11
  226. package/dist/skeleton.esm.js +27 -24
  227. package/dist/slider.cjs.js +1 -1
  228. package/dist/slider.esm.js +6 -11
  229. package/dist/slot.cjs.js +4 -4
  230. package/dist/slot.esm.js +16 -19
  231. package/dist/sortable.cjs.js +45 -45
  232. package/dist/sortable.esm.js +421 -524
  233. package/dist/spinning-text.cjs.js +12 -12
  234. package/dist/spinning-text.esm.js +80 -92
  235. package/dist/split-button.cjs.js +4 -4
  236. package/dist/split-button.esm.js +77 -62
  237. package/dist/splitter.cjs.js +1 -1
  238. package/dist/splitter.esm.js +1 -1
  239. package/dist/stepper.cjs.js +8 -8
  240. package/dist/stepper.esm.js +32 -52
  241. package/dist/switch.cjs.js +7 -7
  242. package/dist/switch.esm.js +23 -31
  243. package/dist/table.cjs.js +2 -2
  244. package/dist/table.esm.js +46 -56
  245. package/dist/tabs.cjs.js +3 -3
  246. package/dist/tabs.esm.js +35 -55
  247. package/dist/tags-input.cjs.js +4 -4
  248. package/dist/tags-input.esm.js +45 -62
  249. package/dist/textarea.cjs.js +6 -6
  250. package/dist/textarea.esm.js +32 -41
  251. package/dist/time-field.cjs.js +4 -4
  252. package/dist/time-field.esm.js +70 -84
  253. package/dist/time-picker.cjs.js +22 -22
  254. package/dist/time-picker.esm.js +88 -110
  255. package/dist/timeline.cjs.js +1 -1
  256. package/dist/timeline.esm.js +3 -5
  257. package/dist/toast.cjs.js +2 -2
  258. package/dist/toast.esm.js +33 -47
  259. package/dist/toggle-group.cjs.js +6 -6
  260. package/dist/toggle-group.esm.js +85 -105
  261. package/dist/toggle.cjs.js +1 -1
  262. package/dist/toggle.esm.js +3 -5
  263. package/dist/toolbar.cjs.js +1 -1
  264. package/dist/toolbar.esm.js +13 -24
  265. package/dist/tooltip.cjs.js +2 -2
  266. package/dist/tooltip.esm.js +31 -42
  267. package/dist/transfer-list.cjs.js +19 -19
  268. package/dist/transfer-list.esm.js +98 -111
  269. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  270. package/dist/tree-Dx_kv_ih.js +39 -0
  271. package/dist/tree-item.cjs.js +2 -2
  272. package/dist/tree-item.esm.js +2 -3
  273. package/dist/tree.cjs.js +1 -1
  274. package/dist/tree.esm.js +2 -5
  275. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  276. package/dist/ui-button-rXQOS9QJ.js +521 -0
  277. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  278. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  279. package/dist/visually-hidden.cjs.js +1 -1
  280. package/dist/visually-hidden.esm.js +1 -1
  281. package/dist/wizard.cjs.js +14 -14
  282. package/dist/wizard.esm.js +85 -105
  283. package/package.json +2 -2
  284. package/dist/date-time-utils-66480de4.js +0 -1
  285. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  286. package/dist/dismissable-layer-193e3bed.js +0 -1
  287. package/dist/focus-scope-2b12b4e7.js +0 -1
  288. package/dist/listbox-308789a0.mjs +0 -210
  289. package/dist/listbox-ef2f708e.js +0 -46
  290. package/dist/panel-group-40254cdd.js +0 -36
  291. package/dist/portal-c69756c0.js +0 -1
  292. package/dist/positioner-33529bb8.js +0 -1
  293. package/dist/runtime-3f13807b.js +0 -1
  294. package/dist/tree-0a7a8d05.js +0 -39
  295. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  296. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  297. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  298. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  299. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/form.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-1b301e7f.js");class _{constructor(){this.fields=new Map}registerField(t,e){if(!t)throw new Error("Field must have a name to register with the form");return this.fields.set(t,e),()=>{this.fields.delete(t)}}getValues(){const t={};for(const[e,i]of this.fields)t[e]=i.getValue();return t}setValue(t,e){const i=this.fields.get(t);i&&typeof i.setValue=="function"&&i.setValue(e)}async validateField(t){const e=this.fields.get(t);if(!e)return{valid:!0};if(typeof e.validate=="function"){const i=await e.validate();return e.setError&&e.setError(i.valid?void 0:i.message),i}return{valid:!0}}async validateAll(){const t={};let e=!0;const i=Array.from(this.fields.entries());for(const[r,s]of i){const n=await this.validateField(r);n.valid||(e=!1,t[r]=n.message||"invalid")}return{valid:e,errors:t}}}const v=new Set(["heading","title","description","state-text","loading-text"]),y=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-EV6mVBUV.js");class _{constructor(){this.fields=new Map}registerField(t,e){if(!t)throw new Error("Field must have a name to register with the form");return this.fields.set(t,e),()=>{this.fields.delete(t)}}getValues(){const t={};for(const[e,i]of this.fields)t[e]=i.getValue();return t}setValue(t,e){const i=this.fields.get(t);i&&typeof i.setValue=="function"&&i.setValue(e)}async validateField(t){const e=this.fields.get(t);if(!e)return{valid:!0};if(typeof e.validate=="function"){const i=await e.validate();return e.setError&&e.setError(i.valid?void 0:i.message),i}return{valid:!0}}async validateAll(){const t={};let e=!0;const i=Array.from(this.fields.entries());for(const[r,s]of i){const n=await this.validateField(r);n.valid||(e=!1,t[r]=n.message||"invalid")}return{valid:e,errors:t}}}const v=new Set(["heading","title","description","state-text","loading-text"]),y=`
2
2
  :host {
3
3
  --ui-form-gap: 12px;
4
4
  --ui-form-radius: 14px;
@@ -342,7 +342,7 @@
342
342
  border-color: CanvasText;
343
343
  }
344
344
  }
345
- `;function m(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function u(o){if(!o)return!1;const t=o.assignedNodes({flatten:!0});return t.length?t.some(e=>{var i;return e.nodeType===Node.TEXT_NODE?!!((i=e.textContent)!=null&&i.trim()):e.nodeType===Node.ELEMENT_NODE}):!1}function x(o){const t=o.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"}function h(o){if(o==null)return o;if(o instanceof Date)return o.toISOString();if(typeof File<"u"&&o instanceof File)return{__file:!0,name:o.name,size:o.size,type:o.type,lastModified:o.lastModified};if(Array.isArray(o))return o.map(t=>h(t));if(typeof o=="object"){const t=Object.entries(o).sort(([i],[r])=>i.localeCompare(r)),e={};return t.forEach(([i,r])=>{e[i]=h(r)}),e}return o}function c(o){if(Array.isArray(o))return o.map(t=>c(t));if(o&&typeof o=="object"){if(typeof File<"u"&&o instanceof File)return o;if(o instanceof Date)return new Date(o.getTime());const t={};return Object.entries(o).forEach(([e,i])=>{t[e]=c(i)}),t}return o}function A(o){return o==="success"||o==="warning"||o==="error"?o:"default"}class b extends g.ElementBase{constructor(){super(),this._controller=new _,this._submitting=!1,this._autosaveTimer=null,this._readyFrame=null,this._dirtyFrame=null,this._initialSnapshot="",this._cleanValues={},this._baselineReady=!1,this._dirty=!1,this._dirtyAttrSyncing=!1,this._uid=Math.random().toString(36).slice(2,10),this._formEl=null,this._headerEl=null,this._headingEl=null,this._titleEl=null,this._descriptionEl=null,this._titleTextEl=null,this._descriptionTextEl=null,this._actionsEl=null,this._statusEl=null,this._statusTextEl=null,this._footerEl=null,this._titleSlot=null,this._headingSlot=null,this._descriptionSlot=null,this._actionsSlot=null,this._statusSlot=null,this._footerSlot=null,this._descriptionVisible=!1,this._statusVisible=!1,this._onNativeSubmit=this._onNativeSubmit.bind(this),this._onValueEvent=this._onValueEvent.bind(this),this._onBeforeUnload=this._onBeforeUnload.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["novalidate","variant","tone","density","shape","elevation","gap","headless","loading","autosave","autosave-delay","guard-unsaved","dirty","disabled","heading","title","description","state","state-text","loading-text","aria-label","aria-labelledby"]}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("title")&&!this.hasAttribute("heading")){const t=this.getAttribute("title");t!=null&&this.setAttribute("heading",t),this.removeAttribute("title")}this.root.addEventListener("submit",this._onNativeSubmit),this.root.addEventListener("slotchange",this._onSlotChange),this.addEventListener("input",this._onValueEvent),this.addEventListener("change",this._onValueEvent),this.hasAttribute("guard-unsaved")&&typeof window<"u"&&window.addEventListener("beforeunload",this._onBeforeUnload),queueMicrotask(()=>{!this.isConnected||this._baselineReady||this._setBaseline(this.getValues(),!1)}),this.hasAttribute("data-ui-ready")||(typeof requestAnimationFrame=="function"?this._readyFrame=requestAnimationFrame(()=>{this._readyFrame=null,this.setAttribute("data-ui-ready","")}):this._readyFrame=window.setTimeout(()=>{this._readyFrame=null,this.setAttribute("data-ui-ready","")},16))}disconnectedCallback(){this.root.removeEventListener("submit",this._onNativeSubmit),this.root.removeEventListener("slotchange",this._onSlotChange),this.removeEventListener("input",this._onValueEvent),this.removeEventListener("change",this._onValueEvent),this._readyFrame!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this._readyFrame),clearTimeout(this._readyFrame),this._readyFrame=null),this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=null),this._dirtyFrame!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this._dirtyFrame),clearTimeout(this._dirtyFrame),this._dirtyFrame=null),typeof window<"u"&&window.removeEventListener("beforeunload",this._onBeforeUnload),super.disconnectedCallback()}_onNativeSubmit(t){const e=t.target;e!=null&&e.classList.contains("form")&&(t.preventDefault(),t.stopPropagation(),!this.hasAttribute("disabled")&&this.submit())}registerField(t,e){return this._controller.registerField(t,e)}setValue(t,e){this._controller.setValue(t,e),this._setNativeValue(t,e,this._groupNativeControls({includeDisabled:!0})),this._scheduleDirtyRefresh()}setValues(t){if(!t||typeof t!="object")return;const e=this._groupNativeControls({includeDisabled:!0});Object.entries(t).forEach(([i,r])=>{this._controller.setValue(i,r),this._setNativeValue(i,r,e)}),this._scheduleDirtyRefresh()}getValues(){const t={...this._controller.getValues()},e=new Set(Object.keys(t)),i=this._collectNativeValues(e,this._groupNativeControls());return Object.assign(t,i),t}_queryNativeControls(t={}){const{includeDisabled:e=!1}=t;return Array.from(this.querySelectorAll("input[name],textarea[name],select[name]")).filter(r=>!(!x(r)||r.closest("ui-form")!==this||!e&&r.matches(":disabled")))}_groupNativeControls(t={}){const e=new Map;return this._queryNativeControls(t).forEach(i=>{const r=i.getAttribute("name")||"";if(!r)return;const s=e.get(r)||[];s.push(i),e.set(r,s)}),e}_collectNativeValues(t,e){const i={};return e.forEach((r,s)=>{if(t.has(s))return;const n=r[0];if(n){if(n instanceof HTMLInputElement&&n.type==="radio"){const a=r.find(l=>l instanceof HTMLInputElement&&l.checked);i[s]=a?a.value:"";return}if(n instanceof HTMLInputElement&&n.type==="checkbox"){if(r.length===1){i[s]=n.checked;return}i[s]=r.filter(a=>a instanceof HTMLInputElement&&a.checked).map(a=>a.value||"on");return}if(n instanceof HTMLSelectElement&&n.multiple){i[s]=Array.from(n.selectedOptions).map(a=>a.value);return}if(n instanceof HTMLInputElement&&n.type==="file"){i[s]=Array.from(n.files||[]);return}i[s]=n.value}}),i}_setNativeValue(t,e,i){const r=(i||this._groupNativeControls({includeDisabled:!0})).get(t)||[];if(!r.length)return;const s=r[0];if(s){if(s instanceof HTMLInputElement&&s.type==="radio"){const n=String(e??"");r.forEach(a=>{a instanceof HTMLInputElement&&(a.checked=a.value===n)});return}if(s instanceof HTMLInputElement&&s.type==="checkbox"){if(r.length===1){const a=typeof e=="boolean"?e:!!e;s.checked=a;return}const n=Array.isArray(e)?e.map(a=>String(a)):[];r.forEach(a=>{a instanceof HTMLInputElement&&(a.checked=n.includes(a.value||"on"))});return}if(s instanceof HTMLSelectElement&&s.multiple){const n=Array.isArray(e)?e.map(a=>String(a)):[];Array.from(s.options).forEach(a=>{a.selected=n.includes(a.value)});return}s instanceof HTMLInputElement&&s.type==="file"||(s.value=String(e??""))}}async validate(){const t=await this._controller.validateAll(),e=this._validateNativeControls(),i={valid:t.valid&&e.valid,errors:{...e.errors,...t.errors}};return this.dispatchEvent(new CustomEvent("validate",{bubbles:!0,composed:!0,detail:i})),i}_validateNativeControls(){const t={};let e=null,i=!0;return this._groupNativeControls().forEach((s,n)=>{for(const a of s)if(!(!a.willValidate||a.checkValidity())){i=!1,t[n]||(t[n]=a.validationMessage||"invalid"),e||(e=a);break}}),{valid:i,errors:t,firstInvalid:e}}async submit(){if(this._submitting||this.hasAttribute("loading")||this.hasAttribute("disabled"))return!1;this._submitting=!0;const t=this.hasAttribute("loading");t||this.setAttribute("loading","");try{const e=this.getValues();if(!this.hasAttribute("novalidate")){const r=await this._controller.validateAll(),s=this._validateNativeControls(),n={...s.errors,...r.errors},a=r.valid&&s.valid;if(this.dispatchEvent(new CustomEvent("validate",{bubbles:!0,composed:!0,detail:{valid:a,errors:n}})),!a)return this.dispatchEvent(new CustomEvent("invalid",{bubbles:!0,composed:!0,detail:{errors:n,values:e}})),this._focusFirstInvalid(s.firstInvalid,n),!1}return this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,composed:!0,detail:{values:e}})),this.markClean(e),!0}finally{this._submitting=!1,t||this.removeAttribute("loading")}}_focusFirstInvalid(t,e){var n;if(t){t.focus();return}const i=(n=Object.entries(e).find(([,a])=>!!a))==null?void 0:n[0];if(!i)return;const r=i.replace(/"/g,'\\"'),s=this.querySelector(`[name="${r}"]`);!s||typeof s.focus!="function"||s.focus()}async requestSubmit(){return this.submit()}reset(t){if(t&&typeof t=="object"){this.setValues(t),this.markClean(t);return}this.setValues(this._cleanValues),this.markClean(this._cleanValues)}get dirty(){return this._dirty}isDirty(){return this._dirty}markClean(t){if(t&&typeof t=="object"){this._setBaseline(t);return}this._setBaseline(this.getValues())}_setBaseline(t,e=!0){this._cleanValues=c(t||{}),this._initialSnapshot=this._snapshot(this._cleanValues),this._baselineReady=!0,this._setDirty(!1,e)}_snapshot(t){const e=t&&typeof t=="object"?t:this.getValues();try{return JSON.stringify(h(e||{}))}catch{return""}}_setDirty(t,e=!0){this._dirty!==t&&(this._dirty=t,this._dirtyAttrSyncing=!0,t?this.setAttribute("dirty",""):this.hasAttribute("dirty")&&this.removeAttribute("dirty"),this._dirtyAttrSyncing=!1,this._syncStatus(),this._syncFormAttrs(),e&&this.dispatchEvent(new CustomEvent("dirty-change",{bubbles:!0,composed:!0,detail:{dirty:t,values:this.getValues()}})))}_scheduleDirtyRefresh(){if(this._dirtyFrame!=null)return;const t=typeof window<"u"?window.setTimeout.bind(window):setTimeout;this._dirtyFrame=t(()=>{this._dirtyFrame=null,this._refreshDirtyState()},0)}_refreshDirtyState(){if(!this._baselineReady)return;const t=this._snapshot()!==this._initialSnapshot;if(this._setDirty(t),!this.hasAttribute("autosave"))return;if(!t||this.hasAttribute("loading")){this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=null);return}const e=Number(this.getAttribute("autosave-delay")||800),i=Number.isFinite(e)&&e>=0?e:800;this._autosaveTimer&&clearTimeout(this._autosaveTimer),this._autosaveTimer=setTimeout(()=>{this._autosaveTimer=null,this._dirty&&this.dispatchEvent(new CustomEvent("autosave",{bubbles:!0,composed:!0,detail:{values:this.getValues(),dirty:this._dirty}}))},i)}_onValueEvent(t){const e=t.target;if(!e||e===this)return;const i=e.closest("ui-form");i&&i!==this||this._scheduleDirtyRefresh()}_onBeforeUnload(t){!this.hasAttribute("guard-unsaved")||!this._dirty||(t.preventDefault(),t.returnValue="")}_onSlotChange(){this._syncStructure(),this._syncStatus(),this._syncFormAttrs(),this._scheduleDirtyRefresh()}_syncGap(){const t=this.getAttribute("gap");t?this.style.setProperty("--ui-form-gap",t):this.style.removeProperty("--ui-form-gap")}_syncFormAttrs(){const t=this._formEl;if(!t)return;t.setAttribute("aria-busy",this.hasAttribute("loading")?"true":"false");const e=this.hasAttribute("disabled");t.setAttribute("aria-disabled",e?"true":"false"),e?t.setAttribute("inert",""):t.removeAttribute("inert"),this.hasAttribute("novalidate")?t.setAttribute("novalidate",""):t.removeAttribute("novalidate");const i=this.getAttribute("aria-label"),r=this.getAttribute("aria-labelledby");i?t.setAttribute("aria-label",i):t.removeAttribute("aria-label"),r?t.setAttribute("aria-labelledby",r):t.removeAttribute("aria-labelledby");const s=[];this._descriptionVisible&&s.push(`${this._uid}-description`),this._statusVisible&&s.push(`${this._uid}-status`),s.length?t.setAttribute("aria-describedby",s.join(" ")):t.removeAttribute("aria-describedby")}_syncStructure(){const t=(this.getAttribute("heading")||this.getAttribute("title")||"").trim(),e=(this.getAttribute("description")||"").trim(),i=u(this._headingSlot),r=u(this._titleSlot),s=u(this._descriptionSlot),n=u(this._actionsSlot),a=u(this._footerSlot),l=!!t||i||r,d=!!e||s,f=l||d,p=f||n;this._titleTextEl&&(this._titleTextEl.textContent=t,!t||i||r?this._titleTextEl.setAttribute("hidden",""):this._titleTextEl.removeAttribute("hidden")),this._descriptionTextEl&&(this._descriptionTextEl.textContent=e,!e||s?this._descriptionTextEl.setAttribute("hidden",""):this._descriptionTextEl.removeAttribute("hidden")),this._titleEl&&(l?this._titleEl.removeAttribute("hidden"):this._titleEl.setAttribute("hidden","")),this._descriptionEl&&(d?this._descriptionEl.removeAttribute("hidden"):this._descriptionEl.setAttribute("hidden","")),this._headingEl&&(f?this._headingEl.removeAttribute("hidden"):this._headingEl.setAttribute("hidden","")),this._actionsEl&&(n?this._actionsEl.removeAttribute("hidden"):this._actionsEl.setAttribute("hidden","")),this._headerEl&&(p?this._headerEl.removeAttribute("hidden"):this._headerEl.setAttribute("hidden","")),this._footerEl&&(a?this._footerEl.removeAttribute("hidden"):this._footerEl.setAttribute("hidden","")),this._descriptionVisible=d}_deriveStatusTextAndTone(){const t=this.hasAttribute("loading"),e=A(this.getAttribute("state")),i=(this.getAttribute("state-text")||"").trim(),r=(this.getAttribute("loading-text")||"").trim()||"Saving changes...";return t?{text:r,tone:"loading"}:i?{text:i,tone:e}:e==="success"?{text:"Saved",tone:"success"}:e==="warning"?{text:"Needs attention",tone:"warning"}:e==="error"?{text:"Validation errors present",tone:"error"}:this._dirty?{text:"Unsaved changes",tone:"warning"}:{text:"",tone:"default"}}_syncStatus(){if(!this._statusEl||!this._statusTextEl)return;const t=u(this._statusSlot),e=this._deriveStatusTextAndTone();t?this._statusTextEl.setAttribute("hidden",""):(this._statusTextEl.textContent=e.text,e.text?this._statusTextEl.removeAttribute("hidden"):this._statusTextEl.setAttribute("hidden",""));const i=t||!!e.text;i?this._statusEl.removeAttribute("hidden"):this._statusEl.setAttribute("hidden",""),this._statusEl.setAttribute("data-tone",e.tone),this._statusVisible=i}attributeChangedCallback(t,e,i){if(e!==i){if(t==="title"){i!=null&&!this.hasAttribute("heading")&&this.setAttribute("heading",i),this.hasAttribute("title")&&this.removeAttribute("title");return}if(v.has(t)){this._syncStructure(),this._syncStatus(),this._syncFormAttrs();return}if(t==="gap"){this._syncGap();return}if(t==="dirty"){if(!this._dirtyAttrSyncing){const r=this.hasAttribute("dirty");this._dirty=r,this._syncStatus(),this._syncFormAttrs()}return}if(t==="loading"||t==="novalidate"||t==="state"||t==="state-text"||t==="loading-text"||t==="disabled"){this._syncStatus(),this._syncFormAttrs();return}if(t==="guard-unsaved"){if(typeof window>"u")return;this.hasAttribute("guard-unsaved")?window.addEventListener("beforeunload",this._onBeforeUnload):window.removeEventListener("beforeunload",this._onBeforeUnload);return}(t==="aria-label"||t==="aria-labelledby")&&this._syncFormAttrs()}}render(){this._syncGap();const t=this.getAttribute("heading")||this.getAttribute("title")||"",e=this.getAttribute("description")||"";this.setContent(`
345
+ `;function m(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function u(o){if(!o)return!1;const t=o.assignedNodes({flatten:!0});return t.length?t.some(e=>e.nodeType===Node.TEXT_NODE?!!e.textContent?.trim():e.nodeType===Node.ELEMENT_NODE):!1}function x(o){const t=o.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"}function h(o){if(o==null)return o;if(o instanceof Date)return o.toISOString();if(typeof File<"u"&&o instanceof File)return{__file:!0,name:o.name,size:o.size,type:o.type,lastModified:o.lastModified};if(Array.isArray(o))return o.map(t=>h(t));if(typeof o=="object"){const t=Object.entries(o).sort(([i],[r])=>i.localeCompare(r)),e={};return t.forEach(([i,r])=>{e[i]=h(r)}),e}return o}function c(o){if(Array.isArray(o))return o.map(t=>c(t));if(o&&typeof o=="object"){if(typeof File<"u"&&o instanceof File)return o;if(o instanceof Date)return new Date(o.getTime());const t={};return Object.entries(o).forEach(([e,i])=>{t[e]=c(i)}),t}return o}function A(o){return o==="success"||o==="warning"||o==="error"?o:"default"}class b extends g.ElementBase{constructor(){super(),this._controller=new _,this._submitting=!1,this._autosaveTimer=null,this._readyFrame=null,this._dirtyFrame=null,this._initialSnapshot="",this._cleanValues={},this._baselineReady=!1,this._dirty=!1,this._dirtyAttrSyncing=!1,this._uid=Math.random().toString(36).slice(2,10),this._formEl=null,this._headerEl=null,this._headingEl=null,this._titleEl=null,this._descriptionEl=null,this._titleTextEl=null,this._descriptionTextEl=null,this._actionsEl=null,this._statusEl=null,this._statusTextEl=null,this._footerEl=null,this._titleSlot=null,this._headingSlot=null,this._descriptionSlot=null,this._actionsSlot=null,this._statusSlot=null,this._footerSlot=null,this._descriptionVisible=!1,this._statusVisible=!1,this._onNativeSubmit=this._onNativeSubmit.bind(this),this._onValueEvent=this._onValueEvent.bind(this),this._onBeforeUnload=this._onBeforeUnload.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["novalidate","variant","tone","density","shape","elevation","gap","headless","loading","autosave","autosave-delay","guard-unsaved","dirty","disabled","heading","title","description","state","state-text","loading-text","aria-label","aria-labelledby"]}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("title")&&!this.hasAttribute("heading")){const t=this.getAttribute("title");t!=null&&this.setAttribute("heading",t),this.removeAttribute("title")}this.root.addEventListener("submit",this._onNativeSubmit),this.root.addEventListener("slotchange",this._onSlotChange),this.addEventListener("input",this._onValueEvent),this.addEventListener("change",this._onValueEvent),this.hasAttribute("guard-unsaved")&&typeof window<"u"&&window.addEventListener("beforeunload",this._onBeforeUnload),queueMicrotask(()=>{!this.isConnected||this._baselineReady||this._setBaseline(this.getValues(),!1)}),this.hasAttribute("data-ui-ready")||(typeof requestAnimationFrame=="function"?this._readyFrame=requestAnimationFrame(()=>{this._readyFrame=null,this.setAttribute("data-ui-ready","")}):this._readyFrame=window.setTimeout(()=>{this._readyFrame=null,this.setAttribute("data-ui-ready","")},16))}disconnectedCallback(){this.root.removeEventListener("submit",this._onNativeSubmit),this.root.removeEventListener("slotchange",this._onSlotChange),this.removeEventListener("input",this._onValueEvent),this.removeEventListener("change",this._onValueEvent),this._readyFrame!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this._readyFrame),clearTimeout(this._readyFrame),this._readyFrame=null),this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=null),this._dirtyFrame!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this._dirtyFrame),clearTimeout(this._dirtyFrame),this._dirtyFrame=null),typeof window<"u"&&window.removeEventListener("beforeunload",this._onBeforeUnload),super.disconnectedCallback()}_onNativeSubmit(t){t.target?.classList.contains("form")&&(t.preventDefault(),t.stopPropagation(),!this.hasAttribute("disabled")&&this.submit())}registerField(t,e){return this._controller.registerField(t,e)}setValue(t,e){this._controller.setValue(t,e),this._setNativeValue(t,e,this._groupNativeControls({includeDisabled:!0})),this._scheduleDirtyRefresh()}setValues(t){if(!t||typeof t!="object")return;const e=this._groupNativeControls({includeDisabled:!0});Object.entries(t).forEach(([i,r])=>{this._controller.setValue(i,r),this._setNativeValue(i,r,e)}),this._scheduleDirtyRefresh()}getValues(){const t={...this._controller.getValues()},e=new Set(Object.keys(t)),i=this._collectNativeValues(e,this._groupNativeControls());return Object.assign(t,i),t}_queryNativeControls(t={}){const{includeDisabled:e=!1}=t;return Array.from(this.querySelectorAll("input[name],textarea[name],select[name]")).filter(r=>!(!x(r)||r.closest("ui-form")!==this||!e&&r.matches(":disabled")))}_groupNativeControls(t={}){const e=new Map;return this._queryNativeControls(t).forEach(i=>{const r=i.getAttribute("name")||"";if(!r)return;const s=e.get(r)||[];s.push(i),e.set(r,s)}),e}_collectNativeValues(t,e){const i={};return e.forEach((r,s)=>{if(t.has(s))return;const n=r[0];if(n){if(n instanceof HTMLInputElement&&n.type==="radio"){const a=r.find(l=>l instanceof HTMLInputElement&&l.checked);i[s]=a?a.value:"";return}if(n instanceof HTMLInputElement&&n.type==="checkbox"){if(r.length===1){i[s]=n.checked;return}i[s]=r.filter(a=>a instanceof HTMLInputElement&&a.checked).map(a=>a.value||"on");return}if(n instanceof HTMLSelectElement&&n.multiple){i[s]=Array.from(n.selectedOptions).map(a=>a.value);return}if(n instanceof HTMLInputElement&&n.type==="file"){i[s]=Array.from(n.files||[]);return}i[s]=n.value}}),i}_setNativeValue(t,e,i){const r=(i||this._groupNativeControls({includeDisabled:!0})).get(t)||[];if(!r.length)return;const s=r[0];if(s){if(s instanceof HTMLInputElement&&s.type==="radio"){const n=String(e??"");r.forEach(a=>{a instanceof HTMLInputElement&&(a.checked=a.value===n)});return}if(s instanceof HTMLInputElement&&s.type==="checkbox"){if(r.length===1){const a=typeof e=="boolean"?e:!!e;s.checked=a;return}const n=Array.isArray(e)?e.map(a=>String(a)):[];r.forEach(a=>{a instanceof HTMLInputElement&&(a.checked=n.includes(a.value||"on"))});return}if(s instanceof HTMLSelectElement&&s.multiple){const n=Array.isArray(e)?e.map(a=>String(a)):[];Array.from(s.options).forEach(a=>{a.selected=n.includes(a.value)});return}s instanceof HTMLInputElement&&s.type==="file"||(s.value=String(e??""))}}async validate(){const t=await this._controller.validateAll(),e=this._validateNativeControls(),i={valid:t.valid&&e.valid,errors:{...e.errors,...t.errors}};return this.dispatchEvent(new CustomEvent("validate",{bubbles:!0,composed:!0,detail:i})),i}_validateNativeControls(){const t={};let e=null,i=!0;return this._groupNativeControls().forEach((s,n)=>{for(const a of s)if(!(!a.willValidate||a.checkValidity())){i=!1,t[n]||(t[n]=a.validationMessage||"invalid"),e||(e=a);break}}),{valid:i,errors:t,firstInvalid:e}}async submit(){if(this._submitting||this.hasAttribute("loading")||this.hasAttribute("disabled"))return!1;this._submitting=!0;const t=this.hasAttribute("loading");t||this.setAttribute("loading","");try{const e=this.getValues();if(!this.hasAttribute("novalidate")){const r=await this._controller.validateAll(),s=this._validateNativeControls(),n={...s.errors,...r.errors},a=r.valid&&s.valid;if(this.dispatchEvent(new CustomEvent("validate",{bubbles:!0,composed:!0,detail:{valid:a,errors:n}})),!a)return this.dispatchEvent(new CustomEvent("invalid",{bubbles:!0,composed:!0,detail:{errors:n,values:e}})),this._focusFirstInvalid(s.firstInvalid,n),!1}return this.dispatchEvent(new CustomEvent("submit",{bubbles:!0,composed:!0,detail:{values:e}})),this.markClean(e),!0}finally{this._submitting=!1,t||this.removeAttribute("loading")}}_focusFirstInvalid(t,e){if(t){t.focus();return}const i=Object.entries(e).find(([,n])=>!!n)?.[0];if(!i)return;const r=i.replace(/"/g,'\\"'),s=this.querySelector(`[name="${r}"]`);!s||typeof s.focus!="function"||s.focus()}async requestSubmit(){return this.submit()}reset(t){if(t&&typeof t=="object"){this.setValues(t),this.markClean(t);return}this.setValues(this._cleanValues),this.markClean(this._cleanValues)}get dirty(){return this._dirty}isDirty(){return this._dirty}markClean(t){if(t&&typeof t=="object"){this._setBaseline(t);return}this._setBaseline(this.getValues())}_setBaseline(t,e=!0){this._cleanValues=c(t||{}),this._initialSnapshot=this._snapshot(this._cleanValues),this._baselineReady=!0,this._setDirty(!1,e)}_snapshot(t){const e=t&&typeof t=="object"?t:this.getValues();try{return JSON.stringify(h(e||{}))}catch{return""}}_setDirty(t,e=!0){this._dirty!==t&&(this._dirty=t,this._dirtyAttrSyncing=!0,t?this.setAttribute("dirty",""):this.hasAttribute("dirty")&&this.removeAttribute("dirty"),this._dirtyAttrSyncing=!1,this._syncStatus(),this._syncFormAttrs(),e&&this.dispatchEvent(new CustomEvent("dirty-change",{bubbles:!0,composed:!0,detail:{dirty:t,values:this.getValues()}})))}_scheduleDirtyRefresh(){if(this._dirtyFrame!=null)return;const t=typeof window<"u"?window.setTimeout.bind(window):setTimeout;this._dirtyFrame=t(()=>{this._dirtyFrame=null,this._refreshDirtyState()},0)}_refreshDirtyState(){if(!this._baselineReady)return;const t=this._snapshot()!==this._initialSnapshot;if(this._setDirty(t),!this.hasAttribute("autosave"))return;if(!t||this.hasAttribute("loading")){this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=null);return}const e=Number(this.getAttribute("autosave-delay")||800),i=Number.isFinite(e)&&e>=0?e:800;this._autosaveTimer&&clearTimeout(this._autosaveTimer),this._autosaveTimer=setTimeout(()=>{this._autosaveTimer=null,this._dirty&&this.dispatchEvent(new CustomEvent("autosave",{bubbles:!0,composed:!0,detail:{values:this.getValues(),dirty:this._dirty}}))},i)}_onValueEvent(t){const e=t.target;if(!e||e===this)return;const i=e.closest("ui-form");i&&i!==this||this._scheduleDirtyRefresh()}_onBeforeUnload(t){!this.hasAttribute("guard-unsaved")||!this._dirty||(t.preventDefault(),t.returnValue="")}_onSlotChange(){this._syncStructure(),this._syncStatus(),this._syncFormAttrs(),this._scheduleDirtyRefresh()}_syncGap(){const t=this.getAttribute("gap");t?this.style.setProperty("--ui-form-gap",t):this.style.removeProperty("--ui-form-gap")}_syncFormAttrs(){const t=this._formEl;if(!t)return;t.setAttribute("aria-busy",this.hasAttribute("loading")?"true":"false");const e=this.hasAttribute("disabled");t.setAttribute("aria-disabled",e?"true":"false"),e?t.setAttribute("inert",""):t.removeAttribute("inert"),this.hasAttribute("novalidate")?t.setAttribute("novalidate",""):t.removeAttribute("novalidate");const i=this.getAttribute("aria-label"),r=this.getAttribute("aria-labelledby");i?t.setAttribute("aria-label",i):t.removeAttribute("aria-label"),r?t.setAttribute("aria-labelledby",r):t.removeAttribute("aria-labelledby");const s=[];this._descriptionVisible&&s.push(`${this._uid}-description`),this._statusVisible&&s.push(`${this._uid}-status`),s.length?t.setAttribute("aria-describedby",s.join(" ")):t.removeAttribute("aria-describedby")}_syncStructure(){const t=(this.getAttribute("heading")||this.getAttribute("title")||"").trim(),e=(this.getAttribute("description")||"").trim(),i=u(this._headingSlot),r=u(this._titleSlot),s=u(this._descriptionSlot),n=u(this._actionsSlot),a=u(this._footerSlot),l=!!t||i||r,d=!!e||s,f=l||d,p=f||n;this._titleTextEl&&(this._titleTextEl.textContent=t,!t||i||r?this._titleTextEl.setAttribute("hidden",""):this._titleTextEl.removeAttribute("hidden")),this._descriptionTextEl&&(this._descriptionTextEl.textContent=e,!e||s?this._descriptionTextEl.setAttribute("hidden",""):this._descriptionTextEl.removeAttribute("hidden")),this._titleEl&&(l?this._titleEl.removeAttribute("hidden"):this._titleEl.setAttribute("hidden","")),this._descriptionEl&&(d?this._descriptionEl.removeAttribute("hidden"):this._descriptionEl.setAttribute("hidden","")),this._headingEl&&(f?this._headingEl.removeAttribute("hidden"):this._headingEl.setAttribute("hidden","")),this._actionsEl&&(n?this._actionsEl.removeAttribute("hidden"):this._actionsEl.setAttribute("hidden","")),this._headerEl&&(p?this._headerEl.removeAttribute("hidden"):this._headerEl.setAttribute("hidden","")),this._footerEl&&(a?this._footerEl.removeAttribute("hidden"):this._footerEl.setAttribute("hidden","")),this._descriptionVisible=d}_deriveStatusTextAndTone(){const t=this.hasAttribute("loading"),e=A(this.getAttribute("state")),i=(this.getAttribute("state-text")||"").trim(),r=(this.getAttribute("loading-text")||"").trim()||"Saving changes...";return t?{text:r,tone:"loading"}:i?{text:i,tone:e}:e==="success"?{text:"Saved",tone:"success"}:e==="warning"?{text:"Needs attention",tone:"warning"}:e==="error"?{text:"Validation errors present",tone:"error"}:this._dirty?{text:"Unsaved changes",tone:"warning"}:{text:"",tone:"default"}}_syncStatus(){if(!this._statusEl||!this._statusTextEl)return;const t=u(this._statusSlot),e=this._deriveStatusTextAndTone();t?this._statusTextEl.setAttribute("hidden",""):(this._statusTextEl.textContent=e.text,e.text?this._statusTextEl.removeAttribute("hidden"):this._statusTextEl.setAttribute("hidden",""));const i=t||!!e.text;i?this._statusEl.removeAttribute("hidden"):this._statusEl.setAttribute("hidden",""),this._statusEl.setAttribute("data-tone",e.tone),this._statusVisible=i}attributeChangedCallback(t,e,i){if(e!==i){if(t==="title"){i!=null&&!this.hasAttribute("heading")&&this.setAttribute("heading",i),this.hasAttribute("title")&&this.removeAttribute("title");return}if(v.has(t)){this._syncStructure(),this._syncStatus(),this._syncFormAttrs();return}if(t==="gap"){this._syncGap();return}if(t==="dirty"){if(!this._dirtyAttrSyncing){const r=this.hasAttribute("dirty");this._dirty=r,this._syncStatus(),this._syncFormAttrs()}return}if(t==="loading"||t==="novalidate"||t==="state"||t==="state-text"||t==="loading-text"||t==="disabled"){this._syncStatus(),this._syncFormAttrs();return}if(t==="guard-unsaved"){if(typeof window>"u")return;this.hasAttribute("guard-unsaved")?window.addEventListener("beforeunload",this._onBeforeUnload):window.removeEventListener("beforeunload",this._onBeforeUnload);return}(t==="aria-label"||t==="aria-labelledby")&&this._syncFormAttrs()}}render(){this._syncGap();const t=this.getAttribute("heading")||this.getAttribute("title")||"",e=this.getAttribute("description")||"";this.setContent(`
346
346
  <style>${y}</style>
347
347
  <form
348
348
  class="form"
package/dist/form.esm.js CHANGED
@@ -1,11 +1,10 @@
1
- import { E as p } from "./ElementBase-909688f3.mjs";
1
+ import { E as p } from "./ElementBase-YlTLMsGk.mjs";
2
2
  class g {
3
3
  constructor() {
4
4
  this.fields = /* @__PURE__ */ new Map();
5
5
  }
6
6
  registerField(t, e) {
7
- if (!t)
8
- throw new Error("Field must have a name to register with the form");
7
+ if (!t) throw new Error("Field must have a name to register with the form");
9
8
  return this.fields.set(t, e), () => {
10
9
  this.fields.delete(t);
11
10
  };
@@ -22,8 +21,7 @@ class g {
22
21
  }
23
22
  async validateField(t) {
24
23
  const e = this.fields.get(t);
25
- if (!e)
26
- return { valid: !0 };
24
+ if (!e) return { valid: !0 };
27
25
  if (typeof e.validate == "function") {
28
26
  const i = await e.validate();
29
27
  return e.setError && e.setError(i.valid ? void 0 : i.message), i;
@@ -390,23 +388,17 @@ function m(o) {
390
388
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
391
389
  }
392
390
  function u(o) {
393
- if (!o)
394
- return !1;
391
+ if (!o) return !1;
395
392
  const t = o.assignedNodes({ flatten: !0 });
396
- return t.length ? t.some((e) => {
397
- var i;
398
- return e.nodeType === Node.TEXT_NODE ? !!((i = e.textContent) != null && i.trim()) : e.nodeType === Node.ELEMENT_NODE;
399
- }) : !1;
393
+ return t.length ? t.some((e) => e.nodeType === Node.TEXT_NODE ? !!e.textContent?.trim() : e.nodeType === Node.ELEMENT_NODE) : !1;
400
394
  }
401
395
  function y(o) {
402
396
  const t = o.tagName.toLowerCase();
403
397
  return t === "input" || t === "textarea" || t === "select";
404
398
  }
405
399
  function h(o) {
406
- if (o == null)
407
- return o;
408
- if (o instanceof Date)
409
- return o.toISOString();
400
+ if (o == null) return o;
401
+ if (o instanceof Date) return o.toISOString();
410
402
  if (typeof File < "u" && o instanceof File)
411
403
  return {
412
404
  __file: !0,
@@ -415,8 +407,7 @@ function h(o) {
415
407
  type: o.type,
416
408
  lastModified: o.lastModified
417
409
  };
418
- if (Array.isArray(o))
419
- return o.map((t) => h(t));
410
+ if (Array.isArray(o)) return o.map((t) => h(t));
420
411
  if (typeof o == "object") {
421
412
  const t = Object.entries(o).sort(([i], [r]) => i.localeCompare(r)), e = {};
422
413
  return t.forEach(([i, r]) => {
@@ -426,13 +417,10 @@ function h(o) {
426
417
  return o;
427
418
  }
428
419
  function c(o) {
429
- if (Array.isArray(o))
430
- return o.map((t) => c(t));
420
+ if (Array.isArray(o)) return o.map((t) => c(t));
431
421
  if (o && typeof o == "object") {
432
- if (typeof File < "u" && o instanceof File)
433
- return o;
434
- if (o instanceof Date)
435
- return new Date(o.getTime());
422
+ if (typeof File < "u" && o instanceof File) return o;
423
+ if (o instanceof Date) return new Date(o.getTime());
436
424
  const t = {};
437
425
  return Object.entries(o).forEach(([e, i]) => {
438
426
  t[e] = c(i);
@@ -490,8 +478,7 @@ class A extends p {
490
478
  this.root.removeEventListener("submit", this._onNativeSubmit), this.root.removeEventListener("slotchange", this._onSlotChange), this.removeEventListener("input", this._onValueEvent), this.removeEventListener("change", this._onValueEvent), this._readyFrame != null && (typeof cancelAnimationFrame == "function" && cancelAnimationFrame(this._readyFrame), clearTimeout(this._readyFrame), this._readyFrame = null), this._autosaveTimer && (clearTimeout(this._autosaveTimer), this._autosaveTimer = null), this._dirtyFrame != null && (typeof cancelAnimationFrame == "function" && cancelAnimationFrame(this._dirtyFrame), clearTimeout(this._dirtyFrame), this._dirtyFrame = null), typeof window < "u" && window.removeEventListener("beforeunload", this._onBeforeUnload), super.disconnectedCallback();
491
479
  }
492
480
  _onNativeSubmit(t) {
493
- const e = t.target;
494
- e != null && e.classList.contains("form") && (t.preventDefault(), t.stopPropagation(), !this.hasAttribute("disabled") && this.submit());
481
+ t.target?.classList.contains("form") && (t.preventDefault(), t.stopPropagation(), !this.hasAttribute("disabled") && this.submit());
495
482
  }
496
483
  registerField(t, e) {
497
484
  return this._controller.registerField(t, e);
@@ -500,8 +487,7 @@ class A extends p {
500
487
  this._controller.setValue(t, e), this._setNativeValue(t, e, this._groupNativeControls({ includeDisabled: !0 })), this._scheduleDirtyRefresh();
501
488
  }
502
489
  setValues(t) {
503
- if (!t || typeof t != "object")
504
- return;
490
+ if (!t || typeof t != "object") return;
505
491
  const e = this._groupNativeControls({ includeDisabled: !0 });
506
492
  Object.entries(t).forEach(([i, r]) => {
507
493
  this._controller.setValue(i, r), this._setNativeValue(i, r, e);
@@ -519,8 +505,7 @@ class A extends p {
519
505
  const e = /* @__PURE__ */ new Map();
520
506
  return this._queryNativeControls(t).forEach((i) => {
521
507
  const r = i.getAttribute("name") || "";
522
- if (!r)
523
- return;
508
+ if (!r) return;
524
509
  const s = e.get(r) || [];
525
510
  s.push(i), e.set(r, s);
526
511
  }), e;
@@ -528,8 +513,7 @@ class A extends p {
528
513
  _collectNativeValues(t, e) {
529
514
  const i = {};
530
515
  return e.forEach((r, s) => {
531
- if (t.has(s))
532
- return;
516
+ if (t.has(s)) return;
533
517
  const n = r[0];
534
518
  if (n) {
535
519
  if (n instanceof HTMLInputElement && n.type === "radio") {
@@ -559,8 +543,7 @@ class A extends p {
559
543
  }
560
544
  _setNativeValue(t, e, i) {
561
545
  const r = (i || this._groupNativeControls({ includeDisabled: !0 })).get(t) || [];
562
- if (!r.length)
563
- return;
546
+ if (!r.length) return;
564
547
  const s = r[0];
565
548
  if (s) {
566
549
  if (s instanceof HTMLInputElement && s.type === "radio") {
@@ -617,8 +600,7 @@ class A extends p {
617
600
  }), { valid: i, errors: t, firstInvalid: e };
618
601
  }
619
602
  async submit() {
620
- if (this._submitting || this.hasAttribute("loading") || this.hasAttribute("disabled"))
621
- return !1;
603
+ if (this._submitting || this.hasAttribute("loading") || this.hasAttribute("disabled")) return !1;
622
604
  this._submitting = !0;
623
605
  const t = this.hasAttribute("loading");
624
606
  t || this.setAttribute("loading", "");
@@ -653,14 +635,12 @@ class A extends p {
653
635
  }
654
636
  }
655
637
  _focusFirstInvalid(t, e) {
656
- var n;
657
638
  if (t) {
658
639
  t.focus();
659
640
  return;
660
641
  }
661
- const i = (n = Object.entries(e).find(([, a]) => !!a)) == null ? void 0 : n[0];
662
- if (!i)
663
- return;
642
+ const i = Object.entries(e).find(([, n]) => !!n)?.[0];
643
+ if (!i) return;
664
644
  const r = i.replace(/"/g, '\\"'), s = this.querySelector(`[name="${r}"]`);
665
645
  !s || typeof s.focus != "function" || s.focus();
666
646
  }
@@ -708,19 +688,16 @@ class A extends p {
708
688
  ));
709
689
  }
710
690
  _scheduleDirtyRefresh() {
711
- if (this._dirtyFrame != null)
712
- return;
691
+ if (this._dirtyFrame != null) return;
713
692
  const t = typeof window < "u" ? window.setTimeout.bind(window) : setTimeout;
714
693
  this._dirtyFrame = t(() => {
715
694
  this._dirtyFrame = null, this._refreshDirtyState();
716
695
  }, 0);
717
696
  }
718
697
  _refreshDirtyState() {
719
- if (!this._baselineReady)
720
- return;
698
+ if (!this._baselineReady) return;
721
699
  const t = this._snapshot() !== this._initialSnapshot;
722
- if (this._setDirty(t), !this.hasAttribute("autosave"))
723
- return;
700
+ if (this._setDirty(t), !this.hasAttribute("autosave")) return;
724
701
  if (!t || this.hasAttribute("loading")) {
725
702
  this._autosaveTimer && (clearTimeout(this._autosaveTimer), this._autosaveTimer = null);
726
703
  return;
@@ -738,8 +715,7 @@ class A extends p {
738
715
  }
739
716
  _onValueEvent(t) {
740
717
  const e = t.target;
741
- if (!e || e === this)
742
- return;
718
+ if (!e || e === this) return;
743
719
  const i = e.closest("ui-form");
744
720
  i && i !== this || this._scheduleDirtyRefresh();
745
721
  }
@@ -755,8 +731,7 @@ class A extends p {
755
731
  }
756
732
  _syncFormAttrs() {
757
733
  const t = this._formEl;
758
- if (!t)
759
- return;
734
+ if (!t) return;
760
735
  t.setAttribute("aria-busy", this.hasAttribute("loading") ? "true" : "false");
761
736
  const e = this.hasAttribute("disabled");
762
737
  t.setAttribute("aria-disabled", e ? "true" : "false"), e ? t.setAttribute("inert", "") : t.removeAttribute("inert"), this.hasAttribute("novalidate") ? t.setAttribute("novalidate", "") : t.removeAttribute("novalidate");
@@ -774,8 +749,7 @@ class A extends p {
774
749
  return t ? { text: r, tone: "loading" } : i ? { text: i, tone: e } : e === "success" ? { text: "Saved", tone: "success" } : e === "warning" ? { text: "Needs attention", tone: "warning" } : e === "error" ? { text: "Validation errors present", tone: "error" } : this._dirty ? { text: "Unsaved changes", tone: "warning" } : { text: "", tone: "default" };
775
750
  }
776
751
  _syncStatus() {
777
- if (!this._statusEl || !this._statusTextEl)
778
- return;
752
+ if (!this._statusEl || !this._statusTextEl) return;
779
753
  const t = u(this._statusSlot), e = this._deriveStatusTextAndTone();
780
754
  t ? this._statusTextEl.setAttribute("hidden", "") : (this._statusTextEl.textContent = e.text, e.text ? this._statusTextEl.removeAttribute("hidden") : this._statusTextEl.setAttribute("hidden", ""));
781
755
  const i = t || !!e.text;
@@ -807,8 +781,7 @@ class A extends p {
807
781
  return;
808
782
  }
809
783
  if (t === "guard-unsaved") {
810
- if (typeof window > "u")
811
- return;
784
+ if (typeof window > "u") return;
812
785
  this.hasAttribute("guard-unsaved") ? window.addEventListener("beforeunload", this._onBeforeUnload) : window.removeEventListener("beforeunload", this._onBeforeUnload);
813
786
  return;
814
787
  }
package/dist/gantt.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Lt=require("./ElementBase-1b301e7f.js"),I=24*60*60*1e3,$=42,W=62,J=376,N=28,Ft=15,wt=Ft*Math.SQRT2/2,ht={day:36,week:13,month:4.4,quarter:2.2,year:1.15},mt=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const At=require("./ElementBase-EV6mVBUV.js"),I=1440*60*1e3,y=42,W=62,J=376,N=28,Lt=15,vt=Lt*Math.SQRT2/2,gt={day:36,week:13,month:4.4,quarter:2.2,year:1.15},ht=`
2
2
  :host {
3
3
  --ui-gantt-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
4
4
  --ui-gantt-panel: var(--ui-color-surface, #ffffff);
@@ -200,7 +200,7 @@
200
200
 
201
201
  .grid-row,
202
202
  .timeline-row {
203
- block-size: ${$}px;
203
+ block-size: ${y}px;
204
204
  border-bottom: 1px solid color-mix(in srgb, var(--ui-gantt-border) 56%, transparent);
205
205
  }
206
206
 
@@ -656,84 +656,84 @@
656
656
  box-shadow: none;
657
657
  }
658
658
  }
659
- `,bt={default:"var(--ui-color-primary, #2563eb)",info:"var(--ui-color-info, #0891b2)",success:"var(--ui-color-success, #16a34a)",warning:"var(--ui-color-warning, #d97706)",danger:"var(--ui-color-danger, #dc2626)"};function f(n){return String(n??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function x(n){if(n instanceof Date){const a=n.getTime();return Number.isFinite(a)?D(a):null}const r=String(n||"").trim(),d=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r);if(d){const a=Number(d[1]),e=Number(d[2]),i=Number(d[3]),g=new Date(a,e-1,i).getTime();return Number.isFinite(g)?D(g):null}const l=Date.parse(r);return Number.isFinite(l)?D(l):null}function D(n){const r=new Date(n);return r.setHours(0,0,0,0),r.getTime()}function w(n,r){return D(n+r*I)}function S(n){const r=new Date(n),d=r.getFullYear(),l=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0");return`${d}-${l}-${a}`}function O(n){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(n))}function ft(n){return n==="day"||n==="month"||n==="quarter"||n==="year"?n:"week"}function j(n){return n==="start"||n==="end"||n==="label"||n==="progress"?n:"none"}function Dt(n){return n==="soft"||n==="striped"||n==="outline"||n==="glass"?n:"solid"}function Rt(n,r){if(!n)return[];try{const d=JSON.parse(n);return Array.isArray(d)?d.map((l,a)=>{if(!l||typeof l!="object")return null;const e=l,i=String(e.label||e.text||"").trim(),s=x(e.start),g=Number(e.duration);let c=x(e.end);if(c==null&&s!=null&&Number.isFinite(g)&&(c=w(s,Math.max(0,g))),!i||s==null)return null;const o=e.type==="summary"||e.type==="milestone"?e.type:"task",u=o==="milestone"?s:Math.max(c??w(s,1),w(s,1)),p=String(e.id||`task-${a+1}`),m=r.get(p)||{};return{id:p,label:i,start:m.start||S(s),end:m.end||S(u),progress:Number.isFinite(Number(e.progress))?Math.max(0,Math.min(100,Number(e.progress))):void 0,tone:typeof e.tone=="string"?e.tone:void 0,type:o,parent:e.parent!=null?String(e.parent):void 0,open:e.open!==!1,assignee:e.assignee!=null?String(e.assignee):e.owner!=null?String(e.owner):void 0,readonly:e.readonly===!0,baselineStart:e.baselineStart!=null?String(e.baselineStart):void 0,baselineEnd:e.baselineEnd!=null?String(e.baselineEnd):void 0,critical:e.critical===!0,segments:Array.isArray(e.segments)?e.segments:void 0}}).filter(Boolean):[]}catch{return[]}}function qt(n){if(!n)return[];try{const r=JSON.parse(n);return Array.isArray(r)?r.map((d,l)=>{if(!d||typeof d!="object")return null;const a=d,e=String(a.source||"").trim(),i=String(a.target||"").trim();if(!e||!i)return null;const s=a.type==="s2s"||a.type==="e2e"||a.type==="s2e"?a.type:"e2s";return{id:String(a.id||`link-${l+1}`),source:e,target:i,type:s}}).filter(Boolean):[]}catch{return[]}}function Nt(n,r){return r==="none"?n:[...n].sort((d,l)=>{if(r==="label")return d.label.localeCompare(l.label);if(r==="progress")return Number(l.progress??0)-Number(d.progress??0);const a=x(r==="start"?d.start:d.end)??0,e=x(r==="start"?l.start:l.end)??0;return a-e})}function Ht(n,r,d,l){const a=new Map,e=new Map(n.map(o=>[o.id,o]));n.forEach(o=>{const u=o.parent&&e.has(o.parent)?o.parent:"__root__",p=a.get(u)||[];p.push(o),a.set(u,p)});const i=d.trim().toLowerCase(),s=o=>!i||o.label.toLowerCase().includes(i)||(o.assignee||"").toLowerCase().includes(i)?!0:(a.get(o.id)||[]).some(s),g=[],c=(o,u)=>{Nt(a.get(o)||[],l).forEach(p=>{if(!s(p))return;const m=x(p.start),h=x(p.end);if(m==null||h==null)return;const b=(a.get(p.id)||[]).length>0;g.push({...p,depth:u,hasChildren:b,startMs:m,endMs:h}),b&&!r.has(p.id)&&c(p.id,u+1)})};return c("__root__",0),g}function _t(n,r,d,l,a=0,e=Number.POSITIVE_INFINITY){const i=Math.max(1,Math.ceil((r-n)/I)),s=l==="day"?1:l==="week"?7:l==="month"?30:l==="quarter"?91:365,g=Math.max(0,Math.floor(Math.max(0,a-480)/d/s)*s),c=Math.min(i,Math.ceil((a+e+960)/d/s)*s),o=[];for(let u=g;u<=c;u+=s){const p=u*d,m=w(n,u),h=l==="day"?O(m):new Intl.DateTimeFormat(void 0,{month:"short",year:l==="week"||l==="month"?void 0:"numeric"}).format(new Date(m));o.push(`<span class="tick" style="left:${p.toFixed(2)}px">${f(h)}</span>`)}return o.join("")}function H(n){return n.type==="summary"||n.hasChildren?"summary":n.type==="milestone"||n.startMs===n.endMs?"milestone":"task"}function xt(n){const r=H(n);return r==="summary"?17+9/2:r==="milestone"?7+N/2:12+18/2}function Vt(n,r){return H(n)==="milestone"?r(n.startMs)-wt:r(n.startMs)}function Wt(n,r){return H(n)==="milestone"?r(n.startMs)+wt:r(n.endMs)}function vt(n,r,d){return r==="start"?Vt(n,d):Wt(n,d)}function jt(n="e2s"){return n==="s2s"?{source:"start",target:"start"}:n==="e2e"?{source:"end",target:"end"}:n==="s2e"?{source:"start",target:"end"}:{source:"end",target:"start"}}function Ot(n,r,d,l,a,e){const i=jt(a),s=i.source==="start"?-1:1,g=i.target==="start"?1:-1,c=vt(n,i.source,e),o=vt(d,i.target,e),u=r*$+xt(n),p=l*$+xt(d),m=22,h=c+s*m,b=o-g*m,v=26;let y=(h+b)/2;if(s===g){const T=s===1?Math.max(h,b,c,o)+v:Math.min(h,b,c,o)-v;y=(s===1?b>h+v:b<h-v)?y:T}else(s===1?b<h:b>h)&&(y=s===1?Math.max(h,c,o)+v:Math.min(h,c,o)-v);const A=Math.abs(p-u)<1?i.target==="start"?p-16:p+16:p>u?p-$/2+3:p+$/2-3;return[[c,u],[h,u],[y,u],[y,A],[b,A],[b,p],[o,p]].map(([T,R],P)=>`${P===0?"M":"L"} ${T.toFixed(1)} ${R.toFixed(1)}`).join(" ")}class yt extends Lt.ElementBase{constructor(){super(...arguments),this.collapsed=new Set,this.overrides=new Map,this.drag=null,this.selectedId=null,this.internalFilter="",this.viewportTop=0,this.viewportLeft=0,this.viewportWidth=1800,this.viewportHeight=620,this.renderedFirstRow=0,this.renderedLastRow=0,this.scrollFrame=null,this.overridesVersion=0,this.taskCacheRaw=null,this.taskCacheVersion=-1,this.taskCache=[],this.linkCacheRaw=null,this.linkCache=[],this.visibleCacheKey="",this.visibleCache=[]}static get observedAttributes(){return["tasks","links","zoom","filter","sort","bar-variant","variant","readonly","show-toolbar","show-today","headless"]}render(){const r=this.getTasks(),d=this.getLinks(),l=ft(this.getAttribute("zoom")),a=j(this.getAttribute("sort")),e=Dt(this.getAttribute("bar-variant")),i=this.getAttribute("filter")??this.internalFilter,s=this.getVisibleTasks(r,i,a),g=this.hasAttribute("readonly"),c=this.getAttribute("show-toolbar")!=="false",o=this.getAttribute("show-today")!=="false";if(!r.length){this.setContent(`
660
- <style>${mt}</style>
659
+ `,mt={default:"var(--ui-color-primary, #2563eb)",info:"var(--ui-color-info, #0891b2)",success:"var(--ui-color-success, #16a34a)",warning:"var(--ui-color-warning, #d97706)",danger:"var(--ui-color-danger, #dc2626)"};function b(a){return String(a??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function f(a){if(a instanceof Date){const n=a.getTime();return Number.isFinite(n)?D(n):null}const t=String(a||"").trim(),i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(i){const n=Number(i[1]),s=Number(i[2]),l=Number(i[3]),p=new Date(n,s-1,l).getTime();return Number.isFinite(p)?D(p):null}const e=Date.parse(t);return Number.isFinite(e)?D(e):null}function D(a){const t=new Date(a);return t.setHours(0,0,0,0),t.getTime()}function x(a,t){return D(a+t*I)}function S(a){const t=new Date(a),i=t.getFullYear(),e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${i}-${e}-${n}`}function O(a){return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(a))}function bt(a){return a==="day"||a==="month"||a==="quarter"||a==="year"?a:"week"}function j(a){return a==="start"||a==="end"||a==="label"||a==="progress"?a:"none"}function Ft(a){return a==="soft"||a==="striped"||a==="outline"||a==="glass"?a:"solid"}function Dt(a,t){if(!a)return[];try{const i=JSON.parse(a);return Array.isArray(i)?i.map((e,n)=>{if(!e||typeof e!="object")return null;const s=e,l=String(s.label||s.text||"").trim(),o=f(s.start),p=Number(s.duration);let u=f(s.end);if(u==null&&o!=null&&Number.isFinite(p)&&(u=x(o,Math.max(0,p))),!l||o==null)return null;const d=s.type==="summary"||s.type==="milestone"?s.type:"task",g=d==="milestone"?o:Math.max(u??x(o,1),x(o,1)),c=String(s.id||`task-${n+1}`),m=t.get(c)||{};return{id:c,label:l,start:m.start||S(o),end:m.end||S(g),progress:Number.isFinite(Number(s.progress))?Math.max(0,Math.min(100,Number(s.progress))):void 0,tone:typeof s.tone=="string"?s.tone:void 0,type:d,parent:s.parent!=null?String(s.parent):void 0,open:s.open!==!1,assignee:s.assignee!=null?String(s.assignee):s.owner!=null?String(s.owner):void 0,readonly:s.readonly===!0,baselineStart:s.baselineStart!=null?String(s.baselineStart):void 0,baselineEnd:s.baselineEnd!=null?String(s.baselineEnd):void 0,critical:s.critical===!0,segments:Array.isArray(s.segments)?s.segments:void 0}}).filter(Boolean):[]}catch{return[]}}function Rt(a){if(!a)return[];try{const t=JSON.parse(a);return Array.isArray(t)?t.map((i,e)=>{if(!i||typeof i!="object")return null;const n=i,s=String(n.source||"").trim(),l=String(n.target||"").trim();if(!s||!l)return null;const o=n.type==="s2s"||n.type==="e2e"||n.type==="s2e"?n.type:"e2s";return{id:String(n.id||`link-${e+1}`),source:s,target:l,type:o}}).filter(Boolean):[]}catch{return[]}}function qt(a,t){return t==="none"?a:[...a].sort((i,e)=>{if(t==="label")return i.label.localeCompare(e.label);if(t==="progress")return Number(e.progress??0)-Number(i.progress??0);const n=f(t==="start"?i.start:i.end)??0,s=f(t==="start"?e.start:e.end)??0;return n-s})}function Nt(a,t,i,e){const n=new Map,s=new Map(a.map(d=>[d.id,d]));a.forEach(d=>{const g=d.parent&&s.has(d.parent)?d.parent:"__root__",c=n.get(g)||[];c.push(d),n.set(g,c)});const l=i.trim().toLowerCase(),o=d=>!l||d.label.toLowerCase().includes(l)||(d.assignee||"").toLowerCase().includes(l)?!0:(n.get(d.id)||[]).some(o),p=[],u=(d,g)=>{qt(n.get(d)||[],e).forEach(c=>{if(!o(c))return;const m=f(c.start),h=f(c.end);if(m==null||h==null)return;const w=(n.get(c.id)||[]).length>0;p.push({...c,depth:g,hasChildren:w,startMs:m,endMs:h}),w&&!t.has(c.id)&&u(c.id,g+1)})};return u("__root__",0),p}function Ht(a,t,i,e,n=0,s=Number.POSITIVE_INFINITY){const l=Math.max(1,Math.ceil((t-a)/I)),o=e==="day"?1:e==="week"?7:e==="month"?30:e==="quarter"?91:365,p=Math.max(0,Math.floor(Math.max(0,n-480)/i/o)*o),u=Math.min(l,Math.ceil((n+s+960)/i/o)*o),d=[];for(let g=p;g<=u;g+=o){const c=g*i,m=x(a,g),h=e==="day"?O(m):new Intl.DateTimeFormat(void 0,{month:"short",year:e==="week"||e==="month"?void 0:"numeric"}).format(new Date(m));d.push(`<span class="tick" style="left:${c.toFixed(2)}px">${b(h)}</span>`)}return d.join("")}function H(a){return a.type==="summary"||a.hasChildren?"summary":a.type==="milestone"||a.startMs===a.endMs?"milestone":"task"}function ft(a){const t=H(a);return t==="summary"?17+9/2:t==="milestone"?7+N/2:12+18/2}function _t(a,t){return H(a)==="milestone"?t(a.startMs)-vt:t(a.startMs)}function Vt(a,t){return H(a)==="milestone"?t(a.startMs)+vt:t(a.endMs)}function xt(a,t,i){return t==="start"?_t(a,i):Vt(a,i)}function Wt(a="e2s"){return a==="s2s"?{source:"start",target:"start"}:a==="e2e"?{source:"end",target:"end"}:a==="s2e"?{source:"start",target:"end"}:{source:"end",target:"start"}}function jt(a,t,i,e,n,s){const l=Wt(n),o=l.source==="start"?-1:1,p=l.target==="start"?1:-1,u=xt(a,l.source,s),d=xt(i,l.target,s),g=t*y+ft(a),c=e*y+ft(i),m=22,h=u+o*m,w=d-p*m,M=26;let k=(h+w)/2;if(o===p){const T=o===1?Math.max(h,w,u,d)+M:Math.min(h,w,u,d)-M;k=(o===1?w>h+M:w<h-M)?k:T}else(o===1?w<h:w>h)&&(k=o===1?Math.max(h,u,d)+M:Math.min(h,u,d)-M);const A=Math.abs(c-g)<1?l.target==="start"?c-16:c+16:c>g?c-y/2+3:c+y/2-3;return[[u,g],[h,g],[k,g],[k,A],[w,A],[w,c],[d,c]].map(([T,R],P)=>`${P===0?"M":"L"} ${T.toFixed(1)} ${R.toFixed(1)}`).join(" ")}class wt extends At.ElementBase{constructor(){super(...arguments),this.collapsed=new Set,this.overrides=new Map,this.drag=null,this.selectedId=null,this.internalFilter="",this.viewportTop=0,this.viewportLeft=0,this.viewportWidth=1800,this.viewportHeight=620,this.renderedFirstRow=0,this.renderedLastRow=0,this.scrollFrame=null,this.overridesVersion=0,this.taskCacheRaw=null,this.taskCacheVersion=-1,this.taskCache=[],this.linkCacheRaw=null,this.linkCache=[],this.visibleCacheKey="",this.visibleCache=[]}static get observedAttributes(){return["tasks","links","zoom","filter","sort","bar-variant","variant","readonly","show-toolbar","show-today","headless"]}render(){const t=this.getTasks(),i=this.getLinks(),e=bt(this.getAttribute("zoom")),n=j(this.getAttribute("sort")),s=Ft(this.getAttribute("bar-variant")),l=this.getAttribute("filter")??this.internalFilter,o=this.getVisibleTasks(t,l,n),p=this.hasAttribute("readonly"),u=this.getAttribute("show-toolbar")!=="false",d=this.getAttribute("show-today")!=="false";if(!t.length){this.setContent(`
660
+ <style>${ht}</style>
661
661
  <section class="frame" part="frame">
662
662
  <div class="empty" part="empty">No tasks in this range</div>
663
663
  </section>
664
- `);return}const u=r.map(t=>x(t.start)).filter(t=>t!=null),p=r.map(t=>x(t.end)).filter(t=>t!=null),m=w(Math.min(...u),-2),h=w(Math.max(...p),3),b=Math.max(7,Math.ceil((h-m)/I)),v=ht[l],y=Math.max(680,b*v),A=Math.max(s.length*$,$),z=this.getAttribute("virtualized")!=="false"&&s.length>240,T=Math.max(20,Math.ceil(Math.max(420,this.viewportHeight-W)/$)),R=160,P=Math.max(0,this.viewportTop-W),kt=Math.max(0,Math.floor(P/$)),X=Math.max(180,T*4),L=z?Math.max(0,Math.floor(kt/X)*X-R):0,B=z?Math.min(s.length,L+T+R*2+X):s.length,K=s.slice(L,B),_=L*$,V=Math.max(0,(s.length-B)*$);this.renderedFirstRow=L,this.renderedLastRow=B;const Q=new Map(s.map((t,M)=>[t.id,{task:t,index:M}])),tt=new Set(K.map(t=>t.id)),C=t=>(t-m)/I*v,$t=K.map((t,M)=>{const E=L+M,k=this.selectedId===t.id?" selected":"",F=H(t),G=t.progress==null?"-":`${Math.round(t.progress)}%`,U=F==="milestone"?O(t.startMs):`${O(t.startMs)} - ${O(t.endMs)}`;return`
665
- <article class="grid-row${k}" part="grid-row" data-task-id="${f(t.id)}" role="row" aria-rowindex="${E+2}" aria-level="${t.depth+1}" ${t.hasChildren?`aria-expanded="${!this.collapsed.has(t.id)}"`:""}>
666
- <div class="grid-cell task-name" role="gridcell" style="padding-left:${10+t.depth*18}px">
667
- ${t.hasChildren?`<button class="expander" data-action="toggle" data-task-id="${f(t.id)}" aria-label="${this.collapsed.has(t.id)?"Expand":"Collapse"} ${f(t.label)}">${this.collapsed.has(t.id)?"›":"⌄"}</button>`:'<span style="inline-size:22px"></span>'}
668
- <span class="name-text" title="${f(t.label)}">${f(t.label)}</span>
664
+ `);return}const g=t.map(r=>f(r.start)).filter(r=>r!=null),c=t.map(r=>f(r.end)).filter(r=>r!=null),m=x(Math.min(...g),-2),h=x(Math.max(...c),3),w=Math.max(7,Math.ceil((h-m)/I)),M=gt[e],k=Math.max(680,w*M),A=Math.max(o.length*y,y),z=this.getAttribute("virtualized")!=="false"&&o.length>240,T=Math.max(20,Math.ceil(Math.max(420,this.viewportHeight-W)/y)),R=160,P=Math.max(0,this.viewportTop-W),yt=Math.max(0,Math.floor(P/y)),X=Math.max(180,T*4),L=z?Math.max(0,Math.floor(yt/X)*X-R):0,B=z?Math.min(o.length,L+T+R*2+X):o.length,K=o.slice(L,B),_=L*y,V=Math.max(0,(o.length-B)*y);this.renderedFirstRow=L,this.renderedLastRow=B;const Q=new Map(o.map((r,$)=>[r.id,{task:r,index:$}])),tt=new Set(K.map(r=>r.id)),C=r=>(r-m)/I*M,kt=K.map((r,$)=>{const E=L+$,v=this.selectedId===r.id?" selected":"",F=H(r),G=r.progress==null?"-":`${Math.round(r.progress)}%`,U=F==="milestone"?O(r.startMs):`${O(r.startMs)} - ${O(r.endMs)}`;return`
665
+ <article class="grid-row${v}" part="grid-row" data-task-id="${b(r.id)}" role="row" aria-rowindex="${E+2}" aria-level="${r.depth+1}" ${r.hasChildren?`aria-expanded="${!this.collapsed.has(r.id)}"`:""}>
666
+ <div class="grid-cell task-name" role="gridcell" style="padding-left:${10+r.depth*18}px">
667
+ ${r.hasChildren?`<button class="expander" data-action="toggle" data-task-id="${b(r.id)}" aria-label="${this.collapsed.has(r.id)?"Expand":"Collapse"} ${b(r.label)}">${this.collapsed.has(r.id)?"›":"⌄"}</button>`:'<span style="inline-size:22px"></span>'}
668
+ <span class="name-text" title="${b(r.label)}">${b(r.label)}</span>
669
669
  </div>
670
- <div class="grid-cell badge" role="gridcell">${f(t.assignee||F)}</div>
671
- <div class="grid-cell badge" role="gridcell">${f(U)}</div>
672
- <div class="grid-cell badge" role="gridcell">${f(G)}</div>
670
+ <div class="grid-cell badge" role="gridcell">${b(r.assignee||F)}</div>
671
+ <div class="grid-cell badge" role="gridcell">${b(U)}</div>
672
+ <div class="grid-cell badge" role="gridcell">${b(G)}</div>
673
673
  </article>
674
- `}).join(""),Mt=K.map((t,M)=>{var st;const E=L+M,k=H(t),F=this.selectedId===t.id?" selected":"",G=this.selectedId===t.id||!this.selectedId&&E===0,U=bt[t.tone||(k==="summary"?"info":"default")]||bt.default,rt=k==="milestone"?C(t.startMs)-N/2:C(t.startMs),Ct=C(k==="milestone"?t.startMs:t.endMs),Tt=k==="milestone"?N:Math.max(12,Ct-rt),It=Math.max(0,Math.min(100,Number(t.progress??0))),at=!g&&!t.readonly&&k!=="summary",nt=at&&k==="task",it=k==="task"&&((st=t.segments)!=null&&st.length)?t.segments.map(ot=>{const lt=x(ot.start),dt=x(ot.end);if(lt==null||dt==null)return"";const ct=Math.max(I,t.endMs-t.startMs),Z=Math.max(t.startMs,lt),pt=Math.min(t.endMs,dt);if(pt<=Z)return"";const ut=Math.max(0,Math.min(100,(Z-t.startMs)/ct*100)),At=(pt-Z)/ct*100,gt=Math.min(100-ut,Math.max(1,At));return gt<=0?"":`<span class="split-segment" style="left:${ut.toFixed(2)}%;width:${gt.toFixed(2)}%"></span>`}).join(""):"";return`
675
- <article class="timeline-row${F}" part="timeline-row" data-task-id="${f(t.id)}" role="row" aria-rowindex="${E+2}">
676
- ${t.baselineStart&&t.baselineEnd?`<span class="baseline" style="left:${C(x(t.baselineStart)||t.startMs).toFixed(2)}px;width:${Math.max(4,C(x(t.baselineEnd)||t.endMs)-C(x(t.baselineStart)||t.startMs)).toFixed(2)}px"></span>`:""}
674
+ `}).join(""),$t=K.map((r,$)=>{const E=L+$,v=H(r),F=this.selectedId===r.id?" selected":"",G=this.selectedId===r.id||!this.selectedId&&E===0,U=mt[r.tone||(v==="summary"?"info":"default")]||mt.default,rt=v==="milestone"?C(r.startMs)-N/2:C(r.startMs),zt=C(v==="milestone"?r.startMs:r.endMs),Ct=v==="milestone"?N:Math.max(12,zt-rt),Tt=Math.max(0,Math.min(100,Number(r.progress??0))),at=!p&&!r.readonly&&v!=="summary",nt=at&&v==="task",it=v==="task"&&r.segments?.length?r.segments.map(st=>{const ot=f(st.start),lt=f(st.end);if(ot==null||lt==null)return"";const dt=Math.max(I,r.endMs-r.startMs),Z=Math.max(r.startMs,ot),ct=Math.min(r.endMs,lt);if(ct<=Z)return"";const pt=Math.max(0,Math.min(100,(Z-r.startMs)/dt*100)),It=(ct-Z)/dt*100,ut=Math.min(100-pt,Math.max(1,It));return ut<=0?"":`<span class="split-segment" style="left:${pt.toFixed(2)}%;width:${ut.toFixed(2)}%"></span>`}).join(""):"";return`
675
+ <article class="timeline-row${F}" part="timeline-row" data-task-id="${b(r.id)}" role="row" aria-rowindex="${E+2}">
676
+ ${r.baselineStart&&r.baselineEnd?`<span class="baseline" style="left:${C(f(r.baselineStart)||r.startMs).toFixed(2)}px;width:${Math.max(4,C(f(r.baselineEnd)||r.endMs)-C(f(r.baselineStart)||r.startMs)).toFixed(2)}px"></span>`:""}
677
677
  <button
678
- class="bar ${k}${t.critical?" critical":""}${it?" split":""}"
679
- part="bar ${k}"
680
- data-task-id="${f(t.id)}"
681
- data-kind="${k}"
678
+ class="bar ${v}${r.critical?" critical":""}${it?" split":""}"
679
+ part="bar ${v}"
680
+ data-task-id="${b(r.id)}"
681
+ data-kind="${v}"
682
682
  role="gridcell"
683
683
  tabindex="${G?"0":"-1"}"
684
- aria-selected="${this.selectedId===t.id}"
684
+ aria-selected="${this.selectedId===r.id}"
685
685
  aria-colindex="5"
686
- style="left:${rt.toFixed(2)}px;width:${Tt.toFixed(2)}px;--tone:${U};--progress:${It.toFixed(2)}%"
687
- aria-label="${f(t.label)}"
686
+ style="left:${rt.toFixed(2)}px;width:${Ct.toFixed(2)}px;--tone:${U};--progress:${Tt.toFixed(2)}%"
687
+ aria-label="${b(r.label)}"
688
688
  ${at?'data-draggable="true"':""}
689
689
  >
690
690
  ${nt?'<span class="handle start" data-mode="resize-start"></span>':""}
691
691
  <span class="progress"></span>
692
692
  ${it}
693
- ${k==="milestone"?'<span class="milestone-shape"></span>':""}
693
+ ${v==="milestone"?'<span class="milestone-shape"></span>':""}
694
694
  <span class="drag-tip"></span>
695
695
  ${nt?'<span class="handle end" data-mode="resize-end"></span>':""}
696
696
  </button>
697
697
  </article>
698
- `}).join(""),et=d.map(t=>{const M=Q.get(t.source),E=Q.get(t.target);if(!M||!E||z&&!tt.has(t.source)&&!tt.has(t.target))return"";const k=Ot(M.task,M.index,E.task,E.index,t.type,C),F=`${M.task.label} dependency to ${E.task.label}`;return`<path class="link-hit" d="${k}" data-link-id="${f(t.id)}" data-source-id="${f(t.source)}" data-target-id="${f(t.target)}" data-link-type="${f(t.type||"e2s")}" aria-label="${f(F)}" /><path d="${k}" />`}).join(""),Et=et?'<defs><marker id="ui-gantt-arrow" markerWidth="9" markerHeight="9" refX="8.5" refY="4.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 0.5 0.75 L 8.5 4.5 L 0.5 8.25 z" /></marker></defs>':"",Y=D(Date.now()),St=C(Y),zt=o&&Y>=m&&Y<=h?`<div class="today" part="today" style="left:${St.toFixed(2)}px"></div>`:"";this.setContent(`
699
- <style>${mt}</style>
700
- <section class="frame" part="frame" data-bar-variant="${e}">
701
- ${c?`
698
+ `}).join(""),et=i.map(r=>{const $=Q.get(r.source),E=Q.get(r.target);if(!$||!E||z&&!tt.has(r.source)&&!tt.has(r.target))return"";const v=jt($.task,$.index,E.task,E.index,r.type,C),F=`${$.task.label} dependency to ${E.task.label}`;return`<path class="link-hit" d="${v}" data-link-id="${b(r.id)}" data-source-id="${b(r.source)}" data-target-id="${b(r.target)}" data-link-type="${b(r.type||"e2s")}" aria-label="${b(F)}" /><path d="${v}" />`}).join(""),Mt=et?'<defs><marker id="ui-gantt-arrow" markerWidth="9" markerHeight="9" refX="8.5" refY="4.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 0.5 0.75 L 8.5 4.5 L 0.5 8.25 z" /></marker></defs>':"",Y=D(Date.now()),Et=C(Y),St=d&&Y>=m&&Y<=h?`<div class="today" part="today" style="left:${Et.toFixed(2)}px"></div>`:"";this.setContent(`
699
+ <style>${ht}</style>
700
+ <section class="frame" part="frame" data-bar-variant="${s}">
701
+ ${u?`
702
702
  <header class="toolbar" part="toolbar">
703
- <div class="title">Project schedule <span class="meta">${s.length}/${r.length} tasks</span></div>
703
+ <div class="title">Project schedule <span class="meta">${o.length}/${t.length} tasks</span></div>
704
704
  <div class="controls">
705
- <input class="control" value="${f(i)}" placeholder="Filter tasks" aria-label="Filter tasks" />
705
+ <input class="control" value="${b(l)}" placeholder="Filter tasks" aria-label="Filter tasks" />
706
706
  <select class="select" aria-label="Sort tasks">
707
- ${[["none","Manual"],["start","Start date"],["end","End date"],["label","Name"],["progress","Progress"]].map(([t,M])=>`<option value="${t}" ${a===t?"selected":""}>${M}</option>`).join("")}
707
+ ${[["none","Manual"],["start","Start date"],["end","End date"],["label","Name"],["progress","Progress"]].map(([r,$])=>`<option value="${r}" ${n===r?"selected":""}>${$}</option>`).join("")}
708
708
  </select>
709
- ${["day","week","month","quarter","year"].map(t=>`<button class="zoom-button" data-zoom="${t}" aria-pressed="${l===t}">${t}</button>`).join("")}
709
+ ${["day","week","month","quarter","year"].map(r=>`<button class="zoom-button" data-zoom="${r}" aria-pressed="${e===r}">${r}</button>`).join("")}
710
710
  </div>
711
711
  </header>
712
712
  `:""}
713
713
  <div class="viewport" part="viewport">
714
- <div class="surface" part="surface" style="--day-width:${v}px;grid-template-columns:${J}px ${y.toFixed(2)}px;inline-size:max(100%, ${(J+y).toFixed(2)}px)">
714
+ <div class="surface" part="surface" style="--day-width:${M}px;grid-template-columns:${J}px ${k.toFixed(2)}px;inline-size:max(100%, ${(J+k).toFixed(2)}px)">
715
715
  <header class="grid-head" part="grid-head" role="row">
716
- <button class="head-button" data-sort="label" role="columnheader" aria-sort="${a==="label"?"ascending":"none"}">Task</button>
716
+ <button class="head-button" data-sort="label" role="columnheader" aria-sort="${n==="label"?"ascending":"none"}">Task</button>
717
717
  <span role="columnheader">Owner</span>
718
- <button class="head-button" data-sort="start" role="columnheader" aria-sort="${a==="start"?"ascending":"none"}">Dates</button>
719
- <button class="head-button" data-sort="progress" role="columnheader" aria-sort="${a==="progress"?"descending":"none"}">%</button>
718
+ <button class="head-button" data-sort="start" role="columnheader" aria-sort="${n==="start"?"ascending":"none"}">Dates</button>
719
+ <button class="head-button" data-sort="progress" role="columnheader" aria-sort="${n==="progress"?"descending":"none"}">%</button>
720
720
  </header>
721
721
  <header class="timeline-head" part="timeline-head">
722
- <div class="scale" style="width:${y.toFixed(2)}px">${_t(m,h,v,l,this.viewportLeft,this.viewportWidth)}</div>
722
+ <div class="scale" style="width:${k.toFixed(2)}px">${Ht(m,h,M,e,this.viewportLeft,this.viewportWidth)}</div>
723
723
  </header>
724
- <div class="grid-body" part="grid-body" role="treegrid" aria-rowcount="${s.length+1}" aria-colcount="4">
724
+ <div class="grid-body" part="grid-body" role="treegrid" aria-rowcount="${o.length+1}" aria-colcount="4">
725
725
  ${z&&_?`<div style="height:${_}px"></div>`:""}
726
- ${$t||'<div class="empty">No matching tasks</div>'}
726
+ ${kt||'<div class="empty">No matching tasks</div>'}
727
727
  ${z&&V?`<div style="height:${V}px"></div>`:""}
728
728
  </div>
729
- <div class="timeline-body" part="timeline-body" style="width:${y.toFixed(2)}px;min-height:${A}px">
730
- <svg class="links" width="${y.toFixed(0)}" height="${A}" viewBox="0 0 ${y.toFixed(0)} ${A}" aria-hidden="true">${Et}${et}</svg>
731
- ${zt}
729
+ <div class="timeline-body" part="timeline-body" style="width:${k.toFixed(2)}px;min-height:${A}px">
730
+ <svg class="links" width="${k.toFixed(0)}" height="${A}" viewBox="0 0 ${k.toFixed(0)} ${A}" aria-hidden="true">${Mt}${et}</svg>
731
+ ${St}
732
732
  ${z&&_?`<div style="height:${_}px"></div>`:""}
733
- ${Mt}
733
+ ${$t}
734
734
  ${z&&V?`<div style="height:${V}px"></div>`:""}
735
735
  </div>
736
736
  </div>
737
737
  </div>
738
738
  </section>
739
- `);const q=this.root.querySelector(".viewport");q&&(q.scrollTop=this.viewportTop,q.scrollLeft=this.viewportLeft,this.viewportWidth=q.clientWidth||this.viewportWidth,this.viewportHeight=q.clientHeight||this.viewportHeight),this.bindEvents()}bindEvents(){var r,d,l;this.root.querySelectorAll("[data-task-id]").forEach(a=>{a.addEventListener("click",e=>{var o;const i=e.target,s=e.currentTarget;if(!s.classList.contains("bar")&&i.closest(".bar"))return;if((o=this.drag)!=null&&o.moved){e.stopPropagation();return}const c=e.currentTarget.dataset.taskId;c&&(i.closest('[data-action="toggle"]')||(s.classList.contains("bar")&&e.stopPropagation(),this.selectTask(c)))})}),this.root.querySelectorAll('[data-action="toggle"]').forEach(a=>{a.addEventListener("click",e=>{e.stopPropagation();const i=a.dataset.taskId;i&&(this.collapsed.has(i)?this.collapsed.delete(i):this.collapsed.add(i),this.requestRender())})}),this.root.querySelectorAll("[data-zoom]").forEach(a=>{a.addEventListener("click",()=>{const e=a.dataset.zoom||"week";this.setAttribute("zoom",e),this.dispatchEvent(new CustomEvent("zoomchange",{detail:{zoom:e},bubbles:!0,composed:!0}))})}),this.root.querySelectorAll(".head-button[data-sort]").forEach(a=>{a.addEventListener("click",()=>{const e=j(a.dataset.sort||null);e==="none"?this.removeAttribute("sort"):this.setAttribute("sort",e),this.dispatchEvent(new CustomEvent("sortchange",{detail:{sort:e},bubbles:!0,composed:!0}))})}),(r=this.root.querySelector(".viewport"))==null||r.addEventListener("scroll",a=>{const e=a.currentTarget,i=e.scrollTop,s=e.scrollLeft,g=Math.max(20,Math.ceil(Math.max(420,this.viewportHeight-W)/$)),c=Math.max(0,Math.floor(Math.max(0,i-W)/$)),o=c<this.renderedFirstRow+64||c+g>this.renderedLastRow-64,u=Math.abs(s-this.viewportLeft)>=Math.max(480,this.viewportWidth*.6);this.viewportTop=i,this.viewportLeft=s,!(!o&&!u)&&this.scrollFrame==null&&(this.scrollFrame=window.setTimeout(()=>{this.scrollFrame=null,this.requestRender()},24))},{passive:!0}),(d=this.root.querySelector(".control"))==null||d.addEventListener("input",a=>{this.internalFilter=a.currentTarget.value,this.dispatchEvent(new CustomEvent("filterchange",{detail:{filter:this.internalFilter},bubbles:!0,composed:!0})),this.requestRender()}),(l=this.root.querySelector(".select"))==null||l.addEventListener("change",a=>{const e=j(a.currentTarget.value);e==="none"?this.removeAttribute("sort"):this.setAttribute("sort",e),this.dispatchEvent(new CustomEvent("sortchange",{detail:{sort:e},bubbles:!0,composed:!0}))}),this.root.querySelectorAll(".link-hit").forEach(a=>{a.addEventListener("click",e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("linkselect",{detail:{id:a.dataset.linkId||"",source:a.dataset.sourceId||"",target:a.dataset.targetId||"",type:a.dataset.linkType||"e2s"},bubbles:!0,composed:!0}))})}),!this.hasAttribute("readonly")&&this.root.querySelectorAll('.bar[data-draggable="true"]').forEach(a=>{a.addEventListener("pointerdown",i=>{if(i.button!==0)return;const s=a.dataset.taskId;if(!s)return;const c=this.getTasks().find(y=>y.id===s),o=x(c==null?void 0:c.start),u=x(c==null?void 0:c.end);if(!c||o==null||u==null)return;i.preventDefault();const p=a.dataset.kind||"task",m=i.target.dataset.mode||"move",h=p==="milestone"?"move":m,b=ft(this.getAttribute("zoom")),v=this.selectedId!==s;this.selectedId=s,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:s},bubbles:!0,composed:!0})),this.drag={taskId:s,mode:h,startX:i.clientX,originalStart:o,originalEnd:u,kind:p,rangeMin:this.rangeMin(),dayWidth:ht[b],latestStart:o,latestEnd:u,frame:null,bar:a,moved:!1,selectedChanged:v},a.classList.add("dragging"),a.setPointerCapture(i.pointerId)}),a.addEventListener("pointermove",i=>{if(!this.drag||this.drag.taskId!==a.dataset.taskId)return;i.preventDefault();const s=i.clientX-this.drag.startX;Math.abs(s)>2&&(this.drag.moved=!0);let g=this.drag.originalStart,c=this.drag.originalEnd;if(this.drag.mode==="move"){const o=Math.round(s/this.drag.dayWidth);g=w(this.drag.originalStart,o),c=this.drag.kind==="milestone"?g:w(this.drag.originalEnd,o)}else if(this.drag.mode==="resize-start"){const o=Math.round(s/this.drag.dayWidth);g=Math.min(w(this.drag.originalStart,o),w(c,-1))}else{const o=Math.round(s/this.drag.dayWidth);c=Math.max(w(this.drag.originalEnd,o),w(g,1))}this.drag.latestStart=g,this.drag.latestEnd=c,this.drag.frame==null&&(this.drag.frame=requestAnimationFrame(()=>{if(!this.drag)return;this.drag.frame=null;const o=(this.drag.latestStart-this.drag.rangeMin)/I*this.drag.dayWidth-(this.drag.kind==="milestone"?N/2:0),u=this.drag.kind==="milestone"?N:Math.max(12,(this.drag.latestEnd-this.drag.latestStart)/I*this.drag.dayWidth);this.drag.bar.style.left=`${o.toFixed(2)}px`,this.drag.bar.style.width=`${u.toFixed(2)}px`;const p=this.drag.bar.querySelector(".drag-tip");p&&(p.textContent=this.drag.kind==="milestone"?S(this.drag.latestStart):`${S(this.drag.latestStart)} - ${S(this.drag.latestEnd)}`)}))});const e=()=>{if(!this.drag)return;this.drag.frame!=null&&cancelAnimationFrame(this.drag.frame);const i=this.drag;if(i.bar.classList.remove("dragging"),this.drag=null,!i.moved){i.selectedChanged&&this.requestRender();return}const s={id:i.taskId,start:S(i.latestStart),end:S(i.latestEnd)};this.overrides.set(i.taskId,{start:s.start,end:s.end}),this.bumpOverrides(),this.dispatchEvent(new CustomEvent("taskchange",{detail:s,bubbles:!0,composed:!0})),this.requestRender()};a.addEventListener("pointerup",e),a.addEventListener("pointercancel",e),a.addEventListener("keydown",i=>{const s=a.dataset.taskId;if(!s)return;if(i.key==="Delete"||i.key==="Backspace"){i.preventDefault(),this.dispatchEvent(new CustomEvent("taskdelete",{detail:{id:s},bubbles:!0,composed:!0}));return}if(i.key==="Enter"||i.key===" "){i.preventDefault(),this.selectTask(s);return}if(i.key==="ArrowUp"||i.key==="ArrowDown"){i.preventDefault(),this.selectAdjacentTask(s,i.key==="ArrowDown"?1:-1);return}if(i.key!=="ArrowLeft"&&i.key!=="ArrowRight")return;const c=this.getTasks().find(y=>y.id===s),o=x(c==null?void 0:c.start),u=x(c==null?void 0:c.end);if(!c||o==null||u==null)return;i.preventDefault();const p=i.key==="ArrowLeft"?-1:1,m=a.dataset.kind==="milestone",h=i.shiftKey&&!m?o:w(o,p),b=m?h:i.shiftKey?Math.max(w(u,p),w(o,1)):w(u,p),v={id:s,start:S(h),end:S(b)};this.overrides.set(s,{start:v.start,end:v.end}),this.bumpOverrides(),this.dispatchEvent(new CustomEvent("taskchange",{detail:v,bubbles:!0,composed:!0})),this.requestRender()})})}rangeMin(){const d=this.getTasks().map(l=>x(l.start)).filter(l=>l!=null);return d.length?w(Math.min(...d),-2):D(Date.now())}selectTask(r){if(this.captureViewport(),this.selectedId===r){this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:r},bubbles:!0,composed:!0}));return}this.selectedId=r,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:r},bubbles:!0,composed:!0})),this.requestRender()}selectAdjacentTask(r,d){const l=this.getVisibleTasks(this.getTasks(),this.getAttribute("filter")??this.internalFilter,j(this.getAttribute("sort"))),a=l.findIndex(i=>i.id===r),e=l[Math.max(0,Math.min(l.length-1,a+d))];!e||e.id===r||(this.selectedId=e.id,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:e.id},bubbles:!0,composed:!0})),this.requestRender(),window.requestAnimationFrame(()=>{var i;(i=this.root.querySelector(`.bar[data-task-id="${CSS.escape(e.id)}"]`))==null||i.focus()}))}captureViewport(){const r=this.root.querySelector(".viewport");r&&(this.viewportTop=r.scrollTop,this.viewportLeft=r.scrollLeft,this.viewportWidth=r.clientWidth||this.viewportWidth,this.viewportHeight=r.clientHeight||this.viewportHeight)}getTasks(){const r=this.getAttribute("tasks");return r===this.taskCacheRaw&&this.taskCacheVersion===this.overridesVersion?this.taskCache:(this.taskCacheRaw=r,this.taskCacheVersion=this.overridesVersion,this.taskCache=Rt(r,this.overrides),this.visibleCacheKey="",this.taskCache)}getLinks(){const r=this.getAttribute("links");return r===this.linkCacheRaw?this.linkCache:(this.linkCacheRaw=r,this.linkCache=qt(r),this.linkCache)}getVisibleTasks(r,d,l){const a=Array.from(this.collapsed).sort().join(","),e=`${this.taskCacheRaw||""}|${this.overridesVersion}|${d}|${l}|${a}`;return e===this.visibleCacheKey?this.visibleCache:(this.visibleCacheKey=e,this.visibleCache=Ht(r,this.collapsed,d,l),this.visibleCache)}bumpOverrides(){this.overridesVersion+=1,this.taskCacheVersion=-1,this.visibleCacheKey=""}shouldRenderOnAttributeChange(r,d,l){return r==="tasks"&&(this.overrides.clear(),this.bumpOverrides(),this.viewportTop=0,this.viewportLeft=0),r==="links"&&(this.linkCacheRaw=null),!0}}typeof customElements<"u"&&!customElements.get("ui-gantt")&&customElements.define("ui-gantt",yt);exports.UIGantt=yt;
739
+ `);const q=this.root.querySelector(".viewport");q&&(q.scrollTop=this.viewportTop,q.scrollLeft=this.viewportLeft,this.viewportWidth=q.clientWidth||this.viewportWidth,this.viewportHeight=q.clientHeight||this.viewportHeight),this.bindEvents()}bindEvents(){this.root.querySelectorAll("[data-task-id]").forEach(t=>{t.addEventListener("click",i=>{const e=i.target,n=i.currentTarget;if(!n.classList.contains("bar")&&e.closest(".bar"))return;if(this.drag?.moved){i.stopPropagation();return}const l=i.currentTarget.dataset.taskId;l&&(e.closest('[data-action="toggle"]')||(n.classList.contains("bar")&&i.stopPropagation(),this.selectTask(l)))})}),this.root.querySelectorAll('[data-action="toggle"]').forEach(t=>{t.addEventListener("click",i=>{i.stopPropagation();const e=t.dataset.taskId;e&&(this.collapsed.has(e)?this.collapsed.delete(e):this.collapsed.add(e),this.requestRender())})}),this.root.querySelectorAll("[data-zoom]").forEach(t=>{t.addEventListener("click",()=>{const i=t.dataset.zoom||"week";this.setAttribute("zoom",i),this.dispatchEvent(new CustomEvent("zoomchange",{detail:{zoom:i},bubbles:!0,composed:!0}))})}),this.root.querySelectorAll(".head-button[data-sort]").forEach(t=>{t.addEventListener("click",()=>{const i=j(t.dataset.sort||null);i==="none"?this.removeAttribute("sort"):this.setAttribute("sort",i),this.dispatchEvent(new CustomEvent("sortchange",{detail:{sort:i},bubbles:!0,composed:!0}))})}),this.root.querySelector(".viewport")?.addEventListener("scroll",t=>{const i=t.currentTarget,e=i.scrollTop,n=i.scrollLeft,s=Math.max(20,Math.ceil(Math.max(420,this.viewportHeight-W)/y)),l=Math.max(0,Math.floor(Math.max(0,e-W)/y)),o=l<this.renderedFirstRow+64||l+s>this.renderedLastRow-64,p=Math.abs(n-this.viewportLeft)>=Math.max(480,this.viewportWidth*.6);this.viewportTop=e,this.viewportLeft=n,!(!o&&!p)&&this.scrollFrame==null&&(this.scrollFrame=window.setTimeout(()=>{this.scrollFrame=null,this.requestRender()},24))},{passive:!0}),this.root.querySelector(".control")?.addEventListener("input",t=>{this.internalFilter=t.currentTarget.value,this.dispatchEvent(new CustomEvent("filterchange",{detail:{filter:this.internalFilter},bubbles:!0,composed:!0})),this.requestRender()}),this.root.querySelector(".select")?.addEventListener("change",t=>{const i=j(t.currentTarget.value);i==="none"?this.removeAttribute("sort"):this.setAttribute("sort",i),this.dispatchEvent(new CustomEvent("sortchange",{detail:{sort:i},bubbles:!0,composed:!0}))}),this.root.querySelectorAll(".link-hit").forEach(t=>{t.addEventListener("click",i=>{i.stopPropagation(),this.dispatchEvent(new CustomEvent("linkselect",{detail:{id:t.dataset.linkId||"",source:t.dataset.sourceId||"",target:t.dataset.targetId||"",type:t.dataset.linkType||"e2s"},bubbles:!0,composed:!0}))})}),!this.hasAttribute("readonly")&&this.root.querySelectorAll('.bar[data-draggable="true"]').forEach(t=>{t.addEventListener("pointerdown",e=>{if(e.button!==0)return;const n=t.dataset.taskId;if(!n)return;const l=this.getTasks().find(h=>h.id===n),o=f(l?.start),p=f(l?.end);if(!l||o==null||p==null)return;e.preventDefault();const u=t.dataset.kind||"task",d=e.target.dataset.mode||"move",g=u==="milestone"?"move":d,c=bt(this.getAttribute("zoom")),m=this.selectedId!==n;this.selectedId=n,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:n},bubbles:!0,composed:!0})),this.drag={taskId:n,mode:g,startX:e.clientX,originalStart:o,originalEnd:p,kind:u,rangeMin:this.rangeMin(),dayWidth:gt[c],latestStart:o,latestEnd:p,frame:null,bar:t,moved:!1,selectedChanged:m},t.classList.add("dragging"),t.setPointerCapture(e.pointerId)}),t.addEventListener("pointermove",e=>{if(!this.drag||this.drag.taskId!==t.dataset.taskId)return;e.preventDefault();const n=e.clientX-this.drag.startX;Math.abs(n)>2&&(this.drag.moved=!0);let s=this.drag.originalStart,l=this.drag.originalEnd;if(this.drag.mode==="move"){const o=Math.round(n/this.drag.dayWidth);s=x(this.drag.originalStart,o),l=this.drag.kind==="milestone"?s:x(this.drag.originalEnd,o)}else if(this.drag.mode==="resize-start"){const o=Math.round(n/this.drag.dayWidth);s=Math.min(x(this.drag.originalStart,o),x(l,-1))}else{const o=Math.round(n/this.drag.dayWidth);l=Math.max(x(this.drag.originalEnd,o),x(s,1))}this.drag.latestStart=s,this.drag.latestEnd=l,this.drag.frame==null&&(this.drag.frame=requestAnimationFrame(()=>{if(!this.drag)return;this.drag.frame=null;const o=(this.drag.latestStart-this.drag.rangeMin)/I*this.drag.dayWidth-(this.drag.kind==="milestone"?N/2:0),p=this.drag.kind==="milestone"?N:Math.max(12,(this.drag.latestEnd-this.drag.latestStart)/I*this.drag.dayWidth);this.drag.bar.style.left=`${o.toFixed(2)}px`,this.drag.bar.style.width=`${p.toFixed(2)}px`;const u=this.drag.bar.querySelector(".drag-tip");u&&(u.textContent=this.drag.kind==="milestone"?S(this.drag.latestStart):`${S(this.drag.latestStart)} - ${S(this.drag.latestEnd)}`)}))});const i=()=>{if(!this.drag)return;this.drag.frame!=null&&cancelAnimationFrame(this.drag.frame);const e=this.drag;if(e.bar.classList.remove("dragging"),this.drag=null,!e.moved){e.selectedChanged&&this.requestRender();return}const n={id:e.taskId,start:S(e.latestStart),end:S(e.latestEnd)};this.overrides.set(e.taskId,{start:n.start,end:n.end}),this.bumpOverrides(),this.dispatchEvent(new CustomEvent("taskchange",{detail:n,bubbles:!0,composed:!0})),this.requestRender()};t.addEventListener("pointerup",i),t.addEventListener("pointercancel",i),t.addEventListener("keydown",e=>{const n=t.dataset.taskId;if(!n)return;if(e.key==="Delete"||e.key==="Backspace"){e.preventDefault(),this.dispatchEvent(new CustomEvent("taskdelete",{detail:{id:n},bubbles:!0,composed:!0}));return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.selectTask(n);return}if(e.key==="ArrowUp"||e.key==="ArrowDown"){e.preventDefault(),this.selectAdjacentTask(n,e.key==="ArrowDown"?1:-1);return}if(e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;const l=this.getTasks().find(h=>h.id===n),o=f(l?.start),p=f(l?.end);if(!l||o==null||p==null)return;e.preventDefault();const u=e.key==="ArrowLeft"?-1:1,d=t.dataset.kind==="milestone",g=e.shiftKey&&!d?o:x(o,u),c=d?g:e.shiftKey?Math.max(x(p,u),x(o,1)):x(p,u),m={id:n,start:S(g),end:S(c)};this.overrides.set(n,{start:m.start,end:m.end}),this.bumpOverrides(),this.dispatchEvent(new CustomEvent("taskchange",{detail:m,bubbles:!0,composed:!0})),this.requestRender()})})}rangeMin(){const i=this.getTasks().map(e=>f(e.start)).filter(e=>e!=null);return i.length?x(Math.min(...i),-2):D(Date.now())}selectTask(t){if(this.captureViewport(),this.selectedId===t){this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:t},bubbles:!0,composed:!0}));return}this.selectedId=t,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:t},bubbles:!0,composed:!0})),this.requestRender()}selectAdjacentTask(t,i){const e=this.getVisibleTasks(this.getTasks(),this.getAttribute("filter")??this.internalFilter,j(this.getAttribute("sort"))),n=e.findIndex(l=>l.id===t),s=e[Math.max(0,Math.min(e.length-1,n+i))];!s||s.id===t||(this.selectedId=s.id,this.dispatchEvent(new CustomEvent("taskselect",{detail:{id:s.id},bubbles:!0,composed:!0})),this.requestRender(),window.requestAnimationFrame(()=>{this.root.querySelector(`.bar[data-task-id="${CSS.escape(s.id)}"]`)?.focus()}))}captureViewport(){const t=this.root.querySelector(".viewport");t&&(this.viewportTop=t.scrollTop,this.viewportLeft=t.scrollLeft,this.viewportWidth=t.clientWidth||this.viewportWidth,this.viewportHeight=t.clientHeight||this.viewportHeight)}getTasks(){const t=this.getAttribute("tasks");return t===this.taskCacheRaw&&this.taskCacheVersion===this.overridesVersion?this.taskCache:(this.taskCacheRaw=t,this.taskCacheVersion=this.overridesVersion,this.taskCache=Dt(t,this.overrides),this.visibleCacheKey="",this.taskCache)}getLinks(){const t=this.getAttribute("links");return t===this.linkCacheRaw?this.linkCache:(this.linkCacheRaw=t,this.linkCache=Rt(t),this.linkCache)}getVisibleTasks(t,i,e){const n=Array.from(this.collapsed).sort().join(","),s=`${this.taskCacheRaw||""}|${this.overridesVersion}|${i}|${e}|${n}`;return s===this.visibleCacheKey?this.visibleCache:(this.visibleCacheKey=s,this.visibleCache=Nt(t,this.collapsed,i,e),this.visibleCache)}bumpOverrides(){this.overridesVersion+=1,this.taskCacheVersion=-1,this.visibleCacheKey=""}shouldRenderOnAttributeChange(t,i,e){return t==="tasks"&&(this.overrides.clear(),this.bumpOverrides(),this.viewportTop=0,this.viewportLeft=0),t==="links"&&(this.linkCacheRaw=null),!0}}typeof customElements<"u"&&!customElements.get("ui-gantt")&&customElements.define("ui-gantt",wt);exports.UIGantt=wt;