@vuu-ui/vuu-layout 0.0.27 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE +201 -0
  2. package/cjs/index.js +20 -0
  3. package/cjs/index.js.map +7 -0
  4. package/esm/index.js +20 -0
  5. package/esm/index.js.map +7 -0
  6. package/index.css +2 -0
  7. package/index.css.map +7 -0
  8. package/package.json +15 -19
  9. package/src/Component.css +0 -2
  10. package/src/Component.tsx +0 -20
  11. package/src/DraggableLayout.css +0 -18
  12. package/src/DraggableLayout.tsx +0 -29
  13. package/src/__tests__/flexbox-utils.spec.js +0 -90
  14. package/src/action-buttons/action-buttons.css +0 -12
  15. package/src/action-buttons/action-buttons.tsx +0 -30
  16. package/src/action-buttons/index.ts +0 -1
  17. package/src/chest-of-drawers/Chest.css +0 -36
  18. package/src/chest-of-drawers/Chest.tsx +0 -42
  19. package/src/chest-of-drawers/Drawer.css +0 -153
  20. package/src/chest-of-drawers/Drawer.tsx +0 -118
  21. package/src/chest-of-drawers/index.ts +0 -2
  22. package/src/common-types.ts +0 -9
  23. package/src/debug.ts +0 -16
  24. package/src/dialog/Dialog.css +0 -16
  25. package/src/dialog/Dialog.tsx +0 -59
  26. package/src/dialog/index.ts +0 -1
  27. package/src/drag-drop/BoxModel.ts +0 -546
  28. package/src/drag-drop/DragState.ts +0 -222
  29. package/src/drag-drop/Draggable.ts +0 -282
  30. package/src/drag-drop/DropMenu.css +0 -70
  31. package/src/drag-drop/DropMenu.tsx +0 -68
  32. package/src/drag-drop/DropTarget.ts +0 -392
  33. package/src/drag-drop/DropTargetRenderer.css +0 -40
  34. package/src/drag-drop/DropTargetRenderer.tsx +0 -284
  35. package/src/drag-drop/dragDropTypes.ts +0 -49
  36. package/src/drag-drop/index.ts +0 -4
  37. package/src/editable-label/EditableLabel.css +0 -28
  38. package/src/editable-label/EditableLabel.tsx +0 -99
  39. package/src/editable-label/index.ts +0 -1
  40. package/src/flexbox/Flexbox.css +0 -45
  41. package/src/flexbox/Flexbox.tsx +0 -70
  42. package/src/flexbox/FlexboxLayout.jsx +0 -26
  43. package/src/flexbox/FluidGrid.css +0 -134
  44. package/src/flexbox/FluidGrid.tsx +0 -84
  45. package/src/flexbox/FluidGridLayout.tsx +0 -10
  46. package/src/flexbox/Splitter.css +0 -140
  47. package/src/flexbox/Splitter.tsx +0 -135
  48. package/src/flexbox/flexbox-utils.ts +0 -128
  49. package/src/flexbox/flexboxTypes.ts +0 -63
  50. package/src/flexbox/index.ts +0 -4
  51. package/src/flexbox/useResponsiveSizing.ts +0 -85
  52. package/src/flexbox/useSplitterResizing.ts +0 -272
  53. package/src/index.ts +0 -20
  54. package/src/layout-action.ts +0 -21
  55. package/src/layout-header/ActionButton.tsx +0 -23
  56. package/src/layout-header/Header.css +0 -8
  57. package/src/layout-header/Header.tsx +0 -222
  58. package/src/layout-header/index.ts +0 -1
  59. package/src/layout-provider/LayoutProvider.tsx +0 -160
  60. package/src/layout-provider/LayoutProviderContext.ts +0 -17
  61. package/src/layout-provider/index.ts +0 -2
  62. package/src/layout-provider/useLayoutDragDrop.ts +0 -241
  63. package/src/layout-reducer/flexUtils.ts +0 -281
  64. package/src/layout-reducer/index.ts +0 -4
  65. package/src/layout-reducer/insert-layout-element.ts +0 -365
  66. package/src/layout-reducer/layout-reducer.ts +0 -255
  67. package/src/layout-reducer/layoutTypes.ts +0 -151
  68. package/src/layout-reducer/layoutUtils.ts +0 -302
  69. package/src/layout-reducer/remove-layout-element.ts +0 -240
  70. package/src/layout-reducer/replace-layout-element.ts +0 -118
  71. package/src/layout-reducer/resize-flex-children.ts +0 -56
  72. package/src/layout-reducer/wrap-layout-element.ts +0 -317
  73. package/src/layout-view/View.css +0 -58
  74. package/src/layout-view/View.tsx +0 -149
  75. package/src/layout-view/ViewContext.ts +0 -31
  76. package/src/layout-view/index.ts +0 -4
  77. package/src/layout-view/useView.tsx +0 -104
  78. package/src/layout-view/useViewActionDispatcher.ts +0 -133
  79. package/src/layout-view/useViewResize.ts +0 -53
  80. package/src/layout-view/viewTypes.ts +0 -37
  81. package/src/palette/Palette.css +0 -37
  82. package/src/palette/Palette.tsx +0 -140
  83. package/src/palette/PaletteUitk.css +0 -9
  84. package/src/palette/PaletteUitk.tsx +0 -79
  85. package/src/palette/index.ts +0 -2
  86. package/src/placeholder/Placeholder.css +0 -10
  87. package/src/placeholder/Placeholder.tsx +0 -39
  88. package/src/placeholder/index.ts +0 -1
  89. package/src/registry/ComponentRegistry.ts +0 -35
  90. package/src/registry/index.ts +0 -1
  91. package/src/responsive/OverflowMenu.css +0 -31
  92. package/src/responsive/OverflowMenu.jsx +0 -56
  93. package/src/responsive/breakpoints.ts +0 -48
  94. package/src/responsive/index.ts +0 -4
  95. package/src/responsive/measureMinimumNodeSize.ts +0 -23
  96. package/src/responsive/overflowUtils.js +0 -14
  97. package/src/responsive/use-breakpoints.ts +0 -100
  98. package/src/responsive/useOverflowObserver.ts +0 -606
  99. package/src/responsive/useResizeObserver.ts +0 -154
  100. package/src/responsive/utils.ts +0 -37
  101. package/src/stack/Stack.css +0 -39
  102. package/src/stack/Stack.tsx +0 -160
  103. package/src/stack/StackLayout.tsx +0 -137
  104. package/src/stack/index.ts +0 -3
  105. package/src/stack/stackTypes.ts +0 -19
  106. package/src/tabs/TabPanel.css +0 -12
  107. package/src/tabs/TabPanel.tsx +0 -17
  108. package/src/tabs/index.ts +0 -1
  109. package/src/tools/config-wrapper/ConfigWrapper.jsx +0 -53
  110. package/src/tools/config-wrapper/index.js +0 -1
  111. package/src/tools/devtools-box/layout-configurator.css +0 -112
  112. package/src/tools/devtools-box/layout-configurator.jsx +0 -369
  113. package/src/tools/devtools-tree/layout-tree-viewer.css +0 -15
  114. package/src/tools/devtools-tree/layout-tree-viewer.jsx +0 -36
  115. package/src/tools/index.js +0 -3
  116. package/src/use-persistent-state.ts +0 -115
  117. package/src/utils/componentFromLayout.tsx +0 -30
  118. package/src/utils/index.ts +0 -6
  119. package/src/utils/pathUtils.ts +0 -294
  120. package/src/utils/propUtils.ts +0 -24
  121. package/src/utils/refUtils.ts +0 -16
  122. package/src/utils/styleUtils.ts +0 -14
  123. package/src/utils/typeOf.ts +0 -22
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2015 UBS
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/cjs/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";var Ci=Object.create;var Bt=Object.defineProperty;var Ii=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var zi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Oi=(e,t)=>{for(var o in t)Bt(e,o,{get:t[o],enumerable:!0})},Vn=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ai(t))!ki.call(e,r)&&r!==o&&Bt(e,r,{get:()=>t[r],enumerable:!(n=Ii(t,r))||n.enumerable});return e};var k=(e,t,o)=>(o=e!=null?Ci(zi(e)):{},Vn(t||!e||!e.__esModule?Bt(o,"default",{value:e,enumerable:!0}):o,e)),Bi=e=>Vn(Bt({},"__esModule",{value:!0}),e);var Gc={};Oi(Gc,{Action:()=>Ne,BORDER_STYLES:()=>Hc,Chest:()=>Zn,Component:()=>Ht,ComponentRegistry:()=>se,ConfigWrapper:()=>Oc,ContextMenu:()=>yo,ContextMenuContext:()=>bo,ContextMenuProvider:()=>Dc,Dialog:()=>sc,DialogService:()=>vt,Draggable:()=>io,DraggableLayout:()=>In,Drawer:()=>$t,DropMenu:()=>dn,DropTarget:()=>Re,Flexbox:()=>Qe,FlexboxLayout:()=>yn,FluidGrid:()=>lo,FluidGridLayout:()=>vn,Header:()=>Pn,HeightOnly:()=>Ll,LayoutConfigurator:()=>On,LayoutProvider:()=>Dl,LayoutProviderContext:()=>tt,LayoutProviderVersion:()=>Pl,LayoutTreeViewer:()=>Bn,MARGIN_STYLES:()=>$c,MenuItem:()=>ho,MenuItemGroup:()=>Ot,MenuList:()=>go,PADDING_STYLES:()=>Nc,Palette:()=>gi,PaletteItem:()=>zn,PaletteListItem:()=>Cc,PaletteSalt:()=>xi,Placeholder:()=>ft,Popup:()=>pl,PopupService:()=>Z,Separator:()=>Ln,Stack:()=>vo,StackLayout:()=>kn,View:()=>fe,ViewContext:()=>At,WidthHeight:()=>Ml,WidthOnly:()=>Cl,XXXnormalizeStyles:()=>Wc,componentFromLayout:()=>No,computeMenuPosition:()=>pn,containerOf:()=>nr,expandFlex:()=>Ft,extractResponsiveProps:()=>Ql,findTarget:()=>ye,followPath:()=>K,followPathToComponent:()=>$o,followPathToParent:()=>ge,getChild:()=>rr,getChildProp:()=>Bo,getPersistentState:()=>Ko,getProp:()=>A,getProps:()=>I,hasPersistentState:()=>Xo,identifyDropTarget:()=>qt,isContainer:()=>G,isLayoutComponent:()=>Io,isRegistered:()=>Ni,isResponsiveAttribute:()=>Cs,isTabstrip:()=>Xa,isTypeOf:()=>Wi,isView:()=>Xn,nextLeaf:()=>Gi,nextStep:()=>ee,previousLeaf:()=>Ui,registerComponent:()=>N,resetPath:()=>F,setPersistentState:()=>Yo,setRef:()=>Xi,typeOf:()=>z,useBreakpoints:()=>Rn,useContextMenu:()=>Tc,useLayoutProviderDispatch:()=>j,useLayoutProviderVersion:()=>bs,useOverflowObserver:()=>Yl,usePersistentState:()=>Fe,useResizeObserver:()=>Lt,useViewActionDispatcher:()=>zt,useViewContext:()=>nc,useViewDispatch:()=>Tn});module.exports=Bi(Gc);var Yn=k(require("classnames"));var _n=require("react"),Co=k(require("classnames")),mt=require("@salt-ds/core");var Me=require("react/jsx-runtime"),De="vuuDrawer",Wn=e=>typeof e=="string"?e:e+"px",$i=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?Wn(t):void 0,"--drawer-peek-size":r?Wn(o):void 0}},Gn=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:s,style:i,open:a,position:l="left",inline:c,onClick:u,peekaboo:d=!1,toggleButton:p,...m})=>{let[f,g]=(0,mt.useControlled)({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),b=(0,Co.default)(De,t,`${De}-${l}`,{[`${De}-open`]:f,[`${De}-inline`]:c,[`${De}-over`]:!c,[`${De}-peekaboo`]:d}),h=(0,_n.useCallback)(()=>{console.log("toggleDrawer"),g(!f)},[f,g]),S=$i(i,r,s),R=o?h:u,y=()=>(0,Me.jsx)("div",{className:(0,Co.default)("vuuToggleButton-container"),children:f?(0,Me.jsx)(mt.Button,{"aria-label":"close",onClick:h,"data-icon":"close",variant:"secondary"}):(0,Me.jsx)(mt.Button,{"aria-label":"open",onClick:h,"data-icon":"close",variant:"secondary"})});return(0,Me.jsxs)("div",{...m,className:b,onClick:R,style:S,children:[p=="start"?y():null,(0,Me.jsx)("div",{className:`${De}-liner`,children:(0,Me.jsx)("div",{className:`${De}-content`,children:e})}),p=="end"?y():null]})};Gn.displayName="Drawer";var $t=Gn;var Ao=require("@vuu-ui/vuu-utils");var Un={},Kn={},se={};function G(e){return Un[e]===!0}function Xn(e){return Kn[e]===!0}var Io=e=>G(e)||Xn(e),Ni=e=>!!se[e];function N(e,t,o="component"){se[e]=t,o==="container"?Un[e]=!0:o==="view"&&(Kn[e]=!0)}var Nt=require("react/jsx-runtime"),Hi=e=>e.type===$t,Fi=({props:{position:e="left"}})=>e.match(/top|bottom/),zo=e=>{let{children:t,className:o,id:n,style:r}=e,s="hwChest",[i,a]=(0,Ao.partition)(t,Hi),[l,c]=(0,Ao.partition)(i,Fi),u=l.length===0?"horizontal":c.length===0?"vertical":"both",d=(0,Yn.default)(s,o,`${s}-${u}`);return(0,Nt.jsxs)("div",{className:d,id:n,style:r,children:[i,(0,Nt.jsx)("div",{className:`${s}-content`,children:a})]})};zo.displayName="Chest";var Zn=zo;N("Chest",zo,"container");var qn=require("react");var Jn=require("react/jsx-runtime"),ko=(0,qn.forwardRef)(function({resizeable:t,...o},n){return(0,Jn.jsx)("div",{...o,className:"Component",ref:n})});ko.displayName="Component";var Ht=ko;N("Component",ko);var Oe=require("react"),Us=k(require("classnames"));var hr=require("@salt-ds/core"),gr=k(require("classnames")),yr=require("react");var H=k(require("react")),mr=require("@vuu-ui/vuu-utils");var U=k(require("react")),jn=k(require("classnames"));var Oo=require("react/jsx-runtime"),Qn=U.default.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:s,style:i}){let a=(0,U.useRef)(),l=(0,U.useRef)(null),c=(0,U.useRef)(0),[u,d]=(0,U.useState)(!1),p=(0,U.useCallback)(({key:T,shiftKey:D})=>{let P=D?10:1;t&&T==="ArrowDown"?n(o,P):t&&T==="ArrowUp"||!t&&T==="ArrowLeft"?n(o,-P):!t&&T==="ArrowRight"&&n(o,P)},[t,o,n]),m=(0,U.useCallback)(T=>{let{key:D}=T;(t&&(D==="ArrowUp"||D==="ArrowDown")||!t&&(D==="ArrowLeft"||D==="ArrowRIght"))&&(s(o),p(T),f.current=p)},[t,p,o,s]),f=(0,U.useRef)(m),g=T=>f.current(T),b=(0,U.useCallback)(T=>{a.current=!0;let D=T[t?"clientY":"clientX"],P=D-c.current;D&&D!==c.current&&n(o,P),c.current=D},[t,o,n]),h=(0,U.useCallback)(()=>{var T;window.removeEventListener("mousemove",b,!1),window.removeEventListener("mouseup",h,!1),r(),d(!1),(T=l.current)==null||T.focus()},[b,r,d]),S=(0,U.useCallback)(T=>{c.current=t?T.clientY:T.clientX,s(o),window.addEventListener("mousemove",b,!1),window.addEventListener("mouseup",h,!1),T.preventDefault(),d(!0)},[t,b,h,o,s,d]),R=()=>{},y=()=>{var T;a.current?a.current=!1:(T=l.current)==null||T.focus()},x=()=>{f.current=m},E=(0,jn.default)("Splitter","focusable",{active:u,column:t});return(0,Oo.jsx)("div",{className:E,"data-splitter":!0,ref:l,role:"separator",style:i,onBlur:x,onClick:y,onFocus:R,onKeyDown:g,onMouseDown:S,tabIndex:0,children:(0,Oo.jsx)("div",{className:"grab-zone"})})});var tr=k(require("classnames"));var or=require("react/jsx-runtime"),er="vuuPlaceholder",ft=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...s})=>(0,or.jsx)("div",{className:(0,tr.default)(er,e,{[`${er}-shim`]:r}),...s,"data-placeholder":!0,"data-resizeable":!0});ft.displayName="Placeholder";N("Placeholder",ft);var Ft=e=>{if(typeof e=="number")return{flexBasis:0,flexGrow:1,flexShrink:1};throw Error(`"no support yet for flex value ${e}`)};var Le=k(require("react"));var Vi={},A=(e,t)=>{var n;let o=I(e);return(n=o[t])!=null?n:o[`data-${t}`]},I=e=>(e==null?void 0:e.props)||e||Vi,Bo=e=>{let t=I(e);if(t.children){let{children:[o,...n]}=t;return n.length>0&&console.warn(`getChild expected a single child, found ${n.length+1}`),o}};function z(e){var t;if(e){let o=e.type;if(typeof o=="function"||typeof o=="object"){let n=o.displayName||o.name||((t=o.type)==null?void 0:t.name);if(typeof n=="string")return n}else{if(typeof e.type=="string")return e.type;if(e.constructor)return e.constructor.displayName}throw Error("typeOf unable to determine type of element")}}var Wi=(e,t)=>z(e)===t;var _i=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function ge(e,t){let{"data-path":o,path:n=o}=I(e);return t==="0"||t===n?null:K(e,_i(t),!0)}function ye(e,t){let{children:o,...n}=I(e);if(t(n))return e;if(Le.default.Children.count(o)>0){let r=Le.default.isValidElement(o)?[o]:o;for(let s of r){let i=ye(s,t);if(i)return i}}}function nr(e,t){if(t===e)return null;{let{path:o,children:n}=I(e),{idx:r,finalStep:s}=ee(o,A(t,"path"));return s?e:n===void 0||n[r]===void 0?null:nr(n[r],t)}}var rr=(e,t)=>{if(Le.default.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function $o(e,t){var o=t.split(".");let n=[e],r=s=>Le.default.isValidElement(s.props.children)?[s.props.children]:s.props.children;for(let s=0;s<o.length;s++){let i=parseInt(o[s]),a=n[i];if(s===o.length-1)return a;n=r(a)}}function K(e,t,o=!1){let{"data-path":n,path:r=n}=I(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let s=t.slice(r.length+1);if(s==="")return e;let i=e,a=s.split(".");for(var l=0;l<a.length;l++){if(Le.default.Children.count(i.props.children)===0){let c=`element at 0.${a.slice(0,l).join(".")} has no children, so cannot fulfill rest of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c);return}if(i=rr(i.props.children,parseInt(a[l])),i===void 0){let c=`model at 0.${a.slice(0,l).join(".")} has no children that fulfill next step of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c)}}return i}function Gi(e,t){let o=ge(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:s}=o.props;if(s.length-1>r)return Vt(s[r+1]);{let i=n.pop(),a=ge(e,A(o,"path"));if(a&&typeof i=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>i)){let l=a.props.children[i+1];return G(z(l))?Vt(l):l}}}return Vt(e)}function Ui(e,t){let o=t.split(".").map(s=>parseInt(s,10)),n=o.pop(),r=ge(e,t);if(r!=null&&typeof n=="number"){let{children:s}=r.props;if(n>0)return Wt(s[n-1]);for(;o.length>1;)if(n=o.pop(),r=ge(e,A(r,"path")),n>0){let i=r.props.children[n-1];return G(z(i))?Wt(i):i}}return Wt(e)}function Vt(e){if(G(z(e))){let{children:t}=e.props||e;return Vt(t[0])}else return e}function Wt(e){if(G(z(e))){let{children:t}=e.props||e;return Wt(t[t.length-1])}else return e}function ee(e,t,o=!1){if(e===t)return{idx:-1,finalStep:!0};let n=`${e}.`;if(!t.startsWith(n))throw Error("pathUtils nextStep has strayed from the path");let r=o?0:1,s=t.replace(n,"").split(".").map(i=>parseInt(i,10));return{idx:s[0],finalStep:s.length===r}}function F(e,t,o){if(A(e,"path")===t)return e;let n=[];Le.default.Children.forEach(e.props.children,(s,i)=>{A(s,"path")?n.push(F(s,`${t}.${i}`)):n.push(s)});let r=e.props["data-path"]?"data-path":"path";return Le.default.cloneElement(e,{[r]:t,...o},n)}var sr=require("react");function No(e){let{id:t,type:o,props:n,children:r}=e,s=Ki(o),i=!r||r.length===0?null:r.length===1?No(r[0]):r.map(No);return(0,sr.createElement)(s,{...n,key:t},i)}function Ki(e){let t=se[e];if(t===void 0)throw Error("componentFromLayout: unknown component type: "+e);return t}function Xi(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var Fo=k(require("react")),Vo=require("@vuu-ui/vuu-utils");var Yi={"data-placeholder":!0,"data-resizeable":!0},_t={},Ce="auto",Ho={flexBasis:0,flexGrow:1,flexShrink:1,height:Ce,width:Ce},ir={height:"width",width:"height"},ar=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],Zi=e=>typeof e=="string"&&e.endsWith("%"),te=e=>{let{style:{width:t=Ce,height:o=Ce}=_t}=e.props,n=typeof o=="number",r=typeof t=="number";return n&&r?{height:o,width:t}:n?{height:o}:r?{width:t}:void 0};function Wo(e,t,o){let n=ir[t],{style:{[n]:r=Ce,...s}=_t}=e.props;return o&&o[t]?{...s,...Ho,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,...Ho,[n]:r}}function lr(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=_t}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function _o(e,t,o){let n=ir[t],{style:{[t]:r=Ce,[n]:s=Ce,...i}=_t}=e.props;return r!==Ce?Zi(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:s}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:s}:o&&o[t]?{...i,...Ho,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,[n]:s}}function ht(e,t,o,n,r){let s=[],i=0,a;if(n&&r){let u,[d,p,m,f]=r;[u,a]=t==="column"?[p-n.top,n.bottom-f]:[d-n.left,n.right-m],u&&s.push(be(`${o}.${i++}`,u,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=I(e);return s.push(F(e,`${o}.${i++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&s.push(be(`${o}.${i++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),Go(t,{resizeable:!1,style:{flexBasis:"auto"}},s,o)}var qi=(e,t)=>{if(!t)return e===0?1:0};function Go(e,t,o,n){let r=(0,Vo.uuid)(),{flexFill:s,style:i,resizeable:a=!0}=t,{flexBasis:l=s?void 0:"auto"}=i,c=qi(l,s);return Fo.default.createElement(se.Flexbox,{id:r,key:r,path:n,flexFill:s,style:{...i,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var Ji={flexGrow:1,flexShrink:1};function be(e,t,o,n){let r=(0,Vo.uuid)();return Fo.default.createElement("div",{...Yi,...n,"data-path":e,id:r,key:r,style:{...Ji,...o,flexBasis:t}})}var ji={},gt=1,yt=2,Qi=e=>typeof e.intrinsicSize=="number",ea=(e,t)=>{let o={};return e.forEach(n=>{o[n]=A(t,n)}),o},Gt=(e,t,o)=>e.map((n,r)=>{var l;let s=A(n,"resizeable"),{[t]:i}=(l=te(n))!=null?l:ji,a=lr(n);return o?{index:r,flexOpen:a,intrinsicSize:i,resizeable:s,...ea(o,n)}:{index:r,flexOpen:a,intrinsicSize:i,resizeable:s}}),cr=e=>{let t=e.length,o=e.every(Qi),n=Array(t).fill(0);if(o&&(n[0]=yt,n[t-1]=yt),t<2)return n;for(let r=0,s=0;r<t-1;r++)e[r].resizeable&&!s&&(s=gt),n[r]+=s;for(let r=t-1;r>0&&(n[r]&gt&&(n[r]-=gt),!e[r].resizeable);r--);return n},ur=(e,t)=>{let o=oa(e,t),n=na(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,s=ta(e,r);return[r,s]};function ta(e,t){if(t){let o=[];for(let n=0;n<e.length;n++)e[n].flexOpen&&!t.includes(n)&&o.push(n);return o}}function oa(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=pr(e,o);return o}function na(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=pr(e,o);return o===r?-1:o}function pr(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:s}=e[t];return Boolean(!n&&!s&&(o||r))}var ra=e=>!e.splitter&&!e.placeholder,fr=({children:e,onSplitterMoved:t,style:o})=>{let n=(0,H.useRef)(),r=(0,H.useRef)(),s=(0,H.useRef)(),i=(0,H.useRef)([]),[,a]=(0,H.useState)({}),l=b=>{s.current=b,a({})},c=(o==null?void 0:o.flexDirection)==="column",u=c?"height":"width",d=(0,H.useMemo)(()=>Array.isArray(e)?e:H.default.isValidElement(e)?[e]:[],[e]),p=(0,H.useCallback)(b=>{let{current:h}=r;if(h){let[S,R]=ur(h,b);S&&(S.forEach(y=>{var E;let x=(E=n.current)==null?void 0:E.childNodes[y];if(x){let{size:T,minSize:D}=la(x,u);h[y].currentSize=T,h[y].minSize=D}}),R&&R.forEach(y=>{var E;let x=(E=n.current)==null?void 0:E.childNodes[y];if(x){let{[u]:T}=x.getBoundingClientRect();h[y].flexBasis=T}}))}},[u]),m=(0,H.useCallback)((b,h)=>{s.current&&r.current&&l(ia(s.current,r.current,h,u))},[u]),f=(0,H.useCallback)(()=>{let b=r.current;b&&(t==null||t(b.filter(ra))),b==null||b.forEach(h=>{h.currentSize=void 0,h.flexBasis=void 0,h.flexOpen=!1})},[t]),g=(0,H.useCallback)(b=>H.default.createElement(Qn,{column:c,index:b,key:`splitter-${b}`,onDrag:m,onDragEnd:f,onDragStart:p}),[m,f,p,c]);return(0,H.useMemo)(()=>{let[b,h]=sa(d,u,g,i.current);r.current=h,s.current=b},[d,g,u]),{content:s.current||[],rootRef:n}};function sa(e,t,o,n){let r=Gt(e,t),s=cr(r),i=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&s[l]&yt&&(i.push(dr(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let u=n[l]||(n[l]=(0,mr.getUniqueId)());i.push(H.default.cloneElement(c,{key:u}))}else i.push(c);a.push(r[l]),l>0&&s[l]&yt?(i.push(dr(l)),a.push({placeholder:!0})):s[l]&gt&&(i.push(o(i.length)),a.push({splitter:!0}))}return[i,a]}function ia(e,t,o,n){return aa(t,o)?e.map((s,i)=>{let a=t[i],{currentSize:l,flexOpen:c,flexBasis:u}=a,d=l!==void 0;if(d||c){let{flexBasis:p}=s.props.style||{},m=d?a.currentSize:u;return m!==p?H.default.cloneElement(s,{style:{...s.props.style,flexBasis:m,[n]:"auto"}}):s}else return s}):e}function aa(e,t){let o=[];e.forEach((u,d)=>{u.currentSize!==void 0&&o.push(d)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:s=0}=e[n];if(r===s)return!1;if(Math.abs(t)>r-s){let u=t<0?-1:1;t=Math.max(0,r-s)*u}let i=e[o[0]],{currentSize:a=0}=i;i.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function dr(e){return H.default.createElement(ft,{shim:e===0,key:`placeholder-${e}`})}function la(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),s=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:s}}var xr=require("react/jsx-runtime"),Uo="hwFlexbox",br=(0,yr.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:s,className:i,flexFill:a,gap:l,fullPage:c,id:u,onSplitterMoved:d,resizeable:p,row:m,spacing:f,splitterSize:g,style:b,...h}=t,{content:S,rootRef:R}=fr({children:r,onSplitterMoved:d,style:b}),y=(0,gr.default)(Uo,i,{[`${Uo}-column`]:s,[`${Uo}-row`]:m,"flex-fill":a,"full-page":c});return(0,xr.jsx)("div",{...h,className:y,"data-resizeable":p||void 0,id:u,ref:(0,hr.useForkRef)(R,o),style:{...b,gap:l,"--spacing":f},children:S})});br.displayName="Flexbox";var Qe=br;var xs=require("react");var Ne={ADD:"add",BLUR:"blur",BLUR_SPLITTER:"blur-splitter",DRAG_START:"drag-start",DRAG_STARTED:"drag-started",DRAG_DROP:"drag-drop",FOCUS:"focus",FOCUS_SPLITTER:"focus-splitter",INITIALIZE:"initialize",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAR_OUT:"tear-out"};var q=require("react");var nn=k(require("react"));var et=k(require("react")),Qo=require("@vuu-ui/vuu-utils");var qo=require("@vuu-ui/vuu-utils"),Ie=k(require("react"));var He=require("react"),X=new Map,oe=new Map,Ko=e=>X.get(e),Xo=e=>X.has(e),Yo=(e,t)=>X.set(e,t),Fe=()=>{let e=(0,He.useCallback)((i,a)=>{let l=oe.get(i);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=(0,He.useCallback)((i,a,l)=>{if(a===void 0)oe.set(i,l);else if(oe.has(i)){let c=oe.get(i);oe.set(i,{...c,[a]:l})}else oe.set(i,{[a]:l})},[]),o=(0,He.useCallback)((i,a)=>{if(oe.has(i)){if(a===void 0)oe.delete(i);else if(oe.get(i)[a]){let{[a]:c,...u}=oe.get(i);Object.keys(u).length>0?oe.set(i,u):oe.delete(i)}}},[]),n=(0,He.useCallback)((i,a)=>{let l=X.get(i);if(l)return a!==void 0?l[a]:l},[]),r=(0,He.useCallback)((i,a,l)=>{if(a===void 0)X.set(i,l);else if(X.has(i)){let c=X.get(i);X.set(i,{...c,[a]:l})}else X.set(i,{[a]:l})},[]),s=(0,He.useCallback)((i,a)=>{if(X.has(i)){if(a===void 0)X.delete(i);else if(X.get(i)[a]){let{[a]:c,...u}=X.get(i);Object.keys(u).length>0?X.set(i,u):X.delete(i)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:s,purgeSessionState:o}};var Rr=e=>e.flexDirection==="column"?["height","width"]:["width","height"],ca={},bt=(e,t="0")=>{let[o,n]=jo(z(e),e.props,t);return Ie.default.cloneElement(e,o,n)},Jo=(e,t)=>{let o=z(e),[n,r]=jo(o,e.props,"0",void 0,t);return(0,Ie.cloneElement)(e,n,r)};function ua(e,t,o="0",n=null,r){var g,b;let{active:s=0,"data-path":i,path:a=i,id:l,style:c}=I(r),u=z(r)===e&&o===a,d=u?l:(g=t.id)!=null?g:(0,qo.uuid)(),p=e==="Stack"?(b=t.active)!=null?b:s:void 0,m=d,f=u?c:da(e,t,n);return Io(e)?{id:d,key:m,path:o,style:f,type:e,active:p}:{id:d,key:m,style:f,"data-path":o}}function jo(e,t,o,n=null,r){var c,u;let s=ua(e,t,o,n,r);if(t.layout&&!r)return[s,[Ut(t.layout,`${o}.0`)]];let i=(u=r==null?void 0:r.children)!=null?u:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&i?i:pa(e,t.children,o,i);return[s,l]}function pa(e,t,o="0",n){let r=Array.isArray(t)?t:Ie.default.isValidElement(t)?[t]:[];return G(e)?r.map((s,i)=>{let a=z(s),l=z(n==null?void 0:n[i]);if(!l||a===l){let[c,u]=jo(a,s.props,`${o}.${i}`,e,n==null?void 0:n[i]);return Ie.default.cloneElement(s,c,u)}else return n==null?void 0:n[i]}):t}var da=(e,t,o)=>{let{style:n=ca}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...s}=n;n={...s,...Ft(r)}}else o==="Stack"?n={...n,...Ft(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function Ut({id:e=(0,qo.uuid)(),type:t,children:o,props:n,state:r},s){let i=t.match(/^[a-z]/)?t:se[t];if(i===void 0)throw Error(`Unable to create component from JSON, unknown type ${t}`);return r&&Yo(e,r),Ie.default.createElement(i,{...n,id:e,key:e,path:s},o?o.map((a,l)=>Ut(a,`${s}.${l}`)):void 0)}function Er(e){return wr(e)}function wr(e){let t=z(e),{id:o,children:n,type:r,...s}=I(e),i=Xo(o)?Ko(o):void 0;return{id:o,type:t,props:ma(s),state:i,children:Ie.default.Children.map(n,wr)}}function ma(e){if(e){let{path:t,...o}=e,n={};for(let[r,s]of Object.entries(o))n[r]=Zo(s);return n}}function Zo(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Zo);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=Zo(n);return t}}function Sr(e,t){var i;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:s="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(i=o[r])!=null?i:null,s]}function Kt(e,t,o){let{active:n,children:r=[],path:s}=I(e),i=A(t,"path"),{idx:a,finalStep:l}=ee(s,i,!0),[c,u]=l?fa(e,r,o):[n,r==null?void 0:r.map((p,m)=>m===a?Kt(p,t,o):p)],d=z(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return et.default.cloneElement(e,{active:d},u)}function fa(e,t,o){let n=A(e,"path"),r=t==null?void 0:t.length,{id:s=(0,Qo.uuid)()}=I(o);return r?[r,t.concat(F(o,`${n}.${r}`,{id:s,key:s}))]:[0,[F(o,`${n}.0`,{id:s})]]}function Xt(e,t,o,n,r,s,i){let{active:a,children:l,path:c}=I(e),u=A(t,"path"),{idx:d,finalStep:p}=ee(c,u),[m,f]=p?ha(e,l,d,o,n,r,s,i):[a,l.map((b,h)=>h===d?Xt(b,t,o,n,r,s,i):b)],g=z(e)==="Stack"?m:a;return et.default.cloneElement(e,{active:g},f)}function ha(e,t,o,n,r,s,i,a){let l=te(n);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)?ya(e,t,o,n,r,i,a):vr(e,t,o,n,r,(s==null?void 0:s.width)||(s==null?void 0:s.height),i)}var ga=(e,t,{top:o,right:n,bottom:r,left:s},[i,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return i-s;if(e==="row")return n-l};function ya(e,t,o,n,r,s,i){let{style:{flexDirection:a}}=I(e),[l,c,u]=ar(a),{[c]:d,[l]:p}=te(n),m=A(t[o],"path"),f=ga(a,r,s,i),[g,b]=d<s[c]?[ht(n,u,m,s,i),p]:[n,void 0],h=f?be(m,f,{flexGrow:0,flexShrink:0}):void 0;return d>s[c]&&(t=t.map(S=>{if(A(S,"placeholder"))return S;{let{[c]:R}=te(S);return R&&R<d?ht(S,u,A(S,"path")):S}})),vr(e,t,o,g,r,b,s,h)}function vr(e,t,o,n,r,s,i,a){let l=A(e,"path"),c=0,u=!t||t.length===0?[n]:t.reduce((d,p,m)=>{if(o===m){let[f,g]=ba(e,p,n,i);r==="before"?a?d.push(a,g,f):d.push(g,f):a?d.push(f,g,a):d.push(f,g),c=d.indexOf(g)}else d.push(p);return d},[]).map((d,p)=>p<c?d:F(d,`${l}.${p}`));return[c,u]}function ba(e,t,o,n){let{id:r=(0,Qo.uuid)(),version:s=0}=I(o);if(s+=1,z(e)==="Flexbox"){let[i]=Rr(e.props.style),a=6,l={[i]:(n[i]-a)/2},c=_o(t,i,l),u=_o(o,i,l);return[et.default.cloneElement(t,{style:c}),et.default.cloneElement(o,{id:r,version:s,style:u})]}else{let{style:{left:i,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=I(o);return[t,et.default.cloneElement(o,{id:r,version:s,style:c})]}}var ne={ADD:"add",DRAG_START:"drag-start",DRAG_DROP:"drag-drop",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAROUT:"tearout"};var Ae=k(require("react"));var xt=k(require("react"));function Tr(e,{target:t,replacement:o}){return en(e,t,o)}function en(e,t,o){let n=A(t,"path"),r=A(t,"resizeable"),{style:s}=I(t),i=bt(xt.default.cloneElement(o,{resizeable:r,style:{...s,...o.props.style}}),n);return ie(e,t,i)}function ie(e,t,o,n){if(e===t)return o;{let{idx:r,finalStep:s}=ee(A(e,"path"),A(t,"path")),i=e.props.children.slice();return s?n?n===Ne.MINIMIZE?i[r]=xa(e,i[r]):n===Ne.RESTORE&&(i[r]=Ra(i[r])):i[r]=o:i[r]=ie(i[r],t,o,n),xt.default.cloneElement(e,void 0,i)}}function xa(e,t){let{style:o}=I(e),{style:n}=I(t),{width:r,height:s,flexBasis:i,flexShrink:a,flexGrow:l,...c}=n,u={width:r,height:s,flexBasis:i,flexShrink:a,flexGrow:l},d={...c,flexBasis:0,flexGrow:0,flexShrink:0},p=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return p?xt.default.cloneElement(t,{collapsed:p,restoreStyle:u,style:d}):t}function Ra(e){let{style:t,restoreStyle:o}=I(e),{flexBasis:n,flexShrink:r,flexGrow:s,...i}=t,a={...i,...o};return xt.default.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function tn(e,{path:t}){let o=K(e,t),n=ge(e,t);if(n===null)return e;let{children:r}=I(n);if(r.length>1&&Dr(r,t)){let{style:{flexBasis:s,display:i,flexDirection:a,...l}}=I(n),c=A(n,"path"),u=ie(e,n,be(c,s,l));for(;(n=ge(u,c))&&A(n,"path")!=="0";){let{children:d}=I(n);if(Dr(d)){c=A(n,"path");let{style:{flexBasis:p,display:m,flexDirection:f,...g}}=I(n);u=ie(e,n,be(c,p,g))}else if(va(d))u=Cr(e,n);else break}return u}else return Mr(e,o)}function Mr(e,t){let{active:o,children:n,path:r,preserve:s}=I(e),{idx:i,finalStep:a}=ee(r,A(t,"path")),l=z(e),c=n.slice();if(a){if(c.splice(i,1),o!==void 0&&o>=i&&(o=Math.max(0,o-1)),c.length===1&&!s&&r!=="0"&&l.match(/Flexbox|Stack/))return Ea(e,c[0]);!c.some(wa)&&c.some(Lr)&&(c=Sa(c))}else c[i]=Mr(c[i],t);return c=c.map((u,d)=>F(u,`${r}.${d}`)),Ae.default.cloneElement(e,{active:o},c)}function Ea(e,t){let o=z(e),{path:n,style:{flexBasis:r,flexGrow:s,flexShrink:i,width:a,height:l}}=I(e),c=F(t,n);if(n==="0")c=Ae.default.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let u=e.props.style.flexDirection==="column"?"height":"width",{style:{[u]:d,...p}}=c.props;c=Ae.default.cloneElement(c,{flexFill:void 0,style:{...p,flexGrow:s,flexShrink:i,flexBasis:r,width:a,height:l}})}return c}function wa(e){return e.props.style.flexGrow>0}function Lr(e){let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"}function Sa(e){return e.map(t=>Lr(t)?Ae.default.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t)}var va=e=>{if(e&&e.length>0){let t=A(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=A(e[n],"placeholder"),t&&o)return!0;t=o}}},Cr=(e,t)=>{let{children:o,path:n}=I(e),{idx:r,finalStep:s}=ee(n,A(t,"path")),i=o.slice();return s?i[r]=Ta(t):i[r]=Cr(i[r],t),i=i.map((a,l)=>F(a,`${n}.${l}`)),Ae.default.cloneElement(e,void 0,i)},Ta=e=>{let{children:t}=I(e),o=[],n=[];for(let s=0;s<t.length;s++)A(t[s],"placeholder")?n.push(t[s]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(Pr(n)),n.length=0),o.push(t[s]));n.length===1?o.push(n.pop()):n.length>0&&o.push(Pr(n));let r=A(e,"path");return Ae.default.cloneElement(e,void 0,o.map((s,i)=>F(s,`${r}.${i}`)))},Pr=([e,...t])=>{let o=A(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:s}=o;for(let{props:{style:i}}of t)n+=i.flexBasis,r=Math.max(r,i.flexGrow),s=Math.max(s,i.flexShrink);return Ae.default.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:s}})},Dr=(e,t)=>e.every(o=>A(o,"placeholder")||t&&A(o,"path")===t);var on=k(require("react"));function Ir(e,{path:t,sizes:o}){let n=K(e,t,!0),{children:r,style:s}=I(n),i=s.flexDirection==="column"?"height":"width",a=Pa(r,o,i),l=on.default.cloneElement(n,void 0,a);return ie(e,n,l)}function Pa(e,t,o){return e.map((n,r)=>{let{style:{[o]:s,flexBasis:i}}=I(n),a=t[r],{currentSize:l,flexBasis:c}=a,d=l!==void 0?a.currentSize:c;return d===void 0||s===d||i===d?n:on.default.cloneElement(n,{style:Da(n.props.style,o,d)})})}function Da(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:s=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:s}}var Rt=k(require("react")),Ar=require("@vuu-ui/vuu-utils");var zr=e=>{let[t]=z(e);return t===t.toLowerCase()};function Et(e,t,o,n,r,s){let{children:i,path:a}=I(e),l=A(t,"path"),{idx:c,finalStep:u}=ee(a,l),d=u?Ma(e,i,t,o,n,r,s):i.map((p,m)=>m===c?Et(p,t,o,n,r,s):p);return Rt.default.cloneElement(e,void 0,d)}function Ma(e,t,o,n,r,s,i){let a=te(n);if((a==null?void 0:a.width)&&(a==null?void 0:a.height)){if(s===void 0||i===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return Ca(t,o,n,r,s,i)}else return La(e,t,o,n,r)}function La(e,t,o,n,r){var E;let{version:s=0}=I(n),i=A(o,"path"),{type:a,flexDirection:l,showTabs:c}=Or(r),[u,d,p]=Ia(a,o,n,l,r),m=kr(r),f=m?1:0,g={resizeable:!0,style:p,version:s+1},h={[zr(o)?"data-resizeable":"resizeable"]:!0,style:d},S=a==="Stack"?{showTabs:c}:void 0,R=a==="Flexbox"?{splitterSize:(E=z(e)==="Flexbox"&&e.props.splitterSize)!=null?E:void 0}:void 0,y=(0,Ar.uuid)();var x=Rt.default.createElement(se[a],{active:f,id:y,key:y,path:A(o,"path"),flexFill:A(o,"flexFill"),...R,...S,style:u,resizeable:A(o,"resizeable")},m?[F(o,`${i}.0`,h),bt(Rt.default.cloneElement(n,g),`${i}.1`)]:[bt(Rt.default.cloneElement(n,g),`${i}.0`),F(o,`${i}.1`,h)]);return t.map(T=>T===o?x:T)}function Ca(e,t,o,n,r,s){let{flexDirection:i}=Or(n),a=i==="column"?"row":"column",l=kr(n),[c,u,d,p]=s,[m,f]=i==="column"?[u-r.top,r.bottom-p]:[c-r.left,r.right-d],g=A(t,"path"),b=0,h=zr(t)?"data-resizeable":"resizeable",S=[];m&&S.push(l?F(t,`${g}.${b++}`,{[h]:!0,style:{flexBasis:m,flexGrow:1,flexShrink:1}}):be(`${g}.${b++}`,m,{flexGrow:0,flexShrink:0})),S.push(ht(o,a,`${g}.${b++}`,r,s)),f&&S.push(l?be(`${g}.${b++}`,0):F(t,`${g}.${b++}`,{[h]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let R=Go(i,t.props,S,g);return e.map(y=>y===t?R:y)}function Ia(e,t,o,n,r){let s={...t.props.style,flexDirection:n},i=e==="Flexbox"&&n==="column"?"height":"width",a=Wo(o,i,r),l=Wo(t,i);return[s,l,a]}var kr=e=>{var t;return e.position.SouthOrEast?!0:((t=e==null?void 0:e.tab)==null?void 0:t.positionRelativeToTab)==="before"?!1:!!e.position.Header};function Or(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var Hr=(e,t)=>{switch(t.type){case ne.ADD:return Ba(e,t);case ne.DRAG_DROP:return Oa(e,t);case ne.MAXIMIZE:return ka(e,t);case ne.REMOVE:return tn(e,t);case ne.REPLACE:return Tr(e,t);case ne.SET_TITLE:return za(e,t);case ne.SPLITTER_RESIZE:return Ir(e,t);case ne.SWITCH_TAB:return Aa(e,t);default:return console.warn(`layoutActionHandlers. No handler for action.type ${t.type}`),e}};function Aa(e,{path:t,nextIdx:o}){var n=K(e,t,!0);let r=nn.default.cloneElement(n,{active:o});return ie(e,n,r)}function za(e,{path:t,title:o}){var n=K(e,t,!0);let r=nn.default.cloneElement(n,{title:o});return ie(e,n,r)}function ka(e,{path:t,type:o}){if(t){var n=K(e,t,!0);return ie(e,n,n,o)}else return e}function Oa(e,t){var p,m;console.log("drag drop");let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,s=r.component,{pos:i}=r,a=((p=i==null?void 0:i.position)==null?void 0:p.Header)&&z(s)==="Stack",{id:l,version:c}=I(o),u=te(o),d;if(a){let[f,g]=Sr(s,i);f===void 0?d=Kt(e,s,o):d=Xt(e,f,o,g)}else!u&&((m=i==null?void 0:i.position)==null?void 0:m.Centre)?d=en(e,s,o):d=$a(e,r,o);if(n.DoNotRemove)return d;{let f=ye(d,b=>b.id===l&&b.version===c),g=A(f,"path");return tn(d,{path:g,type:"remove"})}}function Ba(e,{path:t,component:o}){return Kt(e,K(e,t),o)}function $a(e,t,o){let{component:n,pos:r,clientRect:s,dropRect:i}=t,a=A(n,"path");if(a==="0.0")return Et(e,n,o,r);var l=ge(e,a);if(Br(r,l)){let c=r.position.SouthOrEast?"after":"before";return Xt(e,n,o,c,r,s,i)}else if(Br(r,l)){if(G(z(l)))return Et(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)}else return Et(e,n,o,r,s,i);return e}function Br(e,t){return e.position.Centre?Nr(t)||$r(t):e.position.NorthOrSouth?$r(t):e.position.EastOrWest?Nr(t):!1}function $r(e){return z(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function Nr(e){return z(e)==="Flexbox"&&e.props.style.flexDirection!=="column"}var Fr=require("react"),Na=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),tt=(0,Fr.createContext)({dispatchLayoutProvider:Na,version:-1});var we=require("react");var We={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},wt={AFTER:"after",BEFORE:"before"},Y=Object.freeze({North:Ve("north"),East:Ve("east"),South:Ve("south"),West:Ve("west"),Header:Ve("header"),Centre:Ve("centre"),Absolute:Ve("absolute")});function Ve(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return We[e]},toString:function(){return e},North:e==="north",South:e==="south",East:e==="east",West:e==="west",Header:e==="header",Centre:e==="centre",NorthOrSouth:e==="north"||e==="south",EastOrWest:e==="east"||e==="west",NorthOrWest:e==="north"||e==="west",SouthOrEast:e==="east"||e==="south",Absolute:e==="absolute"})}var Vr=Y.North,Wr=Y.South,rn=Y.East,sn=Y.West,Ha=Y.Header,Fa=Y.Centre,ot=class{static measure(t,o=[]){var n={};return _a(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,s){return Kr(t,o,n,r,s).reverse()}};function an(e,t,o,n=30){let r=o.right-o.left,s=o.bottom-o.top,i=e-o.left,a=t-o.top,l=0;return i<n&&(l+=8),i>r-n&&(l+=2),a<n&&(l+=1),a>s-n&&(l+=4),{pctX:i/r,pctY:a/s,closeToTheEdge:l}}function ln(e,t,o,n){let{BEFORE:r,AFTER:s}=wt,{pctX:i,pctY:a,closeToTheEdge:l}=an(e,t,o),c,u;if(n==="row")c=i<.5?sn:rn;else if(o.header&&Yt(o.header,e,t))if(c=Ha,o.Stack){let d=o.Stack.length;if(d===0)u={index:-1,left:o.left,positionRelativeToTab:s,width:0};else{let p=o.Stack.find(({left:m,right:f})=>e>=m&&e<=f);if(p){let m=p.right-p.left;u={index:o.Stack.indexOf(p),left:p.left,positionRelativeToTab:(e-p.left)/m<.5?r:s,width:m}}else u={left:o.Stack[d-1].right,width:0,index:d,positionRelativeToTab:s}}}else if(o.header.titleWidth){let d=o.header.titleWidth;u={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/d<.5?r:s,width:d}}else u={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=Va(e,t,o,i,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:u}}function Va(e,t,o,n,r){let s=Wa(o,.2);if(Yt(s,e,t))return Fa;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?Vr:sn;case"northeast":return 1-n>r?Vr:rn;case"southeast":return n>r?rn:Wr;case"southwest":return 1-n>r?sn:Wr;default:}}function Wa({right:e,left:t,top:o,bottom:n},r){let s=(1-r)/2,i=(e-t)*s,a=(n-o)*s;return{left:t+i,top:o+a,right:e-i,bottom:n-a}}function _a(e,t,o){let{id:n,"data-path":r,path:s=r}=I(e),i=z(e);if(n&&s){let[a,l]=Ur(e);_r(e,a,l,t),G(i)&&Gr(e,t,o)}}function _r(e,t,o,n){let{"data-path":r,path:s=r,header:i}=I(e);n[s]=t;let a=z(e);if(i||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:u,right:d,bottom:p}=l.getBoundingClientRect();if(n[s].header={top:Math.round(c),left:Math.round(u),right:Math.round(d),bottom:Math.round(p)},a==="Stack")n[s].Stack=Array.from(l.querySelectorAll(".saltTab")).map(m=>m.getBoundingClientRect()).map(({left:m,right:f})=>({left:m,right:f}));else{let m=l.querySelector('[class^="vuuHeader-title"]'),{header:f}=n[s];m&&f&&(f.titleWidth=m.clientWidth)}}}return n[s]}function Gr(e,t,o,n=0,r=0,s=0,i=0){let{children:a,"data-path":l,path:c=l,style:u,active:d=0}=I(e),p=z(e),m=p==="Flexbox",f=p==="Stack",g=m&&u.flexDirection==="column",b=m&&u.flexDirection==="row",S=(f?a.filter((y,x)=>x===d):a.filter(Ga)).map(y=>{let[x,E]=Ur(y);return[{...x,top:x.top-s,right:x.right+r,bottom:x.bottom+i,left:x.left-n},E,y]}),R=S.map(([y,x,E],T,D)=>{let P,M,w,v,L,C,O=D.length-1;b?(L=T===0?0:y.left-D[T-1][0].right,C=T===O?0:D[T+1][0].left-y.right,P=T===0||L===0?0:L,M=T===O||C===0?0:C-C/2,y.left-=P,y.right+=M,w=s,v=i):g&&(L=T===0?0:y.top-D[T-1][0].bottom,C=T===O?0:D[T+1][0].top-y.bottom,w=T===0||L===0?0:L,v=T===O||C===0?0:C-C/2,y.top-=w,y.bottom+=v,P=n,M=r);let W=_r(E,y,x,t),_=z(E);return G(_)&&Gr(E,t,o,P,M,w,v),W});S.length&&(t[c].children=R)}function Ga(e){let{id:t}=I(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function Ur(e){let{id:t}=I(e),o=z(e),n=document.getElementById(t);if(!n)throw Error(`No DOM for ${o} ${t}`);let{top:r,left:s,right:i,bottom:a,height:l,width:c}=n.getBoundingClientRect(),u;if(G(o)){let d=n.scrollHeight;d>l&&(u={id:t,scrollHeight:d,scrollTop:n.scrollTop})}return[{top:Math.round(r),left:Math.round(s),right:Math.round(i),bottom:Math.round(a),height:Math.round(l),width:Math.round(c),scrolling:u},n,e]}function Kr(e,t,o,n,r,s=[]){let{children:i,"data-path":a,path:l=a}=I(e),c=z(e);var u=t[l];if(!Yt(u,o,n))return s;if(r&&r.length){if(r.includes(l))s.push(e);else if(!r.some(p=>p.startsWith(l)))return s}else s.push(e);if(!G(c)||u.header&&Yt(u.header,o,n))return s;u.scrolling&&Ua(u,o,n);for(var d=0;d<i.length;d++){if(c==="Stack"&&e.props.active!==d)continue;let p=Kr(i[d],t,o,n,r);if(p.length)return s.concat(p)}return s}function Yt(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function Ua({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:s,scrollTop:i,scrollHeight:a}=o,l=t-e;if(i===0&&t-r<50){let c=a-l;document.getElementById(s).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(i>0&&r-e<50)document.getElementById(s).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var Ka=.4,Zt=class{constructor(t,o,n,r,s){this.init(t,o,n,r,s)}init(t,o,n,r,s){var{left:i,top:a}=r,{pctX:l,pctY:c}=an(o,n,r),u=Ka,d=l*r.width,p=r.width-d,m=c*r.height,f=r.height-m,g=r.width*u,b=r.height*u,h=1-u,S=d*h,R=m*h,y=p*h,x=f*h;this.intrinsicSize=s,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-S,hi:t.right-r.width+y},y:{lo:t.top-R,hi:t.bottom-r.height+x}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+b*c,hi:t.bottom-b*(1-c)}}},this.x={pos:i,lo:!1,hi:!1,mousePos:o,mousePct:l},this.y={pos:a,lo:!1,hi:!1,mousePos:n,mousePct:c}}outOfBounds(){return this.x.lo||this.x.hi||this.y.lo||this.y.hi}inBounds(){return!this.outOfBounds()}dropX(){return this.dropXY("x")}dropY(){return this.dropXY("y")}hasIntrinsicSize(){var t,o;return((t=this==null?void 0:this.intrinsicSize)==null?void 0:t.height)&&((o=this==null?void 0:this.intrinsicSize)==null?void 0:o.width)}update(t,o){var n=this[t],r=this.constraint.mouse[t],s=this.constraint.pos[t],i=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=s.lo):n.hi?o<r.hi&&(n.hi=!1,n.pos+=a):n.pos+=a):a>0&&(n.hi||(o>r.hi?(n.hi=!0,n.pos=s.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,i!==n.pos}dropXY(t){var o=this[t],n=this.constraint.zone[t];return o.lo?Math.max(n.lo,o.mousePos):o.hi?Math.min(o.mousePos,Math.round(n.hi)-1):o.mousePos}};var Xa=e=>e.pos.tab&&z(e.component)==="Stack"&&e.pos.position.Header,{north:Ya,south:Za,east:qa,west:Ja}=We,ja=qa+Ja,Qa=Ya+Za,Re=class{constructor({component:t,pos:o,clientRect:n,nextDropTarget:r}){this.component=t,this.pos=o,this.clientRect=n,this.nextDropTarget=r,this.active=!1,this.dropRect=void 0}targetTabPos(t){let{left:o,width:n,positionRelativeToTab:r}=t;return r===wt.BEFORE?o:o+n}getTargetDropOutline(t,o){if(this.pos.tab)return this.getDropTabOutline(t,this.pos.tab);if(o&&o.hasIntrinsicSize())return this.getIntrinsicDropRect(o);{let[n,r,s,i]=this.getDropRectOutline(t,o);return{l:n,t:r,r:s,b:i}}}getDropTabOutline(t,o){let{clientRect:{top:n,left:r,right:s,bottom:i,header:a}}=this,l=0,c=Math.round(t/2)+l,u=Math.round(n),d=Math.round(r+c),p=Math.round(s-c),m=Math.round(i-c),f=this.targetTabPos(o),g=60,b=a.bottom-a.top;return{l:d,t:u,r:p,b:m,tabLeft:f,tabWidth:g,tabHeight:b}}getIntrinsicDropRect(t){var g,b,h,S;let{pos:o,clientRect:n}=this,{x:r,y:s}=t,i=(b=(g=t.intrinsicSize)==null?void 0:g.height)!=null?b:0,a=(S=(h=t.intrinsicSize)==null?void 0:h.height)!=null?S:0;i&&i>n.height?(console.log("DropTarget: we're going to blow the gaff"),i=n.height):a&&a>n.width&&(console.log("DropTarget: we're going to blow the gaff"),a=n.width);let l=Math.min(n.right-a,Math.max(n.left,Math.round(o.x-r.mousePct*a))),c=Math.min(n.bottom-i,Math.max(n.top,Math.round(o.y-s.mousePct*i))),[u,d,p,m]=this.dropRect=[l,c,l+a,c+i],f=o.position.EastOrWest?[u,n.top,u,n.bottom,p,n.top,p,n.bottom]:[n.left,d,n.right,d,n.left,m,n.right,m];return{l:u,r:p,t:d,b:m,guideLines:f}}getDropRectOutline(t,o){var S,R,y;let{pos:n,clientRect:r}=this,{width:s,height:i,position:a}=n,{width:l,height:c}=(S=o==null?void 0:o.intrinsicSize)!=null?S:{},u=(R=c!=null?c:i)!=null?R:0,d=(y=l!=null?l:s)!=null?y:0;this.dropRect=void 0;let{top:p,left:m,right:f,bottom:g}=r,b=0,h=Math.round(t/2)+b;switch(a){case Y.North:case Y.Header:{let x=Math.round((g-p)/2),E=u?Math.min(x,Math.round(u)):x;return d&&m+d<f?[m+h,p+h,m+d-h,p+h+E]:[m+h,p+h,f-h,p+h+E]}case Y.West:{let x=Math.round((f-m)/2),E=d?Math.min(x,Math.round(d)):x;return u&&p+u<g?[m+h,p+h,m-h+E,p+u+h]:[m+h,p+h,m-h+E,g-h]}case Y.East:{let x=Math.round((f-m)/2),E=d?Math.min(x,Math.round(d)):x;return u&&p+u<g?[f-h-E,p+h,f-h,p+u+h]:[f-h-E,p+h,f-h,g-h]}case Y.South:{let x=Math.round((g-p)/2),E=u?Math.min(x,Math.round(u)):x;return d&&m+d<f?[m+h,g-h-E,m+d-h,g-h]:[m+h,g-h-E,f-h,g-h]}case Y.Centre:return[m+h,p+h,f-h,g-h];default:return console.warn(`DropTarget does not recognize position ${a}`),null}}activate(){return this.active=!0,this}toArray(){let t=this,o=[t];for(;t=t.nextDropTarget;)o.push(t);return o}static getActiveDropTarget(t){return t===null?null:t!=null&&t.active?t:Re.getActiveDropTarget(t.nextDropTarget)}};function qt(e,t,o,n,r,s){var l;let i=null,a=ot.allBoxesContainingPoint(o,n,e,t,s);if(a.length){let[c,...u]=a,{"data-path":d,path:p=d,"data-row-placeholder":m}=I(c),f=n[p],b=ln(e,t,f,r&&m?"row":void 0),h=n[p],S=([R,...y])=>{var x,E;if(((x=b.position)==null?void 0:x.Header)||b.closeToTheEdge){let T=el(R,b,h,n,e,t);if(T){let[D,P]=T;return new Re({component:R,pos:D,clientRect:P,nextDropTarget:(E=S(y))!=null?E:null})}else if(y.length)return S(y)}};i=new Re({component:c,pos:b,clientRect:f,nextDropTarget:(l=S(u))!=null?l:null}).activate()}return i}function el(e,{closeToTheEdge:t,position:o},n,r,s,i){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&We.north,c=t&We.east,u=t&We.south,d=t&We.west,p=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),m=c&&Math.round(n.right)===Math.round(a.right),f=u&&Math.round(n.bottom)===Math.round(a.bottom),g=d&&Math.round(n.left)===Math.round(a.left);if(p||m||f||g){let{"data-path":b,path:h=b}=e.props,S=r[h],R=ln(s,i,S);if((tl(e)||Xr(e))&&t&ja)return R.width=120,[R,S];if((ol(e)||Xr(e))&&(o.Header||t&Qa))return R.height=120,[R,S]}}function Xr(e){return z(e)==="Stack"}function tl(e){return z(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function ol(e){return z(e)==="Flexbox"&&e.props.style.flexDirection==="row"}var re=k(require("react")),nt=k(require("react-dom"));var St=require("react"),jr=k(require("react-dom"));var Yr=k(require("react-dom")),Zr=require("@salt-ds/core"),Jr=require("react/jsx-runtime"),nl=1,rl=(e=0,t=0,o=window)=>{let n=o.document.createElement("div");return n.className="vuuPopup "+nl++,n.style.cssText=`left:${e}px; top:${t}px;`,o.document.body.appendChild(n),n},sl=(e,t)=>rl(e,t),Jt=(e,t,o,n,r)=>{t.style.cssText=`left:${o}px; top:${n}px;position: absolute;`,Yr.render((0,Jr.jsx)(Zr.SaltProvider,{applyClassesTo:"child",children:e}),t,r)},qr=sl;var jt=function({children:t,x:o=0,y:n=0,onRender:r}){let s=(0,St.useMemo)(()=>qr(),[]);return(0,St.useLayoutEffect)(()=>{Jt(t,s,o,n,r)},[t,r,s,o,n]),(0,St.useLayoutEffect)(()=>()=>{var i;s&&(jr.unmountComponentAtNode(s),s.classList.contains("vuuPopup")&&((i=s.parentElement)==null||i.removeChild(s)))},[s]),null};var Qr=k(require("classnames"));window.popupReact=re.default;var _e=!1,ae=[];function Qt(e){e.keyCode===27&&(ae.length?ts():_e&&nt.default.unmountComponentAtNode(document.body.querySelector(".vuuDialog")))}function es(e){if(ae.length){let t=document.body.querySelectorAll(".vuuPopup");for(let o=0;o<t.length;o++)if(t[o].contains(e.target))return;ts()}}function ts(){if(ae.length){let e=document.body.querySelectorAll(".vuuPopup");for(let t=0;t<e.length;t++)nt.default.unmountComponentAtNode(e[t]);os("*")}}function il(){_e===!1&&(_e=!0,window.addEventListener("keydown",Qt,!0))}function al(){_e&&(_e=!1,window.removeEventListener("keydown",Qt,!0))}function ll(e){ae.indexOf(e)===-1&&(ae.push(e),_e===!1&&(window.addEventListener("keydown",Qt,!0),window.addEventListener("click",es,!0)))}function os(e){if(ae.length){if(e==="*")ae.length=0;else{let t=ae.indexOf(e);t!==-1&&ae.splice(t,1)}ae.length===0&&_e===!1&&(window.removeEventListener("keydown",Qt,!0),window.removeEventListener("click",es,!0))}}var cl=({children:e,position:t,style:o})=>{let n=(0,Qr.default)("hwPopup","hwPopupContainer",t);return(0,re.createElement)("div",{className:n,style:o},e)},ul=1,Z=class{static showPopup({name:t="anon",group:o="all",position:n="",left:r=0,right:s="auto",top:i=0,width:a="auto",component:l}){if(!l)throw Error("PopupService showPopup, no component supplied");ll(t,o);let c=document.body.querySelector(".vuuPopup."+o);c===null&&(c=document.createElement("div"),c.className="vuuPopup "+o,document.body.appendChild(c));let u={width:a};Jt((0,re.createElement)(cl,{key:ul++,position:n,style:u},l),c,r,i,()=>{Z.keepWithinThePage(c,s)})}static hidePopup(t="anon",o="all"){ae.indexOf(t)!==-1&&(os(t,o),nt.default.unmountComponentAtNode(document.body.querySelector(`.vuuPopup.${o}`)))}static keepWithinThePage(t,o="auto"){let n=t.querySelector(".vuuPopupContainer > *");if(n){let{top:r,left:s,width:i,height:a,right:l}=n.getBoundingClientRect(),c=window.innerWidth,d=window.innerHeight-(r+a);d<0&&(n.style.top=parseInt(r,10)+d+"px");let p=c-(s+i);if(p<0&&(n.style.left=parseInt(s,10)+p+"px"),typeof o=="number"&&o!==l){let m=o-l;n.style.left=s+m+"px"}}}},vt=class{static showDialog(t){let o=".vuuDialog",n=t.props.onClose;il(),nt.default.render(re.default.cloneElement(t,{container:o,onClose:()=>{vt.closeDialog(),n&&n()}}),document.body.querySelector(o))}static closeDialog(){al(),nt.default.unmountComponentAtNode(document.body.querySelector(".vuuDialog"))}},pl=e=>{let t=(0,re.useRef)(null),o=(0,re.useRef)(null),n=(r,s)=>{let{name:i,group:a,depth:l,width:c}=r,u,d;if(t.current&&(clearTimeout(t.current),t.current=null),r.close===!0)Z.hidePopup(i,a);else{let{position:p,children:m}=r,{left:f,top:g,width:b,bottom:h}=s;p==="below"?(u=f,d=h):p==="above"&&(u=f,d=g),t.current=setTimeout(()=>{Z.showPopup({name:i,group:a,depth:l,position:p,left:u,top:d,width:c||b,component:m})},10)}};return(0,re.useEffect)(()=>{if(o.current){let s=o.current.parentElement.getBoundingClientRect();n(e,s)}return()=>{Z.hidePopup(e.name,e.group)}},[e]),re.default.createElement("div",{className:"popup-proxy",ref:o})};var ns=k(require("classnames"));var un=require("react/jsx-runtime");function pn(e,t=0,o=0){let{pos:n,clientRect:r}=e,s=20;return n.position.West?[r.left-o+s,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-s,"bottom"]:n.position.East?[r.right-o-s,n.y-t,"right"]:[n.x-o,r.top-t+s,"top"]}var cn="vuuDropMenu",dn=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return(0,un.jsx)("div",{className:(0,ns.default)(cn,e,`${cn}-${n}`),onMouseLeave:()=>o(null),children:r.map((s,i)=>(0,un.jsx)("div",{className:`${cn}-item`,"data-icon":i===0?"column-2A":"column-2B",onMouseEnter:()=>o(s)},i))})};var as=require("react/jsx-runtime"),mn=!1,Tt=null,le=null,dl=e=>Tt=e,ml=([e,t])=>`M${e},${t}`,fl=([e,t])=>`L${e},${t}`,rs=([e,...t])=>`${ml(e)} ${t.map(fl)}Z`,hl=e=>{if(e){let[t,o,n,r,s,i,a,l]=e;return`M${t},${o} L${n},${r} M${s},${i} L${a},${l}`}else return""};function gl(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
2
+ <svg width="100%" height="100%">
3
+ <path id="hw-drop-guides" />
4
+ <path
5
+ id="vuu-drop-outline"
6
+ d="M300,132 L380,132 L380,100 L460,100 L460,132, L550,132 L550,350 L300,350z">
7
+ <animate
8
+ attributeName="d"
9
+ id="hw-drop-outline-animate"
10
+ begin="indefinite"
11
+ dur="300ms"
12
+ fill="freeze"
13
+ to="M255,33 L255,33,L255,1,L315,1,L315,1,L794,1,L794,164,L255,164Z"
14
+ />
15
+ </path>
16
+ </svg>
17
+ `,document.body.insertBefore(t,e)}}var Pt=class{constructor(){this.currentPath=null;this.tabMode=null;gl()}prepare(t,o="full-view"){document.body.classList.add("drawing"),this.currentPath=null,this.tabMode=o;let n=this.getPoints(0,0,0,0),r=rs(n),s=document.getElementById("vuu-drop-outline");s==null||s.setAttribute("d",r),this.currentPath=r}clear(){Tt=null,eo(),document.body.classList.remove("drawing"),Z.hidePopup()}get hoverDropTarget(){return Tt}getPoints(t,o,n,r,s=0,i=0,a=0){let l=this.tabMode==="tab-only";if(i===0)return[[t,o+a],[t,o+a],[t,o],[t+i,o],[t+i,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=s;return[[c,o],[c,o],[c+i,o],[c+i,o],[c+i,o+a],[c+i,o+a],[c,o+a],[c,o+a]]}else return s===0?[[t,o+a],[t,o+a],[t,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+s,o+a],[t+s,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=mn;if(Tt!==null)this.drawTarget(Tt);else if(mn=t.nextDropTarget!=null,t.pos.tab?yl(t):le&&eo(),this.drawTarget(t,o),mn){let[s,i,a]=pn(t);{let l=(0,as.jsx)(dn,{dropTarget:t,onHover:dl,orientation:a});Z.showPopup({left:s,top:i,component:l})}}else Z.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:s,t:i,r:a,b:l,tabLeft:c,tabWidth:u,tabHeight:d,guideLines:p}=r,m=a-s,f=l-i;if(this.currentPath){let R=document.getElementById("vuu-drop-outline");R==null||R.setAttribute("d",this.currentPath)}let g=this.getPoints(s,i,m,f,c,u,d),b=rs(g),h=document.getElementById("hw-drop-outline-animate");h==null||h.setAttribute("to",b),h==null||h.beginElement(),this.currentPath=b;let S=document.getElementById("hw-drop-guides");S==null||S.setAttribute("d",hl(p))}}},ss="transition:margin-left .4s ease-out;margin-left: 63px",is="transition:margin-left .4s ease-out;margin-left: 0px";function yl(e){var a,l;let{AFTER:t,BEFORE:o}=wt,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:s}=e.component.props,i=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,u=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;i=(a=document.getElementById(s))==null?void 0:a.querySelector(u),i?(le===null||le!==i)&&(i.style.cssText=ss,le&&(le.style.cssText=is),le=i):eo()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(le===null){let c=".vuuHeader-title";i=(l=document.getElementById(s))==null?void 0:l.querySelector(c),i.style.cssText=ss,le=i}}else eo()}function eo(){le&&(le.style.cssText=is,le=null)}var Ee,Dt,ze,cs,us,Ge,to,rt=null,hn,ps,Mt,ds,fn,oo=null,bl=3,no=new Pt,ls=.4;function xl(e,t){return t?K(e,t):ye(e,o=>o.dropTarget)}var io={handleMousedown(e,t,o={}){Ee=t,ps=o,cs=e.clientX,us=e.clientY,fn=o.dragThreshold===void 0?bl:o.dragThreshold,fn===0?Ee(e,0,0):(window.addEventListener("mousemove",ro,!1),window.addEventListener("mouseup",so,!1),oo=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",ro,!1),window.removeEventListener("mouseup",so,!1),Ee==null||Ee(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:s},i,a,l,c){return{drag:Dt,drop:ze}=a,Rl(e,t,{top:o,left:n,right:r,bottom:s},i,l,c)}};function ro(e){var t=!0,o=!0;let n=t?e.clientX-cs:0,r=o?e.clientY-us:0;Math.max(Math.abs(n),Math.abs(r))>fn&&(window.removeEventListener("mousemove",ro,!1),window.removeEventListener("mouseup",so,!1),Ee==null||Ee(e,n,r),Ee=null)}function so(){oo&&(window.clearTimeout(oo),oo=null),window.removeEventListener("mousemove",ro,!1),window.removeEventListener("mouseup",so,!1)}function Rl(e,t,o,n,r,s){Ge=xl(e,t);let{"data-path":i,path:a=i}=I(Ge);s&&(hn=s.map(p=>ye(e,m=>m.id===p)).map(p=>p.props.path)),Mt=ot.measure(Ge,s),console.log({_measurements:Mt});let l=Mt[a];to=new Zt(l,n.x,n.y,o,r);let c=Math.round(to.x.mousePct*100),u=Math.round(to.y.mousePct*100);return window.addEventListener("mousemove",ms,!1),window.addEventListener("mouseup",fs,!1),ds=!1,no.prepare(o,"tab-only"),ps.DoNotTransform?"transform:none":`transform:scale(${ls},${ls});transform-origin:${c}% ${u}%;`}function ms(e){let t=e.clientX,o=e.clientY,n=to,r=rt,s,i,a;n.update("x",t)&&(i=n.x.pos),n.update("y",o)&&(a=n.y.pos),i===void 0&&a===void 0||Dt==null||Dt(i,a),!ds&&(n.inBounds()?s=qt(t,o,Ge,Mt,n.hasIntrinsicSize(),hn):s=qt(n.dropX(),n.dropY(),Ge,Mt),r&&(s==null||s.box!==r.box)&&(rt=null),s&&(no.draw(s,n),rt=s))}function fs(){El()}function El(){if(rt){let e=no.hoverDropTarget||Re.getActiveDropTarget(rt);ze==null||ze(e),rt=null}else ze==null||ze({component:Ge,pos:{position:Y.Absolute}});Dt=null,ze=null,Ge=null,no.clear(),hn=null,window.removeEventListener("mousemove",ms,!1),window.removeEventListener("mouseup",fs,!1)}var wl={},hs=[0,0],Sl=(e,t,o)=>{let n=document.createElement("div");n.className="vuuSimpleDraggableWrapper",n.classList.add("vuuSimpleDraggableWrapper","salt-theme","salt-density-medium"),n.dataset.dragging="true";let r=o!=null?o:document.createElement("div");r.id=t,n.appendChild(r),document.body.appendChild(n);let s=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,s,e.left,e.top]},vl=e=>{let{offsetParent:t}=e;if(t===null)return hs;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},gs=(e,t)=>{let o=(0,we.useRef)(),n=(0,we.useRef)(),r=(0,we.useRef)(),s=(0,we.useCallback)((c,u)=>{if(n.current&&r.current){let{dragOffsets:[d,p],targetPosition:m}=n.current,f=typeof c=="number"?c-d:m.left,g=typeof u=="number"?u-p:m.top;(f!==m.left||g!==m.top)&&(n.current.targetPosition.left=f,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=f+"px")}},[]),i=(0,we.useCallback)(c=>{if(n.current){let{dragInstructions:u,payload:d,originalCSS:p}=n.current;t({type:"drag-drop",draggedReactElement:d,dragInstructions:u,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:u}),r.current&&(u.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=p,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[]),a=(0,we.useCallback)(c=>{if(o.current){let{payload:u,dragContainerPath:d,dragElement:p,dragRect:m,instructions:f=wl,path:g}=o.current,{current:b}=e,h={x:c.clientX,y:c.clientY},S=u!=null?u:K(b,g,!0),{id:R}=S.props,y=te(S),x="",E="",T="",D=f,P=-1,M=-1,w=hs,v=document.getElementById(R);if(v===null)[v,E,P,M]=Sl(m,R,p),D={...D,RemoveDraggableOnDragEnd:!0};else{w=vl(v);let[L,C]=w,{width:O,height:W,left:_,top:J}=v.getBoundingClientRect();P=_-L,M=J-C,E=`width:${O}px;height:${W}px;left:${P}px;top:${M}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,v.dataset.dragging="true",x=v.style.cssText}T=io.initDrag(e.current,d,m,h,{drag:s,drop:i},y),v.style.cssText=E+T,r.current=v,n.current={payload:S,originalCSS:x,dragRect:m,dragOffsets:w,dragInstructions:f,targetPosition:{left:P,top:M}}}},[s,i,e]);return(0,we.useCallback)(c=>{let{evt:u,...d}=c;console.log("prepare to drag",{options:d}),o.current={...d,dragContainerPath:""},io.handleMousedown(u,a,d.instructions)},[a])};var gn=require("react/jsx-runtime"),ys=e=>e.dropTarget,Tl=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Pl=()=>{let e=bs();return(0,gn.jsx)("div",{children:`Context: ${e} `})},Dl=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=(0,q.useRef)(void 0),s=(0,q.useRef)(t),[,i]=(0,q.useState)(null),a=(0,q.useCallback)(d=>{if(n){let p=ye(d,ys)||r.current,f=z(p)==="DraggableLayout"?I(p).children[0]:p,g=Er(f);n(g,"drag-root")}},[n]),l=(0,q.useCallback)((d,p=!1)=>{let m=Hr(r.current,d);m!==r.current&&(r.current=m,i({}),!p&&Tl(d)&&a(m))},[a]),c=(0,q.useCallback)(d=>{d.type==="drag-start"?u(d):d.type==="save"?a(r.current):r.current&&l(d)},[l,a]),u=gs(r,c);return(0,q.useEffect)(()=>{if(o){let d=ye(r.current,ys),p=Bo(d),m=Ut(o,`${d.props.path}.0`),f=p?{type:ne.REPLACE,target:p,replacement:m}:{type:ne.ADD,path:d.props.path,component:m};l(f,!0)}},[l,o]),r.current===void 0?r.current=Jo(t):t!==s.current&&(r.current=Jo(t,r.current),s.current=t),(0,gn.jsx)(tt.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},j=()=>{let{dispatchLayoutProvider:e}=(0,q.useContext)(tt);return e},bs=()=>{console.log({LayoutProviderContext:tt});let{version:e}=(0,q.useContext)(tt);return e};var Rs=require("react/jsx-runtime"),yn=function(t){let{path:o}=t,n=j(),r=(0,xs.useCallback)(s=>{n({type:Ne.SPLITTER_RESIZE,path:o,sizes:s})},[n,o]);return(0,Rs.jsx)(Qe,{...t,onSplitterMoved:r})};yn.displayName="Flexbox";N("Flexbox",yn,"container");var zs=require("@salt-ds/core"),ks=k(require("classnames")),Os=require("react");var ce=require("react");var Ke=require("react"),Ml=["height","width"],Ll=["height"],Cl=["width"],Ue=new WeakMap,ws=(e,t,o)=>{switch(o){case"height":return t.height;case"scrollHeight":return e.scrollHeight;case"scrollWidth":return e.scrollWidth;case"width":return t.width;default:return 0}},Es=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=Ue.get(o);if(r){let{onResize:s,measurements:i}=r,a=!1;for(let[l,c]of Object.entries(i)){let u=ws(o,n,l);u!==c&&(a=!0,i[l]=u)}a&&s&&s(i)}}});function Lt(e,t,o,n=!1){let r=(0,Ke.useRef)(t),s=(0,Ke.useCallback)(i=>{let a=i.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=ws(i,a,c),l),{})},[]);(0,Ke.useLayoutEffect)(()=>{let i=e.current,a=!1;async function l(){Ue.set(i,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let u=Ue.get(i);if(u){let d=s(i);u.measurements=d,Es.observe(i),n&&o(d)}}}if(i){if(Ue.has(i))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{i&&Ue.has(i)&&(Es.unobserve(i),Ue.delete(i),a=!0)}},[e,s]),(0,Ke.useLayoutEffect)(()=>{let i=e.current,a=Ue.get(i);if(a){if(r.current!==t){r.current=t;let l=s(i);a.measurements=l}a.onResize=o}},[t,s,e,o])}function Il(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,s){let i=r.getPropertyValue(`--${e}-breakpoint-${s}`);return i?parseInt(i):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var Al=([,e],[,t])=>t-e,xn=e=>Object.entries(e).sort(Al).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),bn=null,zl=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:s}=Il(e);return xn({xs:t,sm:o,md:n,lg:r,xl:s})},Ss=e=>(bn===null&&(bn=zl(e)),bn);var kl=[],Rn=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=(0,ce.useState)(t?!1:"lg"),s=(0,ce.useRef)(document.body),i=(0,ce.useRef)(e?xn(e):Ss()),a=(0,ce.useRef)("lg"),l=(0,ce.useCallback)(u=>{if(i.current){for(let[d,p]of i.current)if(u>=p)return d}},[i]),c=(0,ce.useCallback)(u=>{if(t){let d=i.current.find(([p])=>p===t);if(d){let[,,p]=d;return u<p}}else return l(u);return u},[t,l]);return Lt(o||s,i.current?["width"]:kl,({width:u})=>{let d=c(u);d!==a.current&&(a.current=d,r(d))},!0),(0,ce.useEffect)(()=>{let u=o||s;if(u.current){let d=a.current;if(i.current){let{clientWidth:p}=u.current,m=c(p);a.current=m,m!==d&&r(m)}}},[r,c,o]),n};var B=require("react");var Ol=["left","right"],Bl=["top","bottom"];function Ct(e,t="width"){let{[t]:o}=e.getBoundingClientRect(),{padRight:n=!1,padLeft:r=!1}=e.dataset,s=getComputedStyle(e),[i,a]=t==="width"?Ol:Bl,l=r?0:parseInt(s.getPropertyValue(`margin-${i}`),10),c=n?0:parseInt(s.getPropertyValue(`margin-${a}`),10),u=o;if(parseInt(s.getPropertyValue("flex-shrink"),10)>0){let p=parseInt(s.getPropertyValue("flex-basis"),10);isNaN(p)||(u=p)}return l+u+c}var $l={horizontal:["width","scrollHeight"],vertical:["height","scrollWidth"],none:[]},Nl={},Ds={},Hl='[data-collapsible="dynamic"]:not([data-collapsed="true"]):not([data-collapsing="true"])',En=(e,t)=>e+t.size,vs=(e,t)=>e+(t.isOverflowIndicator?0:t.size),Fl=e=>{for(let t=e.length-1;t>=0;t--){let o=e[t];if(!o.isOverflowIndicator)return o}return null},st=1e3,Vl=e=>e>0&&e<1e3,Sn=e=>e>=st,wn=e=>e.current[e.current.length-1],Wl=e=>e.some(t=>t.collapsed&&t.fullWidth===null),_l=e=>e.current.querySelector(Hl)!==null,Ts=(e,t)=>{let o=Fl(e.current);return o?(e.current=e.current.filter(n=>n!==o),t.current=t.current.concat(o),o):null},Ms=(e,t)=>{let o=e.priority-t.priority;return o===0&&(o=e.index-t.index),o},Ps=e=>e.current.find(t=>t.isOverflowIndicator),Gl={horizontal:{size:"clientWidth",depth:"clientHeight",scrollDepth:"scrollHeight"},vertical:{size:"clientHeight",depth:"clientWidth",scrollDepth:"scrollWidth"}},Ul=({current:e},t="horizontal")=>{let o=Gl[t],{[o.depth]:n}=e.parentNode,{[o.scrollDepth]:r,[o.size]:s}=e;return[n<r,s,n]},Kl=()=>{let[,e]=(0,B.useState)(null),[t,o]=(0,B.useState)(0),n=(0,B.useRef)(0),r=(0,B.useCallback)(i=>{o(n.current=i)},[o]),s=(0,B.useCallback)((i,a)=>{Math.abs(i)===st?i>0&&!Sn(n.current)||i<0&&Sn(n.current)?r(n.current+i):e({}):i!==0?r(n.current+i):a&&e({})},[e,n,r]);return[n,t,s]},Xl=({current:e},t)=>Array.from(e.childNodes).reduce((n,r)=>{var p;let{collapsible:s,collapsed:i,collapsing:a,index:l,priority:c="1",overflowIndicator:u,overflowed:d}=(p=r==null?void 0:r.dataset)!=null?p:Ds;if(l){let m=Ct(r,t);d&&delete r.dataset.overflowed,n.push({collapsible:s,collapsed:s?i==="true":void 0,collapsing:a,fullSize:null,index:parseInt(l,10),isOverflowIndicator:u,label:r.title||r.innerText,priority:parseInt(c,10),size:m})}return n},[]).sort(Ms),ue=(e,t)=>e.current.querySelector(`:scope > [data-idx='${t.index}']`);function Yl(e="horizontal",t=""){let o=(0,B.useRef)(null),[n,r,s]=Kl(),i=(0,B.useRef)([]),a=(0,B.useRef)([]),l=(0,B.useRef)([]),c=(0,B.useRef)(!1),u=(0,B.useRef)(null),d=(0,B.useRef)(null),p=(0,B.useRef)(e==="horizontal"),m=(0,B.useRef)(36),f=(0,B.useRef)(0),g=(0,B.useCallback)(D=>{let P=p.current;if(D===void 0){let w=P?"width":"height";({[w]:D}=o.current.getBoundingClientRect())}f.current=D;let M=P?"minWidth":"minHeight";o.current.style[M]=D+"px"},[o]),b=(0,B.useCallback)((D,P)=>{let M=0;if(i.current.some(w=>w.collapsible&&!w.collapsed))for(let w=i.current.length-1;w>=0;w--){let v=i.current[w];if(v.collapsible==="instant"&&!v.collapsed){v.collapsed=!0;let L=ue(o,v);return L.dataset.collapsed=!0,l.current.push(v),1}else if(v.collapsible==="dynamic"&&!v.collapsed&&!v.collapsing){v.collapsing=!0;let L=ue(o,v);return L.dataset.collapsing=!0,l.current.push(v),o.current.dataset.collapsing=!0,1}}for(;D>P;){let w=Ts(i,a);if(w===null){g(D);break}D-=w.size;let v=ue(o,w);v.dataset.overflowed=!0,M=st}return M},[g]),h=(0,B.useCallback)(D=>{let P=0,M=i.current.reduce(vs,0),w=D-M;if(Vl(n.current)){for(;l.current.length;){let v=wn(l),L=v.fullSize-v.size;if(w>=L){v.collapsed=!1,v.size=v.fullSize,delete v.fullSize;let C=ue(o,v);l.current.pop(),delete C.dataset.collapsed,w=w-L,P+=1}else break}return P}else for(;a.current.length>0;){let{size:v}=wn(a);if(w>=v){let{size:L=0}=Ps(i)||Nl;if(a.current.length===1||w>=v+L){let C=Ts(a,i);M+=C.size;let O=ue(o,C);delete O.dataset.overflowed,w=w-C.size,P=st}else break}else break}return P},[n]),S=(0,B.useCallback)(()=>{let P=i.current.reduce(En,0)-d.current;for(let M=i.current.length-1;M>=0;M--){let w=i.current[M];if(w.collapsible&&!w.collapsed){let v=ue(o,w);if(P>w.size-36)v.dataset.collapsed=w.collapsed=!0,P-=w.size;else{v.dataset.collapsing=w.collapsing=!0;break}}}},[d,o,i]),R=(0,B.useCallback)((D,P)=>{P.dataset.collapsing=D.collapsing=!1,P.dataset.collapsed=D.collapsed=!0;let w=i.current.filter(({collapsible:v,collapsed:L})=>v==="dynamic"&&!L).pop();if(w){let v=ue(o,w);v.dataset.collapsing=w.collapsing=!0}else g()},[g]),y=(0,B.useCallback)((D,P)=>{P.dataset.collapsing=D.collapsing=!1},[]),x=(0,B.useCallback)(D=>{let P=i.current.find(({collapsible:L,collapsing:C})=>L==="dynamic"&&C),M=i.current.find(({collapsible:L,collapsed:C})=>L==="dynamic"&&C);if(P===void 0&&M===void 0)return;if(P===void 0){let L=ue(o,M);L.dataset.collapsed=M.collapsed=!1,L.dataset.collapsing=M.collapsing=!0;return}let w=ue(o,P),v=p.current?"width":"height";if(D&&M){let L=Ct(w,v);M&&L===P.size&&y(P,w)}else{let{[v]:L}=w.getBoundingClientRect(),C=getComputedStyle(w),O=parseInt(C.getPropertyValue(`min-${v}`));L===O&&R(P,w)}},[R,y]),E=(0,B.useCallback)(()=>{let[D,P,M]=Ul(o,e);d.current=P,u.current=M;let w=_l(o);if(w||D){let v=p.current?"width":"height",L=Xl(o,v);i.current=L,a.current=[]}if(w)if(c.current=!0,o.current.dataset.collapsing=!0,D)S();else{let v=wn(i),L=ue(o,v);L.dataset.collapsing=v.collapsing=!0}else if(D){let v=i.current.reduce(vs,0),L=b(v,P-m.current);s(+L)}},[S,b,e,s]),T=(0,B.useCallback)(({scrollHeight:D,height:P=D,scrollWidth:M,width:w=M})=>{let[v,L]=p.current?[w,P]:[P,w],C=n.current===0,O=L>u.current,W=v>d.current;if(d.current=v,!(W&&v===f.current)){if(c.current)x(W);else if(!C&&W){let _=h(v);_!==st||a.current.length===0?s(-_):_===st&&s(0,!0)}else if(C&&O)E();else if(!C&&O){let _=i.current.reduce(En,0);if(v<_){let J=b(_,v);s(+J)}}}},[x,h,E,b,n,s]);return(0,B.useLayoutEffect)(()=>{var P;let D=p.current?"width":"height";if(Wl(i.current)){let[M]=i.current.filter(w=>w.collapsed);if(M.fullSize===null){let w=ue(o,M);if(w){let v=Ct(w,D);M.fullSize=M.size,M.size=v;let L=i.current.reduce(En,0);if(L>d.current){let C=b(L,d.current-m.current);s(+C)}}}}else if(Sn(r)){let M=o.current.querySelector(":scope > [data-overflow-indicator='true']");if(M){let{index:w,priority:v="1"}=(P=M==null?void 0:M.dataset)!=null?P:Ds,L={index:parseInt(w,10),isOverflowIndicator:!0,priority:parseInt(v,10),label:M.innerText,size:Ct(M,D)};m.current=L.size,i.current=i.current.concat(L).sort(Ms)}}else Ps(i)&&(i.current=i.current.filter(M=>!M.isOverflowIndicator))},[b,r,o,s,i]),(0,B.useLayoutEffect)(()=>{async function D(){await document.fonts.ready,o.current!==null&&E()}e!=="none"&&D()},[t,e,E]),Lt(o,$l[e],T),[o,a.current,l.current,E]}var Ls="data-collapsible",Zl={[Ls]:!0,"data-pad-start":!0,"data-pad-end":!0},Cs=e=>{var t;return(t=Zl[e])!=null?t:!1},ql=e=>e===Ls,Jl={dynamic:"dynamic",instant:"instant",true:"instant"},jl=e=>{var t;return(t=Jl[e])!=null?t:"none"},Ql=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Cs(o)){let s=ql(o)?jl(e[o]):e[o];n[o]=s,r[o]=void 0}return t},[{},{}]);var Q=require("react"),Is=require("@vuu-ui/vuu-utils");var ec=["xs","sm","md","lg","xl"],tc=12,As=({children:e,cols:t,style:o})=>{let n=(0,Q.useRef)(null),r=(0,Q.useRef)(null),s=(0,Q.useRef)(),i=t!=null?t:tc,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=(0,Q.useMemo)(()=>Array.isArray(e)?e:(0,Q.isValidElement)(e)?[e]:[],[e]),u=(0,Q.useCallback)((d,p)=>{let m=Gt(d,p,ec),f=[],g=[];for(let b=0;b<d.length;b++){let h=d[b],{style:{flex:S,...R}}=h.props;f.push((0,Q.cloneElement)(h,{key:(0,Is.getUniqueId)(),style:{...R,"--parent-col-count":i}})),g.push(m[b])}return[f,g]},[i]);return(0,Q.useMemo)(()=>{let[d,p]=u(c,l);r.current=p,s.current=d},[u,c,l]),{cols:i,content:s.current,rootRef:n}};var Bs=require("react/jsx-runtime"),ao="hwFluidGrid",lo=(0,Os.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:s,cols:i=12,className:a,flexFill:l,gap:c=3,fullPage:u,id:d,onSplitterMoved:p,resizeable:m,row:f,showGrid:g,spacing:b,splitterSize:h,style:S,...R}=t,{cols:y,content:x,rootRef:E}=As({children:r,cols:i,style:S}),T=Rn({breakPoints:n},E),D=(0,ks.default)(ao,a,{[`${ao}-column`]:s,[`${ao}-row`]:f,[`${ao}-show-grid`]:g,"flex-fill":l,"full-page":u}),P={...S,"--spacing":b,"--grid-col-count":y,"--grid-gap":c};return(0,Bs.jsx)("div",{...R,className:D,"data-breakpoint":T,"data-cols":y,"data-resizeable":m||void 0,id:d,ref:(0,zs.useForkRef)(E,o),style:P,children:x})});lo.displayName="FluidGrid";var $s=require("react/jsx-runtime"),vn=function(t){return(0,$s.jsx)(lo,{...t})};vn.displayName="FluidGrid";N("FluidGrid",vn,"container");var It=k(require("react")),oc={dispatch:null},At=It.default.createContext(oc),Tn=()=>{var t;let e=(0,It.useContext)(At);return(t=e==null?void 0:e.dispatch)!=null?t:null},nc=()=>(0,It.useContext)(At);var uo=require("@salt-ds/core"),Ws=k(require("classnames")),me=k(require("react"));var Ns=k(require("classnames")),Xe=k(require("react"));var pe=require("@heswell/salt-lab"),Hs=require("@salt-ds/icons");var Se=require("react/jsx-runtime"),Pn=({className:e,contributions:t,collapsed:o,expanded:n,closeable:r,onEditTitle:s,orientation:i="horizontal",style:a,tearOut:l,title:c="Untitled"})=>{let u=(0,Xe.useRef)(null),[d,p]=(0,Xe.useState)(c),[m,f]=(0,Xe.useState)(!1),g=Tn(),b=(C,O)=>g==null?void 0:g({type:O},C),h=C=>g==null?void 0:g({type:"remove"},C),S="vuuHeader",R=C=>{var O;(O=u.current)==null||O.focus()},y=C=>{C.stopPropagation()},E=(0,Ns.default)(S,e,`${S}-${o||i}`),T=()=>{f(!0)},D=C=>{C.key==="Enter"&&f(!0)},P=(C="",O="",W=!0,_=!1)=>{var J;f(!1),_?p(C):O!==C&&(p(O),s==null||s(O)),W===!1&&((J=u.current)==null||J.focus())},M=C=>{g==null||g({type:"mousedown"},C)},w=[],v=[],L=[];return c&&w.push((0,Se.jsx)(pe.ToolbarField,{className:"vuuHeader-title",children:(0,Se.jsx)(pe.EditableLabel,{editing:m,value:d,onChange:p,onMouseDownCapture:R,onEnterEditMode:T,onExitEditMode:P,onKeyDown:D,ref:u,tabIndex:0},"title")},"title")),t==null||t.forEach((C,O)=>{v.push(Xe.default.cloneElement(C.content,{key:O}))}),r&&L.push((0,Se.jsxs)(pe.ToolbarButton,{onClick:h,onMouseDown:y,children:[(0,Se.jsx)(Hs.CloseIcon,{})," Close"]},"close")),v.length>0&&w.push((0,Se.jsx)(pe.Tooltray,{"data-align-end":!0,children:v},"contributions")),L.length>0&&w.push((0,Se.jsx)(pe.Tooltray,{"data-align-end":!0,children:L},"actions")),(0,Se.jsx)(pe.Toolbar,{className:E,orientation:i,style:a,onMouseDown:M,children:w})};var de=require("react");var ke=require("react");var zt=(e,t,o,n)=>{var b;let{loadSessionState:r,purgeSessionState:s,purgeState:i,saveSessionState:a}=Fe(),[l,c]=(0,ke.useState)((b=r(e,"contributions"))!=null?b:[]),u=j(),d=(0,ke.useCallback)((h,S)=>{let R=l.concat([{location:h,content:S}]);a(e,"contributions",R),c(R)},[l,e,a]),p=(0,ke.useCallback)(()=>{s(e,"contributions"),c([])},[e,s]),m=(0,ke.useCallback)(()=>{let h=r(e,"data-source");h&&h.unsubscribe(),s(e),i(e),u({type:"remove",path:o})},[u,e,r,s,i,o]),f=(0,ke.useCallback)(async(h,S,R)=>{var x;h.stopPropagation();let y=(x=t.current)==null?void 0:x.getBoundingClientRect();return new Promise((E,T)=>{u({type:"drag-start",evt:h,path:S===void 0?o:`${o}.${S}`,dragRect:y,preDragActivity:R,dropTargets:n,resolveDragStart:E,rejectDragStart:T})})},[t,u,o,n]);return[(0,ke.useCallback)(async(h,S)=>{var y;let{type:R}=h;switch(R){case"maximize":case"minimize":case"restore":return u({type:R,path:(y=h.path)!=null?y:o});case"remove":return m();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),f(S,h.index,h.preDragActivity);case"add-toolbar-contribution":return d(h.location,h.content);case"remove-toolbar-contribution":return p();default:return}},[u,o,m,f,d,p]),l]};var Fs=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let s=j(),{loadState:i,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:u}=Fe(),[d,p]=zt(e,t,o,n),m=(0,de.useMemo)(()=>{var E;return(E=i("view-title"))!=null?E:r},[i,r]),f=(0,de.useCallback)(E=>{o&&s({type:"set-title",path:o,title:E})},[s,o]),g=(0,de.useMemo)(()=>i(e),[e,i]),b=(0,de.useCallback)(E=>i(e,E),[e,i]),h=(0,de.useCallback)(E=>{l(e,E),s({type:"save"})},[e,l]),S=(0,de.useCallback)((E,T)=>{c(e,T,E),s({type:"save"})},[e,s,c]),R=(0,de.useCallback)(E=>a(e,E),[e,a]),y=(0,de.useCallback)((E,T)=>u(e,T,E),[e,u]),x=(0,de.useCallback)(({type:E,...T})=>{let{[E]:D}=T;S(D,E)},[S]);return{contributions:p,dispatchViewAction:d,load:b,loadSession:R,onConfigChange:x,onEditTitle:f,purge:h,restoredState:g,save:S,saveSession:y,title:m}};var co=require("@heswell/salt-lab"),it=require("react"),rc=[],Vs=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=(0,it.useRef)({}),s=(0,it.useRef)(),i=(0,it.useCallback)(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),s.current=void 0},[]),a=(0,it.useCallback)(({height:l,width:c})=>{r.current.height=l,r.current.width=c,s.current!==null&&clearTimeout(s.current),s.current=window.setTimeout(i,40)},[i]);(0,co.useResizeObserver)(o,n?co.WidthHeight:rc,a,n)};var at=require("react/jsx-runtime"),_s=(0,me.forwardRef)(function(t,o){let{children:n,className:r,collapsed:s,closeable:i,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:u,id:d,header:p,orientation:m="horizontal",path:f,resize:g="responsive",resizeable:b=a,tearOut:h,style:S={},title:R,...y}=t,x=(0,uo.useIdMemo)(d),E=(0,me.useRef)(null),T=(0,me.useRef)(null),{contributions:D,dispatchViewAction:P,load:M,loadSession:w,onConfigChange:v,onEditTitle:L,purge:C,restoredState:O,save:W,saveSession:_,title:J}=Fs({id:x,rootRef:E,path:f,dropTargets:l,title:R});Vs({mainRef:T,resize:g,rootRef:E});let $e="vuuView",Mo=()=>me.default.isValidElement(n)&&O?me.default.cloneElement(n,O):n,Lo=(0,me.useMemo)(()=>({dispatch:P,id:x,path:f,title:J,load:M,loadSession:w,onConfigChange:v,purge:C,save:W,saveSession:_}),[P,x,M,w,v,f,C,W,_,J]),dt=typeof p=="object"?p:{};return(0,at.jsx)("div",{...y,className:(0,Ws.default)($e,r,{[`${$e}-collapsed`]:s,[`${$e}-expanded`]:c,[`${$e}-resize-defer`]:g==="defer"}),"data-resizeable":b,id:x,ref:(0,uo.useForkRef)(o,E),style:S,tabIndex:-1,children:(0,at.jsxs)(At.Provider,{value:Lo,children:[p?(0,at.jsx)(Pn,{...dt,collapsed:s,contributions:D,expanded:c,closeable:i,onEditTitle:L,orientation:m,tearOut:h,title:J}):null,(0,at.jsx)("div",{className:`${$e}-main`,ref:T,children:Mo()})]})})});_s.displayName="View";var fe=me.default.memo(_s);fe.displayName="View";N("View",fe,"view");var Ks=require("@heswell/salt-lab"),po=require("@heswell/salt-lab"),Xs=require("@salt-ds/icons");var he=require("react/jsx-runtime"),Gs="vuuDialog",sc=({children:e,className:t,isOpen:o=!1,onClose:n,title:r,...s})=>{let i=(0,Oe.useRef)(null),[a,l]=(0,Oe.useState)(0),[c,u]=(0,Oe.useState)(0),d=(0,Oe.useCallback)(()=>{n==null||n()},[n]),p=(0,Oe.useCallback)(()=>{},[]);return o?(0,he.jsx)(jt,{onRender:p,x:a,y:c,children:(0,he.jsx)(Ks.Scrim,{className:`${Gs}-scrim`,open:o,children:(0,he.jsx)("div",{...s,className:(0,Us.default)(Gs,t),ref:i,children:(0,he.jsxs)(Qe,{style:{flexDirection:"column",width:"100%",height:"100%"},children:[(0,he.jsxs)(po.Toolbar,{style:{height:32},children:[(0,he.jsx)("span",{children:r}),(0,he.jsxs)(po.ToolbarButton,{onClick:d,"data-align-end":!0,children:[(0,he.jsx)(Xs.CloseIcon,{})," Close"]},"close")]}),(0,he.jsx)(fe,{style:{flex:1},children:e})]})})})}):null};var ci=require("@salt-ds/core"),Ze=require("react");var V=require("react");function Ys(e){if(e){let t=e.dataset.idx;if(t)return parseInt(t,10);if(t=e.ariaPosInSet)return parseInt(t,10)-1}}var Dn=e=>e.closest("[data-idx],[aria-posinset]");var Zs=(e,t,o)=>e.map((n,r)=>r===e.length-1?{...n,[o]:n[o]-t}:n),ic=(e,t)=>Zs(e,t,"left"),ac=(e,t)=>Zs(e,t,"top"),lc=(e,t)=>{let[o,n]=t.slice(-2),r=document.getElementById(`${e}-${n.id}`),{width:s}=r.getBoundingClientRect();return t.map(i=>i===n?{...i,left:o.left-(s-2)}:i)},cc=e=>e.ariaHasPopup==="true"&&e.ariaExpanded!=="true",uc=(e,t)=>{let[{left:o,top:n}]=t.slice(-1),{offsetWidth:r,offsetTop:s}=e;return{left:o+r,top:s+n}},kt=e=>{let t=e.lastIndexOf("-");return t===-1?e:e.slice(t+1)},mo=e=>{let t=kt(e),o=t.lastIndexOf(".");return o>-1?t.slice(0,o):"root"},pc=e=>{let t=0,o=e.indexOf(".",0);for(;o!==-1;)t+=1,o=e.indexOf(".",o+1);return t},dc=e=>[mo(e.id),kt(e.id),e.ariaHasPopup==="true",e.ariaExpanded==="true",pc(e.id)],qs=({id:e,onActivate:t,onMouseEnterItem:o,position:{x:n,y:r}})=>{let[,s]=(0,V.useState)({}),i=(0,V.useRef)([{id:"root",left:n,top:r}]),a=(0,V.useCallback)(R=>{i.current=R,s({})},[]),l=(0,V.useRef)(null),c=(0,V.useRef)(null),u=(0,V.useRef)({root:"no-popup"}),d=(0,V.useRef)(0),p=(0,V.useCallback)((R="root",y=null,x=null)=>{if(R==="root"&&y===null)a([{id:"root",left:n,top:r}]);else{u.current[R]="popup-open";let T=(x?x.ownerDocument:document).getElementById(`${e}-${R}-${y}`),{left:D,top:P}=uc(T,i.current);a(i.current.concat({id:y,left:D,top:P}))}},[e,n,r,a]),m=(0,V.useCallback)(R=>{a(R==="root"?[]:i.current.slice(0,-1))},[a]),f=(0,V.useCallback)((R,y)=>{let x=i.current.slice(),{id:E}=x[x.length-1];for(;x.length>1&&!y.startsWith(E);){let T=mo(E);x.pop(),u.current[E]="no-popup",u.current[T]="no-popup",{id:E}=x[x.length-1]}x.length<i.current.length&&a(x)},[a]),g=(0,V.useCallback)((R,y,x)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{console.log(`scheduleOpen timed out opening ${y}`),f(R,y),u.current[R]="popup-open",u.current[y]="no-popup",p(R,y,x)},400)},[f,p]),b=(0,V.useCallback)((R,y,x)=>{console.log(`scheduleClose openMenuId ${R} menuId ${y} itemId ${x}`),u.current[R]="pending-close",c.current=setTimeout(()=>{f(y,x)},400)},[f]),h=(0,V.useCallback)(()=>{let{current:R}=i,[y]=R.slice(-1),x=document.getElementById(`${e}-${y.id}`);if(x){let{right:E,bottom:T}=x.getBoundingClientRect(),{clientHeight:D,clientWidth:P}=document.body;if(E>P){let M=R.length>1?lc(e,R):ic(R,E-P);a(M)}else if(T>D){let M=ac(R,T-D);a(M)}}},[e,a]),S=(0,V.useMemo)(()=>({onMouseEnter:R=>{let y=Dn(R.target),[x,E,T,D,P]=dc(y),M=d.current===P,{current:{[x]:w}}=u;if(d.current=P,w==="no-popup"&&T)u.current[x]="popup-pending",g(x,E,y);else if(w==="popup-pending"&&!T)u.current[x]="no-popup",clearTimeout(l.current),l.current=null;else if(w==="popup-pending"&&T)clearTimeout(l.current),g(x,E,y);else if(w==="popup-open"){let[{id:v},{id:L}]=i.current.slice(-2);v===x&&u.current[L]!=="pending-close"&&M?(b(L,x,E),T&&!D&&g(x,E,y)):v===x&&T&&E!==L&&u.current[L]==="pending-close"?g(x,E,y):T?(f(x,E),g(x,E,y)):u.current[L]==="pending-close"&&M||f(x,E)}w==="pending-close"&&(l.current&&(clearTimeout(l.current),l.current=null),clearTimeout(c.current),c.current=null,u.current[x]="popup-open"),o(R,E)},onClick:R=>{let y=Dn(R.target),x=Ys(y);cc(y).ariaHasPopup==="true"?y.ariaExpanded!=="true"&&p(x):t(kt(y.id))}}),[f,t,o,p,b,g]);return{closeMenu:m,handleRender:h,listItemProps:S,openMenu:p,openMenus:i.current}};var Ye=k(require("react"));var ct=require("react"),Mn=k(require("classnames")),ri=require("@salt-ds/core");var ve=require("react");var Js=e=>e.closest("[data-root='true']")!==null,js=(e,t)=>{var o;return e.ariaHasPopup==="true"&&((o=e.dataset)==null?void 0:o.idx)===`${t}`||e.querySelector(`:scope > [data-idx='${t}'][aria-haspopup='true']`)!==null};var fo=(e,t,...o)=>{let n=()=>{var r,s;return(s=o==null?void 0:(r=o[0]).isPropagationStopped)==null?void 0:s.call(r)};if(e.length>0&&!n()){let r=e.filter(s=>s[t]).map(s=>s[t]);for(let s of r){if(n())break;s(...o)}}};function mc(e,...t){let o=new Set(e);for(let n of t)for(let r of n)o.add(r);return o}var fc="Enter";var hc="Delete",gc=new Set([fc,hc]),yc=new Set(["Tab"]),bc=new Set(["ArrowRight","ArrowLeft"]),Qs=new Set(["Home","End","ArrowDown","ArrowUp"]),ei=new Set(["Home","End","ArrowRight","ArrowLeft"]),xc=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),Ah=mc(gc,ei,Qs,bc,xc,yc);var ti=({key:e},t="vertical")=>(t==="vertical"?Qs:ei).has(e);var oi=({autoHighlightFirstItem:e=!1,count:t,highlightedIdx:o,onActivate:n,onHighlight:r,onKeyDown:s,onCloseMenu:i,onOpenMenu:a},...l)=>{let c=(0,ve.useRef)((o!=null?o:e)?0:-1),[,u]=(0,ve.useState)(null),d=o!==void 0,p=(0,ve.useCallback)(y=>{c.current=y,r&&r(y),fo(l,"onHighlight",y),u({})},[l,r]),m=(0,ve.useRef)(!0),f=(0,ve.useRef)(!1),g=y=>f.current=y,b=(0,ve.useCallback)(y=>{y!==c.current&&(d||p(y))},[d,p]),h=d?o:c.current,S={onFocus:()=>{h===-1&&p(0)},onKeyDown:y=>{if(ti(y)?(y.preventDefault(),y.stopPropagation(),m.current=!0,R(y)):(y.key==="ArrowRight"||y.key==="Enter")&&js(y.target,h)?a(h):y.key==="ArrowLeft"&&!Js(y.target)?i(h):y.key==="Enter"&&n&&n(h),Array.isArray(s))for(let x of s){if(y.isPropagationStopped())break;x(y)}else s&&!y.isPropagationStopped()&&s(y);fo(l,"onKeyDown",y)},onMouseDownCapture:()=>{m.current=!1,g(!0)},onMouseMove:()=>{m.current&&(m.current=!1)},onMouseLeave:()=>{m.current=!0,g(!1),b(-1)}},R=y=>{let x=Rc(t,y.key,c.current);x!==c.current&&(b(x),fo(l,"onKeyboardNavigation",y,x))};return{focusVisible:m.current?h:-1,controlledHighlighting:d,highlightedIdx:h,hiliteItemAtIndex:b,keyBoardNavigation:m,listProps:S,setIgnoreFocus:g}};function Rc(e,t,o){return t==="Up"?o>0?o-1:o:o===null?0:o===e-1?o:o+1}var lt=require("react/jsx-runtime"),ni="hwMenuList",Ln=()=>(0,lt.jsx)("li",{className:"hwMenuItem-divider"}),Ot=()=>null,ho=({children:e,idx:t,...o})=>(0,lt.jsx)("div",{...o,children:e}),Ec=e=>e.props["data-icon"],si=({activatedByKeyboard:e,childMenuShowing:t=-1,children:o,highlightedIdx:n,id:r,isRoot:s,listItemProps:i,menuId:a,onHighlightMenuItem:l,onActivate:c,onCloseMenu:u,onOpenMenu:d,...p})=>{let m=(0,ri.useIdMemo)(r),f=(0,ct.useRef)(null),g=(0,ct.useMemo)(()=>new Map,[]),b=D=>{let P=f.current.querySelector(`:scope > [data-idx='${D}']`);d(P.id)},h=D=>{let P=f.current.querySelector(`:scope > [data-idx='${D}']`);c(P.id)},{focusVisible:S,highlightedIdx:R,listProps:y}=oi({count:o.length,highlightedIdx:n,onActivate:h,onHighlight:l,onOpenMenu:b,onCloseMenu:u,id:m}),x=t==-1?S:-1;return(0,ct.useLayoutEffect)(()=>{t===-1&&e&&f.current.focus()},[e,t]),(0,lt.jsx)("div",{...p,...y,"aria-activedescendant":(()=>R===void 0||R===-1?void 0:g.get(R))(),className:(0,Mn.default)(ni,{[`${ni}-childMenuShowing`]:t!==-1}),"data-root":s||void 0,id:`${m}-${a}`,ref:f,role:"menu",tabIndex:0,children:T()});function T(){let D={...i,role:"menuitem"},P=(v,L)=>L?[(0,lt.jsx)("span",{className:"hwIconContainer"},"icon")].concat(v):v;function M(v,L,C,O){let{children:W,className:_,id:J,hasSeparator:$e,label:Mo,...Lo}=L.props,dt=Cn(L),Fn=dt&&t===C,Li=Fn?`${m}-${J}`:void 0;v.push((0,lt.jsx)(ho,{...Lo,...D,...wc(`${m}-${a}`,J,C,L.key,R,x,_,$e),"aria-controls":Li,"aria-haspopup":dt||void 0,"aria-expanded":Fn||void 0,children:P(dt?Mo:W,O)}))}let w=[];if(o&&o.length>0){let v=o.some(Ec);o.forEach((L,C)=>{M(w,L,C,v)})}return w}},wc=(e,t,o,n,r,s,i,a)=>({id:`${e}-${t}`,key:n!=null?n:o,"data-idx":o,"data-highlighted":o===r||void 0,className:(0,Mn.default)("hwMenuItem",i,{"hwMenuItem-separator":a,focusVisible:s===o})});si.displayName="MenuList";var go=si;var Cn=e=>e.type===Ot||!!e.props["data-group"],ii=(e,t)=>{let o=(0,Ye.useCallback)(()=>{if(t===void 0)return;let s=(a,l="root",c={},u={})=>{let d=c[l]=[],p=0,m=!1;return Ye.default.Children.forEach(a,f=>{if(f.type===Ln)m=!0;else{let g=Cn(f),b=l==="root"?`${p}`:`${l}.${p}`,{props:{action:h,options:S}}=f,[R,y]=i(f,b,g,m);d.push(R),y?s(y,b,c,u):u[b]={action:h,options:S},p+=1,m=!1}}),[c,u]},i=(a,l,c,u=!1)=>{let{props:{children:d}}=a;return[Ye.default.cloneElement(a,{hasSeparator:u,id:`${l}`,key:l,children:c?void 0:d}),c?d:void 0]};return s(t)},[t]),[n,r]=(0,Ye.useMemo)(()=>o(),[o]);return[n,r]};var ai=require("react"),li=({containerClassName:e,isOpen:t,onClose:o})=>{(0,ai.useEffect)(()=>{let n=t?r=>{r.target.closest(`.${e}`)===null&&o("root")}:null;return document.body.addEventListener("click",n,!0),()=>{n&&document.body.removeEventListener("click",n,!0)}},[e,t,o])};var ut=require("react/jsx-runtime"),ui=({activatedWithKeyboard:e=!1,children:t,id:o,onClose:n=()=>{},position:r={x:0,y:0},source:s,style:i})=>{let a=(0,ci.useIdMemo)(o),l=(0,Ze.useRef)(null),[c,u]=ii(s,t),d=(0,Ze.useRef)(e),p=(0,Ze.useCallback)(()=>{d.current=!1},[]),m=(0,Ze.useCallback)(P=>{let{action:M,options:w}=u[P];l.current("root"),n(M,w)},[u,n]),{closeMenu:f,listItemProps:g,openMenu:b,openMenus:h,handleRender:S}=qs({id:a,onActivate:m,onMouseEnterItem:p,position:r});l.current=f,console.log({openMenus:h});let R=(0,Ze.useCallback)(()=>{f(),n()},[f,n]);li({containerClassName:"hwMenuList",onClose:R,isOpen:h.length>0});let y=P=>{let M=kt(P),w=mo(M);d.current=!0,b(w,M)},x=()=>{d.current=!0,f()},E=()=>{},T=h.length-1,D=P=>{if(P>=T)return-1;{let{id:M}=h[P+1],w=M.lastIndexOf(".");return parseInt(w===-1?M:M.slice(-w),10)}};return(0,ut.jsx)(ut.Fragment,{children:h.map(({id:P,left:M,top:w},v)=>{let L=D(v);return(0,ut.jsx)(jt,{x:M,y:w,onRender:S,children:(0,ut.jsx)(go,{activatedByKeyboard:d.current,childMenuShowing:L,id:a,menuId:P,isRoot:v===0,listItemProps:g,onActivate:m,onHighlightMenuItem:E,onCloseMenu:x,onOpenMenu:y,style:i,children:c[P]},v)},v)})})};ui.displayName="ContextMenu";var yo=ui;var Te=k(require("react"));var qe=require("react/jsx-runtime"),Sc=(e,t,o)=>{let{clientX:n,clientY:r}=e,a=(0,qe.jsx)(yo,{onClose:(l,c)=>{l&&(o(l,c),Z.hidePopup())},position:{x:n,y:r},children:(l=>{let c=({children:u,label:d,icon:p,action:m,options:f},g)=>u?(0,qe.jsx)(Ot,{label:d,children:u.map(c)},g):(0,qe.jsx)(ho,{action:m,"data-icon":p,options:f,children:d},g);return l.map(c)})(t)});Z.showPopup({left:0,top:0,component:a})},bo=Te.default.createContext(null),vc={menuItemDescriptors:[]},Tc=()=>{let{menuActionHandler:e,menuBuilders:t}=(0,Te.useContext)(bo),o=(0,Te.useCallback)((r,s,i)=>{let a=[];for(let l of r)a=a.concat(l(s,i));return a},[]);return(r,s,i)=>{r.stopPropagation(),r.preventDefault();let a=o(t,s,i);a.length&&Sc(r,a,e)}},Pc=({children:e,context:{menuBuilders:t,menuActionHandler:o},menuActionHandler:n,menuBuilder:r})=>{let s=(0,Te.useMemo)(()=>t&&r?t.concat(r):r?[r]:t||[],[t,r]),i=(0,Te.useCallback)((a,l)=>{if(n&&n(a,l)||o&&o(a,l))return!0},[o,n]);return(0,qe.jsx)(bo.Provider,{value:{menuActionHandler:i,menuBuilders:s},children:e})},Dc=({children:e,menuActionHandler:t,menuBuilder:o,menuItemDescriptors:n,label:r})=>(0,qe.jsx)(bo.Consumer,{children:s=>(0,qe.jsx)(Pc,{context:s||vc,label:r,menuActionHandler:t,menuBuilder:o,menuItemDescriptors:n,children:e})});var pi=k(require("classnames")),di=require("react");var fi=require("react/jsx-runtime"),In=function(t){let o=(0,di.useRef)();o.current=t;let{className:n,id:r,style:s}=t,i=(0,pi.default)("DraggableLayout",n);return(0,fi.jsx)("div",{className:i,id:r,style:s,children:t.children})},mi="DraggableLayout";In.displayName=mi;N(mi,In,"container");var Ro=require("@heswell/salt-lab"),hi=require("@vuu-ui/vuu-utils"),An=k(require("classnames")),Eo=require("react");var xo=require("react/jsx-runtime"),Mc=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},zn=(0,Eo.memo)(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:s,...i})=>(0,xo.jsx)(Ro.ListItem,{className:(0,An.default)("vuuPaletteItem",e),"data-icon":"grab-handle",...i}));zn.displayName="PaletteItem";var gi=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=j(),s="vuuPalette";function i(a){var E;let c=a.target.closest(".vuuPaletteItem"),u=parseInt((E=c.dataset.idx)!=null?E:"-1");u!==-1&&console.log({children:e,idx:u,listItemElement:c});let{props:{caption:d,children:p,template:m,...f}}=e[u],{height:g,left:b,top:h,width:S}=c.getBoundingClientRect(),R=(0,hi.uuid)(),x=m?p:(0,xo.jsx)(fe,{...{id:R,key:R},...f,title:f.label,children:p});r({dragRect:{left:b,top:h,right:b+S,bottom:h+150,width:S,height:g},dragElement:Mc(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:x,type:"drag-start"})}return(0,xo.jsx)(Ro.List,{...n,borderless:!0,className:(0,An.default)(s,t,`${s}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===zn?(0,Eo.cloneElement)(a,{key:l,onMouseDown:i}):a)})};N("Palette",gi,"view");var So=require("@heswell/salt-lab"),yi=require("@vuu-ui/vuu-utils"),bi=k(require("classnames"));var wo=require("react/jsx-runtime"),Lc="vuuPalette",Cc=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:s,...i}=e,a=j();return(0,wo.jsx)(So.ListItem,{onMouseDown:c=>{let{left:u,top:d,width:p}=c.currentTarget.getBoundingClientRect(),m=(0,yi.uuid)(),g=s?t:(0,wo.jsx)(fe,{...{id:m,key:m},...o,title:e.label,children:t});a({type:"drag-start",evt:c.nativeEvent,path:"*",payload:g,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},dragRect:{left:u,top:d,right:u+p,bottom:d+150,width:p,height:100}})},...i,children:n})},xi=({className:e,...t})=>(0,wo.jsx)(So.List,{...t,className:(0,bi.default)(Lc,e),height:"100%",selectionStrategy:"none"});N("PaletteSalt",xi,"view");var Ri=require("@salt-ds/core"),Ei=k(require("classnames")),Be=require("@heswell/salt-lab"),Pe=k(require("react"));var Je=require("react/jsx-runtime"),Ic="Tabs",Ac=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},zc=e=>{let t=[];return Pe.default.Children.forEach(e,o=>{Pe.default.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},vo=(0,Pe.forwardRef)(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:s,getTabLabel:i=Ac,id:a,keyBoardActivation:l="manual",onMouseDown:c,onTabAdd:u,onTabClose:d,onTabEdit:p,onTabSelectionChanged:m,showTabs:f,style:g,TabstripProps:b},h){let S=(0,Ri.useIdMemo)(a),R=w=>{m==null||m(w)},y=w=>{d==null||d(w)},x=()=>{u==null||u(Pe.default.Children.count(o))},E=w=>{var O;let L=w.target.closest('[role^="tab"]'),C=L==null?void 0:L.getAttribute("role");if(C==="tab"){let W=parseInt((O=L.dataset.idx)!=null?O:"-1");if(W!==-1)c==null||c(w,W);else throw Error("Stack: mousedown on tab with unknown index")}else C==="tablist"&&console.log("Stack mousedown on tabstrip")},T=(0,Pe.useCallback)((w,v,L,C)=>{p==null||p(C,v)},[p]),D=()=>{var w;return Pe.default.isValidElement(o)?o:Array.isArray(o)&&(w=o[t])!=null?w:null},P=()=>zc(o).map((w,v)=>{let L=`${S}-${v}`,{closeable:C,id:O}=w.props;return(0,Je.jsx)(Be.Tab,{ariaControls:`${L}-tab`,draggable:!0,id:L,label:i(w,v),closeable:C,editable:!0},O!=null?O:v)}),M=D();return(0,Je.jsxs)("div",{className:(0,Ei.default)(Ic,n),style:g,id:S,ref:h,children:[f?(0,Je.jsx)(Be.Toolbar,{className:"vuuTabHeader vuuHeader",children:(0,Je.jsx)(Be.ToolbarField,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:(0,Je.jsx)(Be.Tabstrip,{...b,enableRenameTab:!0,enableAddTab:r,enableCloseTab:s,keyBoardActivation:l,onActiveChange:R,onAddTab:x,onCloseTab:y,onExitEditMode:T,onMouseDown:E,activeTabIndex:t||(M===null?-1:0),children:P()})})}):null,M]})});vo.displayName="Stack";var wi=require("@salt-ds/core"),Po=k(require("react"));var To=require("react/jsx-runtime"),kc=e=>(0,To.jsx)(fe,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:(0,To.jsx)(Ht,{style:{flex:1}})}),kn=e=>{let t=(0,Po.useRef)(null),o=j(),{loadState:n,saveState:r}=Fe(),{createNewChild:s=kc,id:i,onTabSelectionChanged:a,path:l,...c}=e,{children:u}=e,d=(0,wi.useIdMemo)(i),[p]=zt(d,t,l);return(0,To.jsx)(vo,{...c,id:d,getTabLabel:(R,y)=>{let{id:x,title:E}=R.props;return n(x,"view-title")||E||`Tab ${y+1}`},onMouseDown:async(R,y)=>{let x;await p({type:"mousedown",index:y,preDragActivity:async()=>new Promise(D=>{console.log("preDragActivity: Ok, gonna release the drag"),x=D})},R)&&(x==null||x(void 0))},onTabAdd:(R,y=Po.default.Children.count(u))=>{if(l){console.log("[StackLayout] handleTabAdd");let x=s(y);console.log({component:x}),o({type:"add",path:l,component:x})}},onTabClose:R=>{if(Array.isArray(u)){let{props:{"data-path":y,path:x=y}}=u[R];o({type:"remove",path:x})}},onTabEdit:(R,y)=>{o({type:"set-title",path:`${l}.${R}`,title:y})},onTabSelectionChanged:R=>{console.log(`StackLayout handleTabSelection nextTab = ${R}`),l&&(o({type:"switch-tab",path:l,nextIdx:R}),a==null||a(R))},ref:t})};kn.displayName="Stack";N("Stack",kn,"container");var pt=k(require("react"));var je=require("react/jsx-runtime"),Oc=({children:e})=>{let[o,n]=(0,pt.useState)(e),[r,s]=(0,pt.useState)(e),i=l=>{let c=$o(o,l);s(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let u=pt.default.cloneElement(r,{style:{...r.props.style,[l]:c}});s(u),n(pt.default.cloneElement(o,null,u))};return(0,je.jsxs)("div",{"data-design-mode":`${!1}`,children:[o,(0,je.jsx)("br",{}),(0,je.jsxs)("div",{style:{display:"flex"},children:[(0,je.jsx)(On,{height:300,managedStyle:r.props.style,width:300,onChange:a}),(0,je.jsx)(Bn,{layout:o,onSelect:i,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};var xe=require("@heswell/salt-lab"),$=require("react/jsx-runtime"),Nn={},Bc={margin:{top:"marginTop",right:"marginRight",bottom:"marginBottom",left:"marginLeft"},border:{top:"borderTopWidth",right:"borderRightWidth",bottom:"borderBottomWidth",left:"borderLeftWidth"},padding:{top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"}},$n=({feature:e,children:t,style:o,onChange:n})=>(0,$.jsxs)("div",{className:`LayoutBox layout-${e} layout-outer`,children:[(0,$.jsxs)("div",{className:"layout-top",children:[(0,$.jsx)("span",{className:"layout-title",children:e}),(0,$.jsx)(xe.FormField,{className:"layout-input",style:{width:30},children:(0,$.jsx)(xe.Input,{value:o.top,onChange:(r,s)=>n(e,"top",s)})})]}),(0,$.jsxs)("div",{className:"layout-inner",children:[(0,$.jsx)("div",{className:"layout-left",children:(0,$.jsx)(xe.FormField,{className:"layout-input",style:{width:30},children:(0,$.jsx)(xe.Input,{value:o.left,onChange:(r,s)=>n(e,"left",s)})})}),t,(0,$.jsx)("div",{className:"layout-right",children:(0,$.jsx)(xe.FormField,{className:"layout-input",style:{width:30},children:(0,$.jsx)(xe.Input,{value:o.right,onChange:(r,s)=>n(e,"right",s)})})})]}),(0,$.jsx)("div",{className:"layout-bottom",children:(0,$.jsx)(xe.FormField,{className:"layout-input",style:{width:30},children:(0,$.jsx)(xe.Input,{value:o.bottom,onChange:(r,s)=>n(e,"bottom",s)})})})]}),$c={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},Nc={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},Hc={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},Do="(\\d+)(?:px)?",Fc=`^(?:${Do}(?:\\s${Do}(?:\\s${Do}(?:\\s${Do})?)?)?)$`,Si=new RegExp(Fc),Vc=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,On=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let s=vi(t),i=(R,y,x)=>{let E=parseInt(x||"0",10),T=Bc[R][y];o(T,E)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:u=0}=s,{borderTopWidth:d=0,borderRightWidth:p=0,borderBottomWidth:m=0,borderLeftWidth:f=0}=s,{paddingTop:g=0,paddingRight:b=0,paddingBottom:h=0,paddingLeft:S=0}=s;return(0,$.jsx)("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:(0,$.jsx)($n,{feature:"margin",style:{top:a,right:l,bottom:c,left:u},onChange:i,children:(0,$.jsx)($n,{feature:"border",style:{top:d,right:p,bottom:m,left:f},onChange:i,children:(0,$.jsx)($n,{feature:"padding",style:{top:g,right:b,bottom:h,left:S},onChange:i,children:(0,$.jsx)("div",{className:"layout-content"})})})})})};function Wc(e=Nn,t=Nn){let{margin:o,marginTop:n,marginRight:r,marginBottom:s,marginLeft:i,padding:a,paddingTop:l,paddingRight:c,paddingBottom:u,paddingLeft:d,...p}=e;if(typeof o=="number")p.marginTop=p.marginRight=p.marginBottom=p.marginLeft=o;else if(typeof o=="string"){let m=Si.exec(o);if(m===null)console.error(`Invalid css value for margin '${o}'`);else{let[,f,g,b,h]=m,S=f&&g&&b;S&&h?(p.marginTop=parseInt(f,10),p.marginRight=parseInt(g,10),p.marginBottom=parseInt(b,10),p.marginLeft=parseInt(h,10)):S?(p.marginTop=parseInt(f,10),p.marginRight=p.marginLeft=parseInt(g,10),p.marginBottom=parseInt(b,10)):f&&g?(p.marginTop=p.marginBottom=parseInt(f,10),p.marginRight=p.marginLeft=parseInt(g,10)):p.marginTop=p.marginRight=p.marginBottom=p.marginLeft=parseInt(f,10)}}if(typeof n=="number"&&(p.marginTop=n),typeof r=="number"&&(p.marginRight=r),typeof s=="number"&&(p.marginBottom=s),typeof i=="number"&&(p.marginLeft=i),typeof a=="number")p.paddingTop=p.paddingRight=p.paddingBottom=p.paddingLeft=a;else if(typeof a=="string"){let m=Si.exec(a);if(m===null)console.error(`Invalid css value for padding '${a}'`);else{let[,f,g,b,h]=m,S=f&&g&&b;S&&h?(p.paddingTop=parseInt(f,10),p.paddingRight=parseInt(g,10),p.paddingBottom=parseInt(b,10),p.paddingLeft=parseInt(h,10)):S?(p.paddingTop=parseInt(f,10),p.paddingRight=p.paddingLeft=parseInt(g,10),p.paddingBottom=parseInt(b,10)):f&&g?(p.paddingTop=p.paddingBottom=parseInt(f,10),p.paddingRight=p.paddingLeft=parseInt(g,10)):p.paddingTop=p.paddingRight=p.paddingBottom=p.paddinggLeft=parseInt(f,10)}}return typeof l=="number"&&(p.paddingTop=l),typeof c=="number"&&(p.paddingRight=c),typeof u=="number"&&(p.paddingBottom=u),typeof d=="number"&&(p.paddingLeft=d),vi(p,t)}function vi(e=Nn){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:s,borderRightWidth:i,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:u,marginTop:d,marginRight:p,marginBottom:m,marginLeft:f,padding:g,paddingTop:b,paddingRight:h,paddingBottom:S,paddingLeft:R,...y}=t,x={},E={};if(typeof u=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=u,x={marginTop:u,marginRight:u,marginBottom:u,marginLeft:u}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,E={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||s||i||a||l){typeof n=="string"&&(o=Vc.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(s=s===void 0?r:s,i=i===void 0?r:i,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let T=`
18
+ ${c} ${l||0}px ${s||0}px 0 0 inset,
19
+ ${c} ${-i||0}px ${-a||0}px 0 0 inset`;return{...y,...x,...E,borderTopWidth:s,borderRightWidth:i,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,borderStyle:"solid",boxShadow:T}}else return t}var Ti=k(require("react")),Pi=k(require("classnames"));var Di=require("@heswell/salt-lab"),Hn=require("react/jsx-runtime"),_c="hwLayoutTreeViewer",Mi=(e,t="0")=>({label:z(e),path:t,childNodes:Ti.default.Children.map(e.props.children,(o,n)=>Mi(o,t?`${t}.${n}`:`${n}`))}),Bn=({layout:e,onSelect:t,style:o})=>{let n=[Mi(e)],r=(s,[{path:i}])=>{t(i)};return(0,Hn.jsx)("div",{className:(0,Pi.default)(_c),style:o,children:(0,Hn.jsx)(Di.Tree,{source:n,groupSelection:"single",onSelectionChange:r})})};
20
+ //# sourceMappingURL=index.js.map