@vuu-ui/vuu-layout 0.5.16 → 0.5.18
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.
- package/cjs/index.js +3 -3
- package/cjs/index.js.map +4 -4
- package/esm/index.js +3 -3
- package/esm/index.js.map +4 -4
- package/index.css +1 -1
- package/index.css.map +3 -3
- package/package.json +3 -2
- package/types/{vuu-layout/src/Component.d.ts → Component.d.ts} +0 -0
- package/types/{vuu-layout/src/DraggableLayout.d.ts → DraggableLayout.d.ts} +0 -0
- package/types/{vuu-layout/src/chest-of-drawers → chest-of-drawers}/Chest.d.ts +0 -0
- package/types/{vuu-layout/src/chest-of-drawers → chest-of-drawers}/Drawer.d.ts +0 -0
- package/types/{vuu-layout/src/chest-of-drawers → chest-of-drawers}/index.d.ts +0 -0
- package/types/{vuu-layout/src/common-types.d.ts → common-types.d.ts} +0 -0
- package/types/{vuu-layout/src/debug.d.ts → debug.d.ts} +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/BoxModel.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/DragState.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/Draggable.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/DropMenu.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/DropTarget.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/DropTargetRenderer.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/dragDropTypes.d.ts +0 -0
- package/types/{vuu-layout/src/drag-drop → drag-drop}/index.d.ts +0 -0
- package/types/{vuu-layout/src/editable-label → editable-label}/EditableLabel.d.ts +0 -0
- package/types/{vuu-layout/src/editable-label → editable-label}/index.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/Flexbox.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/FlexboxLayout.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/FluidGrid.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/FluidGridLayout.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/Splitter.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/flexbox-utils.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/flexboxTypes.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/index.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/useResponsiveSizing.d.ts +0 -0
- package/types/{vuu-layout/src/flexbox → flexbox}/useSplitterResizing.d.ts +0 -0
- package/types/{vuu-layout/src/index.d.ts → index.d.ts} +0 -1
- package/types/{vuu-layout/src/layout-action.d.ts → layout-action.d.ts} +0 -0
- package/types/{vuu-layout/src/layout-header → layout-header}/ActionButton.d.ts +0 -0
- package/types/{vuu-layout/src/layout-header → layout-header}/Header.d.ts +0 -0
- package/types/{vuu-layout/src/layout-header → layout-header}/index.d.ts +0 -0
- package/types/{vuu-layout/src/layout-provider → layout-provider}/LayoutProvider.d.ts +0 -0
- package/types/{vuu-layout/src/layout-provider → layout-provider}/LayoutProviderContext.d.ts +0 -0
- package/types/{vuu-layout/src/layout-provider → layout-provider}/index.d.ts +0 -0
- package/types/{vuu-layout/src/layout-provider → layout-provider}/useLayoutDragDrop.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/flexUtils.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/index.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/insert-layout-element.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/layout-reducer.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/layoutTypes.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/layoutUtils.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/remove-layout-element.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/replace-layout-element.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/resize-flex-children.d.ts +0 -0
- package/types/{vuu-layout/src/layout-reducer → layout-reducer}/wrap-layout-element.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/View.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/ViewContext.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/index.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/useView.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/useViewActionDispatcher.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/useViewResize.d.ts +0 -0
- package/types/{vuu-layout/src/layout-view → layout-view}/viewTypes.d.ts +0 -0
- package/types/{vuu-layout/src/palette → palette}/Palette.d.ts +0 -0
- package/types/{vuu-layout/src/palette → palette}/PaletteSalt.d.ts +0 -0
- package/types/{vuu-layout/src/palette → palette}/index.d.ts +0 -0
- package/types/{vuu-layout/src/placeholder → placeholder}/Placeholder.d.ts +0 -0
- package/types/{vuu-layout/src/placeholder → placeholder}/index.d.ts +0 -0
- package/types/{vuu-layout/src/registry → registry}/ComponentRegistry.d.ts +0 -0
- package/types/{vuu-layout/src/registry → registry}/index.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/breakpoints.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/index.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/measureMinimumNodeSize.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/overflowUtils.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/use-breakpoints.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/useResizeObserver.d.ts +0 -0
- package/types/{vuu-layout/src/responsive → responsive}/utils.d.ts +0 -0
- package/types/{vuu-layout/src/stack → stack}/Stack.d.ts +0 -0
- package/types/{vuu-layout/src/stack → stack}/StackLayout.d.ts +0 -0
- package/types/{vuu-layout/src/stack → stack}/index.d.ts +0 -0
- package/types/{vuu-layout/src/stack → stack}/stackTypes.d.ts +0 -0
- package/types/{vuu-layout/src/tabs → tabs}/TabPanel.d.ts +0 -0
- package/types/{vuu-layout/src/tabs → tabs}/index.d.ts +0 -0
- package/types/{vuu-layout/src/tools → tools}/config-wrapper/ConfigWrapper.d.ts +0 -0
- package/types/{vuu-layout/src/tools → tools}/config-wrapper/index.d.ts +0 -0
- package/types/{vuu-layout/src/tools → tools}/devtools-box/layout-configurator.d.ts +0 -0
- package/types/{vuu-layout/src/tools → tools}/devtools-tree/layout-tree-viewer.d.ts +0 -0
- package/types/{vuu-layout/src/tools → tools}/index.d.ts +0 -0
- package/types/{vuu-layout/src/use-persistent-state.d.ts → use-persistent-state.d.ts} +0 -0
- package/types/{vuu-layout/src/utils → utils}/index.d.ts +0 -0
- package/types/{vuu-layout/src/utils → utils}/pathUtils.d.ts +0 -0
- package/types/{vuu-layout/src/utils → utils}/propUtils.d.ts +0 -0
- package/types/{vuu-layout/src/utils → utils}/refUtils.d.ts +0 -0
- package/types/{vuu-layout/src/utils → utils}/styleUtils.d.ts +0 -0
- package/types/{vuu-layout/src/utils → utils}/typeOf.d.ts +0 -0
- package/types/vuu-popups/src/popup/index.d.ts +0 -1
- package/types/vuu-popups/src/popup/popup-service.d.ts +0 -34
- package/types/vuu-popups/src/portal/Portal.d.ts +0 -8
- package/types/vuu-popups/src/portal/index.d.ts +0 -3
- package/types/vuu-popups/src/portal/portal-utils.d.ts +0 -1
- package/types/vuu-popups/src/portal/render-portal.d.ts +0 -3
package/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Mi=Object.create;var gt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var Ii=(e,t)=>{for(var o in t)gt(e,o,{get:t[o],enumerable:!0})},sn=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ai(t))!zi.call(e,r)&&r!==o&>(e,r,{get:()=>t[r],enumerable:!(n=Ci(t,r))||n.enumerable});return e};var v=(e,t,o)=>(o=e!=null?Mi(ki(e)):{},sn(t||!e||!e.__esModule?gt(o,"default",{value:e,enumerable:!0}):o,e)),Bi=e=>sn(gt({},"__esModule",{value:!0}),e);var nl={};Ii(nl,{Action:()=>ze,BORDER_STYLES:()=>ja,Chest:()=>Sn,Component:()=>Rt,ComponentRegistry:()=>ue,ConfigWrapper:()=>Za,Dialog:()=>Ni,Draggable:()=>It,DraggableLayout:()=>Eo,Drawer:()=>bt,DropMenu:()=>yo,DropTarget:()=>me,Flexbox:()=>Ht,FlexboxLayout:()=>_o,FluidGrid:()=>Wt,FluidGridLayout:()=>Zo,Header:()=>Jo,HeightOnly:()=>wa,LayoutConfigurator:()=>en,LayoutProvider:()=>Ta,LayoutProviderContext:()=>Ye,LayoutProviderVersion:()=>Sa,LayoutTreeViewer:()=>tn,MARGIN_STYLES:()=>Ja,PADDING_STYLES:()=>Ka,Palette:()=>mi,PaletteItem:()=>jo,PaletteListItem:()=>_a,PaletteSalt:()=>hi,Placeholder:()=>it,Stack:()=>Jt,StackLayout:()=>Qo,View:()=>he,ViewContext:()=>ht,WidthHeight:()=>Da,WidthOnly:()=>Pa,XXXnormalizeStyles:()=>tl,computeMenuPosition:()=>go,containerOf:()=>wn,expandFlex:()=>Tt,extractResponsiveProps:()=>Ba,findTarget:()=>le,followPath:()=>V,followPathToComponent:()=>ao,followPathToParent:()=>ae,getChild:()=>Pn,getChildProp:()=>so,getPersistentState:()=>Co,getProp:()=>w,getProps:()=>D,hasPersistentState:()=>Ao,identifyDropTarget:()=>Pt,isContainer:()=>F,isLayoutComponent:()=>oo,isRegistered:()=>Vi,isResponsiveAttribute:()=>Kr,isTabstrip:()=>rs,isTypeOf:()=>Ui,isView:()=>Rn,nextLeaf:()=>Yi,nextStep:()=>q,previousLeaf:()=>Zi,registerComponent:()=>B,resetPath:()=>$,setPersistentState:()=>ko,setRef:()=>qi,typeOf:()=>P,useBreakpoints:()=>Yo,useLayoutProviderDispatch:()=>Y,useLayoutProviderVersion:()=>Gr,usePersistentState:()=>Be,useResizeObserver:()=>Go,useViewActionDispatcher:()=>dt,useViewContext:()=>Fa,useViewDispatch:()=>qo});module.exports=Bi(nl);var We=require("@heswell/salt-lab"),dn=require("@salt-ds/core"),fn=v(require("classnames")),xe=require("react");var je=require("react"),un=v(require("react-dom"));var an=v(require("react-dom")),ln=require("@salt-ds/core"),pn=require("react/jsx-runtime"),Oi=1,Hi=(e=0,t=0,o=window)=>{let n=o.document.createElement("div");return n.className="vuuPopup "+Oi++,n.style.cssText=`left:${e}px; top:${t}px;`,o.document.body.appendChild(n),n},$i=(e,t)=>Hi(e,t),yt=(e,t,o,n,r)=>{t.style.cssText=`left:${o}px; top:${n}px;position: absolute;`,an.render((0,pn.jsx)(ln.SaltProvider,{applyClassesTo:"child",children:e}),t,r)},cn=$i;var mn=function({children:t,x:o=0,y:n=0,onRender:r}){let i=(0,je.useMemo)(()=>cn(),[]);return(0,je.useLayoutEffect)(()=>{yt(t,i,o,n,r)},[t,r,i,o,n]),(0,je.useLayoutEffect)(()=>()=>{var s;i&&(un.unmountComponentAtNode(i),i.classList.contains("vuuPopup")&&((s=i.parentElement)==null||s.removeChild(i)))},[i]),null};var be=require("react/jsx-runtime"),eo="vuuDialog",Ni=({children:e,className:t,isOpen:o=!1,onClose:n,title:r,...i})=>{let s=(0,xe.useRef)(null),[a]=(0,xe.useState)(0),[l]=(0,xe.useState)(0),c=(0,xe.useCallback)(()=>{n==null||n()},[n]),p=(0,xe.useCallback)(()=>{},[]);return o?(0,be.jsx)(mn,{onRender:p,x:a,y:l,children:(0,be.jsx)(We.Scrim,{className:`${eo}-scrim`,open:o,children:(0,be.jsxs)("div",{...i,className:(0,fn.default)(eo,t),ref:s,children:[(0,be.jsxs)(We.Toolbar,{className:`${eo}-header`,children:[(0,be.jsx)(dn.Text,{children:r}),(0,be.jsx)(We.ToolbarButton,{onClick:c,"data-align-end":!0,"data-icon":"close"},"close")]}),e]})})}):null};var En=v(require("classnames"));var Qe=require("@salt-ds/core"),to=v(require("classnames")),gn=require("react");var Ee=require("react/jsx-runtime"),Re="vuuDrawer",hn=e=>typeof e=="string"?e:e+"px",Fi=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?hn(t):void 0,"--drawer-peek-size":r?hn(o):void 0}},yn=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:i,style:s,open:a,position:l="left",inline:c,onClick:p,peekaboo:m=!1,toggleButton:u,...f})=>{let[h,g]=(0,Qe.useControlled)({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=(0,to.default)(Re,t,`${Re}-${l}`,{[`${Re}-open`]:h,[`${Re}-inline`]:c,[`${Re}-over`]:!c,[`${Re}-peekaboo`]:m}),d=(0,gn.useCallback)(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=Fi(s,r,i),E=o?d:p,R=()=>(0,Ee.jsx)("div",{className:(0,to.default)("vuuToggleButton-container"),children:h?(0,Ee.jsx)(Qe.Button,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):(0,Ee.jsx)(Qe.Button,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return(0,Ee.jsxs)("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,(0,Ee.jsx)("div",{className:`${Re}-liner`,children:(0,Ee.jsx)("div",{className:`${Re}-content`,children:e})}),u=="end"?R():null]})};yn.displayName="Drawer";var bt=yn;var no=require("@vuu-ui/vuu-utils");var bn={},xn={},ue={};function F(e){return bn[e]===!0}function Rn(e){return xn[e]===!0}var oo=e=>F(e)||Rn(e),Vi=e=>!!ue[e];function B(e,t,o="component"){ue[e]=t,o==="container"?bn[e]=!0:o==="view"&&(xn[e]=!0)}var xt=require("react/jsx-runtime"),Wi=e=>e.type===bt,_i=({props:{position:e="left"}})=>e.match(/top|bottom/),ro=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=(0,no.partition)(t,Wi),[l,c]=(0,no.partition)(s,_i),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=(0,En.default)(i,o,`${i}-${p}`);return(0,xt.jsxs)("div",{className:m,id:n,style:r,children:[s,(0,xt.jsx)("div",{className:`${i}-content`,children:a})]})};ro.displayName="Chest";var Sn=ro;B("Chest",ro,"container");var Tn=require("react");var Dn=require("react/jsx-runtime"),io=(0,Tn.forwardRef)(function({resizeable:t,...o},n){return(0,Dn.jsx)("div",{...o,className:"Component",ref:n})});io.displayName="Component";var Rt=io;B("Component",io);var Se=v(require("react"));var Gi={},w=(e,t)=>{var n;let o=D(e);return(n=o[t])!=null?n:o[`data-${t}`]},D=e=>(e==null?void 0:e.props)||e||Gi,so=e=>{let t=D(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 P(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}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 Ui=(e,t)=>P(e)===t;var Xi=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function ae(e,t){let{"data-path":o,path:n=o}=D(e);return t==="0"||t===n?null:V(e,Xi(t),!0)}function le(e,t){let{children:o,...n}=D(e);if(t(n))return e;if(Se.default.Children.count(o)>0){let r=Se.default.isValidElement(o)?[o]:o;for(let i of r){let s=le(i,t);if(s)return s}}}function wn(e,t){if(t===e)return null;let{path:o,children:n}=D(e),{idx:r,finalStep:i}=q(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:wn(n[r],t)}var Pn=(e,t)=>{if(Se.default.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function ao(e,t){let o=t.split("."),n=[e],r=i=>Se.default.isValidElement(i.props.children)?[i.props.children]:i.props.children;for(let i=0;i<o.length;i++){let s=parseInt(o[i]),a=n[s];if(i===o.length-1)return a;n=r(a)}}function V(e,t,o=!1){let{"data-path":n,path:r=n}=D(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let i=t.slice(r.length+1);if(i==="")return e;let s=e,a=i.split(".");for(let l=0;l<a.length;l++){if(Se.default.Children.count(s.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(s=Pn(s.props.children,parseInt(a[l])),s===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 s}function Yi(e,t){let o=ae(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:i}=o.props;if(i.length-1>r)return Et(i[r+1]);{let s=n.pop(),a=ae(e,w(o,"path"));if(a&&typeof s=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>s)){let l=a.props.children[s+1];return F(P(l))?Et(l):l}}}return Et(e)}function Zi(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=ae(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return St(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=ae(e,w(r,"path")),n>0){let s=r.props.children[n-1];return F(P(s))?St(s):s}}return St(e)}function Et(e){if(F(P(e))){let{children:t}=e.props||e;return Et(t[0])}return e}function St(e){if(F(P(e))){let{children:t}=e.props||e;return St(t[t.length-1])}return e}function q(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,i=t.replace(n,"").split(".").map(s=>parseInt(s,10));return{idx:i[0],finalStep:i.length===r}}function $(e,t,o){if(w(e,"path")===t)return e;let n=[];Se.default.Children.forEach(e.props.children,(i,s)=>{w(i,"path")?n.push($(i,`${t}.${s}`)):n.push(i)});let r=e.props["data-path"]?"data-path":"path";return Se.default.cloneElement(e,{[r]:t,...o},n)}function qi(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var Tt=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var ke={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},et={AFTER:"after",BEFORE:"before"},W=Object.freeze({North:Ae("north"),East:Ae("east"),South:Ae("south"),West:Ae("west"),Header:Ae("header"),Centre:Ae("centre"),Absolute:Ae("absolute")});function Ae(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return ke[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 vn=W.North,Ln=W.South,lo=W.East,co=W.West,Ji=W.Header,Ki=W.Centre,_e=class{static measure(t,o=[]){let n={};return es(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return kn(t,o,n,r,i).reverse()}};function po(e,t,o,n=30){let r=o.right-o.left,i=o.bottom-o.top,s=e-o.left,a=t-o.top,l=0;return s<n&&(l+=8),s>r-n&&(l+=2),a<n&&(l+=1),a>i-n&&(l+=4),{pctX:s/r,pctY:a/i,closeToTheEdge:l}}function uo(e,t,o,n){let{BEFORE:r,AFTER:i}=et,{pctX:s,pctY:a,closeToTheEdge:l}=po(e,t,o),c,p;if(n==="row")c=s<.5?co:lo;else if(o.header&&Dt(o.header,e,t))if(c=Ji,o.Stack){let m=o.Stack.length;if(m===0)p={index:-1,left:o.left,positionRelativeToTab:i,width:0};else{let u=o.Stack.find(({left:f,right:h})=>e>=f&&e<=h);if(u){let f=u.right-u.left;p={index:o.Stack.indexOf(u),left:u.left,positionRelativeToTab:(e-u.left)/f<.5?r:i,width:f}}else p={left:o.Stack[m-1].right,width:0,index:m,positionRelativeToTab:i}}}else if(o.header.titleWidth){let m=o.header.titleWidth;p={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/m<.5?r:i,width:m}}else p={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=ji(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function ji(e,t,o,n,r){let i=Qi(o,.2);if(Dt(i,e,t))return Ki;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?vn:co;case"northeast":return 1-n>r?vn:lo;case"southeast":return n>r?lo:Ln;case"southwest":return 1-n>r?co:Ln;default:}}function Qi({right:e,left:t,top:o,bottom:n},r){let i=(1-r)/2,s=(e-t)*i,a=(n-o)*i;return{left:t+s,top:o+a,right:e-s,bottom:n-a}}function es(e,t,o){let{id:n,"data-path":r,path:i=r}=D(e),s=P(e);if(n&&i){let[a,l]=An(e);Mn(e,a,l,t),F(s)&&Cn(e,t,o)}}function Mn(e,t,o,n){let{"data-path":r,path:i=r,header:s}=D(e);n[i]=t;let a=P(e);if(s||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:p,right:m,bottom:u}=l.getBoundingClientRect();if(n[i].header={top:Math.round(c),left:Math.round(p),right:Math.round(m),bottom:Math.round(u)},a==="Stack")n[i].Stack=Array.from(l.querySelectorAll(".saltTab")).map(f=>f.getBoundingClientRect()).map(({left:f,right:h})=>({left:f,right:h}));else{let f=l.querySelector('[class^="vuuHeader-title"]'),{header:h}=n[i];f&&h&&(h.titleWidth=f.clientWidth)}}}return n[i]}function Cn(e,t,o,n=0,r=0,i=0,s=0){let{children:a,"data-path":l,path:c=l,style:p,active:m=0}=D(e),u=P(e),f=u==="Flexbox",h=u==="Stack",g=f&&p.flexDirection==="column",y=f&&p.flexDirection==="row",b=(h?a.filter((R,S)=>S===m):a.filter(ts)).map(R=>{let[S,x]=An(R);return[{...S,top:S.top-i,right:S.right+r,bottom:S.bottom+s,left:S.left-n},x,R]}),E=b.map(([R,S,x],T,L)=>{let A,N,M,H,C,k,I=L.length-1;y?(C=T===0?0:R.left-L[T-1][0].right,k=T===I?0:L[T+1][0].left-R.right,A=T===0||C===0?0:C,N=T===I||k===0?0:k-k/2,R.left-=A,R.right+=N,M=i,H=s):g&&(C=T===0?0:R.top-L[T-1][0].bottom,k=T===I?0:L[T+1][0].top-R.bottom,M=T===0||C===0?0:C,H=T===I||k===0?0:k-k/2,R.top-=M,R.bottom+=H,A=n,N=r);let Q=Mn(x,R,S,t),X=P(x);return F(X)&&Cn(x,t,o,A,N,M,H),Q});b.length&&(t[c].children=E)}function ts(e){let{id:t}=D(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function An(e){let{id:t}=D(e);if(t===void 0)throw Error("`BoxModel.measureComponentElement, component has no id");let o=document.getElementById(t);if(!o)throw Error("BoxModel.measureComponentElement, no DOM element found for component");let{top:n,left:r,right:i,bottom:s,height:a,width:l}=o.getBoundingClientRect(),c,p=P(e);if(F(p)){let m=o.scrollHeight;m>a&&(c={id:t,scrollHeight:m,scrollTop:o.scrollTop})}return[{top:Math.round(n),left:Math.round(r),right:Math.round(i),bottom:Math.round(s),height:Math.round(a),width:Math.round(l),scrolling:c},o,e]}function kn(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=D(e),c=P(e),p=t[l];if(!Dt(p,o,n))return i;if(r&&r.length){if(r.includes(l))i.push(e);else if(!r.some(m=>m.startsWith(l)))return i}else i.push(e);if(!F(c)||p.header&&Dt(p.header,o,n))return i;p.scrolling&&os(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=kn(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function Dt(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function os({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:i,scrollTop:s,scrollHeight:a}=o,l=t-e;if(s===0&&t-r<50){let c=a-l;document.getElementById(i).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(s>0&&r-e<50)document.getElementById(i).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var ns=.4,wt=class{constructor(t,o,n,r,i){this.init(t,o,n,r,i)}init(t,o,n,r,i){let{left:s,top:a}=r,{pctX:l,pctY:c}=po(o,n,r),p=ns,m=l*r.width,u=r.width-m,f=c*r.height,h=r.height-f,g=r.width*p,y=r.height*p,d=1-p,b=m*d,E=f*d,R=u*d,S=h*d;this.intrinsicSize=i,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-b,hi:t.right-r.width+R},y:{lo:t.top-E,hi:t.bottom-r.height+S}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+y*c,hi:t.bottom-y*(1-c)}}},this.x={pos:s,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){let n=this[t],r=this.constraint.mouse[t],i=this.constraint.pos[t],s=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=i.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=i.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,s!==n.pos}dropXY(t){let 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 rs=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:is,south:ss,east:as,west:ls}=ke,cs=as+ls,ps=is+ss,me=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===et.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,i,s]=this.getDropRectOutline(t,o);return{l:n,t:r,r:i,b:s}}}getDropTabOutline(t,o){var d,b;let{clientRect:{top:n,left:r,right:i,bottom:s,header:a}}=this,l=0,c=Math.round(t/2)+l,p=Math.round(n),m=Math.round(r+c),u=Math.round(i-c),f=Math.round(s-c),h=this.targetTabPos(o),g=60,y=((d=a==null?void 0:a.bottom)!=null?d:0)-((b=a==null?void 0:a.top)!=null?b:0);return{l:m,t:p,r:u,b:f,tabLeft:h,tabWidth:g,tabHeight:y}}getIntrinsicDropRect(t){var g,y,d,b;let{pos:o,clientRect:n}=this,{x:r,y:i}=t,s=(y=(g=t.intrinsicSize)==null?void 0:g.height)!=null?y:0,a=(b=(d=t.intrinsicSize)==null?void 0:d.height)!=null?b:0;s&&s>n.height?(console.log("DropTarget: we're going to blow the gaff"),s=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-s,Math.max(n.top,Math.round(o.y-i.mousePct*s))),[p,m,u,f]=this.dropRect=[l,c,l+a,c+s],h=o.position.EastOrWest?[p,n.top,p,n.bottom,u,n.top,u,n.bottom]:[n.left,m,n.right,m,n.left,f,n.right,f];return{l:p,r:u,t:m,b:f,guideLines:h}}getDropRectOutline(t,o){var b,E,R;let{pos:n,clientRect:r}=this,{width:i,height:s,position:a}=n,{width:l,height:c}=(b=o==null?void 0:o.intrinsicSize)!=null?b:{},p=(E=c!=null?c:s)!=null?E:0,m=(R=l!=null?l:i)!=null?R:0;this.dropRect=void 0;let{top:u,left:f,right:h,bottom:g}=r,y=0,d=Math.round(t/2)+y;switch(a){case W.North:case W.Header:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,u+d,f+m-d,u+d+x]:[f+d,u+d,h-d,u+d+x]}case W.West:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[f+d,u+d,f-d+x,u+p+d]:[f+d,u+d,f-d+x,g-d]}case W.East:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[h-d-x,u+d,h-d,u+p+d]:[h-d-x,u+d,h-d,g-d]}case W.South:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,g-d-x,f+m-d,g-d]:[f+d,g-d-x,h-d,g-d]}case W.Centre:return[f+d,u+d,h-d,g-d];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:me.getActiveDropTarget(t.nextDropTarget)}};function Pt(e,t,o,n,r,i){var l;let s=null,a=_e.allBoxesContainingPoint(o,n,e,t,i);if(a.length){let[c,...p]=a,{"data-path":m,path:u=m,"data-row-placeholder":f}=D(c),h=n[u],y=uo(e,t,h,r&&f?"row":void 0),d=n[u],b=([E,...R])=>{var S,x;if(((S=y.position)==null?void 0:S.Header)||y.closeToTheEdge){let T=us(E,y,d,n,e,t);if(T){let[L,A]=T;return new me({component:E,pos:L,clientRect:A,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new me({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function us(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&ke.north,c=t&ke.east,p=t&ke.south,m=t&ke.west,u=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),f=c&&Math.round(n.right)===Math.round(a.right),h=p&&Math.round(n.bottom)===Math.round(a.bottom),g=m&&Math.round(n.left)===Math.round(a.left);if(u||f||h||g){let{"data-path":y,path:d=y}=e.props,b=r[d],E=uo(i,s,b);if((ms(e)||zn(e))&&t&cs)return E.width=120,[E,b];if((ds(e)||zn(e))&&(o.Header||t&ps))return E.height=120,[E,b]}}function zn(e){return P(e)==="Stack"}function ms(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function ds(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}var In=v(require("classnames")),Ge=v(require("react")),vt=v(require("react-dom"));var mo=!1,ee=[];function Bn(e){if(e.key==="Esc"){if(ee.length)Hn();else if(mo){let t=document.body.querySelector(".vuuDialog");t&&vt.default.unmountComponentAtNode(t)}}}function On(e){if(ee.length){let t=document.body.querySelectorAll(".vuuPopup");for(let o=0;o<t.length;o++)if(t[o].contains(e.target))return;Hn()}}function Hn(){if(ee.length){let e=document.body.querySelectorAll(".vuuPopup");for(let t=0;t<e.length;t++)vt.default.unmountComponentAtNode(e[t]);$n("*")}}function fs(e){ee.indexOf(e)===-1&&(ee.push(e),mo===!1&&(window.addEventListener("keydown",Bn,!0),window.addEventListener("click",On,!0)))}function $n(e){if(ee.length){if(e==="*")ee.length=0;else{let t=ee.indexOf(e);t!==-1&&ee.splice(t,1)}ee.length===0&&mo===!1&&(window.removeEventListener("keydown",Bn,!0),window.removeEventListener("click",On,!0))}}var hs=({children:e,position:t,style:o})=>{let n=(0,In.default)("hwPopup","hwPopupContainer",t);return(0,Ge.createElement)("div",{className:n,style:o},e)},gs=1,Te=class{static showPopup({name:t="anon",group:o="all",position:n="",left:r=0,right:i="auto",top:s=0,width:a="auto",component:l}){if(!l)throw Error("PopupService showPopup, no component supplied");fs(t);let c=document.body.querySelector(".vuuPopup."+o);c===null&&(c=document.createElement("div"),c.className="vuuPopup "+o,document.body.appendChild(c));let p={width:a};yt((0,Ge.createElement)(hs,{key:gs++,position:n,style:p},l),c,r,s,()=>{Te.keepWithinThePage(c,i)})}static hidePopup(t="anon",o="all"){if(ee.indexOf(t)!==-1){$n(t);let n=document.body.querySelector(`.vuuPopup.${o}`);n&&vt.default.unmountComponentAtNode(n)}}static keepWithinThePage(t,o="auto"){let n=t.querySelector(".vuuPopupContainer > *");if(n){let{top:r,left:i,width:s,height:a,right:l}=n.getBoundingClientRect(),c=window.innerWidth,m=window.innerHeight-(r+a);m<0&&(n.style.top=Math.round(r)+m+"px");let u=c-(i+s);if(u<0&&(n.style.left=Math.round(i)+u+"px"),typeof o=="number"&&o!==l){let f=o-l;n.style.left=i+f+"px"}}}};var Nn=v(require("classnames"));var ho=require("react/jsx-runtime");function go(e,t=0,o=0){let{pos:n,clientRect:r}=e,i=20;return n.position.West?[r.left-o+i,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-i,"bottom"]:n.position.East?[r.right-o-i,n.y-t,"right"]:[n.x-o,r.top-t+i,"top"]}var fo="vuuDropMenu",yo=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return(0,ho.jsx)("div",{className:(0,Nn.default)(fo,e,`${fo}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>(0,ho.jsx)("div",{className:`${fo}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};var _n=require("react/jsx-runtime"),bo=!1,tt=null,te=null,ys=e=>tt=e,bs=([e,t])=>`M${e},${t}`,xs=([e,t])=>`L${e},${t}`,Fn=([e,...t])=>`${bs(e)} ${t.map(xs)}Z`,Rs=e=>{if(e){let[t,o,n,r,i,s,a,l]=e;return`M${t},${o} L${n},${r} M${i},${s} L${a},${l}`}else return""};function Es(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
|
|
1
|
+
"use strict";var si=Object.create;var ct=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var o in t)ct(e,o,{get:t[o],enumerable:!0})},Jo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of li(t))!pi.call(e,r)&&r!==o&&ct(e,r,{get:()=>t[r],enumerable:!(n=ai(t,r))||n.enumerable});return e};var M=(e,t,o)=>(o=e!=null?si(ci(e)):{},Jo(t||!e||!e.__esModule?ct(o,"default",{value:e,enumerable:!0}):o,e)),mi=e=>Jo(ct({},"__esModule",{value:!0}),e);var va={};ui(va,{Action:()=>Me,BORDER_STYLES:()=>Sa,Chest:()=>nn,Component:()=>mt,ComponentRegistry:()=>pe,ConfigWrapper:()=>ba,Draggable:()=>Pt,DraggableLayout:()=>po,Drawer:()=>pt,DropMenu:()=>so,DropTarget:()=>ue,Flexbox:()=>Mt,FlexboxLayout:()=>Io,FluidGrid:()=>kt,FluidGridLayout:()=>$o,Header:()=>No,HeightOnly:()=>Js,LayoutConfigurator:()=>Go,LayoutProvider:()=>Zs,LayoutProviderContext:()=>Ve,LayoutProviderVersion:()=>Xs,LayoutTreeViewer:()=>Uo,MARGIN_STYLES:()=>Ra,PADDING_STYLES:()=>Ea,Palette:()=>_r,PaletteItem:()=>Wo,PaletteListItem:()=>da,PaletteSalt:()=>Xr,Placeholder:()=>qe,Stack:()=>Wt,StackLayout:()=>_o,View:()=>fe,ViewContext:()=>lt,WidthHeight:()=>Ys,WidthOnly:()=>js,XXXnormalizeStyles:()=>wa,computeMenuPosition:()=>io,containerOf:()=>an,expandFlex:()=>ht,extractResponsiveProps:()=>ia,findTarget:()=>ae,followPath:()=>V,followPathToComponent:()=>qt,followPathToParent:()=>se,getChild:()=>ln,getChildProp:()=>Kt,getPersistentState:()=>Ro,getProp:()=>w,getProps:()=>T,hasPersistentState:()=>Eo,identifyDropTarget:()=>bt,isContainer:()=>N,isLayoutComponent:()=>Zt,isRegistered:()=>fi,isResponsiveAttribute:()=>Lr,isTabstrip:()=>Ai,isTypeOf:()=>bi,isView:()=>tn,nextLeaf:()=>Ri,nextStep:()=>J,previousLeaf:()=>Ei,registerComponent:()=>B,resetPath:()=>$,setPersistentState:()=>So,setRef:()=>Si,typeOf:()=>P,useBreakpoints:()=>Ho,useLayoutProviderDispatch:()=>Z,useLayoutProviderVersion:()=>Er,usePersistentState:()=>Ae,useResizeObserver:()=>ko,useViewActionDispatcher:()=>st,useViewContext:()=>pa,useViewDispatch:()=>Fo});module.exports=mi(va);var on=M(require("classnames"));var Xe=require("@salt-ds/core"),Xt=M(require("classnames")),Ko=require("react");var be=require("react/jsx-runtime"),ye="vuuDrawer",jo=e=>typeof e=="string"?e:e+"px",di=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?jo(t):void 0,"--drawer-peek-size":r?jo(o):void 0}},qo=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:i,style:s,open:a,position:l="left",inline:c,onClick:p,peekaboo:m=!1,toggleButton:u,...f})=>{let[h,g]=(0,Xe.useControlled)({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=(0,Xt.default)(ye,t,`${ye}-${l}`,{[`${ye}-open`]:h,[`${ye}-inline`]:c,[`${ye}-over`]:!c,[`${ye}-peekaboo`]:m}),d=(0,Ko.useCallback)(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=di(s,r,i),E=o?d:p,R=()=>(0,be.jsx)("div",{className:(0,Xt.default)("vuuToggleButton-container"),children:h?(0,be.jsx)(Xe.Button,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):(0,be.jsx)(Xe.Button,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return(0,be.jsxs)("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,(0,be.jsx)("div",{className:`${ye}-liner`,children:(0,be.jsx)("div",{className:`${ye}-content`,children:e})}),u=="end"?R():null]})};qo.displayName="Drawer";var pt=qo;var Yt=require("@vuu-ui/vuu-utils");var Qo={},en={},pe={};function N(e){return Qo[e]===!0}function tn(e){return en[e]===!0}var Zt=e=>N(e)||tn(e),fi=e=>!!pe[e];function B(e,t,o="component"){pe[e]=t,o==="container"?Qo[e]=!0:o==="view"&&(en[e]=!0)}var ut=require("react/jsx-runtime"),hi=e=>e.type===pt,gi=({props:{position:e="left"}})=>e.match(/top|bottom/),Jt=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=(0,Yt.partition)(t,hi),[l,c]=(0,Yt.partition)(s,gi),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=(0,on.default)(i,o,`${i}-${p}`);return(0,ut.jsxs)("div",{className:m,id:n,style:r,children:[s,(0,ut.jsx)("div",{className:`${i}-content`,children:a})]})};Jt.displayName="Chest";var nn=Jt;B("Chest",Jt,"container");var rn=require("react");var sn=require("react/jsx-runtime"),jt=(0,rn.forwardRef)(function({resizeable:t,...o},n){return(0,sn.jsx)("div",{...o,className:"Component",ref:n})});jt.displayName="Component";var mt=jt;B("Component",jt);var xe=M(require("react"));var yi={},w=(e,t)=>{var n;let o=T(e);return(n=o[t])!=null?n:o[`data-${t}`]},T=e=>(e==null?void 0:e.props)||e||yi,Kt=e=>{let t=T(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 P(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}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 bi=(e,t)=>P(e)===t;var xi=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function se(e,t){let{"data-path":o,path:n=o}=T(e);return t==="0"||t===n?null:V(e,xi(t),!0)}function ae(e,t){let{children:o,...n}=T(e);if(t(n))return e;if(xe.default.Children.count(o)>0){let r=xe.default.isValidElement(o)?[o]:o;for(let i of r){let s=ae(i,t);if(s)return s}}}function an(e,t){if(t===e)return null;let{path:o,children:n}=T(e),{idx:r,finalStep:i}=J(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:an(n[r],t)}var ln=(e,t)=>{if(xe.default.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function qt(e,t){let o=t.split("."),n=[e],r=i=>xe.default.isValidElement(i.props.children)?[i.props.children]:i.props.children;for(let i=0;i<o.length;i++){let s=parseInt(o[i]),a=n[s];if(i===o.length-1)return a;n=r(a)}}function V(e,t,o=!1){let{"data-path":n,path:r=n}=T(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let i=t.slice(r.length+1);if(i==="")return e;let s=e,a=i.split(".");for(let l=0;l<a.length;l++){if(xe.default.Children.count(s.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(s=ln(s.props.children,parseInt(a[l])),s===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 s}function Ri(e,t){let o=se(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:i}=o.props;if(i.length-1>r)return dt(i[r+1]);{let s=n.pop(),a=se(e,w(o,"path"));if(a&&typeof s=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>s)){let l=a.props.children[s+1];return N(P(l))?dt(l):l}}}return dt(e)}function Ei(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=se(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return ft(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=se(e,w(r,"path")),n>0){let s=r.props.children[n-1];return N(P(s))?ft(s):s}}return ft(e)}function dt(e){if(N(P(e))){let{children:t}=e.props||e;return dt(t[0])}return e}function ft(e){if(N(P(e))){let{children:t}=e.props||e;return ft(t[t.length-1])}return e}function J(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,i=t.replace(n,"").split(".").map(s=>parseInt(s,10));return{idx:i[0],finalStep:i.length===r}}function $(e,t,o){if(w(e,"path")===t)return e;let n=[];xe.default.Children.forEach(e.props.children,(i,s)=>{w(i,"path")?n.push($(i,`${t}.${s}`)):n.push(i)});let r=e.props["data-path"]?"data-path":"path";return xe.default.cloneElement(e,{[r]:t,...o},n)}function Si(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var ht=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var Le={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},Ze={AFTER:"after",BEFORE:"before"},W=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 Le[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 cn=W.North,pn=W.South,Qt=W.East,eo=W.West,Di=W.Header,Ti=W.Centre,$e=class{static measure(t,o=[]){let n={};return vi(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return fn(t,o,n,r,i).reverse()}};function to(e,t,o,n=30){let r=o.right-o.left,i=o.bottom-o.top,s=e-o.left,a=t-o.top,l=0;return s<n&&(l+=8),s>r-n&&(l+=2),a<n&&(l+=1),a>i-n&&(l+=4),{pctX:s/r,pctY:a/i,closeToTheEdge:l}}function oo(e,t,o,n){let{BEFORE:r,AFTER:i}=Ze,{pctX:s,pctY:a,closeToTheEdge:l}=to(e,t,o),c,p;if(n==="row")c=s<.5?eo:Qt;else if(o.header&>(o.header,e,t))if(c=Di,o.Stack){let m=o.Stack.length;if(m===0)p={index:-1,left:o.left,positionRelativeToTab:i,width:0};else{let u=o.Stack.find(({left:f,right:h})=>e>=f&&e<=h);if(u){let f=u.right-u.left;p={index:o.Stack.indexOf(u),left:u.left,positionRelativeToTab:(e-u.left)/f<.5?r:i,width:f}}else p={left:o.Stack[m-1].right,width:0,index:m,positionRelativeToTab:i}}}else if(o.header.titleWidth){let m=o.header.titleWidth;p={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/m<.5?r:i,width:m}}else p={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=wi(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function wi(e,t,o,n,r){let i=Pi(o,.2);if(gt(i,e,t))return Ti;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?cn:eo;case"northeast":return 1-n>r?cn:Qt;case"southeast":return n>r?Qt:pn;case"southwest":return 1-n>r?eo:pn;default:}}function Pi({right:e,left:t,top:o,bottom:n},r){let i=(1-r)/2,s=(e-t)*i,a=(n-o)*i;return{left:t+s,top:o+a,right:e-s,bottom:n-a}}function vi(e,t,o){let{id:n,"data-path":r,path:i=r}=T(e),s=P(e);if(n&&i){let[a,l]=dn(e);un(e,a,l,t),N(s)&&mn(e,t,o)}}function un(e,t,o,n){let{"data-path":r,path:i=r,header:s}=T(e);n[i]=t;let a=P(e);if(s||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:p,right:m,bottom:u}=l.getBoundingClientRect();if(n[i].header={top:Math.round(c),left:Math.round(p),right:Math.round(m),bottom:Math.round(u)},a==="Stack")n[i].Stack=Array.from(l.querySelectorAll(".saltTab")).map(f=>f.getBoundingClientRect()).map(({left:f,right:h})=>({left:f,right:h}));else{let f=l.querySelector('[class^="vuuHeader-title"]'),{header:h}=n[i];f&&h&&(h.titleWidth=f.clientWidth)}}}return n[i]}function mn(e,t,o,n=0,r=0,i=0,s=0){let{children:a,"data-path":l,path:c=l,style:p,active:m=0}=T(e),u=P(e),f=u==="Flexbox",h=u==="Stack",g=f&&p.flexDirection==="column",y=f&&p.flexDirection==="row",b=(h?a.filter((R,S)=>S===m):a.filter(Li)).map(R=>{let[S,x]=dn(R);return[{...S,top:S.top-i,right:S.right+r,bottom:S.bottom+s,left:S.left-n},x,R]}),E=b.map(([R,S,x],D,v)=>{let A,F,L,H,C,z,k=v.length-1;y?(C=D===0?0:R.left-v[D-1][0].right,z=D===k?0:v[D+1][0].left-R.right,A=D===0||C===0?0:C,F=D===k||z===0?0:z-z/2,R.left-=A,R.right+=F,L=i,H=s):g&&(C=D===0?0:R.top-v[D-1][0].bottom,z=D===k?0:v[D+1][0].top-R.bottom,L=D===0||C===0?0:C,H=D===k||z===0?0:z-z/2,R.top-=L,R.bottom+=H,A=n,F=r);let Q=un(x,R,S,t),X=P(x);return N(X)&&mn(x,t,o,A,F,L,H),Q});b.length&&(t[c].children=E)}function Li(e){let{id:t}=T(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function dn(e){let{id:t}=T(e);if(t===void 0)throw Error("`BoxModel.measureComponentElement, component has no id");let o=document.getElementById(t);if(!o)throw Error("BoxModel.measureComponentElement, no DOM element found for component");let{top:n,left:r,right:i,bottom:s,height:a,width:l}=o.getBoundingClientRect(),c,p=P(e);if(N(p)){let m=o.scrollHeight;m>a&&(c={id:t,scrollHeight:m,scrollTop:o.scrollTop})}return[{top:Math.round(n),left:Math.round(r),right:Math.round(i),bottom:Math.round(s),height:Math.round(a),width:Math.round(l),scrolling:c},o,e]}function fn(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=T(e),c=P(e),p=t[l];if(!gt(p,o,n))return i;if(r&&r.length){if(r.includes(l))i.push(e);else if(!r.some(m=>m.startsWith(l)))return i}else i.push(e);if(!N(c)||p.header&>(p.header,o,n))return i;p.scrolling&&Mi(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=fn(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function gt(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function Mi({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:i,scrollTop:s,scrollHeight:a}=o,l=t-e;if(s===0&&t-r<50){let c=a-l;document.getElementById(i).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(s>0&&r-e<50)document.getElementById(i).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var Ci=.4,yt=class{constructor(t,o,n,r,i){this.init(t,o,n,r,i)}init(t,o,n,r,i){let{left:s,top:a}=r,{pctX:l,pctY:c}=to(o,n,r),p=Ci,m=l*r.width,u=r.width-m,f=c*r.height,h=r.height-f,g=r.width*p,y=r.height*p,d=1-p,b=m*d,E=f*d,R=u*d,S=h*d;this.intrinsicSize=i,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-b,hi:t.right-r.width+R},y:{lo:t.top-E,hi:t.bottom-r.height+S}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+y*c,hi:t.bottom-y*(1-c)}}},this.x={pos:s,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){let n=this[t],r=this.constraint.mouse[t],i=this.constraint.pos[t],s=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=i.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=i.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,s!==n.pos}dropXY(t){let 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 Ai=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:zi,south:Ii,east:ki,west:Bi}=Le,Oi=ki+Bi,Hi=zi+Ii,ue=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===Ze.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,i,s]=this.getDropRectOutline(t,o);return{l:n,t:r,r:i,b:s}}}getDropTabOutline(t,o){var d,b;let{clientRect:{top:n,left:r,right:i,bottom:s,header:a}}=this,l=0,c=Math.round(t/2)+l,p=Math.round(n),m=Math.round(r+c),u=Math.round(i-c),f=Math.round(s-c),h=this.targetTabPos(o),g=60,y=((d=a==null?void 0:a.bottom)!=null?d:0)-((b=a==null?void 0:a.top)!=null?b:0);return{l:m,t:p,r:u,b:f,tabLeft:h,tabWidth:g,tabHeight:y}}getIntrinsicDropRect(t){var g,y,d,b;let{pos:o,clientRect:n}=this,{x:r,y:i}=t,s=(y=(g=t.intrinsicSize)==null?void 0:g.height)!=null?y:0,a=(b=(d=t.intrinsicSize)==null?void 0:d.height)!=null?b:0;s&&s>n.height?(console.log("DropTarget: we're going to blow the gaff"),s=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-s,Math.max(n.top,Math.round(o.y-i.mousePct*s))),[p,m,u,f]=this.dropRect=[l,c,l+a,c+s],h=o.position.EastOrWest?[p,n.top,p,n.bottom,u,n.top,u,n.bottom]:[n.left,m,n.right,m,n.left,f,n.right,f];return{l:p,r:u,t:m,b:f,guideLines:h}}getDropRectOutline(t,o){var b,E,R;let{pos:n,clientRect:r}=this,{width:i,height:s,position:a}=n,{width:l,height:c}=(b=o==null?void 0:o.intrinsicSize)!=null?b:{},p=(E=c!=null?c:s)!=null?E:0,m=(R=l!=null?l:i)!=null?R:0;this.dropRect=void 0;let{top:u,left:f,right:h,bottom:g}=r,y=0,d=Math.round(t/2)+y;switch(a){case W.North:case W.Header:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,u+d,f+m-d,u+d+x]:[f+d,u+d,h-d,u+d+x]}case W.West:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[f+d,u+d,f-d+x,u+p+d]:[f+d,u+d,f-d+x,g-d]}case W.East:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[h-d-x,u+d,h-d,u+p+d]:[h-d-x,u+d,h-d,g-d]}case W.South:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,g-d-x,f+m-d,g-d]:[f+d,g-d-x,h-d,g-d]}case W.Centre:return[f+d,u+d,h-d,g-d];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:ue.getActiveDropTarget(t.nextDropTarget)}};function bt(e,t,o,n,r,i){var l;let s=null,a=$e.allBoxesContainingPoint(o,n,e,t,i);if(a.length){let[c,...p]=a,{"data-path":m,path:u=m,"data-row-placeholder":f}=T(c),h=n[u],y=oo(e,t,h,r&&f?"row":void 0),d=n[u],b=([E,...R])=>{var S,x;if(((S=y.position)==null?void 0:S.Header)||y.closeToTheEdge){let D=$i(E,y,d,n,e,t);if(D){let[v,A]=D;return new ue({component:E,pos:v,clientRect:A,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new ue({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function $i(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&Le.north,c=t&Le.east,p=t&Le.south,m=t&Le.west,u=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),f=c&&Math.round(n.right)===Math.round(a.right),h=p&&Math.round(n.bottom)===Math.round(a.bottom),g=m&&Math.round(n.left)===Math.round(a.left);if(u||f||h||g){let{"data-path":y,path:d=y}=e.props,b=r[d],E=oo(i,s,b);if((Fi(e)||hn(e))&&t&Oi)return E.width=120,[E,b];if((Ni(e)||hn(e))&&(o.Header||t&Hi))return E.height=120,[E,b]}}function hn(e){return P(e)==="Stack"}function Fi(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function Ni(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}var xt=require("@vuu-ui/vuu-popups");var gn=M(require("classnames"));var ro=require("react/jsx-runtime");function io(e,t=0,o=0){let{pos:n,clientRect:r}=e,i=20;return n.position.West?[r.left-o+i,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-i,"bottom"]:n.position.East?[r.right-o-i,n.y-t,"right"]:[n.x-o,r.top-t+i,"top"]}var no="vuuDropMenu",so=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return(0,ro.jsx)("div",{className:(0,gn.default)(no,e,`${no}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>(0,ro.jsx)("div",{className:`${no}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};var Rn=require("react/jsx-runtime"),ao=!1,Ye=null,ee=null,Vi=e=>Ye=e,Wi=([e,t])=>`M${e},${t}`,_i=([e,t])=>`L${e},${t}`,yn=([e,...t])=>`${Wi(e)} ${t.map(_i)}Z`,Gi=e=>{if(e){let[t,o,n,r,i,s,a,l]=e;return`M${t},${o} L${n},${r} M${i},${s} L${a},${l}`}else return""};function Ui(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
|
|
2
2
|
<svg width="100%" height="100%">
|
|
3
3
|
<path id="hw-drop-guides" />
|
|
4
4
|
<path
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/>
|
|
15
15
|
</path>
|
|
16
16
|
</svg>
|
|
17
|
-
`,document.body.insertBefore(t,e)}}var ot=class{constructor(){this.currentPath=null;this.tabMode=null;Es()}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=Fn(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){tt=null,Lt(),document.body.classList.remove("drawing"),Te.hidePopup()}get hoverDropTarget(){return tt}getPoints(t,o,n,r,i=0,s=0,a=0){let l=this.tabMode==="tab-only";if(s===0)return[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=i;return[[c,o],[c,o],[c+s,o],[c+s,o],[c+s,o+a],[c+s,o+a],[c,o+a],[c,o+a]]}else return i===0?[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+i,o+a],[t+i,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=bo;if(tt!==null)this.drawTarget(tt);else if(bo=t.nextDropTarget!=null,t.pos.tab?Ss(t):te&&Lt(),this.drawTarget(t,o),bo){let[i,s,a]=go(t);{let l=(0,_n.jsx)(yo,{dropTarget:t,onHover:ys,orientation:a});Te.showPopup({left:i,top:s,component:l})}}else Te.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:i,t:s,r:a,b:l,tabLeft:c,tabWidth:p,tabHeight:m,guideLines:u}=r,f=a-i,h=l-s;if(this.currentPath){let E=document.getElementById("vuu-drop-outline");E==null||E.setAttribute("d",this.currentPath)}let g=this.getPoints(i,s,f,h,c,p,m),y=Fn(g),d=document.getElementById("hw-drop-outline-animate");d==null||d.setAttribute("to",y),d==null||d.beginElement(),this.currentPath=y;let b=document.getElementById("hw-drop-guides");b==null||b.setAttribute("d",Rs(u))}}},Vn="transition:margin-left .4s ease-out;margin-left: 63px",Wn="transition:margin-left .4s ease-out;margin-left: 0px";function Ss(e){var a,l;let{AFTER:t,BEFORE:o}=et,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:i}=e.component.props,s=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,p=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;s=(a=document.getElementById(i))==null?void 0:a.querySelector(p),s?(te===null||te!==s)&&(s.style.cssText=Vn,te&&(te.style.cssText=Wn),te=s):Lt()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(te===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=Vn,te=s}}else Lt()}function Lt(){te&&(te.style.cssText=Wn,te=null)}var de,nt,De,Un,Xn,we,Mt,Ue=null,Ro,Yn,rt,Zn,xo,Ct=null,Ts=3,At=new ot,Gn=.4;function Ds(e,t){return t?V(e,t):le(e,o=>o.dropTarget)}var It={handleMousedown(e,t,o={}){de=t,Yn=o,Un=e.clientX,Xn=e.clientY,xo=o.dragThreshold===void 0?Ts:o.dragThreshold,xo===0?de(e,0,0):(window.addEventListener("mousemove",kt,!1),window.addEventListener("mouseup",zt,!1),Ct=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1),de==null||de(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:nt,drop:De}=a,ws(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function kt(e){let n=e.clientX-Un,r=e.clientY-Xn;Math.max(Math.abs(n),Math.abs(r))>xo&&(window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1),de==null||de(e,n,r),de=null)}function zt(){Ct&&(window.clearTimeout(Ct),Ct=null),window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1)}function ws(e,t,o,n,r,i){we=Ds(e,t);let{"data-path":s,path:a=s}=D(we);i&&(Ro=i.map(u=>le(e,f=>f.id===u)).map(u=>u.props.path)),rt=_e.measure(we,i),console.log({_measurements:rt});let l=rt[a];Mt=new wt(l,n.x,n.y,o,r);let c=Math.round(Mt.x.mousePct*100),p=Math.round(Mt.y.mousePct*100);return window.addEventListener("mousemove",qn,!1),window.addEventListener("mouseup",Jn,!1),Zn=!1,At.prepare(o,"tab-only"),Yn.DoNotTransform?"transform:none":`transform:scale(${Gn},${Gn});transform-origin:${c}% ${p}%;`}function qn(e){let t=e.clientX,o=e.clientY,n=Mt,r=Ue,i,s,a;n.update("x",t)&&(s=n.x.pos),n.update("y",o)&&(a=n.y.pos),s===void 0&&a===void 0||nt==null||nt(s,a),!(Zn||we===void 0)&&(n.inBounds()?i=Pt(t,o,we,rt,n.hasIntrinsicSize(),Ro):i=Pt(n.dropX(),n.dropY(),we,rt),r&&(i==null||i.box!==r.box)&&(Ue=null),i&&(At.draw(i,n),Ue=i))}function Jn(){Ps()}function Ps(){if(Ue){let e=At.hoverDropTarget||me.getActiveDropTarget(Ue);De==null||De(e),Ue=null}else De==null||De({component:we,pos:{position:W.Absolute}});nt=null,De=null,we=void 0,At.clear(),Ro=void 0,window.removeEventListener("mousemove",qn,!1),window.removeEventListener("mouseup",Jn,!1)}var Kn=v(require("classnames")),jn=require("react");var er=require("react/jsx-runtime"),Eo=function(t){let o=(0,jn.useRef)();o.current=t;let{className:n,id:r,style:i}=t,s=(0,Kn.default)("DraggableLayout",n);return(0,er.jsx)("div",{className:s,id:r,style:i,children:t.children})},Qn="DraggableLayout";Eo.displayName=Qn;B(Qn,Eo,"container");var hr=require("@salt-ds/core"),gr=v(require("classnames")),yr=require("react");var dr=require("@vuu-ui/vuu-utils"),O=v(require("react"));var or=v(require("classnames"));var nr=require("react/jsx-runtime"),tr="vuuPlaceholder",it=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>(0,nr.jsx)("div",{className:(0,or.default)(tr,e,{[`${tr}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});it.displayName="Placeholder";B("Placeholder",it);var rr=v(require("classnames")),_=v(require("react"));var So=require("react/jsx-runtime"),ir=_.default.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:i,style:s}){let a=(0,_.useRef)(),l=(0,_.useRef)(null),c=(0,_.useRef)(0),[p,m]=(0,_.useState)(!1),u=(0,_.useCallback)(({key:x,shiftKey:T})=>{let L=T?10:1;t&&x==="ArrowDown"?n(o,L):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-L):!t&&x==="ArrowRight"&&n(o,L)},[t,o,n]),f=(0,_.useCallback)(x=>{let{key:T}=x;(t&&(T==="ArrowUp"||T==="ArrowDown")||!t&&(T==="ArrowLeft"||T==="ArrowRIght"))&&(i(o),u(x),h.current=u)},[t,u,o,i]),h=(0,_.useRef)(f),g=x=>h.current(x),y=(0,_.useCallback)(x=>{a.current=!0;let T=x[t?"clientY":"clientX"],L=T-c.current;T&&T!==c.current&&n(o,L),c.current=T},[t,o,n]),d=(0,_.useCallback)(()=>{var x;window.removeEventListener("mousemove",y,!1),window.removeEventListener("mouseup",d,!1),r(),m(!1),(x=l.current)==null||x.focus()},[y,r,m]),b=(0,_.useCallback)(x=>{c.current=t?x.clientY:x.clientX,i(o),window.addEventListener("mousemove",y,!1),window.addEventListener("mouseup",d,!1),x.preventDefault(),m(!0)},[t,y,d,o,i,m]),E=()=>{var x;a.current?a.current=!1:(x=l.current)==null||x.focus()},R=()=>{h.current=f},S=(0,rr.default)("Splitter","focusable",{active:p,column:t});return(0,So.jsx)("div",{className:S,"data-splitter":!0,ref:l,role:"separator",style:s,onBlur:R,onClick:E,onKeyDown:g,onMouseDown:b,tabIndex:0,children:(0,So.jsx)("div",{className:"grab-zone"})})});var Do=require("@vuu-ui/vuu-utils"),wo=v(require("react"));var vs={"data-placeholder":!0,"data-resizeable":!0},Bt={},Pe="auto",To={flexBasis:0,flexGrow:1,flexShrink:1,height:Pe,width:Pe},sr={height:"width",width:"height"},ar=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],Ls=e=>typeof e=="string"&&e.endsWith("%"),J=e=>{let{style:{width:t=Pe,height:o=Pe}=Bt}=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 Po(e,t,o){let n=sr[t],{style:{[n]:r=Pe,...i}=Bt}=e.props;return o&&o[t]?{...i,...To,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...To,[n]:r}}function lr(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=Bt}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function vo(e,t,o){let n=sr[t],{style:{[t]:r=Pe,[n]:i=Pe,...s}=Bt}=e.props;return r!==Pe?Ls(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:i}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:i}:o&&o[t]?{...s,...To,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function st(e,t,o,n,r){let i=[],s=0,a;if(n&&r){let p,[m,u,f,h]=r;[p,a]=t==="column"?[u-n.top,n.bottom-h]:[m-n.left,n.right-f],p&&i.push(ce(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=D(e);return i.push($(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(ce(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),Lo(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Ms=(e,t)=>{if(!t)return e===0?1:0};function Lo(e,t,o,n){let r=(0,Do.uuid)(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Ms(l,i);return wo.default.createElement(ue.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var Cs={flexGrow:1,flexShrink:1};function ce(e,t,o,n){let r=(0,Do.uuid)();return wo.default.createElement("div",{...vs,...n,"data-path":e,id:r,key:r,style:{...Cs,...o,flexBasis:t}})}var As={},at=1,lt=2,ks=e=>typeof e.intrinsicSize=="number",zs=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},Ot=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=J(n))!=null?l:As,a=lr(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...zs(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),cr=e=>{let t=e.length,o=e.every(ks),n=Array(t).fill(0);if(o&&(n[0]=lt,n[t-1]=lt),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=at),n[r]+=i;for(let r=t-1;r>0&&(n[r]&at&&(n[r]-=at),!e[r].resizeable);r--);return n},pr=(e,t)=>{let o=Bs(e,t),n=Os(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=Is(e,r);return[r,i]};function Is(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 Bs(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=ur(e,o);return o}function Os(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=ur(e,o);return o===r?-1:o}function ur(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var Hs=e=>!e.splitter&&!e.placeholder,fr=({children:e,onSplitterMoved:t,style:o})=>{let n=(0,O.useRef)(null),r=(0,O.useRef)(),i=(0,O.useRef)(),s=(0,O.useRef)([]),[,a]=(0,O.useState)({}),l=y=>{i.current=y,a({})},c=(o==null?void 0:o.flexDirection)==="column",p=c?"height":"width",m=(0,O.useMemo)(()=>Array.isArray(e)?e:O.default.isValidElement(e)?[e]:[],[e]),u=(0,O.useCallback)(y=>{let{current:d}=r;if(d){let[b,E]=pr(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:T,minSize:L}=Vs(S,p);d[R].currentSize=T,d[R].minSize=L}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:T}=S.getBoundingClientRect();d[R].flexBasis=T}}))}},[p]),f=(0,O.useCallback)((y,d)=>{i.current&&r.current&&l(Ns(i.current,r.current,d,p))},[p]),h=(0,O.useCallback)(()=>{let y=r.current;y&&(t==null||t(y.filter(Hs))),y==null||y.forEach(d=>{d.currentSize=void 0,d.flexBasis=void 0,d.flexOpen=!1})},[t]),g=(0,O.useCallback)(y=>O.default.createElement(ir,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return(0,O.useMemo)(()=>{let[y,d]=$s(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function $s(e,t,o,n){let r=Ot(e,t),i=cr(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]<&&(s.push(mr(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=(0,dr.getUniqueId)());s.push(O.default.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]<?(s.push(mr(l)),a.push({placeholder:!0})):i[l]&at&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function Ns(e,t,o,n){return Fs(t,o)?e.map((i,s)=>{let a=t[s],{currentSize:l,flexOpen:c,flexBasis:p}=a,m=l!==void 0;if(m||c){let{flexBasis:u}=i.props.style||{},f=m?a.currentSize:p;return f!==u?O.default.cloneElement(i,{style:{...i.props.style,flexBasis:f,[n]:"auto"}}):i}else return i}):e}function Fs(e,t){let o=[];e.forEach((p,m)=>{p.currentSize!==void 0&&o.push(m)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:i=0}=e[n];if(r===i)return!1;if(Math.abs(t)>r-i){let p=t<0?-1:1;t=Math.max(0,r-i)*p}let s=e[o[0]],{currentSize:a=0}=s;s.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function mr(e){return O.default.createElement(it,{shim:e===0,key:`placeholder-${e}`})}function Vs(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),i=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:i}}var xr=require("react/jsx-runtime"),Mo="hwFlexbox",br=(0,yr.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,className:s,flexFill:a,gap:l,fullPage:c,id:p,onSplitterMoved:m,resizeable:u,row:f,spacing:h,splitterSize:g,style:y,...d}=t,{content:b,rootRef:E}=fr({children:r,onSplitterMoved:m,style:y}),R=(0,gr.default)(Mo,s,{[`${Mo}-column`]:i,[`${Mo}-row`]:f,"flex-fill":a,"full-page":c});return(0,xr.jsx)("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:(0,hr.useForkRef)(E,o),style:{...y,gap:l,"--spacing":h},children:b})});br.displayName="Flexbox";var Ht=br;var Ur=require("react");var ze={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 U=require("react");var Vo=v(require("react"));var Ho=require("@vuu-ui/vuu-utils"),Xe=v(require("react"));var Io=require("@vuu-ui/vuu-utils"),ve=v(require("react"));var Ie=require("react"),G=new Map,K=new Map,Co=e=>G.get(e),Ao=e=>G.has(e),ko=(e,t)=>G.set(e,t),Be=()=>{let e=(0,Ie.useCallback)((s,a)=>{let l=K.get(s);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=(0,Ie.useCallback)((s,a,l)=>{if(a===void 0)K.set(s,l);else if(K.has(s)){let c=K.get(s);K.set(s,{...c,[a]:l})}else K.set(s,{[a]:l})},[]),o=(0,Ie.useCallback)((s,a)=>{if(K.has(s)){if(a===void 0)K.delete(s);else if(K.get(s)[a]){let{[a]:c,...p}=K.get(s);Object.keys(p).length>0?K.set(s,p):K.delete(s)}}},[]),n=(0,Ie.useCallback)((s,a)=>{let l=G.get(s);if(l)return a!==void 0?l[a]:l},[]),r=(0,Ie.useCallback)((s,a,l)=>{if(a===void 0)G.set(s,l);else if(G.has(s)){let c=G.get(s);G.set(s,{...c,[a]:l})}else G.set(s,{[a]:l})},[]),i=(0,Ie.useCallback)((s,a)=>{if(G.has(s)){if(a===void 0)G.delete(s);else if(G.get(s)[a]){let{[a]:c,...p}=G.get(s);Object.keys(p).length>0?G.set(s,p):G.delete(s)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:i,purgeSessionState:o}};var Rr=e=>e.flexDirection==="column"?["height","width"]:["width","height"],Ws={},ct=(e,t="0")=>{let[o,n]=Oo(P(e),e.props,t);return ve.default.cloneElement(e,o,n)},Bo=(e,t)=>{let o=P(e),[n,r]=Oo(o,e.props,"0",void 0,t);return(0,ve.cloneElement)(e,n,r)};function _s(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=D(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:(0,Io.uuid)(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:Us(e,t,n);return oo(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Oo(e,t,o,n=null,r){var c,p;let i=_s(e,t,o,n,r);if(t.layout&&!r)return[i,[$t(t.layout,`${o}.0`)]];let s=(p=r==null?void 0:r.children)!=null?p:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&s?s:Gs(e,t.children,o,s);return[i,l]}function Gs(e,t,o="0",n){let r=Array.isArray(t)?t:ve.default.isValidElement(t)?[t]:[];return F(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Oo(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return ve.default.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var Us=(e,t,o)=>{let{style:n=Ws}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...Tt(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...Tt(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function $t({id:e=(0,Io.uuid)(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:ue[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&ko(e,r),ve.default.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>$t(a,`${i}.${l}`)):void 0)}function Er(e){return Sr(e)}function Sr(e){let t=P(e),{id:o,children:n,type:r,...i}=D(e),s=Ao(o)?Co(o):void 0;return{id:o,type:t,props:Xs(i),state:s,children:ve.default.Children.map(n,Sr)}}function Xs(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=zo(i);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 Tr(e,t){var s;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:i="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(s=o[r])!=null?s:null,i]}function Nt(e,t,o){let{active:n,children:r=[],path:i}=D(e),s=w(t,"path"),{idx:a,finalStep:l}=q(i,s,!0),[c,p]=l?Ys(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?Nt(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Xe.default.cloneElement(e,{active:m},p)}function Ys(e,t,o){let n=w(e,"path"),r=t==null?void 0:t.length,{id:i=(0,Ho.uuid)()}=D(o);return r?[r,t.concat($(o,`${n}.${r}`,{id:i,key:i}))]:[0,[$(o,`${n}.0`,{id:i})]]}function Ft(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=D(e),p=w(t,"path"),{idx:m,finalStep:u}=q(c,p),[f,h]=u?Zs(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?Ft(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Xe.default.cloneElement(e,{active:g},h)}function Zs(e,t,o,n,r,i,s,a){let l=J(n);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)?Js(e,t,o,n,r,s,a):Dr(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var qs=(e,t,{top:o,right:n,bottom:r,left:i},[s,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return s-i;if(e==="row")return n-l};function Js(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=D(e),[l,c,p]=ar(a),{[c]:m,[l]:u}=J(n),f=w(t[o],"path"),h=qs(a,r,i,s),[g,y]=m<i[c]?[st(n,p,f,i,s),u]:[n,void 0],d=h?ce(f,h,{flexGrow:0,flexShrink:0}):void 0;return m>i[c]&&(t=t.map(b=>{if(w(b,"placeholder"))return b;{let{[c]:E}=J(b);return E&&E<m?st(b,p,w(b,"path")):b}})),Dr(e,t,o,g,r,y,i,d)}function Dr(e,t,o,n,r,i,s,a){let l=w(e,"path"),c=0,p=!t||t.length===0?[n]:t.reduce((m,u,f)=>{if(o===f){let[h,g]=Ks(e,u,n,s);r==="before"?a?m.push(a,g,h):m.push(g,h):a?m.push(h,g,a):m.push(h,g),c=m.indexOf(g)}else m.push(u);return m},[]).map((m,u)=>u<c?m:$(m,`${l}.${u}`));return[c,p]}function Ks(e,t,o,n){let r=(0,Ho.uuid)(),{version:i=0}=D(o);if(i+=1,P(e)==="Flexbox"){let[s]=Rr(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=vo(t,s,l),p=vo(o,s,l);return[Xe.default.cloneElement(t,{style:c}),Xe.default.cloneElement(o,{id:r,version:i,style:p})]}else{let{style:{left:s,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=D(o);return[t,Xe.default.cloneElement(o,{id:r,version:i,style:c})]}}var j={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 Le=v(require("react"));var pt=v(require("react"));function wr(e,{target:t,replacement:o}){return $o(e,t,o)}function $o(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=D(t),s=ct(pt.default.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return oe(e,t,s)}function oe(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=q(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===ze.MINIMIZE?s[r]=js(e,s[r]):n===ze.RESTORE&&(s[r]=Qs(s[r])):s[r]=o:s[r]=oe(s[r],t,o,n),pt.default.cloneElement(e,void 0,s)}function js(e,t){let{style:o}=D(e),{style:n}=D(t),{width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l,...c}=n,p={width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l},m={...c,flexBasis:0,flexGrow:0,flexShrink:0},u=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return u?pt.default.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Qs(e){let{style:t,restoreStyle:o}=D(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return pt.default.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function No(e,{path:t}){let o=V(e,t),n=ae(e,t);if(n===null)return e;let{children:r}=D(n);if(r.length>1&&vr(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=D(n),c=w(n,"path"),p=oe(e,n,ce(c,i,l));for(;(n=ae(p,c))&&w(n,"path")!=="0";){let{children:m}=D(n);if(vr(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=D(n);p=oe(e,n,ce(c,u,g))}else if(na(m))p=Cr(e,n);else break}return p}return Lr(e,o)}function Lr(e,t){let o=D(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=q(r,w(t,"path")),c=P(e),p=n.slice();if(l){if(p.splice(a,1),s!==void 0&&s>=a&&(s=Math.max(0,s-1)),p.length===1&&!i&&r!=="0"&&c.match(/Flexbox|Stack/))return ea(e,p[0]);!p.some(ta)&&p.some(Mr)&&(p=oa(p))}else p[a]=Lr(p[a],t);return p=p.map((m,u)=>$(m,`${r}.${u}`)),Le.default.cloneElement(e,{active:s},p)}function ea(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=D(e),c=$(t,n);if(n==="0")c=Le.default.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let p=e.props.style.flexDirection==="column"?"height":"width",{style:{[p]:m,...u}}=c.props;c=Le.default.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var ta=e=>e.props.style.flexGrow>0,Mr=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},oa=e=>e.map(t=>Mr(t)?Le.default.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),na=e=>{if(e&&e.length>0){let t=w(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=w(e[n],"placeholder"),t&&o)return!0;t=o}}},Cr=(e,t)=>{let{children:o,path:n}=D(e),{idx:r,finalStep:i}=q(n,w(t,"path")),s=o.slice();return i?s[r]=ra(t):s[r]=Cr(s[r],t),s=s.map((a,l)=>$(a,`${n}.${l}`)),Le.default.cloneElement(e,void 0,s)},ra=e=>{let{children:t}=D(e),o=[],n=[];for(let i=0;i<t.length;i++)w(t[i],"placeholder")?n.push(t[i]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(Pr(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(Pr(n));let r=w(e,"path");return Le.default.cloneElement(e,void 0,o.map((i,s)=>$(i,`${r}.${s}`)))},Pr=([e,...t])=>{let o=w(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:i}=o;for(let{props:{style:s}}of t)n+=s.flexBasis,r=Math.max(r,s.flexGrow),i=Math.max(i,s.flexShrink);return Le.default.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},vr=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);var Fo=v(require("react"));function Ar(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=D(n),s=i.flexDirection==="column"?"height":"width",a=ia(r,o,s),l=Fo.default.cloneElement(n,void 0,a);return oe(e,n,l)}function ia(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=D(n),a=t[r],{currentSize:l,flexBasis:c}=a,m=l!==void 0?a.currentSize:c;return m===void 0||i===m||s===m?n:Fo.default.cloneElement(n,{style:sa(n.props.style,o,m)})})}function sa(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:i=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:i}}var kr=require("@vuu-ui/vuu-utils"),ut=v(require("react"));var zr=e=>{let[t]=P(e);return t===t.toLowerCase()};function mt(e,t,o,n,r,i){let{children:s,path:a}=D(e),l=w(t,"path"),{idx:c,finalStep:p}=q(a,l),m=p?aa(e,s,t,o,n,r,i):s.map((u,f)=>f===c?mt(u,t,o,n,r,i):u);return ut.default.cloneElement(e,void 0,m)}function aa(e,t,o,n,r,i,s){let a=J(n);if((a==null?void 0:a.width)&&(a==null?void 0:a.height)){if(i===void 0||s===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return ca(t,o,n,r,i,s)}return la(e,t,o,n,r)}function la(e,t,o,n,r){var x;let{version:i=0}=D(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=Br(r),[p,m,u]=pa(a,o,n,l,r),f=Ir(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[zr(o)?"data-resizeable":"resizeable"]:!0,style:m},b=a==="Stack"?{showTabs:c}:void 0,E=a==="Flexbox"?{splitterSize:(x=P(e)==="Flexbox"&&e.props.splitterSize)!=null?x:void 0}:void 0,R=(0,kr.uuid)(),S=ut.default.createElement(ue[a],{active:h,id:R,key:R,path:w(o,"path"),flexFill:w(o,"flexFill"),...E,...b,style:p,resizeable:w(o,"resizeable")},f?[$(o,`${s}.0`,d),ct(ut.default.cloneElement(n,g),`${s}.1`)]:[ct(ut.default.cloneElement(n,g),`${s}.0`),$(o,`${s}.1`,d)]);return t.map(T=>T===o?S:T)}function ca(e,t,o,n,r,i){let{flexDirection:s}=Br(n),a=s==="column"?"row":"column",l=Ir(n),[c,p,m,u]=i,[f,h]=s==="column"?[p-r.top,r.bottom-u]:[c-r.left,r.right-m],g=w(t,"path"),y=0,d=zr(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):ce(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(st(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?ce(`${g}.${y++}`,0):$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=Lo(s,t.props,b,g);return e.map(R=>R===t?E:R)}function pa(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=Po(o,s,r),l=Po(t,s);return[i,l,a]}var Ir=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 Br(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var Nr=(e,t)=>{switch(t.type){case j.ADD:return ha(e,t);case j.DRAG_DROP:return fa(e,t);case j.MAXIMIZE:return da(e,t);case j.REMOVE:return No(e,t);case j.REPLACE:return wr(e,t);case j.SET_TITLE:return ma(e,t);case j.SPLITTER_RESIZE:return Ar(e,t);case j.SWITCH_TAB:return ua(e,t);default:return e}},ua=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Vo.default.cloneElement(n,{active:o});return oe(e,n,r)},ma=(e,{path:t,title:o})=>{let n=V(e,t,!0),r=Vo.default.cloneElement(n,{title:o});return oe(e,n,r)},da=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return oe(e,n,n,o)}else return e},fa=(e,t)=>{var h,g;console.log("drag drop");let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,i=r.component,{pos:s}=r,a=((h=s==null?void 0:s.position)==null?void 0:h.Header)&&P(i)==="Stack",{id:l,version:c}=D(o),p=J(o),m;if(a){let[y,d]=Tr(i,s);y===void 0?m=Nt(e,i,o):m=Ft(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)==null?void 0:g.Centre)?m=$o(e,i,o):m=ga(e,r,o);if(n.DoNotRemove)return m;let u=le(m,y=>y.id===l&&y.version===c),f=w(u,"path");return No(m,{path:f,type:"remove"})},ha=(e,{path:t,component:o})=>Nt(e,V(e,t),o),ga=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return mt(e,n,o,r);let l=ae(e,a);if(Or(r,l)){let c=r.position.SouthOrEast?"after":"before";return Ft(e,n,o,c,r,i,s)}if(!Or(r,l))return mt(e,n,o,r,i,s);if(F(P(l)))return mt(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},Or=(e,t)=>e.position.Centre?$r(t)||Hr(t):e.position.NorthOrSouth?Hr(t):e.position.EastOrWest?$r(t):!1,Hr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",$r=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";var Fr=require("react"),ya=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),Ye=(0,Fr.createContext)({dispatchLayoutProvider:ya,version:-1});var fe=require("react");var ba={},Vr=[0,0],xa=(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 i=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,i,e.left,e.top]},Ra=e=>{let{offsetParent:t}=e;if(t===null)return Vr;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},Wr=(e,t)=>{let o=(0,fe.useRef)(),n=(0,fe.useRef)(),r=(0,fe.useRef)(),i=(0,fe.useCallback)((c,p)=>{if(n.current&&r.current){let{dragOffsets:[m,u],targetPosition:f}=n.current,h=typeof c=="number"?c-m:f.left,g=typeof p=="number"?p-u:f.top;(h!==f.left||g!==f.top)&&(n.current.targetPosition.left=h,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=h+"px")}},[]),s=(0,fe.useCallback)(c=>{if(n.current){let{dragInstructions:p,payload:m,originalCSS:u}=n.current;t({type:"drag-drop",draggedReactElement:m,dragInstructions:p,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:p}),r.current&&(p.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=u,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[t]),a=(0,fe.useCallback)(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=ba,path:g}=o.current,{current:y}=e,d={x:c.clientX,y:c.clientY},b=p!=null?p:V(y,g,!0),{id:E}=b.props,R=J(b),S="",x="",T="",L=-1,A=-1,N=Vr,M=document.getElementById(E);if(M===null)[M,x,L,A]=xa(f,E,u);else{N=Ra(M);let[H,C]=N,{width:k,height:I,left:Q,top:X}=M.getBoundingClientRect();L=Q-H,A=X-C,x=`width:${k}px;height:${I}px;left:${L}px;top:${A}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,M.dataset.dragging="true",S=M.style.cssText}T=It.initDrag(e.current,m,f,d,{drag:i,drop:s},R),M.style.cssText=x+T,r.current=M,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:N,dragInstructions:h,targetPosition:{left:L,top:A}}}},[i,s,e]);return(0,fe.useCallback)(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},It.handleMousedown(p,a,m.instructions)},[a])};var Wo=require("react/jsx-runtime"),_r=e=>e.dropTarget,Ea=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Sa=()=>{let e=Gr();return(0,Wo.jsx)("div",{children:`Context: ${e} `})},Ta=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=(0,U.useRef)(void 0),i=(0,U.useRef)(t),[,s]=(0,U.useState)(null),a=(0,U.useCallback)(m=>{if(n){let u=le(m,_r)||r.current,h=P(u)==="DraggableLayout"?D(u).children[0]:u,g=Er(h);n(g,"drag-root")}},[n]),l=(0,U.useCallback)((m,u=!1)=>{let f=Nr(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Ea(m)&&a(f))},[a]),c=(0,U.useCallback)(m=>{switch(m.type){case"drag-start":{p(m);break}case"save":{a(r.current);break}default:{l(m);break}}},[l,a]),p=Wr(r,c);return(0,U.useEffect)(()=>{if(o){let m=le(r.current,_r),u=so(m),f=$t(o,`${m.props.path}.0`),h=u?{type:j.REPLACE,target:u,replacement:f}:{type:j.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=Bo(t):t!==i.current&&(r.current=Bo(t,r.current),i.current=t),(0,Wo.jsx)(Ye.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},Y=()=>{let{dispatchLayoutProvider:e}=(0,U.useContext)(Ye);return e},Gr=()=>{console.log({LayoutProviderContext:Ye});let{version:e}=(0,U.useContext)(Ye);return e};var Xr=require("react/jsx-runtime"),_o=function(t){let{path:o}=t,n=Y(),r=(0,Ur.useCallback)(i=>{n({type:ze.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return(0,Xr.jsx)(Ht,{...t,onSplitterMoved:r})};_o.displayName="Flexbox";B("Flexbox",_o,"container");var ei=require("@salt-ds/core"),ti=v(require("classnames")),oi=require("react");var ne=require("react");var He=require("react"),Da=["height","width"],wa=["height"],Pa=["width"],Oe=new WeakMap,Zr=(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}},Yr=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=Oe.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=Zr(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function Go(e,t,o,n=!1){let r=(0,He.useRef)(t),i=(0,He.useCallback)(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=Zr(s,a,c),l),{})},[]);(0,He.useLayoutEffect)(()=>{let s=e.current,a=!1;async function l(){Oe.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=Oe.get(s);if(p){let m=i(s);p.measurements=m,Yr.observe(s),n&&o(m)}}}if(s){if(Oe.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&Oe.has(s)&&(Yr.unobserve(s),Oe.delete(s),a=!0)}},[e,i]),(0,He.useLayoutEffect)(()=>{let s=e.current,a=Oe.get(s);if(a){if(r.current!==t){r.current=t;let l=i(s);a.measurements=l}a.onResize=o}},[t,i,e,o])}function va(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,i){let s=r.getPropertyValue(`--${e}-breakpoint-${i}`);return s?parseInt(s):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var La=([,e],[,t])=>t-e,Xo=e=>Object.entries(e).sort(La).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Uo=null,Ma=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=va(e);return Xo({xs:t,sm:o,md:n,lg:r,xl:i})},qr=e=>(Uo===null&&(Uo=Ma(e)),Uo);var Ca=[],Yo=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=(0,ne.useState)(t?!1:"lg"),i=(0,ne.useRef)(document.body),s=(0,ne.useRef)(e?Xo(e):qr()),a=(0,ne.useRef)("lg"),l=(0,ne.useCallback)(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=(0,ne.useCallback)(p=>{if(t){let m=s.current.find(([u])=>u===t);if(m){let[,,u]=m;return p<u}}else return l(p);return p},[t,l]);return Go(o||i,s.current?["width"]:Ca,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),(0,ne.useEffect)(()=>{let p=o||i;if(p.current){let m=a.current;if(s.current){let{clientWidth:u}=p.current,f=c(u);a.current=f,f!==m&&r(f)}}},[r,c,o]),n};var Jr="data-collapsible",Aa={[Jr]:!0,"data-pad-start":!0,"data-pad-end":!0},Kr=e=>{var t;return(t=Aa[e])!=null?t:!1},ka=e=>e===Jr,za={dynamic:"dynamic",instant:"instant",true:"instant"},Ia=e=>{var t;return(t=za[e])!=null?t:"none"},Ba=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Kr(o)){let i=ka(o)?Ia(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);var jr=require("@vuu-ui/vuu-utils"),Z=require("react");var Oa=["xs","sm","md","lg","xl"],Ha=12,Qr=({children:e,cols:t,style:o})=>{let n=(0,Z.useRef)(null),r=(0,Z.useRef)(null),i=(0,Z.useRef)(),s=t!=null?t:Ha,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=(0,Z.useMemo)(()=>Array.isArray(e)?e:(0,Z.isValidElement)(e)?[e]:[],[e]),p=(0,Z.useCallback)((m,u)=>{let f=Ot(m,u,Oa),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push((0,Z.cloneElement)(d,{key:(0,jr.getUniqueId)(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return(0,Z.useMemo)(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};var ni=require("react/jsx-runtime"),Vt="hwFluidGrid",Wt=(0,oi.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,cols:s=12,className:a,flexFill:l,gap:c=3,fullPage:p,id:m,onSplitterMoved:u,resizeable:f,row:h,showGrid:g,spacing:y,splitterSize:d,style:b,...E}=t,{cols:R,content:S,rootRef:x}=Qr({children:r,cols:s,style:b}),T=Yo({breakPoints:n},x),L=(0,ti.default)(Vt,a,{[`${Vt}-column`]:i,[`${Vt}-row`]:h,[`${Vt}-show-grid`]:g,"flex-fill":l,"full-page":p}),A={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return(0,ni.jsx)("div",{...E,className:L,"data-breakpoint":T,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:(0,ei.useForkRef)(x,o),style:A,children:S})});Wt.displayName="FluidGrid";var ri=require("react/jsx-runtime"),Zo=function(t){return(0,ri.jsx)(Wt,{...t})};Zo.displayName="FluidGrid";B("FluidGrid",Zo,"container");var ci=v(require("classnames")),$e=v(require("react"));var Me=require("react");var dt=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=Be(),[l,c]=(0,Me.useState)((y=r(e,"contributions"))!=null?y:[]),p=Y(),m=(0,Me.useCallback)((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=(0,Me.useCallback)(()=>{i(e,"contributions"),c([])},[e,i]),f=(0,Me.useCallback)(()=>{let d=r(e,"data-source");d&&d.unsubscribe(),i(e),s(e),p({type:"remove",path:o})},[p,e,r,i,s,o]),h=(0,Me.useCallback)(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,T)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:T})})},[t,p,o,n]);return[(0,Me.useCallback)(async(d,b)=>{var R;let{type:E}=d;switch(E){case"maximize":case"minimize":case"restore":return p({type:E,path:(R=d.path)!=null?R:o});case"remove":return f();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),h(b,d.index,d.preDragActivity);case"add-toolbar-contribution":return m(d.location,d.content);case"remove-toolbar-contribution":return u();default:return}},[p,o,f,h,m,u]),l]};var Gt=require("@salt-ds/core"),ai=v(require("classnames")),ie=v(require("react"));var re=require("react");var ii=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=Y(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=Be(),[m,u]=dt(e,t,o,n),f=(0,re.useMemo)(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=(0,re.useCallback)(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=(0,re.useMemo)(()=>s(e),[e,s]),y=(0,re.useCallback)(x=>s(e,x),[e,s]),d=(0,re.useCallback)(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=(0,re.useCallback)((x,T)=>{c(e,T,x),i({type:"save"})},[e,i,c]),E=(0,re.useCallback)(x=>a(e,x),[e,a]),R=(0,re.useCallback)((x,T)=>p(e,T,x),[e,p]),S=(0,re.useCallback)(({type:x,...T})=>{let{[x]:L}=T;b(L,x)},[b]);return{contributions:u,dispatchViewAction:m,load:y,loadSession:E,onConfigChange:S,onEditTitle:h,purge:d,restoredState:g,save:b,saveSession:R,title:f}};var _t=require("@heswell/salt-lab"),Ze=require("react"),$a=[],si=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=(0,Ze.useRef)({}),i=(0,Ze.useRef)(),s=(0,Ze.useCallback)(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),i.current=void 0},[e]),a=(0,Ze.useCallback)(({height:l,width:c})=>{r.current.height=l,r.current.width=c,i.current!==null&&clearTimeout(i.current),i.current=window.setTimeout(s,40)},[s]);(0,_t.useResizeObserver)(o,n?_t.WidthHeight:$a,a,n)};var ft=v(require("react")),Na={dispatch:null},ht=ft.default.createContext(Na),qo=()=>{var t;let e=(0,ft.useContext)(ht);return(t=e==null?void 0:e.dispatch)!=null?t:null},Fa=()=>(0,ft.useContext)(ht);var qe=require("react/jsx-runtime"),li=(0,ie.forwardRef)(function(t,o){let{children:n,className:r,collapsed:i,closeable:s,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:p,id:m,header:u,orientation:f="horizontal",path:h,resize:g="responsive",resizeable:y=a,tearOut:d,style:b={},title:E,...R}=t,S=(0,Gt.useIdMemo)(m),x=(0,ie.useRef)(null),T=(0,ie.useRef)(null),{contributions:L,dispatchViewAction:A,load:N,loadSession:M,onConfigChange:H,onEditTitle:C,purge:k,restoredState:I,save:Q,saveSession:X,title:Ve}=ii({id:S,rootRef:x,path:h,dropTargets:l,title:E});si({mainRef:T,resize:g,rootRef:x});let Ke="vuuView",Pi=()=>ie.default.isValidElement(n)&&I?ie.default.cloneElement(n,I):n,vi=(0,ie.useMemo)(()=>({dispatch:A,id:S,path:h,title:Ve,load:N,loadSession:M,onConfigChange:H,purge:k,save:Q,saveSession:X}),[A,S,N,M,H,h,k,Q,X,Ve]),Li=typeof u=="object"?u:{};return(0,qe.jsx)("div",{...R,className:(0,ai.default)(Ke,r,{[`${Ke}-collapsed`]:i,[`${Ke}-expanded`]:c,[`${Ke}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:(0,Gt.useForkRef)(o,x),style:b,tabIndex:-1,children:(0,qe.jsxs)(ht.Provider,{value:vi,children:[u?(0,qe.jsx)(Jo,{...Li,collapsed:i,contributions:L,expanded:c,closeable:s,onEditTitle:C,orientation:f,tearOut:d,title:Ve}):null,(0,qe.jsx)("div",{className:`${Ke}-main`,ref:T,children:Pi()})]})})});li.displayName="View";var he=ie.default.memo(li);he.displayName="View";B("View",he,"view");var se=require("@heswell/salt-lab"),pi=require("@salt-ds/icons");var ge=require("react/jsx-runtime"),Jo=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=(0,$e.useRef)(null),[c,p]=(0,$e.useState)(a),[m,u]=(0,$e.useState)(!1),f=qo(),h=M=>f==null?void 0:f({type:"remove"},M),g="vuuHeader",y=()=>{var M;(M=l.current)==null||M.focus()},d=M=>{M.stopPropagation()},E=(0,ci.default)(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=M=>{M.key==="Enter"&&u(!0)},x=(M="",H="",C=!0,k=!1)=>{var I;u(!1),k?p(M):H!==M&&(p(H),r==null||r(H)),C===!1&&((I=l.current)==null||I.focus())},T=M=>{f==null||f({type:"mousedown"},M)},L=[],A=[],N=[];return a&&L.push((0,ge.jsx)(se.ToolbarField,{className:"vuuHeader-title",children:(0,ge.jsx)(se.EditableLabel,{editing:m,value:c,onChange:p,onMouseDownCapture:y,onEnterEditMode:R,onExitEditMode:x,onKeyDown:S,ref:l,tabIndex:0},"title")},"title")),t==null||t.forEach((M,H)=>{A.push($e.default.cloneElement(M.content,{key:H}))}),n&&N.push((0,ge.jsxs)(se.ToolbarButton,{onClick:h,onMouseDown:d,children:[(0,ge.jsx)(pi.CloseIcon,{})," Close"]},"close")),A.length>0&&L.push((0,ge.jsx)(se.Tooltray,{"data-align-end":!0,children:A},"contributions")),N.length>0&&L.push((0,ge.jsx)(se.Tooltray,{"data-align-end":!0,children:N},"actions")),(0,ge.jsx)(se.Toolbar,{className:E,orientation:i,style:s,onMouseDown:T,children:L})};var ui=require("@vuu-ui/vuu-utils"),Xt=require("@heswell/salt-lab"),Ko=v(require("classnames")),Yt=require("react");var Ut=require("react/jsx-runtime"),Va=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},jo=(0,Yt.memo)(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>(0,Ut.jsx)(Xt.ListItem,{className:(0,Ko.default)("vuuPaletteItem",e),"data-draggable":!0,...s}));jo.displayName="PaletteItem";var mi=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=Y(),i="vuuPalette";function s(a){var x;let c=a.target.closest(".vuuPaletteItem"),p=parseInt((x=c.dataset.idx)!=null?x:"-1");p!==-1&&console.log({children:e,idx:p,listItemElement:c});let{props:{caption:m,children:u,template:f,...h}}=e[p],{height:g,left:y,top:d,width:b}=c.getBoundingClientRect(),E=(0,ui.uuid)(),S=f?u:(0,Ut.jsx)(he,{...{id:E,key:E},...h,title:h.label,children:u});r({dragRect:{left:y,top:d,right:y+b,bottom:d+150,width:b,height:g},dragElement:Va(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return(0,Ut.jsx)(Xt.List,{...n,borderless:!0,className:(0,Ko.default)(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===jo?(0,Yt.cloneElement)(a,{key:l,onMouseDown:s}):a)})};B("Palette",mi,"view");var di=require("@vuu-ui/vuu-utils"),qt=require("@heswell/salt-lab"),fi=v(require("classnames"));var Zt=require("react/jsx-runtime"),Wa="vuuPalette",_a=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=Y();return(0,Zt.jsx)(qt.ListItem,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=(0,di.uuid)(),g=i?t:(0,Zt.jsx)(he,{...{id:f,key:f},...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:p,top:m,right:p+u,bottom:m+150,width:u,height:100}})},...s,children:n})},hi=({className:e,...t})=>(0,Zt.jsx)(qt.List,{...t,className:(0,fi.default)(Wa,e),height:"100%",selectionStrategy:"none"});B("PaletteSalt",hi,"view");var Ce=require("@heswell/salt-lab"),yi=require("@salt-ds/core"),bi=v(require("classnames")),ye=v(require("react"));var Ne=require("react/jsx-runtime"),gi="Tabs",Ga=()=>{},Ua=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},Xa=e=>{let t=[];return ye.default.Children.forEach(e,o=>{ye.default.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Jt=(0,ye.forwardRef)(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=Ga,getTabLabel:a=Ua,id:l,keyBoardActivation:c="manual",onMouseDown:p,onTabAdd:m,onTabClose:u,onTabEdit:f,onTabSelectionChanged:h,showTabs:g,style:y,TabstripProps:d},b){var H;let E=(0,yi.useIdMemo)(l),R=C=>{h==null||h(C)},S=C=>{u==null||u(C)},x=()=>{m==null||m(ye.default.Children.count(o))},T=C=>{var X;let I=C.target.closest('[role^="tab"]');if((I==null?void 0:I.getAttribute("role"))==="tab"){let Ve=parseInt((X=I.dataset.idx)!=null?X:"-1");if(Ve===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(C,Ve)}},L=(0,ye.useCallback)((C,k,I,Q)=>{f==null||f(Q,k)},[f]),A=()=>{var C;return ye.default.isValidElement(o)?o:Array.isArray(o)&&(C=o[t])!=null?C:null},N=()=>Xa(o).map((C,k)=>{let I=`${E}-${k}`,{closeable:Q,id:X}=C.props;return(0,Ne.jsx)(Ce.Tab,{ariaControls:`${I}-tab`,"data-icon":s(C,k),draggable:!0,id:I,label:a(C,k),closeable:Q,editable:(d==null?void 0:d.enableRenameTab)!==!1},X!=null?X:k)}),M=A();return(0,Ne.jsxs)("div",{className:(0,bi.default)(gi,n,{[`${gi}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?(0,Ne.jsx)(Ce.Toolbar,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:(0,Ne.jsx)(Ce.ToolbarField,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:(0,Ne.jsx)(Ce.Tabstrip,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:L,onMouseDown:T,activeTabIndex:(H=d==null?void 0:d.activeTabIndex)!=null?H:M===null?-1:t,children:N()})})}):null,M]})});Jt.displayName="Stack";var xi=require("@salt-ds/core"),jt=v(require("react"));var Kt=require("react/jsx-runtime"),Ya=e=>(0,Kt.jsx)(he,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:(0,Kt.jsx)(Rt,{style:{flex:1}})}),Qo=e=>{let t=(0,jt.useRef)(null),o=Y(),{loadState:n}=Be(),{createNewChild:r=Ya,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=(0,xi.useIdMemo)(i),[m]=dt(p,t,a);return(0,Kt.jsx)(Jt,{...l,id:p,getTabLabel:(b,E)=>{let{id:R,title:S}=b.props;return n(R,"view-title")||S||`Tab ${E+1}`},onMouseDown:async(b,E)=>{let R;await m({type:"mousedown",index:E,preDragActivity:async()=>new Promise(T=>{console.log("preDragActivity: Ok, gonna release the drag"),R=T})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=jt.default.Children.count(c))=>{if(a){console.log("[StackLayout] handleTabAdd");let R=r(E);console.log({component:R}),o({type:"add",path:a,component:R})}},onTabClose:b=>{if(Array.isArray(c)){let{props:{"data-path":E,path:R=E}}=c[b];o({type:"remove",path:R})}},onTabEdit:(b,E)=>{o({type:"set-title",path:`${a}.${b}`,title:E})},onTabSelectionChanged:b=>{console.log(`StackLayout handleTabSelection nextTab = ${b}`),a&&(o({type:"switch-tab",path:a,nextIdx:b}),s==null||s(b))},ref:t})};Qo.displayName="Stack";B("Stack",Qo,"container");var Je=v(require("react"));var Fe=require("react/jsx-runtime"),Za=({children:e})=>{let[o,n]=(0,Je.useState)(e),[r,i]=(0,Je.useState)(e),s=l=>{let c=ao(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=Je.default.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(Je.default.cloneElement(o,{},p))};return(0,Fe.jsxs)("div",{"data-design-mode":`${!1}`,children:[o,(0,Fe.jsx)("br",{}),(0,Fe.jsxs)("div",{style:{display:"flex"},children:[(0,Fe.jsx)(en,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),(0,Fe.jsx)(tn,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};var pe=require("@heswell/salt-lab"),z=require("react/jsx-runtime"),nn={},qa={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"}},on=({feature:e,children:t,style:o,onChange:n})=>(0,z.jsxs)("div",{className:`LayoutBox layout-${e} layout-outer`,children:[(0,z.jsxs)("div",{className:"layout-top",children:[(0,z.jsx)("span",{className:"layout-title",children:e}),(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),(0,z.jsxs)("div",{className:"layout-inner",children:[(0,z.jsx)("div",{className:"layout-left",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,(0,z.jsx)("div",{className:"layout-right",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),(0,z.jsx)("div",{className:"layout-bottom",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),Ja={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},Ka={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},ja={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},Qt="(\\d+)(?:px)?",Qa=`^(?:${Qt}(?:\\s${Qt}(?:\\s${Qt}(?:\\s${Qt})?)?)?)$`,Ri=new RegExp(Qa),el=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,en=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=Ei(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),T=qa[E][R];o(T,x)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:p=0}=i,{borderTopWidth:m=0,borderRightWidth:u=0,borderBottomWidth:f=0,borderLeftWidth:h=0}=i,{paddingTop:g=0,paddingRight:y=0,paddingBottom:d=0,paddingLeft:b=0}=i;return(0,z.jsx)("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:(0,z.jsx)(on,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:(0,z.jsx)(on,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:(0,z.jsx)(on,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:(0,z.jsx)("div",{className:"layout-content"})})})})})};function tl(e=nn,t=nn){let{margin:o,marginTop:n,marginRight:r,marginBottom:i,marginLeft:s,padding:a,paddingTop:l,paddingRight:c,paddingBottom:p,paddingLeft:m,...u}=e;if(typeof o=="number")u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=o;else if(typeof o=="string"){let f=Ri.exec(o);if(f===null)console.error(`Invalid css value for margin '${o}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.marginTop=parseInt(h,10),u.marginRight=parseInt(g,10),u.marginBottom=parseInt(y,10),u.marginLeft=parseInt(d,10)):b?(u.marginTop=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10),u.marginBottom=parseInt(y,10)):h&&g?(u.marginTop=u.marginBottom=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10)):u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=parseInt(h,10)}}if(typeof n=="number"&&(u.marginTop=n),typeof r=="number"&&(u.marginRight=r),typeof i=="number"&&(u.marginBottom=i),typeof s=="number"&&(u.marginLeft=s),typeof a=="number")u.paddingTop=u.paddingRight=u.paddingBottom=u.paddingLeft=a;else if(typeof a=="string"){let f=Ri.exec(a);if(f===null)console.error(`Invalid css value for padding '${a}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.paddingTop=parseInt(h,10),u.paddingRight=parseInt(g,10),u.paddingBottom=parseInt(y,10),u.paddingLeft=parseInt(d,10)):b?(u.paddingTop=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10),u.paddingBottom=parseInt(y,10)):h&&g?(u.paddingTop=u.paddingBottom=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10)):u.paddingTop=u.paddingRight=u.paddingBottom=u.paddinggLeft=parseInt(h,10)}}return typeof l=="number"&&(u.paddingTop=l),typeof c=="number"&&(u.paddingRight=c),typeof p=="number"&&(u.paddingBottom=p),typeof m=="number"&&(u.paddingLeft=m),Ei(u,t)}function Ei(e=nn){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:p,marginTop:m,marginRight:u,marginBottom:f,marginLeft:h,padding:g,paddingTop:y,paddingRight:d,paddingBottom:b,paddingLeft:E,...R}=t,S={},x={};if(typeof p=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=p,S={marginTop:p,marginRight:p,marginBottom:p,marginLeft:p}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,x={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||i||s||a||l){typeof n=="string"&&(o=el.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(i=i===void 0?r:i,s=s===void 0?r:s,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let T=`
|
|
17
|
+
`,document.body.insertBefore(t,e)}}var Je=class{constructor(){this.currentPath=null;this.tabMode=null;Ui()}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=yn(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){Ye=null,Rt(),document.body.classList.remove("drawing"),xt.PopupService.hidePopup()}get hoverDropTarget(){return Ye}getPoints(t,o,n,r,i=0,s=0,a=0){let l=this.tabMode==="tab-only";if(s===0)return[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=i;return[[c,o],[c,o],[c+s,o],[c+s,o],[c+s,o+a],[c+s,o+a],[c,o+a],[c,o+a]]}else return i===0?[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+i,o+a],[t+i,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=ao;if(Ye!==null)this.drawTarget(Ye);else if(ao=t.nextDropTarget!=null,t.pos.tab?Xi(t):ee&&Rt(),this.drawTarget(t,o),ao){let[i,s,a]=io(t);{let l=(0,Rn.jsx)(so,{dropTarget:t,onHover:Vi,orientation:a});xt.PopupService.showPopup({left:i,top:s,component:l})}}else xt.PopupService.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:i,t:s,r:a,b:l,tabLeft:c,tabWidth:p,tabHeight:m,guideLines:u}=r,f=a-i,h=l-s;if(this.currentPath){let E=document.getElementById("vuu-drop-outline");E==null||E.setAttribute("d",this.currentPath)}let g=this.getPoints(i,s,f,h,c,p,m),y=yn(g),d=document.getElementById("hw-drop-outline-animate");d==null||d.setAttribute("to",y),d==null||d.beginElement(),this.currentPath=y;let b=document.getElementById("hw-drop-guides");b==null||b.setAttribute("d",Gi(u))}}},bn="transition:margin-left .4s ease-out;margin-left: 63px",xn="transition:margin-left .4s ease-out;margin-left: 0px";function Xi(e){var a,l;let{AFTER:t,BEFORE:o}=Ze,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:i}=e.component.props,s=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,p=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;s=(a=document.getElementById(i))==null?void 0:a.querySelector(p),s?(ee===null||ee!==s)&&(s.style.cssText=bn,ee&&(ee.style.cssText=xn),ee=s):Rt()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(ee===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=bn,ee=s}}else Rt()}function Rt(){ee&&(ee.style.cssText=xn,ee=null)}var me,je,Re,Sn,Dn,Ee,Et,Fe=null,co,Tn,Ke,wn,lo,St=null,Zi=3,Dt=new Je,En=.4;function Yi(e,t){return t?V(e,t):ae(e,o=>o.dropTarget)}var Pt={handleMousedown(e,t,o={}){me=t,Tn=o,Sn=e.clientX,Dn=e.clientY,lo=o.dragThreshold===void 0?Zi:o.dragThreshold,lo===0?me(e,0,0):(window.addEventListener("mousemove",Tt,!1),window.addEventListener("mouseup",wt,!1),St=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1),me==null||me(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:je,drop:Re}=a,Ji(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function Tt(e){let n=e.clientX-Sn,r=e.clientY-Dn;Math.max(Math.abs(n),Math.abs(r))>lo&&(window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1),me==null||me(e,n,r),me=null)}function wt(){St&&(window.clearTimeout(St),St=null),window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1)}function Ji(e,t,o,n,r,i){Ee=Yi(e,t);let{"data-path":s,path:a=s}=T(Ee);i&&(co=i.map(u=>ae(e,f=>f.id===u)).map(u=>u.props.path)),Ke=$e.measure(Ee,i),console.log({_measurements:Ke});let l=Ke[a];Et=new yt(l,n.x,n.y,o,r);let c=Math.round(Et.x.mousePct*100),p=Math.round(Et.y.mousePct*100);return window.addEventListener("mousemove",Pn,!1),window.addEventListener("mouseup",vn,!1),wn=!1,Dt.prepare(o,"tab-only"),Tn.DoNotTransform?"transform:none":`transform:scale(${En},${En});transform-origin:${c}% ${p}%;`}function Pn(e){let t=e.clientX,o=e.clientY,n=Et,r=Fe,i,s,a;n.update("x",t)&&(s=n.x.pos),n.update("y",o)&&(a=n.y.pos),s===void 0&&a===void 0||je==null||je(s,a),!(wn||Ee===void 0)&&(n.inBounds()?i=bt(t,o,Ee,Ke,n.hasIntrinsicSize(),co):i=bt(n.dropX(),n.dropY(),Ee,Ke),r&&(i==null||i.box!==r.box)&&(Fe=null),i&&(Dt.draw(i,n),Fe=i))}function vn(){ji()}function ji(){if(Fe){let e=Dt.hoverDropTarget||ue.getActiveDropTarget(Fe);Re==null||Re(e),Fe=null}else Re==null||Re({component:Ee,pos:{position:W.Absolute}});je=null,Re=null,Ee=void 0,Dt.clear(),co=void 0,window.removeEventListener("mousemove",Pn,!1),window.removeEventListener("mouseup",vn,!1)}var Ln=M(require("classnames")),Mn=require("react");var An=require("react/jsx-runtime"),po=function(t){let o=(0,Mn.useRef)();o.current=t;let{className:n,id:r,style:i}=t,s=(0,Ln.default)("DraggableLayout",n);return(0,An.jsx)("div",{className:s,id:r,style:i,children:t.children})},Cn="DraggableLayout";po.displayName=Cn;B(Cn,po,"container");var Xn=require("@salt-ds/core"),Zn=M(require("classnames")),Yn=require("react");var Gn=require("@vuu-ui/vuu-utils"),O=M(require("react"));var In=M(require("classnames"));var kn=require("react/jsx-runtime"),zn="vuuPlaceholder",qe=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>(0,kn.jsx)("div",{className:(0,In.default)(zn,e,{[`${zn}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});qe.displayName="Placeholder";B("Placeholder",qe);var Bn=M(require("classnames")),_=M(require("react"));var uo=require("react/jsx-runtime"),On=_.default.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:i,style:s}){let a=(0,_.useRef)(),l=(0,_.useRef)(null),c=(0,_.useRef)(0),[p,m]=(0,_.useState)(!1),u=(0,_.useCallback)(({key:x,shiftKey:D})=>{let v=D?10:1;t&&x==="ArrowDown"?n(o,v):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-v):!t&&x==="ArrowRight"&&n(o,v)},[t,o,n]),f=(0,_.useCallback)(x=>{let{key:D}=x;(t&&(D==="ArrowUp"||D==="ArrowDown")||!t&&(D==="ArrowLeft"||D==="ArrowRIght"))&&(i(o),u(x),h.current=u)},[t,u,o,i]),h=(0,_.useRef)(f),g=x=>h.current(x),y=(0,_.useCallback)(x=>{a.current=!0;let D=x[t?"clientY":"clientX"],v=D-c.current;D&&D!==c.current&&n(o,v),c.current=D},[t,o,n]),d=(0,_.useCallback)(()=>{var x;window.removeEventListener("mousemove",y,!1),window.removeEventListener("mouseup",d,!1),r(),m(!1),(x=l.current)==null||x.focus()},[y,r,m]),b=(0,_.useCallback)(x=>{c.current=t?x.clientY:x.clientX,i(o),window.addEventListener("mousemove",y,!1),window.addEventListener("mouseup",d,!1),x.preventDefault(),m(!0)},[t,y,d,o,i,m]),E=()=>{var x;a.current?a.current=!1:(x=l.current)==null||x.focus()},R=()=>{h.current=f},S=(0,Bn.default)("Splitter","focusable",{active:p,column:t});return(0,uo.jsx)("div",{className:S,"data-splitter":!0,ref:l,role:"separator",style:s,onBlur:R,onClick:E,onKeyDown:g,onMouseDown:b,tabIndex:0,children:(0,uo.jsx)("div",{className:"grab-zone"})})});var fo=require("@vuu-ui/vuu-utils"),ho=M(require("react"));var Ki={"data-placeholder":!0,"data-resizeable":!0},vt={},Se="auto",mo={flexBasis:0,flexGrow:1,flexShrink:1,height:Se,width:Se},Hn={height:"width",width:"height"},$n=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],qi=e=>typeof e=="string"&&e.endsWith("%"),j=e=>{let{style:{width:t=Se,height:o=Se}=vt}=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 go(e,t,o){let n=Hn[t],{style:{[n]:r=Se,...i}=vt}=e.props;return o&&o[t]?{...i,...mo,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...mo,[n]:r}}function Fn(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=vt}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function yo(e,t,o){let n=Hn[t],{style:{[t]:r=Se,[n]:i=Se,...s}=vt}=e.props;return r!==Se?qi(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:i}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:i}:o&&o[t]?{...s,...mo,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function Qe(e,t,o,n,r){let i=[],s=0,a;if(n&&r){let p,[m,u,f,h]=r;[p,a]=t==="column"?[u-n.top,n.bottom-h]:[m-n.left,n.right-f],p&&i.push(le(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=T(e);return i.push($(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(le(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),bo(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Qi=(e,t)=>{if(!t)return e===0?1:0};function bo(e,t,o,n){let r=(0,fo.uuid)(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Qi(l,i);return ho.default.createElement(pe.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var es={flexGrow:1,flexShrink:1};function le(e,t,o,n){let r=(0,fo.uuid)();return ho.default.createElement("div",{...Ki,...n,"data-path":e,id:r,key:r,style:{...es,...o,flexBasis:t}})}var ts={},et=1,tt=2,os=e=>typeof e.intrinsicSize=="number",ns=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},Lt=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=j(n))!=null?l:ts,a=Fn(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...ns(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),Nn=e=>{let t=e.length,o=e.every(os),n=Array(t).fill(0);if(o&&(n[0]=tt,n[t-1]=tt),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=et),n[r]+=i;for(let r=t-1;r>0&&(n[r]&et&&(n[r]-=et),!e[r].resizeable);r--);return n},Vn=(e,t)=>{let o=is(e,t),n=ss(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=rs(e,r);return[r,i]};function rs(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 is(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=Wn(e,o);return o}function ss(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=Wn(e,o);return o===r?-1:o}function Wn(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var as=e=>!e.splitter&&!e.placeholder,Un=({children:e,onSplitterMoved:t,style:o})=>{let n=(0,O.useRef)(null),r=(0,O.useRef)(),i=(0,O.useRef)(),s=(0,O.useRef)([]),[,a]=(0,O.useState)({}),l=y=>{i.current=y,a({})},c=(o==null?void 0:o.flexDirection)==="column",p=c?"height":"width",m=(0,O.useMemo)(()=>Array.isArray(e)?e:O.default.isValidElement(e)?[e]:[],[e]),u=(0,O.useCallback)(y=>{let{current:d}=r;if(d){let[b,E]=Vn(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:D,minSize:v}=us(S,p);d[R].currentSize=D,d[R].minSize=v}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:D}=S.getBoundingClientRect();d[R].flexBasis=D}}))}},[p]),f=(0,O.useCallback)((y,d)=>{i.current&&r.current&&l(cs(i.current,r.current,d,p))},[p]),h=(0,O.useCallback)(()=>{let y=r.current;y&&(t==null||t(y.filter(as))),y==null||y.forEach(d=>{d.currentSize=void 0,d.flexBasis=void 0,d.flexOpen=!1})},[t]),g=(0,O.useCallback)(y=>O.default.createElement(On,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return(0,O.useMemo)(()=>{let[y,d]=ls(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function ls(e,t,o,n){let r=Lt(e,t),i=Nn(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]&tt&&(s.push(_n(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=(0,Gn.getUniqueId)());s.push(O.default.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]&tt?(s.push(_n(l)),a.push({placeholder:!0})):i[l]&et&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function cs(e,t,o,n){return ps(t,o)?e.map((i,s)=>{let a=t[s],{currentSize:l,flexOpen:c,flexBasis:p}=a,m=l!==void 0;if(m||c){let{flexBasis:u}=i.props.style||{},f=m?a.currentSize:p;return f!==u?O.default.cloneElement(i,{style:{...i.props.style,flexBasis:f,[n]:"auto"}}):i}else return i}):e}function ps(e,t){let o=[];e.forEach((p,m)=>{p.currentSize!==void 0&&o.push(m)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:i=0}=e[n];if(r===i)return!1;if(Math.abs(t)>r-i){let p=t<0?-1:1;t=Math.max(0,r-i)*p}let s=e[o[0]],{currentSize:a=0}=s;s.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function _n(e){return O.default.createElement(qe,{shim:e===0,key:`placeholder-${e}`})}function us(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),i=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:i}}var jn=require("react/jsx-runtime"),xo="hwFlexbox",Jn=(0,Yn.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,className:s,flexFill:a,gap:l,fullPage:c,id:p,onSplitterMoved:m,resizeable:u,row:f,spacing:h,splitterSize:g,style:y,...d}=t,{content:b,rootRef:E}=Un({children:r,onSplitterMoved:m,style:y}),R=(0,Zn.default)(xo,s,{[`${xo}-column`]:i,[`${xo}-row`]:f,"flex-fill":a,"full-page":c});return(0,jn.jsx)("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:(0,Xn.useForkRef)(E,o),style:{...y,gap:l,"--spacing":h},children:b})});Jn.displayName="Flexbox";var Mt=Jn;var Sr=require("react");var Me={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 U=require("react");var Ao=M(require("react"));var vo=require("@vuu-ui/vuu-utils"),Ne=M(require("react"));var To=require("@vuu-ui/vuu-utils"),De=M(require("react"));var Ce=require("react"),G=new Map,K=new Map,Ro=e=>G.get(e),Eo=e=>G.has(e),So=(e,t)=>G.set(e,t),Ae=()=>{let e=(0,Ce.useCallback)((s,a)=>{let l=K.get(s);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=(0,Ce.useCallback)((s,a,l)=>{if(a===void 0)K.set(s,l);else if(K.has(s)){let c=K.get(s);K.set(s,{...c,[a]:l})}else K.set(s,{[a]:l})},[]),o=(0,Ce.useCallback)((s,a)=>{if(K.has(s)){if(a===void 0)K.delete(s);else if(K.get(s)[a]){let{[a]:c,...p}=K.get(s);Object.keys(p).length>0?K.set(s,p):K.delete(s)}}},[]),n=(0,Ce.useCallback)((s,a)=>{let l=G.get(s);if(l)return a!==void 0?l[a]:l},[]),r=(0,Ce.useCallback)((s,a,l)=>{if(a===void 0)G.set(s,l);else if(G.has(s)){let c=G.get(s);G.set(s,{...c,[a]:l})}else G.set(s,{[a]:l})},[]),i=(0,Ce.useCallback)((s,a)=>{if(G.has(s)){if(a===void 0)G.delete(s);else if(G.get(s)[a]){let{[a]:c,...p}=G.get(s);Object.keys(p).length>0?G.set(s,p):G.delete(s)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:i,purgeSessionState:o}};var Kn=e=>e.flexDirection==="column"?["height","width"]:["width","height"],ms={},ot=(e,t="0")=>{let[o,n]=Po(P(e),e.props,t);return De.default.cloneElement(e,o,n)},wo=(e,t)=>{let o=P(e),[n,r]=Po(o,e.props,"0",void 0,t);return(0,De.cloneElement)(e,n,r)};function ds(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=T(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:(0,To.uuid)(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:hs(e,t,n);return Zt(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Po(e,t,o,n=null,r){var c,p;let i=ds(e,t,o,n,r);if(t.layout&&!r)return[i,[Ct(t.layout,`${o}.0`)]];let s=(p=r==null?void 0:r.children)!=null?p:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&s?s:fs(e,t.children,o,s);return[i,l]}function fs(e,t,o="0",n){let r=Array.isArray(t)?t:De.default.isValidElement(t)?[t]:[];return N(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Po(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return De.default.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var hs=(e,t,o)=>{let{style:n=ms}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...ht(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...ht(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function Ct({id:e=(0,To.uuid)(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:pe[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&So(e,r),De.default.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>Ct(a,`${i}.${l}`)):void 0)}function qn(e){return Qn(e)}function Qn(e){let t=P(e),{id:o,children:n,type:r,...i}=T(e),s=Eo(o)?Ro(o):void 0;return{id:o,type:t,props:gs(i),state:s,children:De.default.Children.map(n,Qn)}}function gs(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=Do(i);return n}}function Do(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Do);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=Do(n);return t}}function er(e,t){var s;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:i="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(s=o[r])!=null?s:null,i]}function At(e,t,o){let{active:n,children:r=[],path:i}=T(e),s=w(t,"path"),{idx:a,finalStep:l}=J(i,s,!0),[c,p]=l?ys(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?At(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Ne.default.cloneElement(e,{active:m},p)}function ys(e,t,o){let n=w(e,"path"),r=t==null?void 0:t.length,{id:i=(0,vo.uuid)()}=T(o);return r?[r,t.concat($(o,`${n}.${r}`,{id:i,key:i}))]:[0,[$(o,`${n}.0`,{id:i})]]}function zt(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=T(e),p=w(t,"path"),{idx:m,finalStep:u}=J(c,p),[f,h]=u?bs(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?zt(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Ne.default.cloneElement(e,{active:g},h)}function bs(e,t,o,n,r,i,s,a){let l=j(n);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)?Rs(e,t,o,n,r,s,a):tr(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var xs=(e,t,{top:o,right:n,bottom:r,left:i},[s,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return s-i;if(e==="row")return n-l};function Rs(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=T(e),[l,c,p]=$n(a),{[c]:m,[l]:u}=j(n),f=w(t[o],"path"),h=xs(a,r,i,s),[g,y]=m<i[c]?[Qe(n,p,f,i,s),u]:[n,void 0],d=h?le(f,h,{flexGrow:0,flexShrink:0}):void 0;return m>i[c]&&(t=t.map(b=>{if(w(b,"placeholder"))return b;{let{[c]:E}=j(b);return E&&E<m?Qe(b,p,w(b,"path")):b}})),tr(e,t,o,g,r,y,i,d)}function tr(e,t,o,n,r,i,s,a){let l=w(e,"path"),c=0,p=!t||t.length===0?[n]:t.reduce((m,u,f)=>{if(o===f){let[h,g]=Es(e,u,n,s);r==="before"?a?m.push(a,g,h):m.push(g,h):a?m.push(h,g,a):m.push(h,g),c=m.indexOf(g)}else m.push(u);return m},[]).map((m,u)=>u<c?m:$(m,`${l}.${u}`));return[c,p]}function Es(e,t,o,n){let r=(0,vo.uuid)(),{version:i=0}=T(o);if(i+=1,P(e)==="Flexbox"){let[s]=Kn(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=yo(t,s,l),p=yo(o,s,l);return[Ne.default.cloneElement(t,{style:c}),Ne.default.cloneElement(o,{id:r,version:i,style:p})]}else{let{style:{left:s,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=T(o);return[t,Ne.default.cloneElement(o,{id:r,version:i,style:c})]}}var q={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 Te=M(require("react"));var nt=M(require("react"));function or(e,{target:t,replacement:o}){return Lo(e,t,o)}function Lo(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=T(t),s=ot(nt.default.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return te(e,t,s)}function te(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=J(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===Me.MINIMIZE?s[r]=Ss(e,s[r]):n===Me.RESTORE&&(s[r]=Ds(s[r])):s[r]=o:s[r]=te(s[r],t,o,n),nt.default.cloneElement(e,void 0,s)}function Ss(e,t){let{style:o}=T(e),{style:n}=T(t),{width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l,...c}=n,p={width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l},m={...c,flexBasis:0,flexGrow:0,flexShrink:0},u=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return u?nt.default.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Ds(e){let{style:t,restoreStyle:o}=T(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return nt.default.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function Mo(e,{path:t}){let o=V(e,t),n=se(e,t);if(n===null)return e;let{children:r}=T(n);if(r.length>1&&rr(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=T(n),c=w(n,"path"),p=te(e,n,le(c,i,l));for(;(n=se(p,c))&&w(n,"path")!=="0";){let{children:m}=T(n);if(rr(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=T(n);p=te(e,n,le(c,u,g))}else if(vs(m))p=ar(e,n);else break}return p}return ir(e,o)}function ir(e,t){let o=T(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=J(r,w(t,"path")),c=P(e),p=n.slice();if(l){if(p.splice(a,1),s!==void 0&&s>=a&&(s=Math.max(0,s-1)),p.length===1&&!i&&r!=="0"&&c.match(/Flexbox|Stack/))return Ts(e,p[0]);!p.some(ws)&&p.some(sr)&&(p=Ps(p))}else p[a]=ir(p[a],t);return p=p.map((m,u)=>$(m,`${r}.${u}`)),Te.default.cloneElement(e,{active:s},p)}function Ts(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=T(e),c=$(t,n);if(n==="0")c=Te.default.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let p=e.props.style.flexDirection==="column"?"height":"width",{style:{[p]:m,...u}}=c.props;c=Te.default.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var ws=e=>e.props.style.flexGrow>0,sr=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},Ps=e=>e.map(t=>sr(t)?Te.default.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),vs=e=>{if(e&&e.length>0){let t=w(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=w(e[n],"placeholder"),t&&o)return!0;t=o}}},ar=(e,t)=>{let{children:o,path:n}=T(e),{idx:r,finalStep:i}=J(n,w(t,"path")),s=o.slice();return i?s[r]=Ls(t):s[r]=ar(s[r],t),s=s.map((a,l)=>$(a,`${n}.${l}`)),Te.default.cloneElement(e,void 0,s)},Ls=e=>{let{children:t}=T(e),o=[],n=[];for(let i=0;i<t.length;i++)w(t[i],"placeholder")?n.push(t[i]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(nr(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(nr(n));let r=w(e,"path");return Te.default.cloneElement(e,void 0,o.map((i,s)=>$(i,`${r}.${s}`)))},nr=([e,...t])=>{let o=w(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:i}=o;for(let{props:{style:s}}of t)n+=s.flexBasis,r=Math.max(r,s.flexGrow),i=Math.max(i,s.flexShrink);return Te.default.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},rr=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);var Co=M(require("react"));function lr(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=T(n),s=i.flexDirection==="column"?"height":"width",a=Ms(r,o,s),l=Co.default.cloneElement(n,void 0,a);return te(e,n,l)}function Ms(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=T(n),a=t[r],{currentSize:l,flexBasis:c}=a,m=l!==void 0?a.currentSize:c;return m===void 0||i===m||s===m?n:Co.default.cloneElement(n,{style:Cs(n.props.style,o,m)})})}function Cs(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:i=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:i}}var cr=require("@vuu-ui/vuu-utils"),rt=M(require("react"));var pr=e=>{let[t]=P(e);return t===t.toLowerCase()};function it(e,t,o,n,r,i){let{children:s,path:a}=T(e),l=w(t,"path"),{idx:c,finalStep:p}=J(a,l),m=p?As(e,s,t,o,n,r,i):s.map((u,f)=>f===c?it(u,t,o,n,r,i):u);return rt.default.cloneElement(e,void 0,m)}function As(e,t,o,n,r,i,s){let a=j(n);if((a==null?void 0:a.width)&&(a==null?void 0:a.height)){if(i===void 0||s===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return Is(t,o,n,r,i,s)}return zs(e,t,o,n,r)}function zs(e,t,o,n,r){var x;let{version:i=0}=T(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=mr(r),[p,m,u]=ks(a,o,n,l,r),f=ur(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[pr(o)?"data-resizeable":"resizeable"]:!0,style:m},b=a==="Stack"?{showTabs:c}:void 0,E=a==="Flexbox"?{splitterSize:(x=P(e)==="Flexbox"&&e.props.splitterSize)!=null?x:void 0}:void 0,R=(0,cr.uuid)(),S=rt.default.createElement(pe[a],{active:h,id:R,key:R,path:w(o,"path"),flexFill:w(o,"flexFill"),...E,...b,style:p,resizeable:w(o,"resizeable")},f?[$(o,`${s}.0`,d),ot(rt.default.cloneElement(n,g),`${s}.1`)]:[ot(rt.default.cloneElement(n,g),`${s}.0`),$(o,`${s}.1`,d)]);return t.map(D=>D===o?S:D)}function Is(e,t,o,n,r,i){let{flexDirection:s}=mr(n),a=s==="column"?"row":"column",l=ur(n),[c,p,m,u]=i,[f,h]=s==="column"?[p-r.top,r.bottom-u]:[c-r.left,r.right-m],g=w(t,"path"),y=0,d=pr(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):le(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(Qe(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?le(`${g}.${y++}`,0):$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=bo(s,t.props,b,g);return e.map(R=>R===t?E:R)}function ks(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=go(o,s,r),l=go(t,s);return[i,l,a]}var ur=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 mr(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var gr=(e,t)=>{switch(t.type){case q.ADD:return Fs(e,t);case q.DRAG_DROP:return $s(e,t);case q.MAXIMIZE:return Hs(e,t);case q.REMOVE:return Mo(e,t);case q.REPLACE:return or(e,t);case q.SET_TITLE:return Os(e,t);case q.SPLITTER_RESIZE:return lr(e,t);case q.SWITCH_TAB:return Bs(e,t);default:return e}},Bs=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Ao.default.cloneElement(n,{active:o});return te(e,n,r)},Os=(e,{path:t,title:o})=>{debugger;let n=V(e,t,!0),r=Ao.default.cloneElement(n,{title:o});return te(e,n,r)},Hs=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return te(e,n,n,o)}else return e},$s=(e,t)=>{var h,g;let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,i=r.component,{pos:s}=r,a=((h=s==null?void 0:s.position)==null?void 0:h.Header)&&P(i)==="Stack",{id:l,version:c}=T(o),p=j(o),m;if(a){let[y,d]=er(i,s);y===void 0?m=At(e,i,o):m=zt(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)==null?void 0:g.Centre)?m=Lo(e,i,o):m=Ns(e,r,o);if(n.DoNotRemove)return m;let u=ae(m,y=>y.id===l&&y.version===c),f=w(u,"path");return Mo(m,{path:f,type:"remove"})},Fs=(e,{path:t,component:o})=>At(e,V(e,t),o),Ns=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return it(e,n,o,r);let l=se(e,a);if(dr(r,l)){let c=r.position.SouthOrEast?"after":"before";return zt(e,n,o,c,r,i,s)}if(!dr(r,l))return it(e,n,o,r,i,s);if(N(P(l)))return it(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},dr=(e,t)=>e.position.Centre?hr(t)||fr(t):e.position.NorthOrSouth?fr(t):e.position.EastOrWest?hr(t):!1,fr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",hr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";var yr=require("react"),Vs=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),Ve=(0,yr.createContext)({dispatchLayoutProvider:Vs,version:-1});var de=require("react");var Ws={},br=[0,0],_s=(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 i=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,i,e.left,e.top]},Gs=e=>{let{offsetParent:t}=e;if(t===null)return br;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},xr=(e,t)=>{let o=(0,de.useRef)(),n=(0,de.useRef)(),r=(0,de.useRef)(),i=(0,de.useCallback)((c,p)=>{if(n.current&&r.current){let{dragOffsets:[m,u],targetPosition:f}=n.current,h=typeof c=="number"?c-m:f.left,g=typeof p=="number"?p-u:f.top;(h!==f.left||g!==f.top)&&(n.current.targetPosition.left=h,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=h+"px")}},[]),s=(0,de.useCallback)(c=>{if(n.current){let{dragInstructions:p,payload:m,originalCSS:u}=n.current;t({type:"drag-drop",draggedReactElement:m,dragInstructions:p,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:p}),r.current&&(p.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=u,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[t]),a=(0,de.useCallback)(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=Ws,path:g}=o.current,{current:y}=e,d={x:c.clientX,y:c.clientY},b=p!=null?p:V(y,g,!0),{id:E}=b.props,R=j(b),S="",x="",D="",v=-1,A=-1,F=br,L=document.getElementById(E);if(L===null)[L,x,v,A]=_s(f,E,u);else{F=Gs(L);let[H,C]=F,{width:z,height:k,left:Q,top:X}=L.getBoundingClientRect();v=Q-H,A=X-C,x=`width:${z}px;height:${k}px;left:${v}px;top:${A}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,L.dataset.dragging="true",S=L.style.cssText}D=Pt.initDrag(e.current,m,f,d,{drag:i,drop:s},R),L.style.cssText=x+D,r.current=L,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:F,dragInstructions:h,targetPosition:{left:v,top:A}}}},[i,s,e]);return(0,de.useCallback)(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},Pt.handleMousedown(p,a,m.instructions)},[a])};var zo=require("react/jsx-runtime"),Rr=e=>e.dropTarget,Us=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Xs=()=>{let e=Er();return(0,zo.jsx)("div",{children:`Context: ${e} `})},Zs=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=(0,U.useRef)(void 0),i=(0,U.useRef)(t),[,s]=(0,U.useState)(null),a=(0,U.useCallback)(m=>{if(n){let u=ae(m,Rr)||r.current,h=P(u)==="DraggableLayout"?T(u).children[0]:u,g=qn(h);n(g,"drag-root")}},[n]),l=(0,U.useCallback)((m,u=!1)=>{let f=gr(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Us(m)&&a(f))},[a]),c=(0,U.useCallback)(m=>{switch(m.type){case"drag-start":{p(m);break}case"save":{a(r.current);break}default:{l(m);break}}},[l,a]),p=xr(r,c);return(0,U.useEffect)(()=>{if(o){let m=ae(r.current,Rr),u=Kt(m),f=Ct(o,`${m.props.path}.0`),h=u?{type:q.REPLACE,target:u,replacement:f}:{type:q.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=wo(t):t!==i.current&&(r.current=wo(t,r.current),i.current=t),(0,zo.jsx)(Ve.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},Z=()=>{let{dispatchLayoutProvider:e}=(0,U.useContext)(Ve);return e},Er=()=>{console.log({LayoutProviderContext:Ve});let{version:e}=(0,U.useContext)(Ve);return e};var Dr=require("react/jsx-runtime"),Io=function(t){let{path:o}=t,n=Z(),r=(0,Sr.useCallback)(i=>{n({type:Me.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return(0,Dr.jsx)(Mt,{...t,onSplitterMoved:r})};Io.displayName="Flexbox";B("Flexbox",Io,"container");var Ar=require("@salt-ds/core"),zr=M(require("classnames")),Ir=require("react");var oe=require("react");var Ie=require("react"),Ys=["height","width"],Js=["height"],js=["width"],ze=new WeakMap,wr=(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}},Tr=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=ze.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=wr(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function ko(e,t,o,n=!1){let r=(0,Ie.useRef)(t),i=(0,Ie.useCallback)(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=wr(s,a,c),l),{})},[]);(0,Ie.useLayoutEffect)(()=>{let s=e.current,a=!1;async function l(){ze.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=ze.get(s);if(p){let m=i(s);p.measurements=m,Tr.observe(s),n&&o(m)}}}if(s){if(ze.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&ze.has(s)&&(Tr.unobserve(s),ze.delete(s),a=!0)}},[e,i]),(0,Ie.useLayoutEffect)(()=>{let s=e.current,a=ze.get(s);if(a){if(r.current!==t){r.current=t;let l=i(s);a.measurements=l}a.onResize=o}},[t,i,e,o])}function Ks(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,i){let s=r.getPropertyValue(`--${e}-breakpoint-${i}`);return s?parseInt(s):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var qs=([,e],[,t])=>t-e,Oo=e=>Object.entries(e).sort(qs).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Bo=null,Qs=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=Ks(e);return Oo({xs:t,sm:o,md:n,lg:r,xl:i})},Pr=e=>(Bo===null&&(Bo=Qs(e)),Bo);var ea=[],Ho=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=(0,oe.useState)(t?!1:"lg"),i=(0,oe.useRef)(document.body),s=(0,oe.useRef)(e?Oo(e):Pr()),a=(0,oe.useRef)("lg"),l=(0,oe.useCallback)(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=(0,oe.useCallback)(p=>{if(t){let m=s.current.find(([u])=>u===t);if(m){let[,,u]=m;return p<u}}else return l(p);return p},[t,l]);return ko(o||i,s.current?["width"]:ea,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),(0,oe.useEffect)(()=>{let p=o||i;if(p.current){let m=a.current;if(s.current){let{clientWidth:u}=p.current,f=c(u);a.current=f,f!==m&&r(f)}}},[r,c,o]),n};var vr="data-collapsible",ta={[vr]:!0,"data-pad-start":!0,"data-pad-end":!0},Lr=e=>{var t;return(t=ta[e])!=null?t:!1},oa=e=>e===vr,na={dynamic:"dynamic",instant:"instant",true:"instant"},ra=e=>{var t;return(t=na[e])!=null?t:"none"},ia=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Lr(o)){let i=oa(o)?ra(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);var Mr=require("@vuu-ui/vuu-utils"),Y=require("react");var sa=["xs","sm","md","lg","xl"],aa=12,Cr=({children:e,cols:t,style:o})=>{let n=(0,Y.useRef)(null),r=(0,Y.useRef)(null),i=(0,Y.useRef)(),s=t!=null?t:aa,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=(0,Y.useMemo)(()=>Array.isArray(e)?e:(0,Y.isValidElement)(e)?[e]:[],[e]),p=(0,Y.useCallback)((m,u)=>{let f=Lt(m,u,sa),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push((0,Y.cloneElement)(d,{key:(0,Mr.getUniqueId)(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return(0,Y.useMemo)(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};var kr=require("react/jsx-runtime"),It="hwFluidGrid",kt=(0,Ir.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,cols:s=12,className:a,flexFill:l,gap:c=3,fullPage:p,id:m,onSplitterMoved:u,resizeable:f,row:h,showGrid:g,spacing:y,splitterSize:d,style:b,...E}=t,{cols:R,content:S,rootRef:x}=Cr({children:r,cols:s,style:b}),D=Ho({breakPoints:n},x),v=(0,zr.default)(It,a,{[`${It}-column`]:i,[`${It}-row`]:h,[`${It}-show-grid`]:g,"flex-fill":l,"full-page":p}),A={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return(0,kr.jsx)("div",{...E,className:v,"data-breakpoint":D,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:(0,Ar.useForkRef)(x,o),style:A,children:S})});kt.displayName="FluidGrid";var Br=require("react/jsx-runtime"),$o=function(t){return(0,Br.jsx)(kt,{...t})};$o.displayName="FluidGrid";B("FluidGrid",$o,"container");var Nr=M(require("classnames")),ke=M(require("react"));var we=require("react");var st=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=Ae(),[l,c]=(0,we.useState)((y=r(e,"contributions"))!=null?y:[]),p=Z(),m=(0,we.useCallback)((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=(0,we.useCallback)(()=>{i(e,"contributions"),c([])},[e,i]),f=(0,we.useCallback)(()=>{let d=r(e,"data-source");d&&d.unsubscribe(),i(e),s(e),p({type:"remove",path:o})},[p,e,r,i,s,o]),h=(0,we.useCallback)(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,D)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:D})})},[t,p,o,n]);return[(0,we.useCallback)(async(d,b)=>{var R;let{type:E}=d;switch(E){case"maximize":case"minimize":case"restore":return p({type:E,path:(R=d.path)!=null?R:o});case"remove":return f();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),h(b,d.index,d.preDragActivity);case"add-toolbar-contribution":return m(d.location,d.content);case"remove-toolbar-contribution":return u();default:return}},[p,o,f,h,m,u]),l]};var Ot=require("@salt-ds/core"),$r=M(require("classnames")),re=M(require("react"));var ne=require("react");var Or=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=Z(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=Ae(),[m,u]=st(e,t,o,n),f=(0,ne.useMemo)(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=(0,ne.useCallback)(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=(0,ne.useMemo)(()=>s(e),[e,s]),y=(0,ne.useCallback)(x=>s(e,x),[e,s]),d=(0,ne.useCallback)(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=(0,ne.useCallback)((x,D)=>{c(e,D,x),i({type:"save"})},[e,i,c]),E=(0,ne.useCallback)(x=>a(e,x),[e,a]),R=(0,ne.useCallback)((x,D)=>p(e,D,x),[e,p]),S=(0,ne.useCallback)(({type:x,...D})=>{let{[x]:v}=D;b(v,x)},[b]);return{contributions:u,dispatchViewAction:m,load:y,loadSession:E,onConfigChange:S,onEditTitle:h,purge:d,restoredState:g,save:b,saveSession:R,title:f}};var Bt=require("@heswell/salt-lab"),We=require("react"),la=[],Hr=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=(0,We.useRef)({}),i=(0,We.useRef)(),s=(0,We.useCallback)(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),i.current=void 0},[e]),a=(0,We.useCallback)(({height:l,width:c})=>{r.current.height=l,r.current.width=c,i.current!==null&&clearTimeout(i.current),i.current=window.setTimeout(s,40)},[s]);(0,Bt.useResizeObserver)(o,n?Bt.WidthHeight:la,a,n)};var at=M(require("react")),ca={dispatch:null},lt=at.default.createContext(ca),Fo=()=>{var t;let e=(0,at.useContext)(lt);return(t=e==null?void 0:e.dispatch)!=null?t:null},pa=()=>(0,at.useContext)(lt);var _e=require("react/jsx-runtime"),Fr=(0,re.forwardRef)(function(t,o){let{children:n,className:r,collapsed:i,closeable:s,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:p,id:m,header:u,orientation:f="horizontal",path:h,resize:g="responsive",resizeable:y=a,tearOut:d,style:b={},title:E,...R}=t,S=(0,Ot.useIdMemo)(m),x=(0,re.useRef)(null),D=(0,re.useRef)(null),{contributions:v,dispatchViewAction:A,load:F,loadSession:L,onConfigChange:H,onEditTitle:C,purge:z,restoredState:k,save:Q,saveSession:X,title:He}=Or({id:S,rootRef:x,path:h,dropTargets:l,title:E});Hr({mainRef:D,resize:g,rootRef:x});let Ue="vuuView",ni=()=>re.default.isValidElement(n)&&k?re.default.cloneElement(n,k):n,ri=(0,re.useMemo)(()=>({dispatch:A,id:S,path:h,title:He,load:F,loadSession:L,onConfigChange:H,purge:z,save:Q,saveSession:X}),[A,S,F,L,H,h,z,Q,X,He]),ii=typeof u=="object"?u:{};return(0,_e.jsx)("div",{...R,className:(0,$r.default)(Ue,r,{[`${Ue}-collapsed`]:i,[`${Ue}-expanded`]:c,[`${Ue}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:(0,Ot.useForkRef)(o,x),style:b,tabIndex:-1,children:(0,_e.jsxs)(lt.Provider,{value:ri,children:[u?(0,_e.jsx)(No,{...ii,collapsed:i,contributions:v,expanded:c,closeable:s,onEditTitle:C,orientation:f,tearOut:d,title:He}):null,(0,_e.jsx)("div",{className:`${Ue}-main`,ref:D,children:ni()})]})})});Fr.displayName="View";var fe=re.default.memo(Fr);fe.displayName="View";B("View",fe,"view");var ie=require("@heswell/salt-lab"),Vr=require("@salt-ds/icons");var he=require("react/jsx-runtime"),No=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=(0,ke.useRef)(null),[c,p]=(0,ke.useState)(a),[m,u]=(0,ke.useState)(!1),f=Fo(),h=L=>f==null?void 0:f({type:"remove"},L),g="vuuHeader",y=()=>{var L;(L=l.current)==null||L.focus()},d=L=>{L.stopPropagation()},E=(0,Nr.default)(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=L=>{L.key==="Enter"&&u(!0)},x=(L="",H="",C=!0,z=!1)=>{var k;u(!1),z?p(L):H!==L&&(p(H),r==null||r(H)),C===!1&&((k=l.current)==null||k.focus())},D=L=>{f==null||f({type:"mousedown"},L)},v=[],A=[],F=[];return a&&v.push((0,he.jsx)(ie.ToolbarField,{className:"vuuHeader-title",children:(0,he.jsx)(ie.EditableLabel,{editing:m,value:c,onChange:p,onMouseDownCapture:y,onEnterEditMode:R,onExitEditMode:x,onKeyDown:S,ref:l,tabIndex:0},"title")},"title")),t==null||t.forEach((L,H)=>{A.push(ke.default.cloneElement(L.content,{key:H}))}),n&&F.push((0,he.jsxs)(ie.ToolbarButton,{onClick:h,onMouseDown:d,children:[(0,he.jsx)(Vr.CloseIcon,{})," Close"]},"close")),A.length>0&&v.push((0,he.jsx)(ie.Tooltray,{"data-align-end":!0,children:A},"contributions")),F.length>0&&v.push((0,he.jsx)(ie.Tooltray,{"data-align-end":!0,children:F},"actions")),(0,he.jsx)(ie.Toolbar,{className:E,orientation:i,style:s,onMouseDown:D,children:v})};var Wr=require("@vuu-ui/vuu-utils"),$t=require("@heswell/salt-lab"),Vo=M(require("classnames")),Ft=require("react");var Ht=require("react/jsx-runtime"),ua=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},Wo=(0,Ft.memo)(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>(0,Ht.jsx)($t.ListItem,{className:(0,Vo.default)("vuuPaletteItem",e),"data-draggable":!0,...s}));Wo.displayName="PaletteItem";var _r=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=Z(),i="vuuPalette";function s(a){var x;let c=a.target.closest(".vuuPaletteItem"),p=parseInt((x=c.dataset.idx)!=null?x:"-1");p!==-1&&console.log({children:e,idx:p,listItemElement:c});let{props:{caption:m,children:u,template:f,...h}}=e[p],{height:g,left:y,top:d,width:b}=c.getBoundingClientRect(),E=(0,Wr.uuid)(),S=f?u:(0,Ht.jsx)(fe,{...{id:E,key:E},...h,title:h.label,children:u});r({dragRect:{left:y,top:d,right:y+b,bottom:d+150,width:b,height:g},dragElement:ua(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return(0,Ht.jsx)($t.List,{...n,borderless:!0,className:(0,Vo.default)(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===Wo?(0,Ft.cloneElement)(a,{key:l,onMouseDown:s}):a)})};B("Palette",_r,"view");var Gr=require("@vuu-ui/vuu-utils"),Vt=require("@heswell/salt-lab"),Ur=M(require("classnames"));var Nt=require("react/jsx-runtime"),ma="vuuPalette",da=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=Z();return(0,Nt.jsx)(Vt.ListItem,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=(0,Gr.uuid)(),g=i?t:(0,Nt.jsx)(fe,{...{id:f,key:f},...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:p,top:m,right:p+u,bottom:m+150,width:u,height:100}})},...s,children:n})},Xr=({className:e,...t})=>(0,Nt.jsx)(Vt.List,{...t,className:(0,Ur.default)(ma,e),height:"100%",selectionStrategy:"none"});B("PaletteSalt",Xr,"view");var Pe=require("@heswell/salt-lab"),Yr=require("@salt-ds/core"),Jr=M(require("classnames")),ge=M(require("react"));var Be=require("react/jsx-runtime"),Zr="Tabs",fa=()=>{},ha=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},ga=e=>{let t=[];return ge.default.Children.forEach(e,o=>{ge.default.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Wt=(0,ge.forwardRef)(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=fa,getTabLabel:a=ha,id:l,keyBoardActivation:c="manual",onMouseDown:p,onTabAdd:m,onTabClose:u,onTabEdit:f,onTabSelectionChanged:h,showTabs:g,style:y,TabstripProps:d},b){var H;let E=(0,Yr.useIdMemo)(l),R=C=>{h==null||h(C)},S=C=>{u==null||u(C)},x=()=>{m==null||m(ge.default.Children.count(o))},D=C=>{var X;let k=C.target.closest('[role^="tab"]');if((k==null?void 0:k.getAttribute("role"))==="tab"){let He=parseInt((X=k.dataset.idx)!=null?X:"-1");if(He===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(C,He)}},v=(0,ge.useCallback)((C,z,k,Q)=>{f==null||f(Q,z)},[f]),A=()=>{var C;return ge.default.isValidElement(o)?o:Array.isArray(o)&&(C=o[t])!=null?C:null},F=()=>ga(o).map((C,z)=>{let k=`${E}-${z}`,{closeable:Q,id:X}=C.props;return(0,Be.jsx)(Pe.Tab,{ariaControls:`${k}-tab`,"data-icon":s(C,z),draggable:!0,id:k,label:a(C,z),closeable:Q,editable:(d==null?void 0:d.enableRenameTab)!==!1},X!=null?X:z)}),L=A();return(0,Be.jsxs)("div",{className:(0,Jr.default)(Zr,n,{[`${Zr}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?(0,Be.jsx)(Pe.Toolbar,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:(0,Be.jsx)(Pe.ToolbarField,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:(0,Be.jsx)(Pe.Tabstrip,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:v,onMouseDown:D,activeTabIndex:(H=d==null?void 0:d.activeTabIndex)!=null?H:L===null?-1:t,children:F()})})}):null,L]})});Wt.displayName="Stack";var jr=require("@salt-ds/core"),Gt=M(require("react"));var _t=require("react/jsx-runtime"),ya=e=>(0,_t.jsx)(fe,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:(0,_t.jsx)(mt,{style:{flex:1}})}),_o=e=>{let t=(0,Gt.useRef)(null),o=Z(),{loadState:n}=Ae(),{createNewChild:r=ya,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=(0,jr.useIdMemo)(i),[m]=st(p,t,a);return(0,_t.jsx)(Wt,{...l,id:p,getTabLabel:(b,E)=>{let{id:R,title:S}=b.props;return n(R,"view-title")||S||`Tab ${E+1}`},onMouseDown:async(b,E)=>{let R;await m({type:"mousedown",index:E,preDragActivity:async()=>new Promise(D=>{console.log("preDragActivity: Ok, gonna release the drag"),R=D})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=Gt.default.Children.count(c))=>{if(a){console.log("[StackLayout] handleTabAdd");let R=r(E);console.log({component:R}),o({type:"add",path:a,component:R})}},onTabClose:b=>{if(Array.isArray(c)){let{props:{"data-path":E,path:R=E}}=c[b];o({type:"remove",path:R})}},onTabEdit:(b,E)=>{o({type:"set-title",path:`${a}.${b}`,title:E})},onTabSelectionChanged:b=>{console.log(`StackLayout handleTabSelection nextTab = ${b}`),a&&(o({type:"switch-tab",path:a,nextIdx:b}),s==null||s(b))},ref:t})};_o.displayName="Stack";B("Stack",_o,"container");var Ge=M(require("react"));var Oe=require("react/jsx-runtime"),ba=({children:e})=>{let[o,n]=(0,Ge.useState)(e),[r,i]=(0,Ge.useState)(e),s=l=>{let c=qt(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=Ge.default.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(Ge.default.cloneElement(o,{},p))};return(0,Oe.jsxs)("div",{"data-design-mode":`${!1}`,children:[o,(0,Oe.jsx)("br",{}),(0,Oe.jsxs)("div",{style:{display:"flex"},children:[(0,Oe.jsx)(Go,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),(0,Oe.jsx)(Uo,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};var ce=require("@heswell/salt-lab"),I=require("react/jsx-runtime"),Zo={},xa={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"}},Xo=({feature:e,children:t,style:o,onChange:n})=>(0,I.jsxs)("div",{className:`LayoutBox layout-${e} layout-outer`,children:[(0,I.jsxs)("div",{className:"layout-top",children:[(0,I.jsx)("span",{className:"layout-title",children:e}),(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),(0,I.jsxs)("div",{className:"layout-inner",children:[(0,I.jsx)("div",{className:"layout-left",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,(0,I.jsx)("div",{className:"layout-right",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),(0,I.jsx)("div",{className:"layout-bottom",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),Ra={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},Ea={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},Sa={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},Ut="(\\d+)(?:px)?",Da=`^(?:${Ut}(?:\\s${Ut}(?:\\s${Ut}(?:\\s${Ut})?)?)?)$`,Kr=new RegExp(Da),Ta=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,Go=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=qr(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),D=xa[E][R];o(D,x)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:p=0}=i,{borderTopWidth:m=0,borderRightWidth:u=0,borderBottomWidth:f=0,borderLeftWidth:h=0}=i,{paddingTop:g=0,paddingRight:y=0,paddingBottom:d=0,paddingLeft:b=0}=i;return(0,I.jsx)("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:(0,I.jsx)(Xo,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:(0,I.jsx)(Xo,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:(0,I.jsx)(Xo,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:(0,I.jsx)("div",{className:"layout-content"})})})})})};function wa(e=Zo,t=Zo){let{margin:o,marginTop:n,marginRight:r,marginBottom:i,marginLeft:s,padding:a,paddingTop:l,paddingRight:c,paddingBottom:p,paddingLeft:m,...u}=e;if(typeof o=="number")u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=o;else if(typeof o=="string"){let f=Kr.exec(o);if(f===null)console.error(`Invalid css value for margin '${o}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.marginTop=parseInt(h,10),u.marginRight=parseInt(g,10),u.marginBottom=parseInt(y,10),u.marginLeft=parseInt(d,10)):b?(u.marginTop=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10),u.marginBottom=parseInt(y,10)):h&&g?(u.marginTop=u.marginBottom=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10)):u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=parseInt(h,10)}}if(typeof n=="number"&&(u.marginTop=n),typeof r=="number"&&(u.marginRight=r),typeof i=="number"&&(u.marginBottom=i),typeof s=="number"&&(u.marginLeft=s),typeof a=="number")u.paddingTop=u.paddingRight=u.paddingBottom=u.paddingLeft=a;else if(typeof a=="string"){let f=Kr.exec(a);if(f===null)console.error(`Invalid css value for padding '${a}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.paddingTop=parseInt(h,10),u.paddingRight=parseInt(g,10),u.paddingBottom=parseInt(y,10),u.paddingLeft=parseInt(d,10)):b?(u.paddingTop=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10),u.paddingBottom=parseInt(y,10)):h&&g?(u.paddingTop=u.paddingBottom=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10)):u.paddingTop=u.paddingRight=u.paddingBottom=u.paddinggLeft=parseInt(h,10)}}return typeof l=="number"&&(u.paddingTop=l),typeof c=="number"&&(u.paddingRight=c),typeof p=="number"&&(u.paddingBottom=p),typeof m=="number"&&(u.paddingLeft=m),qr(u,t)}function qr(e=Zo){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:p,marginTop:m,marginRight:u,marginBottom:f,marginLeft:h,padding:g,paddingTop:y,paddingRight:d,paddingBottom:b,paddingLeft:E,...R}=t,S={},x={};if(typeof p=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=p,S={marginTop:p,marginRight:p,marginBottom:p,marginLeft:p}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,x={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||i||s||a||l){typeof n=="string"&&(o=Ta.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(i=i===void 0?r:i,s=s===void 0?r:s,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let D=`
|
|
18
18
|
${c} ${l||0}px ${i||0}px 0 0 inset,
|
|
19
|
-
${c} ${-s||0}px ${-a||0}px 0 0 inset`;return{...R,...S,...x,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,borderStyle:"solid",boxShadow:
|
|
19
|
+
${c} ${-s||0}px ${-a||0}px 0 0 inset`;return{...R,...S,...x,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,borderStyle:"solid",boxShadow:D}}else return t}var Qr=M(require("react")),ei=M(require("classnames"));var ti=require("@heswell/salt-lab"),Yo=require("react/jsx-runtime"),Pa="hwLayoutTreeViewer",oi=(e,t="0")=>({label:P(e),path:t,childNodes:Qr.default.Children.map(e.props.children,(o,n)=>oi(o,t?`${t}.${n}`:`${n}`))}),Uo=({layout:e,onSelect:t,style:o})=>{let n=[oi(e)],r=(i,[{path:s}])=>{t(s)};return(0,Yo.jsx)("div",{className:(0,ei.default)(Pa),style:o,children:(0,Yo.jsx)(ti.Tree,{source:n,groupSelection:"single",onSelectionChange:r})})};
|
|
20
20
|
//# sourceMappingURL=index.js.map
|