@taprootio/espalier 3.9.0 → 4.1.0

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 (105) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/custom-elements.json +24428 -25047
  3. package/dist/action-menu/esp-action-menu-item.d.ts +4 -4
  4. package/dist/action-menu/esp-action-menu-item.js +1 -1
  5. package/dist/action-menu/esp-action-menu.d.ts +2 -2
  6. package/dist/action-menu/esp-action-menu.js +6 -6
  7. package/dist/box/esp-box.d.ts +1 -1
  8. package/dist/burger/esp-burger.d.ts +4 -4
  9. package/dist/burger/esp-burger.js +4 -4
  10. package/dist/button/esp-button.d.ts +5 -5
  11. package/dist/button/esp-button.js +9 -9
  12. package/dist/checkbox/esp-checkbox-group.d.ts +4 -2
  13. package/dist/checkbox/esp-checkbox-group.js +1 -1
  14. package/dist/checkbox/esp-checkbox.d.ts +4 -2
  15. package/dist/color-picker/esp-color-picker.d.ts +2 -2
  16. package/dist/color-picker/esp-color-picker.js +4 -4
  17. package/dist/date-picker/esp-date-picker.d.ts +5 -3
  18. package/dist/date-picker/esp-date-picker.js +7 -7
  19. package/dist/details/esp-details-group.d.ts +1 -1
  20. package/dist/details/esp-details-group.js +3 -3
  21. package/dist/details/esp-details.d.ts +2 -2
  22. package/dist/details/esp-details.js +3 -3
  23. package/dist/dialog/esp-dialog.d.ts +7 -7
  24. package/dist/dialog/esp-dialog.js +7 -7
  25. package/dist/file-upload/esp-file-upload.d.ts +5 -2
  26. package/dist/file-upload/esp-file-upload.js +3 -3
  27. package/dist/flyout/esp-flyout.d.ts +10 -10
  28. package/dist/flyout/esp-flyout.js +14 -14
  29. package/dist/focus-picker/esp-focus-picker.d.ts +4 -4
  30. package/dist/focus-picker/esp-focus-picker.js +4 -4
  31. package/dist/font-picker/esp-font-picker.d.ts +1 -1
  32. package/dist/font-picker/esp-font-picker.js +2 -2
  33. package/dist/form/esp-form.d.ts +9 -9
  34. package/dist/form/esp-form.js +1 -1
  35. package/dist/grid/esp-grid.d.ts +10 -10
  36. package/dist/grid/esp-grid.js +13 -11
  37. package/dist/header/esp-header-button.d.ts +2 -2
  38. package/dist/header/esp-header-button.js +1 -1
  39. package/dist/header/esp-header.d.ts +5 -5
  40. package/dist/header/esp-header.js +4 -4
  41. package/dist/help/esp-help-provider.js +1 -1
  42. package/dist/help/help-document.js +1 -1
  43. package/dist/image-upload/esp-image-preview.js +8 -8
  44. package/dist/image-upload/esp-image-upload.d.ts +14 -14
  45. package/dist/image-upload/esp-image-upload.js +10 -10
  46. package/dist/image-upload/image-helpers.d.ts +2 -2
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/info/esp-info.d.ts +2 -2
  50. package/dist/info/esp-info.js +6 -6
  51. package/dist/input/esp-input.d.ts +8 -7
  52. package/dist/input/esp-input.js +2 -2
  53. package/dist/lightbox/esp-lightbox.js +6 -6
  54. package/dist/menu/esp-menu-group.d.ts +1 -1
  55. package/dist/menu/esp-menu-group.js +1 -1
  56. package/dist/menu/esp-menu-item.d.ts +2 -2
  57. package/dist/menu/esp-menu-item.js +2 -2
  58. package/dist/menu/esp-menu.d.ts +2 -2
  59. package/dist/menu/esp-menu.js +9 -9
  60. package/dist/page/esp-page.d.ts +4 -4
  61. package/dist/page/esp-page.js +1 -1
  62. package/dist/pickers/esp-pick-one.d.ts +3 -1
  63. package/dist/pickers/esp-pick-one.js +2 -2
  64. package/dist/pickers/esp-pick-some.d.ts +3 -1
  65. package/dist/pickers/esp-pick-some.js +1 -1
  66. package/dist/pickers/esp-picker-base.d.ts +1 -1
  67. package/dist/pickers/esp-picker-menu.d.ts +4 -4
  68. package/dist/pickers/esp-picker-menu.js +7 -7
  69. package/dist/popover/esp-popover.d.ts +2 -2
  70. package/dist/popover/esp-popover.js +3 -3
  71. package/dist/progress/esp-progress.d.ts +4 -4
  72. package/dist/radio-button/esp-radio-button-group.d.ts +4 -2
  73. package/dist/radio-button/esp-radio-button-group.js +4 -4
  74. package/dist/radio-button/esp-radio-button.d.ts +1 -1
  75. package/dist/repeater/esp-repeater.d.ts +2 -12
  76. package/dist/search/esp-search.d.ts +4 -4
  77. package/dist/search/esp-search.js +3 -3
  78. package/dist/shared/esp-element-base.js +1 -1
  79. package/dist/shared/events.d.ts +151 -70
  80. package/dist/shared/events.js +1 -1
  81. package/dist/shared/flyout-events.d.ts +1 -1
  82. package/dist/shared/flyout-events.js +1 -1
  83. package/dist/shared/form-field-controller.d.ts +3 -3
  84. package/dist/shared/intent-values.d.ts +0 -12
  85. package/dist/shared/intent-values.js +1 -1
  86. package/dist/shared/theme.d.ts +13 -4
  87. package/dist/shared/theme.js +1 -1
  88. package/dist/shared/utilities.d.ts +0 -31
  89. package/dist/shared/utilities.js +1 -1
  90. package/dist/shared/validation.d.ts +2 -2
  91. package/dist/shared/validation.js +1 -1
  92. package/dist/slider/esp-slider.d.ts +4 -2
  93. package/dist/status-indicator/esp-status-indicator.js +2 -2
  94. package/dist/switch/esp-switch.d.ts +4 -2
  95. package/dist/tabs/esp-tab-group.d.ts +2 -2
  96. package/dist/tabs/esp-tab-group.js +4 -4
  97. package/dist/tabs/esp-tab.d.ts +2 -1
  98. package/dist/tabs/esp-tab.js +2 -2
  99. package/dist/textarea/esp-textarea.d.ts +6 -5
  100. package/dist/textarea/esp-textarea.js +1 -1
  101. package/dist/toaster/esp-toaster.d.ts +4 -4
  102. package/dist/toaster/esp-toaster.js +1 -1
  103. package/dist/tree/esp-tree.d.ts +2 -1
  104. package/dist/tree/esp-tree.js +26 -26
  105. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(c,e,t,i);else for(var a=c.length-1;a>=0;a--)(r=c[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};import{css as T,html as p,nothing as u}from"lit";import{customElement as D,property as h,state as k}from"lit/decorators.js";import{classMap as v}from"lit/directives/class-map.js";import{createRef as $,ref as S}from"lit/directives/ref.js";import{unsafeHTML as R}from"lit/directives/unsafe-html.js";import{EspalierElementBase as z}from"../shared/esp-element-base.js";import{FormFieldController as F}from"../shared/form-field-controller.js";import{getIconHrefForHost as M}from"../shared/intent-values.js";import{caretRight as L}from"../shared/svgs/caret-right.js";import{renderSpriteIcon as E}from"../shared/svgs/render-sprite-icon.js";import"../box/esp-box.js";import"../action-menu/esp-action-menu.js";import"../button/esp-button.js";import"../dialog/esp-dialog.js";import"../form-item/esp-form-item.js";import"../info/esp-info.js";import"../input/esp-input.js";import"./esp-tree-item.js";import{EspalierTreeItem as P}from"./esp-tree-item.js";const B="A branch with that name already exists here.",q="Enter a name for the new branch.",U=500,G={edit:"esp-tree-edit",delete:"esp-tree-delete","move-up":"esp-tree-move-up","move-down":"esp-tree-move-down",cut:"esp-tree-cut","paste-child":"esp-tree-paste-child"},V={edit:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1
+ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(c,e,t,i);else for(var a=c.length-1;a>=0;a--)(r=c[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};import{css as D,html as p,nothing as u}from"lit";import{customElement as L,property as h,state as x}from"lit/decorators.js";import{classMap as m}from"lit/directives/class-map.js";import{createRef as $,ref as S}from"lit/directives/ref.js";import{unsafeHTML as C}from"lit/directives/unsafe-html.js";import{EspalierElementBase as z}from"../shared/esp-element-base.js";import{ESP_EVENTS as _}from"../shared/events.js";import{FormFieldController as F}from"../shared/form-field-controller.js";import{getIconHrefForHost as M}from"../shared/intent-values.js";import{caretRight as U}from"../shared/svgs/caret-right.js";import{renderSpriteIcon as G}from"../shared/svgs/render-sprite-icon.js";import"../box/esp-box.js";import"../action-menu/esp-action-menu.js";import"../button/esp-button.js";import"../dialog/esp-dialog.js";import"../form-item/esp-form-item.js";import"../info/esp-info.js";import"../input/esp-input.js";import"./esp-tree-item.js";import{EspalierTreeItem as P}from"./esp-tree-item.js";const B="A branch with that name already exists here.",q="Enter a name for the new branch.",V=500,T={edit:_.TREE_EDIT,delete:_.TREE_DELETE,"move-up":_.TREE_MOVE_UP,"move-down":_.TREE_MOVE_DOWN,cut:_.TREE_CUT,"paste-child":_.TREE_PASTE_CHILD},N={edit:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
2
  <path stroke="none" d="M0 0h24v24H0z" fill="none" />
3
3
  <path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1" />
4
4
  <path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z" />
@@ -38,14 +38,14 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
38
38
  <path d="M5 10a2 2 0 1 1 0 4a2 2 0 0 1 0 -4z" />
39
39
  <path d="M12 10a2 2 0 1 1 0 4a2 2 0 0 1 0 -4z" />
40
40
  <path d="M19 10a2 2 0 1 1 0 4a2 2 0 0 1 0 -4z" />
41
- </svg>`};function A(c,e){return p`<span
41
+ </svg>`};function R(c,e){return p`<span
42
42
  slot=${e??u}
43
43
  class="tree-action-icon"
44
44
  aria-hidden="true"
45
45
  focusable="false"
46
46
  >
47
- ${R(V[c])}
48
- </span>`}function N(c){return c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function H({parentPath:c,segment:e,rootPath:t}){return e?!c||c===t?t.endsWith("/")?`${t}${e}`:`${t}/${e}`:c.endsWith("/")?`${c}${e}`:`${c}/${e}`:c||t}let n=class extends z{constructor(){super(...arguments),this.internals=this.attachInternals(),this.formCtrl=new F({host:this,internals:this.internals,getFormValue:()=>this.value?this.value:null,getValidity:()=>this.required&&!this.value?{flags:{valueMissing:!0},message:this.requiredMessage||"Please select an option."}:null,onReset:()=>{this.value=this._defaultValue},onRestore:e=>{this.value=e},onDisabled:e=>{this.disabled=e}}),this.nodes=[],this.value="",this.name="",this.required=!1,this.requiredMessage="",this.disabled=!1,this.allowGraft=!1,this.rootLabel="/",this.rootPath="/",this.rootSelectable=!0,this.label="",this.graftError=null,this.buildPath=H,this.normalizeGraftSegment=({raw:e})=>N(e),this.keepExpanded=!1,this.expandIcon="",this.collapseIcon="",this._itemsSlot=$(),this._graftInputRef=$(),this._graftDialogRef=$(),this._slottedIds=new WeakMap,this._nextSlottedId=0,this._model=[],this._rowIndex=new Map,this._pathIndex=new Map,this._slottedNodes=[],this._lazyLoaded=new Map,this._grafted=new Map,this._expanded=new Set,this._loading=new Set,this._generation=0,this._defaultValue="",this._pendingFocus=!1,this._pendingScrollId=null,this._pendingGraftFocus=!1,this._nextGraftId=0,this._typeBuffer="",this._typeTimer=null,this._activeId=null,this._selectedId=null,this._graftParentId=null,this._graftValue="",this._graftErrorInternal=null}willUpdate(e){super.willUpdate(e);const t=!this.hasUpdated||e.has("nodes")||e.has("rootLabel")||e.has("rootPath")||e.has("rootSelectable")||e.has("buildPath");t&&(this.hasUpdated&&this._generation++,this._rebuildModel(),this._reconcileState()),e.has("value")?this._reconcileSelectionFromValue():t&&this._reconcileSelectionFromModel(),e.has("value")&&this.hasUpdated&&this.formCtrl.syncValue(),(t||e.has("value"))&&this._revealSelectedValue()}firstUpdated(e){super.firstUpdated(e),this._defaultValue=this.value,this.childElementCount>0&&this._onSlotChange(),this.formCtrl.syncValueSilently()}updated(e){if(super.updated(e),this._pendingFocus&&this._activeId&&(this._pendingFocus=!1,this._rowEl(this._activeId)?.focus({preventScroll:!0})),this._pendingGraftFocus&&(this._pendingGraftFocus=!1,this._graftInputRef.value?.focus()),this._syncGuidePaths(),this._pendingScrollId){const t=this._pendingScrollId;this._pendingScrollId=null,this._scrollRowIntoView(t)}}formResetCallback(){this.formCtrl.handleFormReset()}formStateRestoreCallback(e){this.formCtrl.handleFormStateRestore(e)}formDisabledCallback(e){this.formCtrl.handleFormDisabled(e)}validate(){this.formCtrl.validate()}checkValidity(){return this.formCtrl.checkValidity()}focus(){if(this.disabled)return;const e=this._visibleRows(),t=this._currentActive(e);t&&this._rowEl(t)?.focus()}setGraftError(e){this.graftError=e&&e.length>0?e:null}_rebuildModel(){const e=this.nodes.length?this.nodes:this._slottedNodes,t=this.rootPath||"/",i={id:"__root",segment:"",label:this.rootLabel||t,selectable:this.rootSelectable,hasChildren:!0},s=new Set(e.map(l=>l.segment.toLowerCase())),o=(this._grafted.get(i.id)??[]).filter(l=>!s.has(l.segment.toLowerCase())),r=e===this._slottedNodes,a=[...this._buildChildren(e,t,2,!1,i,r),...this._buildChildren(o,t,2,!0,i,!0)];this._model=[{id:i.id,segment:i.segment,label:i.label??t,icon:"",selectable:this.rootSelectable,editable:!1,deletable:!1,movableUp:!1,movableDown:!1,cuttable:!1,pasteChildTarget:!1,path:t,parentPath:"",parentId:"",level:1,hasChildren:a.length>0,loaded:!0,ephemeral:!1,root:!0,actions:[],children:a}],this._expanded.add(i.id)}_build(e,t,i,s,o,r=!1){if(!this._isUsableNodeId(e.id,r))return null;const a=this._buildPath(t,e.segment,e,o),l=e.children??[],g=e.hasChildren??!1,b=this._lazyLoaded.has(e.id),_=b?this._lazyLoaded.get(e.id)??[]:[],m=new Set([...l,..._].map(f=>f.segment.toLowerCase())),w=(this._grafted.get(e.id)??[]).filter(f=>!m.has(f.segment.toLowerCase())),y=[...this._buildChildren(l,a,i+1,s,e,r),...this._buildChildren(_,a,i+1,s,e,!1),...this._buildChildren(w,a,i+1,!0,e,!0)],I=e.label||e.segment;return{id:e.id,segment:e.segment,data:e.data,label:I,icon:e.icon??"",selectable:e.selectable!==!1,editable:e.editable===!0,deletable:e.deletable===!0,movableUp:e.movableUp===!0,movableDown:e.movableDown===!0,cuttable:e.cuttable===!0,pasteChildTarget:e.pasteChildTarget===!0,path:a,parentPath:t,parentId:o?.id??"",level:i,hasChildren:g||y.length>0,loaded:!g||b,ephemeral:s,root:!1,actions:this._actionsFor(e,I),children:y}}_actionsFor(e,t){const i=[],s=(o,r,a)=>{o&&i.push({kind:r,label:a,accessibleLabel:`${a} ${t}`})};return s(e.editable===!0,"edit","Edit"),s(e.deletable===!0,"delete","Delete"),s(e.movableUp===!0,"move-up","Move up"),s(e.movableDown===!0,"move-down","Move down"),s(e.cuttable===!0,"cut","Cut"),e.pasteChildTarget===!0&&i.push({kind:"paste-child",label:"Paste as child",accessibleLabel:`Paste as child of ${t}`}),i}_buildChildren(e,t,i,s,o,r=!1){return e.flatMap(a=>{const l=this._build(a,t,i,s,o,r);return l?[l]:[]})}_isUsableNodeId(e,t){return e?!t&&this._isGeneratedId(e)?(console.warn(`esp-tree: reserved node id "${e}" ignored.`),!1):!0:(console.warn("esp-tree: node without a stable id ignored."),!1)}_isGeneratedId(e){return e==="__root"||e.startsWith("__slotted:")||e.startsWith("__graft:")}_reconcileState(){this._rowIndex.clear(),this._pathIndex.clear();const e=t=>{for(const i of t){if(this._rowIndex.has(i.id)){console.warn(`esp-tree: duplicate node id "${i.id}" ignored.`);continue}this._pathIndex.has(i.path)?console.warn(`esp-tree: duplicate path "${i.path}" for ids "${this._pathIndex.get(i.path).id}" and "${i.id}".`):this._pathIndex.set(i.path,i),this._rowIndex.set(i.id,i),e(i.children)}};e(this._model);for(const t of[...this._expanded])this._rowIndex.has(t)||this._expanded.delete(t);for(const t of[...this._lazyLoaded.keys()])this._rowIndex.has(t)||this._lazyLoaded.delete(t);for(const t of[...this._grafted.keys()])this._rowIndex.has(t)||this._grafted.delete(t);this._activeId&&!this._rowIndex.has(this._activeId)&&(this._activeId=null)}_revealSelectedValue(){if(!this.value&&!this._selectedId)return;let e=this._selectedId?this._rowIndex.get(this._selectedId):void 0;for(e??=this.value?this._pathIndex.get(this.value):void 0;e&&e.parentId;)this._expanded.add(e.parentId),e=this._rowIndex.get(e.parentId)}_reconcileSelectionFromValue(){if(this._selectedId){const e=this._findRowById(this._selectedId);if(e&&e.path===this.value)return}this._selectedId=this.value?this._findRow(this.value)?.id??null:null}_reconcileSelectionFromModel(){if(this._selectedId){const e=this._findRowById(this._selectedId);if(e){this.value!==e.path&&(this.value=e.path,this.hasUpdated&&this.formCtrl.syncValue(),this._emit("esp-tree-select",{path:e.path,node:this._toPublic(e)}));return}this._selectedId=null}this.value&&(this._selectedId=this._findRow(this.value)?.id??null)}_buildPath(e,t,i,s){return this.buildPath({parentPath:e,segment:t,node:i,parentNode:s,rootPath:this.rootPath||"/"})}_joinPath(e,t){const i=e?this._findRow(e):null;return this._buildPath(e,t,{id:t,segment:t,label:t},i?this._toPublic(i):null)}_findRow(e){return this._pathIndex.get(e)??null}_findRowById(e){return this._rowIndex.get(e)??null}_isIndexedRow(e){return this._rowIndex.get(e.id)===e}_visibleRows(){const e=[],t=i=>{for(const s of i)this._isIndexedRow(s)&&(e.push(s),s.children.length&&this._expanded.has(s.id)&&t(s.children))};return t(this._model),e}_currentActive(e){return this._activeId&&e.some(t=>t.id===this._activeId)?this._activeId:e[0]?.id??null}_rowEl(e){const t=globalThis.CSS?.escape?.(e)??e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return this.shadowRoot?.querySelector(`[data-id="${t}"]`)??null}_scrollRowIntoView(e){this._rowEl(e)?.scrollIntoView?.({block:"nearest",inline:"nearest"})}_toPublic(e){return{id:e.id,segment:e.segment,data:e.data,label:e.label,icon:e.icon||void 0,selectable:e.selectable,editable:e.editable,deletable:e.deletable,movableUp:e.movableUp,movableDown:e.movableDown,cuttable:e.cuttable,pasteChildTarget:e.pasteChildTarget,hasChildren:e.hasChildren}}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_setExpanded(e,t){t!==this._expanded.has(e.id)&&(t?(this._expanded.add(e.id),e.hasChildren&&!e.loaded&&this._ensureLoaded(e)):this._expanded.delete(e.id),this._emit("esp-tree-toggle",{path:e.path,node:this._toPublic(e),open:t}),this.requestUpdate())}_toggle(e){e.hasChildren&&this._setExpanded(e,!this._expanded.has(e.id))}async _ensureLoaded(e){if(e.loaded||!e.hasChildren||this._loading.has(e.id)||!this.loadChildren)return;const t=this._generation;this._loading.add(e.id),this.requestUpdate();try{const i=await this.loadChildren({id:e.id,segment:e.segment,data:e.data,label:e.label,path:e.path,level:e.level});if(t!==this._generation)return;this._lazyLoaded.set(e.id,i??[]),this._rebuildModel(),this._reconcileState(),this._reconcileSelectionFromModel(),this._pendingScrollId=e.id}catch{}finally{this._loading.delete(e.id),this.requestUpdate()}}_select(e){if(!e.selectable)return;e.hasChildren&&!this._expanded.has(e.id)&&this._setExpanded(e,!0);const t=this._isSelected(e)&&this.value===e.path;this._selectedId=e.id,!t&&(this.value=e.path,this._emit("esp-tree-select",{path:e.path,node:this._toPublic(e)}))}_containsRow(e,t){if(e.id===t.id)return!0;for(;t.parentId;){if(t.parentId===e.id)return!0;const i=this._findRowById(t.parentId);if(!i)break;t=i}return!1}_collapseSelectedBranchOutside(e){if(this.keepExpanded||!this.value&&!this._selectedId||this._isSelected(e))return;const t=this._selectedId?this._findRowById(this._selectedId):this.value?this._findRow(this.value):null;!t?.hasChildren||!this._expanded.has(t.id)||this._containsRow(t,e)||this._setExpanded(t,!1)}_isSelected(e){return this._selectedId===e.id}_setActiveId(e){this._activeId=e,this._pendingFocus=!0,this._pendingScrollId=e}_setActiveRow(e){this._setActiveId(e.id)}_activateAndSelect(e){this._setActiveRow(e),this._collapseSelectedBranchOutside(e),this._select(e),this.requestUpdate()}_onRowClick(e){if(this.disabled)return;if(this._isSelected(e)&&e.selectable&&e.hasChildren){this._setActiveRow(e),this._toggle(e),this.requestUpdate();return}this._activateAndSelect(e)}_onToggleClick(e,t){e.stopPropagation(),!(this.disabled||!t.hasChildren)&&(this._setActiveRow(t),this._toggle(t),this.requestUpdate())}_edit(e){e.editable&&this._emit(G.edit,{path:e.path,node:this._toPublic(e)})}_onActionEvent(e,t,i){e.stopPropagation(),!this.disabled&&(this._activeId=t.id,this._emit(G[i],{path:t.path,node:this._toPublic(t)}),this.requestUpdate())}_onActionMenuSelect(e,t){e.stopPropagation();const i=e.detail.value;t.actions.some(s=>s.kind===i)&&this._onActionEvent(e,t,i)}_stopRowActionEvent(e){e.stopPropagation()}_onRowActionsKeydown(e,t){e.stopPropagation(),!e.defaultPrevented&&(e.key!=="ArrowLeft"&&e.key!=="Escape"||(e.preventDefault(),this._closeRowActionMenus(),this._focusRow(t)))}_onKeydown(e){if(this.disabled)return;const t=e.target;if(t instanceof HTMLElement&&t.closest("button, input, textarea, select, a[href], esp-button, esp-action-menu, esp-action-menu-item, .node-actions"))return;const i=this._visibleRows();if(!i.length)return;const s=this._currentActive(i);let o=i.findIndex(a=>a.id===s);o<0&&(o=0);const r=i[o];if(r){if(e.key==="F10"&&e.shiftKey||e.key==="ContextMenu"){if(r.actions.length===0)return;e.preventDefault(),this._focusRowActions(r);return}switch(e.key){case"ArrowDown":e.preventDefault(),this._moveActive(i[Math.min(o+1,i.length-1)]);break;case"ArrowUp":e.preventDefault(),this._moveActive(i[Math.max(o-1,0)]);break;case"Home":e.preventDefault(),this._moveActive(i[0]);break;case"End":e.preventDefault(),this._moveActive(i[i.length-1]);break;case"ArrowRight":if(e.preventDefault(),r.hasChildren&&!this._expanded.has(r.id)){this._setActiveRow(r),this._setExpanded(r,!0);break}if(r.actions.length>0&&this._focusRowActionTrigger(r))break;if(r.hasChildren&&this._expanded.has(r.id)){const a=i[o+1];if(a&&a.parentId===r.id){this._moveActive(a);break}}break;case"ArrowLeft":if(e.preventDefault(),r.hasChildren&&this._expanded.has(r.id))this._setActiveRow(r),this._setExpanded(r,!1);else if(r.parentId){const a=i.find(l=>l.id===r.parentId);a&&this._moveActive(a)}break;case"Enter":case" ":e.preventDefault(),this._activateAndSelect(r);break;case"F2":if(!r.editable)break;e.preventDefault(),this._setActiveRow(r),this._edit(r),this.requestUpdate();break;case"Insert":if(!this.allowGraft)break;e.preventDefault(),this._openGraftForRow(r);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),this._typeahead(e.key,i,o));break}}}_moveActive(e){e&&(this._closeRowActionMenus(),this._setActiveRow(e),this.requestUpdate())}_focusRow(e){this._closeRowActionMenus(),this._activeId=e.id,this._rowEl(e.id)?.focus({preventScroll:!0}),this.requestUpdate()}_closeRowActionMenus(){this.shadowRoot?.querySelectorAll("esp-action-menu.node-action-menu").forEach(e=>e.closeMenu?.({restoreFocus:!1}))}async _focusRowActions(e){const i=this._rowEl(e.id)?.querySelector(".node-actions");if(!i)return;if(e.actions.length===1){i.querySelector("esp-button")?.focus({preventScroll:!0});return}const s=i.querySelector("esp-action-menu");if(!s)return;s.openMenu(),await s.updateComplete;const o=s;if(typeof o.focusFirstItem=="function"){o.focusFirstItem();return}s.querySelector("esp-action-menu-item:not([disabled])")?.focus()}_focusRowActionTrigger(e){const i=this._rowEl(e.id)?.querySelector(".node-actions esp-button");return i?(i.focus({preventScroll:!0}),!0):!1}_typeahead(e,t,i){this._typeTimer&&clearTimeout(this._typeTimer),this._typeBuffer+=e.toLowerCase(),this._typeTimer=setTimeout(()=>{this._typeBuffer="",this._typeTimer=null},U);const s=t.length;for(let o=1;o<=s;o++){const r=t[(i+o)%s];if(r&&r.label.toLowerCase().startsWith(this._typeBuffer)){this._moveActive(r);return}}}_onSlotChange(){const e=Array.from(this.children).filter(t=>t instanceof P);this._slottedNodes=e.map(t=>this._parseItem(t)),this._generation++,this._rebuildModel(),this._reconcileState(),this.requestUpdate()}_parseItem(e){const t=this._idForSlottedItem(e),i=e.getAttribute("segment")??e.segment??"",s=e.getAttribute("label")??e.label,o=e.getAttribute("icon")??e.icon,r=e.getAttribute("selectable"),a=r===null?e.selectable:r!=="false",l=e.hasAttribute("editable")||e.editable,g=e.hasAttribute("deletable")||e.deletable,b=e.hasAttribute("movable-up")||e.movableUp,_=e.hasAttribute("movable-down")||e.movableDown,m=e.hasAttribute("cuttable")||e.cuttable,w=e.hasAttribute("paste-child-target")||e.pasteChildTarget,y=e.hasAttribute("has-children")||e.hasChildren,I=Array.from(e.children).filter(x=>x instanceof P),f={id:t,segment:i,data:e.data,selectable:a,hasChildren:y};s&&(f.label=s),o&&(f.icon=o),l&&(f.editable=!0),g&&(f.deletable=!0),b&&(f.movableUp=!0),_&&(f.movableDown=!0),m&&(f.cuttable=!0),w&&(f.pasteChildTarget=!0);const C=I.map(x=>this._parseItem(x));return C.length&&(f.children=C),f}_idForSlottedItem(e){const t=this._slottedIds.get(e);if(t)return t;if(e.id&&!this._isGeneratedId(e.id))return this._slottedIds.set(e,e.id),e.id;e.id&&console.warn(`esp-tree: reserved slotted item id "${e.id}" ignored.`);const i=`__slotted:${++this._nextSlottedId}`;return this._slottedIds.set(e,i),i}_onGraftAddClick(e,t){e.stopPropagation(),!this.disabled&&this._openGraftForRow(t)}_openGraftForRow(e){if(this.disabled)return;const t=e??this._model[0]??null,i=this._rowPath(t);this._requestGraft(t,i)&&(t&&(this._setActiveRow(t),this._expanded.add(t.id)),this._openGraft(t?.id??"__root"))}_requestGraft(e,t){return this.dispatchEvent(new CustomEvent("esp-tree-graft-request",{detail:{parentPath:t,parentNode:e?this._toPublic(e):null},bubbles:!0,composed:!0,cancelable:!0}))}_openGraft(e){this._graftParentId=e,this._graftValue="",this._graftErrorInternal=null,this.graftError=null,this._pendingGraftFocus=!0,this.requestUpdate(),this.updateComplete.then(()=>{if(this._graftParentId!==e)return;const t=this._graftDialogRef.value;t&&!t.hasAttribute("is-open")&&t.toggleOpen()})}_cancelGraft(){this._closeGraftDialog(),this._resetGraftState()}_closeGraftDialog(){const e=this._graftDialogRef.value;e?.hasAttribute("is-open")&&e.toggleOpen()}_resetGraftState(){this._graftParentId=null,this._graftValue="",this._graftErrorInternal=null,this.graftError=null}_onGraftDialogClosed(){this._resetGraftState()}_onGraftInput(e){const t=e.detail??e.target.value;this._graftValue=t;const i=this._graftParentPath(),s=this._normalizeGraft(t,i),{valid:o,reason:r}=this._validateSegment(i,s);this._graftErrorInternal=null,this._emit("esp-tree-graft-input",{parentPath:i,raw:t,segment:s,path:this._joinPath(i,s),valid:o,reason:r})}_onGraftKeydown(e){if(e.stopPropagation(),e.key==="Enter")e.preventDefault(),this._commitGraft();else if(e.key==="Escape"){e.preventDefault();const t=this._graftParentId;this._cancelGraft(),t&&this._moveActive(this._findRowById(t)??void 0)}}_commitGraft(){if(this.disabled)return;const e=this._graftParentRow(),t=e?.id??"__root",i=this._rowPath(e),s=this._normalizeGraft(this._graftValue,i),{valid:o,reason:r}=this._validateSegment(i,s);if(!o){this._graftErrorInternal=r==="duplicate"?B:q;return}if(this.graftError)return;const a=this._joinPath(i,s),l={id:`__graft:${++this._nextGraftId}`,segment:s,label:s,selectable:!0},g=this._grafted.get(t)??[];g.push(l),this._grafted.set(t,g),this._rebuildModel(),this._reconcileState(),e&&this._expanded.add(e.id),this._closeGraftDialog(),this._resetGraftState(),this.value=a,this._selectedId=l.id,this._setActiveId(l.id);const b=this._findRowById(l.id),_=b?this._toPublic(b):l;this._emit("esp-tree-graft",{parentPath:i,segment:s,path:a,node:_}),this._emit("esp-tree-select",{path:a,node:_}),this.requestUpdate()}_validateSegment(e,t){return t?this._siblingSegments(e).has(t.toLowerCase())?{valid:!1,reason:"duplicate"}:{valid:!0,reason:""}:{valid:!1,reason:"empty"}}_siblingSegments(e){const t=e?this._findRow(e)?.children??[]:this._model;return new Set(t.map(i=>i.segment.toLowerCase()))}_normalizeGraft(e,t){return this.normalizeGraftSegment({raw:e,parentPath:t})}_graftParentPath(){return this._rowPath(this._graftParentRow())}_graftParentRow(){return this._graftParentId?this._findRowById(this._graftParentId)??this._model[0]??null:this._model[0]??null}_rowPath(e){return e?.path??(this.rootPath||"/")}render(){const e=this._visibleRows(),t=this._currentActive(e);return p`
47
+ ${C(N[c])}
48
+ </span>`}function H(c){return c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function j({parentPath:c,segment:e,rootPath:t}){return e?!c||c===t?t.endsWith("/")?`${t}${e}`:`${t}/${e}`:c.endsWith("/")?`${c}${e}`:`${c}/${e}`:c||t}let n=class extends z{constructor(){super(...arguments),this.internals=this.attachInternals(),this.formCtrl=new F({host:this,internals:this.internals,getFormValue:()=>this.value?this.value:null,getValidity:()=>this.required&&!this.value?{flags:{valueMissing:!0},message:this.requiredMessage||"Please select an option."}:null,onReset:()=>{this.value=this._defaultValue},onRestore:e=>{this.value=e},onDisabled:e=>{this.disabled=e}}),this.nodes=[],this.value="",this.name="",this.required=!1,this.requiredMessage="",this.disabled=!1,this.allowGraft=!1,this.rootLabel="/",this.rootPath="/",this.rootSelectable=!0,this.label="",this.graftError=null,this.buildPath=j,this.normalizeGraftSegment=({raw:e})=>H(e),this.keepExpanded=!1,this.expandIcon="",this.collapseIcon="",this._itemsSlot=$(),this._graftInputRef=$(),this._graftDialogRef=$(),this._slottedIds=new WeakMap,this._nextSlottedId=0,this._model=[],this._rowIndex=new Map,this._pathIndex=new Map,this._slottedNodes=[],this._lazyLoaded=new Map,this._grafted=new Map,this._expanded=new Set,this._loading=new Set,this._generation=0,this._defaultValue="",this._pendingFocus=!1,this._pendingScrollId=null,this._pendingGraftFocus=!1,this._nextGraftId=0,this._typeBuffer="",this._typeTimer=null,this._activeId=null,this._selectedId=null,this._graftParentId=null,this._graftValue="",this._graftErrorInternal=null}willUpdate(e){super.willUpdate(e);const t=!this.hasUpdated||e.has("nodes")||e.has("rootLabel")||e.has("rootPath")||e.has("rootSelectable")||e.has("buildPath");t&&(this.hasUpdated&&this._generation++,this._rebuildModel(),this._reconcileState()),e.has("value")?this._reconcileSelectionFromValue():t&&this._reconcileSelectionFromModel(),e.has("value")&&this.hasUpdated&&this.formCtrl.syncValue(),(t||e.has("value"))&&this._revealSelectedValue()}firstUpdated(e){super.firstUpdated(e),this._defaultValue=this.value,this.childElementCount>0&&this._onSlotChange(),this.formCtrl.syncValueSilently()}updated(e){if(super.updated(e),this._pendingFocus&&this._activeId&&(this._pendingFocus=!1,this._rowEl(this._activeId)?.focus({preventScroll:!0})),this._pendingGraftFocus&&(this._pendingGraftFocus=!1,this._graftInputRef.value?.focus()),this._syncGuidePaths(),this._pendingScrollId){const t=this._pendingScrollId;this._pendingScrollId=null,this._scrollRowIntoView(t)}}formResetCallback(){this.formCtrl.handleFormReset()}formStateRestoreCallback(e){this.formCtrl.handleFormStateRestore(e)}formDisabledCallback(e){this.formCtrl.handleFormDisabled(e)}validate(){this.formCtrl.validate()}checkValidity(){return this.formCtrl.checkValidity()}focus(){if(this.disabled)return;const e=this._visibleRows(),t=this._currentActive(e);t&&this._rowEl(t)?.focus()}setGraftError(e){this.graftError=e&&e.length>0?e:null}_rebuildModel(){const e=this.nodes.length?this.nodes:this._slottedNodes,t=this.rootPath||"/",i={id:"__root",segment:"",label:this.rootLabel||t,selectable:this.rootSelectable,hasChildren:!0},s=new Set(e.map(l=>l.segment.toLowerCase())),o=(this._grafted.get(i.id)??[]).filter(l=>!s.has(l.segment.toLowerCase())),r=e===this._slottedNodes,a=[...this._buildChildren(e,t,2,!1,i,r),...this._buildChildren(o,t,2,!0,i,!0)];this._model=[{id:i.id,segment:i.segment,label:i.label??t,icon:"",selectable:this.rootSelectable,editable:!1,deletable:!1,movableUp:!1,movableDown:!1,cuttable:!1,pasteChildTarget:!1,path:t,parentPath:"",parentId:"",level:1,hasChildren:a.length>0,loaded:!0,ephemeral:!1,root:!0,actions:[],children:a}],this._expanded.add(i.id)}_build(e,t,i,s,o,r=!1){if(!this._isUsableNodeId(e.id,r))return null;const a=this._buildPath(t,e.segment,e,o),l=e.children??[],g=e.hasChildren??!1,v=this._lazyLoaded.has(e.id),b=v?this._lazyLoaded.get(e.id)??[]:[],w=new Set([...l,...b].map(f=>f.segment.toLowerCase())),y=(this._grafted.get(e.id)??[]).filter(f=>!w.has(f.segment.toLowerCase())),I=[...this._buildChildren(l,a,i+1,s,e,r),...this._buildChildren(b,a,i+1,s,e,!1),...this._buildChildren(y,a,i+1,!0,e,!0)],k=e.label||e.segment;return{id:e.id,segment:e.segment,data:e.data,label:k,icon:e.icon??"",selectable:e.selectable!==!1,editable:e.editable===!0,deletable:e.deletable===!0,movableUp:e.movableUp===!0,movableDown:e.movableDown===!0,cuttable:e.cuttable===!0,pasteChildTarget:e.pasteChildTarget===!0,path:a,parentPath:t,parentId:o?.id??"",level:i,hasChildren:g||I.length>0,loaded:!g||v,ephemeral:s,root:!1,actions:this._actionsFor(e,k),children:I}}_actionsFor(e,t){const i=[],s=(o,r,a)=>{o&&i.push({kind:r,label:a,accessibleLabel:`${a} ${t}`})};return s(e.editable===!0,"edit","Edit"),s(e.deletable===!0,"delete","Delete"),s(e.movableUp===!0,"move-up","Move up"),s(e.movableDown===!0,"move-down","Move down"),s(e.cuttable===!0,"cut","Cut"),e.pasteChildTarget===!0&&i.push({kind:"paste-child",label:"Paste as child",accessibleLabel:`Paste as child of ${t}`}),i}_buildChildren(e,t,i,s,o,r=!1){return e.flatMap(a=>{const l=this._build(a,t,i,s,o,r);return l?[l]:[]})}_isUsableNodeId(e,t){return e?!t&&this._isGeneratedId(e)?(console.warn(`esp-tree: reserved node id "${e}" ignored.`),!1):!0:(console.warn("esp-tree: node without a stable id ignored."),!1)}_isGeneratedId(e){return e==="__root"||e.startsWith("__slotted:")||e.startsWith("__graft:")}_reconcileState(){this._rowIndex.clear(),this._pathIndex.clear();const e=t=>{for(const i of t){if(this._rowIndex.has(i.id)){console.warn(`esp-tree: duplicate node id "${i.id}" ignored.`);continue}this._pathIndex.has(i.path)?console.warn(`esp-tree: duplicate path "${i.path}" for ids "${this._pathIndex.get(i.path).id}" and "${i.id}".`):this._pathIndex.set(i.path,i),this._rowIndex.set(i.id,i),e(i.children)}};e(this._model);for(const t of[...this._expanded])this._rowIndex.has(t)||this._expanded.delete(t);for(const t of[...this._lazyLoaded.keys()])this._rowIndex.has(t)||this._lazyLoaded.delete(t);for(const t of[...this._grafted.keys()])this._rowIndex.has(t)||this._grafted.delete(t);this._activeId&&!this._rowIndex.has(this._activeId)&&(this._activeId=null)}_revealSelectedValue(){if(!this.value&&!this._selectedId)return;let e=this._selectedId?this._rowIndex.get(this._selectedId):void 0;for(e??=this.value?this._pathIndex.get(this.value):void 0;e&&e.parentId;)this._expanded.add(e.parentId),e=this._rowIndex.get(e.parentId)}_reconcileSelectionFromValue(){if(this._selectedId){const e=this._findRowById(this._selectedId);if(e&&e.path===this.value)return}this._selectedId=this.value?this._findRow(this.value)?.id??null:null}_reconcileSelectionFromModel(){if(this._selectedId){const e=this._findRowById(this._selectedId);if(e){this.value!==e.path&&(this.value=e.path,this.hasUpdated&&this.formCtrl.syncValue(),this._emit(_.TREE_SELECT,{path:e.path,node:this._toPublic(e)}));return}this._selectedId=null}this.value&&(this._selectedId=this._findRow(this.value)?.id??null)}_buildPath(e,t,i,s){return this.buildPath({parentPath:e,segment:t,node:i,parentNode:s,rootPath:this.rootPath||"/"})}_joinPath(e,t){const i=e?this._findRow(e):null;return this._buildPath(e,t,{id:t,segment:t,label:t},i?this._toPublic(i):null)}_findRow(e){return this._pathIndex.get(e)??null}_findRowById(e){return this._rowIndex.get(e)??null}_isIndexedRow(e){return this._rowIndex.get(e.id)===e}_visibleRows(){const e=[],t=i=>{for(const s of i)this._isIndexedRow(s)&&(e.push(s),s.children.length&&this._expanded.has(s.id)&&t(s.children))};return t(this._model),e}_currentActive(e){return this._activeId&&e.some(t=>t.id===this._activeId)?this._activeId:e[0]?.id??null}_rowEl(e){const t=globalThis.CSS?.escape?.(e)??e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return this.shadowRoot?.querySelector(`[data-id="${t}"]`)??null}_scrollRowIntoView(e){this._rowEl(e)?.scrollIntoView?.({block:"nearest",inline:"nearest"})}_toPublic(e){return{id:e.id,segment:e.segment,data:e.data,label:e.label,icon:e.icon||void 0,selectable:e.selectable,editable:e.editable,deletable:e.deletable,movableUp:e.movableUp,movableDown:e.movableDown,cuttable:e.cuttable,pasteChildTarget:e.pasteChildTarget,hasChildren:e.hasChildren}}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_setExpanded(e,t){t!==this._expanded.has(e.id)&&(t?(this._expanded.add(e.id),e.hasChildren&&!e.loaded&&this._ensureLoaded(e)):this._expanded.delete(e.id),this._emit(_.TREE_TOGGLE,{path:e.path,node:this._toPublic(e),open:t}),this.requestUpdate())}_toggle(e){e.hasChildren&&this._setExpanded(e,!this._expanded.has(e.id))}async _ensureLoaded(e){if(e.loaded||!e.hasChildren||this._loading.has(e.id)||!this.loadChildren)return;const t=this._generation;this._loading.add(e.id),this.requestUpdate();try{const i=await this.loadChildren({id:e.id,segment:e.segment,data:e.data,label:e.label,path:e.path,level:e.level});if(t!==this._generation)return;this._lazyLoaded.set(e.id,i??[]),this._rebuildModel(),this._reconcileState(),this._reconcileSelectionFromModel(),this._pendingScrollId=e.id}catch{}finally{this._loading.delete(e.id),this.requestUpdate()}}_select(e){if(!e.selectable)return;e.hasChildren&&!this._expanded.has(e.id)&&this._setExpanded(e,!0);const t=this._isSelected(e)&&this.value===e.path;this._selectedId=e.id,!t&&(this.value=e.path,this._emit(_.TREE_SELECT,{path:e.path,node:this._toPublic(e)}))}_containsRow(e,t){if(e.id===t.id)return!0;for(;t.parentId;){if(t.parentId===e.id)return!0;const i=this._findRowById(t.parentId);if(!i)break;t=i}return!1}_collapseSelectedBranchOutside(e){if(this.keepExpanded||!this.value&&!this._selectedId||this._isSelected(e))return;const t=this._selectedId?this._findRowById(this._selectedId):this.value?this._findRow(this.value):null;!t?.hasChildren||!this._expanded.has(t.id)||this._containsRow(t,e)||this._setExpanded(t,!1)}_isSelected(e){return this._selectedId===e.id}_setActiveId(e){this._activeId=e,this._pendingFocus=!0,this._pendingScrollId=e}_setActiveRow(e){this._setActiveId(e.id)}_activateAndSelect(e){this._setActiveRow(e),this._collapseSelectedBranchOutside(e),this._select(e),this.requestUpdate()}_onRowClick(e){if(this.disabled)return;if(this._isSelected(e)&&e.selectable&&e.hasChildren){this._setActiveRow(e),this._toggle(e),this.requestUpdate();return}this._activateAndSelect(e)}_onToggleClick(e,t){e.stopPropagation(),!(this.disabled||!t.hasChildren)&&(this._setActiveRow(t),this._toggle(t),this.requestUpdate())}_edit(e){e.editable&&this._emit(T.edit,{path:e.path,node:this._toPublic(e)})}_onActionEvent(e,t,i){e.stopPropagation(),!this.disabled&&(this._activeId=t.id,this._emit(T[i],{path:t.path,node:this._toPublic(t)}),this.requestUpdate())}_onActionMenuSelect(e,t){e.stopPropagation();const i=e.detail.value;t.actions.some(s=>s.kind===i)&&this._onActionEvent(e,t,i)}_stopRowActionEvent(e){e.stopPropagation()}_onRowActionsKeydown(e,t){e.stopPropagation(),!e.defaultPrevented&&(e.key!=="ArrowLeft"&&e.key!=="Escape"||(e.preventDefault(),this._closeRowActionMenus(),this._focusRow(t)))}_onKeydown(e){if(this.disabled)return;const t=e.target;if(t instanceof HTMLElement&&t.closest("button, input, textarea, select, a[href], esp-button, esp-action-menu, esp-action-menu-item, .node-actions"))return;const i=this._visibleRows();if(!i.length)return;const s=this._currentActive(i);let o=i.findIndex(a=>a.id===s);o<0&&(o=0);const r=i[o];if(r){if(e.key==="F10"&&e.shiftKey||e.key==="ContextMenu"){if(r.actions.length===0)return;e.preventDefault(),this._focusRowActions(r);return}switch(e.key){case"ArrowDown":e.preventDefault(),this._moveActive(i[Math.min(o+1,i.length-1)]);break;case"ArrowUp":e.preventDefault(),this._moveActive(i[Math.max(o-1,0)]);break;case"Home":e.preventDefault(),this._moveActive(i[0]);break;case"End":e.preventDefault(),this._moveActive(i[i.length-1]);break;case"ArrowRight":if(e.preventDefault(),r.hasChildren&&!this._expanded.has(r.id)){this._setActiveRow(r),this._setExpanded(r,!0);break}if(r.actions.length>0&&this._focusRowActionTrigger(r))break;if(r.hasChildren&&this._expanded.has(r.id)){const a=i[o+1];if(a&&a.parentId===r.id){this._moveActive(a);break}}break;case"ArrowLeft":if(e.preventDefault(),r.hasChildren&&this._expanded.has(r.id))this._setActiveRow(r),this._setExpanded(r,!1);else if(r.parentId){const a=i.find(l=>l.id===r.parentId);a&&this._moveActive(a)}break;case"Enter":case" ":e.preventDefault(),this._activateAndSelect(r);break;case"F2":if(!r.editable)break;e.preventDefault(),this._setActiveRow(r),this._edit(r),this.requestUpdate();break;case"Insert":if(!this.allowGraft)break;e.preventDefault(),this._openGraftForRow(r);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),this._typeahead(e.key,i,o));break}}}_moveActive(e){e&&(this._closeRowActionMenus(),this._setActiveRow(e),this.requestUpdate())}_focusRow(e){this._closeRowActionMenus(),this._activeId=e.id,this._rowEl(e.id)?.focus({preventScroll:!0}),this.requestUpdate()}_closeRowActionMenus(){this.shadowRoot?.querySelectorAll("esp-action-menu.node-action-menu").forEach(e=>e.closeMenu?.({restoreFocus:!1}))}async _focusRowActions(e){const i=this._rowEl(e.id)?.querySelector(".node-actions");if(!i)return;if(e.actions.length===1){i.querySelector("esp-button")?.focus({preventScroll:!0});return}const s=i.querySelector("esp-action-menu");if(!s)return;s.openMenu(),await s.updateComplete;const o=s;if(typeof o.focusFirstItem=="function"){o.focusFirstItem();return}s.querySelector("esp-action-menu-item:not([disabled])")?.focus()}_focusRowActionTrigger(e){const i=this._rowEl(e.id)?.querySelector(".node-actions esp-button");return i?(i.focus({preventScroll:!0}),!0):!1}_typeahead(e,t,i){this._typeTimer&&clearTimeout(this._typeTimer),this._typeBuffer+=e.toLowerCase(),this._typeTimer=setTimeout(()=>{this._typeBuffer="",this._typeTimer=null},V);const s=t.length;for(let o=1;o<=s;o++){const r=t[(i+o)%s];if(r&&r.label.toLowerCase().startsWith(this._typeBuffer)){this._moveActive(r);return}}}_onSlotChange(){const e=Array.from(this.children).filter(t=>t instanceof P);this._slottedNodes=e.map(t=>this._parseItem(t)),this._generation++,this._rebuildModel(),this._reconcileState(),this.requestUpdate()}_parseItem(e){const t=this._idForSlottedItem(e),i=e.getAttribute("segment")??e.segment??"",s=e.getAttribute("label")??e.label,o=e.getAttribute("icon")??e.icon,r=e.getAttribute("selectable"),a=r===null?e.selectable:r!=="false",l=e.hasAttribute("editable")||e.editable,g=e.hasAttribute("deletable")||e.deletable,v=e.hasAttribute("movable-up")||e.movableUp,b=e.hasAttribute("movable-down")||e.movableDown,w=e.hasAttribute("cuttable")||e.cuttable,y=e.hasAttribute("paste-child-target")||e.pasteChildTarget,I=e.hasAttribute("has-children")||e.hasChildren,k=Array.from(e.children).filter(E=>E instanceof P),f={id:t,segment:i,data:e.data,selectable:a,hasChildren:I};s&&(f.label=s),o&&(f.icon=o),l&&(f.editable=!0),g&&(f.deletable=!0),v&&(f.movableUp=!0),b&&(f.movableDown=!0),w&&(f.cuttable=!0),y&&(f.pasteChildTarget=!0);const A=k.map(E=>this._parseItem(E));return A.length&&(f.children=A),f}_idForSlottedItem(e){const t=this._slottedIds.get(e);if(t)return t;if(e.id&&!this._isGeneratedId(e.id))return this._slottedIds.set(e,e.id),e.id;e.id&&console.warn(`esp-tree: reserved slotted item id "${e.id}" ignored.`);const i=`__slotted:${++this._nextSlottedId}`;return this._slottedIds.set(e,i),i}_onGraftAddClick(e,t){e.stopPropagation(),!this.disabled&&this._openGraftForRow(t)}_openGraftForRow(e){if(this.disabled)return;const t=e??this._model[0]??null,i=this._rowPath(t);this._requestGraft(t,i)&&(t&&(this._setActiveRow(t),this._expanded.add(t.id)),this._openGraft(t?.id??"__root"))}_requestGraft(e,t){return this.dispatchEvent(new CustomEvent(_.TREE_GRAFT_REQUEST,{detail:{parentPath:t,parentNode:e?this._toPublic(e):null},bubbles:!0,composed:!0,cancelable:!0}))}_openGraft(e){this._graftParentId=e,this._graftValue="",this._graftErrorInternal=null,this.graftError=null,this._pendingGraftFocus=!0,this.requestUpdate(),this.updateComplete.then(()=>{if(this._graftParentId!==e)return;const t=this._graftDialogRef.value;t&&!t.hasAttribute("is-open")&&t.toggleOpen()})}_cancelGraft(){this._closeGraftDialog(),this._resetGraftState()}_closeGraftDialog(){const e=this._graftDialogRef.value;e?.hasAttribute("is-open")&&e.toggleOpen()}_resetGraftState(){this._graftParentId=null,this._graftValue="",this._graftErrorInternal=null,this.graftError=null}_onGraftDialogClosed(){this._resetGraftState()}_onGraftInput(e){const t=e.detail??e.target.value;this._graftValue=t;const i=this._graftParentPath(),s=this._normalizeGraft(t,i),{valid:o,reason:r}=this._validateSegment(i,s);this._graftErrorInternal=null,this._emit(_.TREE_GRAFT_INPUT,{parentPath:i,raw:t,segment:s,path:this._joinPath(i,s),valid:o,reason:r})}_onGraftKeydown(e){if(e.stopPropagation(),e.key==="Enter")e.preventDefault(),this._commitGraft();else if(e.key==="Escape"){e.preventDefault();const t=this._graftParentId;this._cancelGraft(),t&&this._moveActive(this._findRowById(t)??void 0)}}_commitGraft(){if(this.disabled)return;const e=this._graftParentRow(),t=e?.id??"__root",i=this._rowPath(e),s=this._normalizeGraft(this._graftValue,i),{valid:o,reason:r}=this._validateSegment(i,s);if(!o){this._graftErrorInternal=r==="duplicate"?B:q;return}if(this.graftError)return;const a=this._joinPath(i,s),l={id:`__graft:${++this._nextGraftId}`,segment:s,label:s,selectable:!0},g=this._grafted.get(t)??[];g.push(l),this._grafted.set(t,g),this._rebuildModel(),this._reconcileState(),e&&this._expanded.add(e.id),this._closeGraftDialog(),this._resetGraftState(),this.value=a,this._selectedId=l.id,this._setActiveId(l.id);const v=this._findRowById(l.id),b=v?this._toPublic(v):l;this._emit(_.TREE_GRAFT,{parentPath:i,segment:s,path:a,node:b}),this._emit(_.TREE_SELECT,{path:a,node:b}),this.requestUpdate()}_validateSegment(e,t){return t?this._siblingSegments(e).has(t.toLowerCase())?{valid:!1,reason:"duplicate"}:{valid:!0,reason:""}:{valid:!1,reason:"empty"}}_siblingSegments(e){const t=e?this._findRow(e)?.children??[]:this._model;return new Set(t.map(i=>i.segment.toLowerCase()))}_normalizeGraft(e,t){return this.normalizeGraftSegment({raw:e,parentPath:t})}_graftParentPath(){return this._rowPath(this._graftParentRow())}_graftParentRow(){return this._graftParentId?this._findRowById(this._graftParentId)??this._model[0]??null:this._model[0]??null}_rowPath(e){return e?.path??(this.rootPath||"/")}render(){const e=this._visibleRows(),t=this._currentActive(e);return p`
49
49
  <div
50
50
  class="tree"
51
51
  role="tree"
@@ -57,7 +57,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
57
57
  </div>
58
58
  ${this.allowGraft?this._renderGraftDialog():u}
59
59
  <slot ${S(this._itemsSlot)} @slotchange=${this._onSlotChange} hidden></slot>
60
- `}_renderGeneratedIcon(e,t){const i=M(e,this);return i?E(i,{class:t}):u}_renderToggleIcon(e){return e?R(e):L}_renderBranchGuide(){return p`
60
+ `}_renderGeneratedIcon(e,t){const i=M(e,this);return i?G(i,{class:t}):u}_renderToggleIcon(e){return e?C(e):U}_renderBranchGuide(){return p`
61
61
  <svg
62
62
  class="branch-guide"
63
63
  viewBox="0 0 24 1"
@@ -67,13 +67,13 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
67
67
  >
68
68
  <path></path>
69
69
  </svg>
70
- `}_syncGuidePaths(){const e=this.shadowRoot;if(e)for(const t of e.querySelectorAll(".children"))this._syncGuidePath(t)}_syncGuidePath(e){const t=Array.from(e.children).find(g=>g.classList.contains("branch-guide")),i=t?.querySelector("path");if(!t||!i)return;const s=e.getBoundingClientRect(),o=Number.parseFloat(getComputedStyle(e).paddingInlineStart)||24,r=[];let a=o;for(const g of Array.from(e.children)){if(g.classList.contains("branch-guide"))continue;const b=this._guideTargetFor(g);if(!b)continue;const _=b.getBoundingClientRect(),m=_.left-s.left;Number.isFinite(m)&&m>0&&(a=m);const w=_.top-s.top+_.height/2;Number.isFinite(w)&&r.push(w)}const l=Math.max(s.height,r[r.length-1]??0,1);if(t.setAttribute("viewBox",`0 0 ${this._round(a)} ${this._round(l)}`),!r.length){i.removeAttribute("d");return}i.setAttribute("d",this._guidePath(r,a))}_guideTargetFor(e){return e.classList.contains("treeitem")?Array.from(e.children).find(i=>i.classList.contains("row-shell"))?.querySelector(".row")??null:e.classList.contains("graft-insert")?e.querySelector(".graft-add"):null}_guidePath(e,t){const i=this._round(Math.max(t,1)),s=this._round(e[e.length-1]??0),o=this._round(Math.max(0,Math.min(6,i/2,s))),r=["M 0 0"];for(const a of e.slice(0,-1)){const l=this._round(a);r.push(`V ${l}`,`H ${i}`,"H 0")}return o>0&&s>o?r.push(`V ${this._round(s-o)}`,`Q 0 ${s} ${o} ${s}`,`H ${i}`):r.push(`V ${s}`,`H ${i}`),r.join(" ")}_round(e){return Math.round(e*100)/100}_renderToggleAction(e,t){if(!e.hasChildren)return p`<span
71
- class=${v({"icon-action":!0,"toggle-action":!0,placeholder:!0})}
70
+ `}_syncGuidePaths(){const e=this.shadowRoot;if(e)for(const t of e.querySelectorAll(".children"))this._syncGuidePath(t)}_syncGuidePath(e){const t=Array.from(e.children).find(g=>g.classList.contains("branch-guide")),i=t?.querySelector("path");if(!t||!i)return;const s=e.getBoundingClientRect(),o=Number.parseFloat(getComputedStyle(e).paddingInlineStart)||24,r=[];let a=o;for(const g of Array.from(e.children)){if(g.classList.contains("branch-guide"))continue;const v=this._guideTargetFor(g);if(!v)continue;const b=v.getBoundingClientRect(),w=b.left-s.left;Number.isFinite(w)&&w>0&&(a=w);const y=b.top-s.top+b.height/2;Number.isFinite(y)&&r.push(y)}const l=Math.max(s.height,r[r.length-1]??0,1);if(t.setAttribute("viewBox",`0 0 ${this._round(a)} ${this._round(l)}`),!r.length){i.removeAttribute("d");return}i.setAttribute("d",this._guidePath(r,a))}_guideTargetFor(e){return e.classList.contains("treeitem")?Array.from(e.children).find(i=>i.classList.contains("row-shell"))?.querySelector(".row")??null:e.classList.contains("graft-insert")?e.querySelector(".graft-add"):null}_guidePath(e,t){const i=this._round(Math.max(t,1)),s=this._round(e[e.length-1]??0),o=this._round(Math.max(0,Math.min(6,i/2,s))),r=["M 0 0"];for(const a of e.slice(0,-1)){const l=this._round(a);r.push(`V ${l}`,`H ${i}`,"H 0")}return o>0&&s>o?r.push(`V ${this._round(s-o)}`,`Q 0 ${s} ${o} ${s}`,`H ${i}`):r.push(`V ${s}`,`H ${i}`),r.join(" ")}_round(e){return Math.round(e*100)/100}_renderToggleAction(e,t){if(!e.hasChildren)return p`<span
71
+ class=${m({"icon-action":!0,"toggle-action":!0,placeholder:!0})}
72
72
  aria-hidden="true"
73
73
  ></span>`;const i=t?`Collapse ${e.label}`:`Expand ${e.label}`,s=t&&this.collapseIcon?this.collapseIcon:this.expandIcon;return p`
74
74
  <button
75
75
  type="button"
76
- class=${v({"icon-action":!0,"toggle-action":!0,open:t&&!this.collapseIcon})}
76
+ class=${m({"icon-action":!0,"toggle-action":!0,open:t&&!this.collapseIcon})}
77
77
  aria-label=${i}
78
78
  title=${i}
79
79
  aria-expanded=${String(t)}
@@ -85,24 +85,24 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
85
85
  </button>
86
86
  `}_renderNodeTools(e){const t=M(e.icon,this),i=t.length>0;return i?p`
87
87
  <span
88
- class=${v({"node-tools":!0,"has-icon":i})}
88
+ class=${m({"node-tools":!0,"has-icon":i})}
89
89
  >
90
90
  <span class="node-icon" aria-hidden="true">
91
- ${E(t,{"aria-hidden":null})}
91
+ ${G(t,{"aria-hidden":null})}
92
92
  </span>
93
93
  </span>
94
94
  `:u}_renderNodeActions(e){const t=e.actions;return t.length===0?u:p`
95
95
  <span
96
96
  class="node-actions"
97
97
  @click=${this._stopRowActionEvent}
98
- @clicked=${this._stopRowActionEvent}
98
+ @esp-clicked=${this._stopRowActionEvent}
99
99
  @keydown=${i=>this._onRowActionsKeydown(i,e)}
100
100
  >
101
101
  ${t.length===1?this._renderSingleNodeAction(e,t[0]):this._renderNodeActionMenu(e,t)}
102
102
  </span>
103
103
  `}_renderSingleNodeAction(e,t){return p`
104
104
  <esp-button
105
- class=${v({"node-action-button":!0,[`${t.kind}-action`]:!0})}
105
+ class=${m({"node-action-button":!0,[`${t.kind}-action`]:!0})}
106
106
  icon-only
107
107
  collapsed
108
108
  label=${t.accessibleLabel}
@@ -111,9 +111,9 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
111
111
  tabindex="-1"
112
112
  incognito
113
113
  ?disabled=${this.disabled}
114
- @clicked=${i=>this._onActionEvent(i,e,t.kind)}
114
+ @esp-clicked=${i=>this._onActionEvent(i,e,t.kind)}
115
115
  >
116
- ${A(t.kind)}
116
+ ${R(t.kind)}
117
117
  </esp-button>
118
118
  `}_renderNodeActionMenu(e,t){const i=`Actions for ${e.label}`;return p`
119
119
  <esp-action-menu
@@ -121,7 +121,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
121
121
  placement="bottom-end"
122
122
  icon-position="right"
123
123
  ?disabled=${this.disabled}
124
- @select=${s=>this._onActionMenuSelect(s,e)}
124
+ @esp-action-menu-select=${s=>this._onActionMenuSelect(s,e)}
125
125
  >
126
126
  <esp-button
127
127
  slot="trigger"
@@ -135,11 +135,11 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
135
135
  tabindex="-1"
136
136
  ?disabled=${this.disabled}
137
137
  >
138
- ${A("menu")}
138
+ ${R("menu")}
139
139
  </esp-button>
140
140
  ${t.map(s=>p`
141
141
  <esp-action-menu-item value=${s.kind}>
142
- ${A(s.kind,"icon")} ${s.label}
142
+ ${R(s.kind,"icon")} ${s.label}
143
143
  </esp-action-menu-item>
144
144
  `)}
145
145
  </esp-action-menu>
@@ -157,7 +157,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
157
157
  tabindex=${this.disabled?-1:o?0:-1}
158
158
  >
159
159
  <div class="row-shell">
160
- <div class=${v(a)} @click=${()=>this._onRowClick(e)}>
160
+ <div class=${m(a)} @click=${()=>this._onRowClick(e)}>
161
161
  ${this._renderToggleAction(e,i)} ${this._renderNodeTools(e)}
162
162
  <span class="node-label">${e.label}</span>
163
163
  ${r?p`<span class="loading" aria-hidden="true"></span>`:u}
@@ -168,7 +168,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
168
168
  </div>
169
169
  `}_renderChildGroup(e,t){const i=this._expanded.has(e.id),s=i&&e.children.length>0,o=this.allowGraft&&(i||!e.hasChildren);return!s&&!o?u:p`
170
170
  <div
171
- class=${v({children:!0,"add-only":!s})}
171
+ class=${m({children:!0,"add-only":!s})}
172
172
  role=${s?"group":"presentation"}
173
173
  >
174
174
  ${this._renderBranchGuide()}
@@ -177,12 +177,12 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
177
177
  </div>
178
178
  `}_renderGraftAdd(e,t,i){return p`
179
179
  <div
180
- class=${v({"graft-insert":!0,root:i})}
180
+ class=${m({"graft-insert":!0,root:i})}
181
181
  role="presentation"
182
182
  >
183
183
  <button
184
184
  type="button"
185
- class=${v({"icon-action":!0,"graft-add":!0,"graft-root":i})}
185
+ class=${m({"icon-action":!0,"graft-add":!0,"graft-root":i})}
186
186
  aria-label=${t}
187
187
  title=${t}
188
188
  ?disabled=${this.disabled}
@@ -218,7 +218,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
218
218
  class="graft-input"
219
219
  .value=${this._graftValue}
220
220
  placeholder="new-branch"
221
- @value-changed=${this._onGraftInput}
221
+ @esp-value-changed=${this._onGraftInput}
222
222
  @keydown=${this._onGraftKeydown}
223
223
  ></esp-input>
224
224
  </esp-form-item>
@@ -232,7 +232,7 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
232
232
  label="Cancel"
233
233
  icon="circle-x"
234
234
  ?disabled=${this.disabled}
235
- @clicked=${this._cancelGraft}
235
+ @esp-clicked=${this._cancelGraft}
236
236
  ></esp-button>
237
237
  <esp-button
238
238
  collapsed
@@ -240,13 +240,13 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
240
240
  label="Add branch"
241
241
  icon="plus"
242
242
  ?disabled=${this.disabled}
243
- @clicked=${this._commitGraft}
243
+ @esp-clicked=${this._commitGraft}
244
244
  ></esp-button>
245
245
  </div>
246
246
  </section>
247
247
  </esp-box>`:u}
248
248
  </esp-dialog>
249
- `}};n.formAssociated=!0,n.styles=[...z.styles,T`
249
+ `}};n.formAssociated=!0,n.styles=[...z.styles,D`
250
250
  :host {
251
251
  --_esp-tree-indent-step: var(--esp-tree-indent-step, 1.25rem);
252
252
  --_esp-tree-action-size: var(--esp-tree-action-size, 1.75rem);
@@ -620,4 +620,4 @@ var d=function(c,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnP
620
620
  gap: var(--esp-size-small);
621
621
  justify-content: flex-end;
622
622
  }
623
- `],d([h({type:Array})],n.prototype,"nodes",void 0),d([h({type:String})],n.prototype,"value",void 0),d([h({type:String,reflect:!0})],n.prototype,"name",void 0),d([h({type:Boolean,reflect:!0})],n.prototype,"required",void 0),d([h({attribute:"required-message"})],n.prototype,"requiredMessage",void 0),d([h({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),d([h({type:Boolean,attribute:"allow-graft"})],n.prototype,"allowGraft",void 0),d([h({type:String,attribute:"root-label"})],n.prototype,"rootLabel",void 0),d([h({type:String,attribute:"root-path"})],n.prototype,"rootPath",void 0),d([h({attribute:"root-selectable",converter:{fromAttribute:c=>c!=="false",toAttribute:c=>String(c)}})],n.prototype,"rootSelectable",void 0),d([h({type:String})],n.prototype,"label",void 0),d([h({type:String,reflect:!0,attribute:"graft-error"})],n.prototype,"graftError",void 0),d([h({attribute:!1})],n.prototype,"loadChildren",void 0),d([h({attribute:!1})],n.prototype,"buildPath",void 0),d([h({attribute:!1})],n.prototype,"normalizeGraftSegment",void 0),d([h({type:Boolean,attribute:"keep-expanded"})],n.prototype,"keepExpanded",void 0),d([h({attribute:!1})],n.prototype,"expandIcon",void 0),d([h({attribute:!1})],n.prototype,"collapseIcon",void 0),d([k()],n.prototype,"_activeId",void 0),d([k()],n.prototype,"_graftParentId",void 0),d([k()],n.prototype,"_graftValue",void 0),d([k()],n.prototype,"_graftErrorInternal",void 0),n=d([D("esp-tree")],n);export{n as EspalierTree,H as buildWebTreePath,N as normalizeSegment};
623
+ `],d([h({type:Array})],n.prototype,"nodes",void 0),d([h({type:String})],n.prototype,"value",void 0),d([h({type:String,reflect:!0})],n.prototype,"name",void 0),d([h({type:Boolean,reflect:!0})],n.prototype,"required",void 0),d([h({attribute:"required-message"})],n.prototype,"requiredMessage",void 0),d([h({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),d([h({type:Boolean,attribute:"allow-graft"})],n.prototype,"allowGraft",void 0),d([h({type:String,attribute:"root-label"})],n.prototype,"rootLabel",void 0),d([h({type:String,attribute:"root-path"})],n.prototype,"rootPath",void 0),d([h({attribute:"root-selectable",converter:{fromAttribute:c=>c!=="false",toAttribute:c=>String(c)}})],n.prototype,"rootSelectable",void 0),d([h({type:String})],n.prototype,"label",void 0),d([h({type:String,reflect:!0,attribute:"graft-error"})],n.prototype,"graftError",void 0),d([h({attribute:!1})],n.prototype,"loadChildren",void 0),d([h({attribute:!1})],n.prototype,"buildPath",void 0),d([h({attribute:!1})],n.prototype,"normalizeGraftSegment",void 0),d([h({type:Boolean,attribute:"keep-expanded"})],n.prototype,"keepExpanded",void 0),d([h({attribute:!1})],n.prototype,"expandIcon",void 0),d([h({attribute:!1})],n.prototype,"collapseIcon",void 0),d([x()],n.prototype,"_activeId",void 0),d([x()],n.prototype,"_graftParentId",void 0),d([x()],n.prototype,"_graftValue",void 0),d([x()],n.prototype,"_graftErrorInternal",void 0),n=d([L("esp-tree")],n);export{n as EspalierTree,j as buildWebTreePath,H as normalizeSegment};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taprootio/espalier",
3
- "version": "3.9.0",
3
+ "version": "4.1.0",
4
4
  "packageManager": "bun@1.3.12",
5
5
  "description": "Espalier — a themeable, accessible, framework-agnostic, enterprise-grade design system built on web standards and love.",
6
6
  "customElements": "custom-elements.json",