@vuu-ui/vuu-ui-controls 0.8.13 → 0.8.14
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 +4 -4
- package/cjs/index.js.map +2 -2
- package/package.json +8 -8
package/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";var hc=Object.create;var xn=Object.defineProperty;var gc=Object.getOwnPropertyDescriptor;var bc=Object.getOwnPropertyNames;var xc=Object.getPrototypeOf,yc=Object.prototype.hasOwnProperty;var vc=(r,e)=>{for(var t in e)xn(r,t,{get:e[t],enumerable:!0})},hi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of bc(e))!yc.call(r,o)&&o!==t&&xn(r,o,{get:()=>e[o],enumerable:!(n=gc(e,o))||n.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?hc(xc(r)):{},hi(e||!r||!r.__esModule?xn(t,"default",{value:r,enumerable:!0}):t,r)),Sc=r=>hi(xn({},"__esModule",{value:!0}),r);var gi=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var nt=(r,e,t)=>(gi(r,e,"read from private field"),t?t.call(r):e.get(r)),bi=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Mo=(r,e,t,n)=>(gi(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var Ff={};vc(Ff,{ArrowDown:()=>ir,ArrowLeft:()=>Qo,ArrowRight:()=>jo,ArrowUp:()=>sr,BWD:()=>hd,CHECKBOX:()=>od,Checkbox:()=>Ga,CheckboxIcon:()=>jr,CollectionContext:()=>Po,CollectionProvider:()=>Nr,ComboBox:()=>Oa,CycleStateButton:()=>Kd,DragDropProvider:()=>yd,Dropdown:()=>Vd,DropdownBase:()=>At,DropdownButton:()=>Wo,EditableLabel:()=>Is,End:()=>Ur,Enter:()=>Mn,Escape:()=>_c,ExpandoInput:()=>jd,FWD:()=>md,GROUP_SELECTION_CASCADE:()=>id,GROUP_SELECTION_NONE:()=>Fi,GROUP_SELECTION_SINGLE:()=>sd,HeightOnly:()=>$o,Highlighter:()=>ss,Home:()=>Pn,InstrumentPicker:()=>Yd,InstrumentSearch:()=>su,LIST_FOCUS_VISIBLE:()=>Rn,List:()=>ur,ListItem:()=>qr,ListItemGroup:()=>ko,ListItemHeader:()=>Ro,ListItemProxy:()=>Zr,NOT_HIDDEN:()=>cs,NOT_OVERFLOWED:()=>Jr,PageDown:()=>Gr,PageUp:()=>Ln,PriceTicker:()=>au,RadioButton:()=>Wa,RadioIcon:()=>ys,Space:()=>Xo,Tab:()=>Tl,Tabstrip:()=>Il,Tree:()=>nc,TreeNode:()=>ai,VirtualizedList:()=>Fd,VuuInput:()=>jn,WarnCommit:()=>Gd,WidthHeight:()=>Hc,WidthOnly:()=>Bo,allowMultipleSelection:()=>Nc,buildValidationChecker:()=>zd,childIsGroup:()=>Fo,childItems:()=>In,cloneElement:()=>ds,closestListItemId:()=>Jc,closestListItemIndex:()=>Yo,constrainRect:()=>ms,countChildItems:()=>Ao,deselectionIsAllowed:()=>Oc,dimensions:()=>Le,dropTargetsDebugString:()=>Cd,escapeRegExp:()=>Fr,forwardCallbackProps:()=>Vr,getChildLabel:()=>yi,getChildNodes:()=>Si,getDefaultFilter:()=>Vo,getDefaultFilterRegex:()=>Cn,getFirstSelectedItem:()=>zo,getIndexOfDraggedItem:()=>Kt,getIndexOfEditedItem:()=>ti,getIndexOfSelectedTab:()=>mo,getItemById:()=>ps,getNextDropTarget:()=>Tt,getScrollableContainer:()=>hs,groupSelectionEnabled:()=>ld,hasSelection:()=>st,isCharacterKey:()=>Wr,isContainerScrollable:()=>gs,isDisabled:()=>No,isExpanded:()=>Io,isFocusable:()=>Oo,isGroupNode:()=>Ho,isHeader:()=>vn,isMultiSelection:()=>Ot,isNavigationKey:()=>Zo,isParentPath:()=>Tn,isSelected:()=>Br,isSingleSelection:()=>_o,itemToString:()=>De,listItemElement:()=>qc,listItemId:()=>Ri,listItemIndex:()=>ki,measureDropTargets:()=>_t,measureElementSizeAndPosition:()=>Yi,mutateDropTargetsSwitchDropTargetPosition:()=>Vn,removeDraggedItem:()=>fs,replaceCollectionItem:()=>Ar,selectionIsDisallowed:()=>Ko,sourceItemHasProp:()=>yn,sourceItems:()=>Sn,useCollapsibleGroups:()=>Jo,useCollection:()=>Lo,useCollectionItems:()=>mt,useControlled:()=>$r,useDragDropNext:()=>en,useDragDropProvider:()=>ls,useDropdownBase:()=>Uo,useEditableText:()=>Wd,useImperativeScrollingAPI:()=>Qr,useItemsWithIds:()=>oi,useKeyboardNavigation:()=>ts,useList:()=>gt,useResizeObserver:()=>ot,useSelection:()=>rs,useStateRef:()=>Fc,useTypeahead:()=>ns,useViewportTracking:()=>os});module.exports=Sc(Ff);var Ha=require("@vuu-ui/vuu-layout"),Na=require("@salt-ds/core"),fr=require("react");var tr=require("react"),xi=require("react/jsx-runtime"),Po=(0,tr.createContext)(void 0);function Nr({children:r,collectionHook:e,...t}){return(0,xi.jsx)(Po.Provider,{value:e,children:Object.keys(t).length>0?(0,tr.cloneElement)(r,t):r})}function Lo(){let r=(0,tr.useContext)(Po);if(r)return r}var Ic=r=>Object.prototype.toString.call(r)==="[object Object]";function De(r){return typeof r=="string"?r:Ic(r)?Object.prototype.hasOwnProperty.call(r,"label")?String(r.label):(console.warn(["itemToString: you've likely forgotten to set the label prop on the item object.","You can also provide your own `itemToString` implementation."].join(`
|
|
2
|
-
`)),""):String(r)}var ne=require("react");var rr=require("react");var ko=r=>null;var Ro=r=>null;var yn=(r,e)=>r!==null&&Object.prototype.hasOwnProperty.call(r,e),vn=r=>yn(r,"header"),Ho=r=>yn(r,"childNodes"),Or=(r,e)=>r&&Object.prototype.hasOwnProperty.call(r.props,e),No=r=>{if((0,rr.isValidElement)(r)){if(Or(r,"disabled"))return r.props.disabled===!0}else if(yn(r,"disabled"))return r.disabled===!0;return!1},Oo=r=>(0,rr.isValidElement)(r)&&Or(r,"focusable")?r.props.focusable:!0,Ao=(r,e,t)=>{if(r.childNodes)return r.childNodes.length;if(r.header){let n=t+1,o=0;for(;n<e.length&&!e[n].header;)o++,n++;return o}else return 0},yi=r=>{if(typeof r.props.children=="string")return r.props.children;if(r.props.title)return r.props.title;if(r.props.label)return r.props.label},vi=r=>r.type===Ro||Or(r,"data-header"),Fo=r=>r.type===ko||Or(r,"data-group"),Tc=r=>Or(r,"selectable")?r.props.selectable===!0:!Fo(r)&&!vi(r),Si=r=>{if(Fo(r)){let{props:{children:e}}=r;if(typeof e!="string")return In(e)}},Cc=(r,e)=>{let t=[];return rr.Children.forEach(r,n=>{(0,rr.isValidElement)(n)&&t.push(e(n))}),t},Sn=(r,e)=>{if(Array.isArray(r))return r.length===0&&(e!=null&&e.noChildrenLabel)?[{label:e.noChildrenLabel,value:null}]:r.map((t,n)=>{var o,s;return{childNodes:Sn(t.childNodes,e),description:t.description,expanded:t.expanded,value:t,label:(s=(o=e==null?void 0:e.itemToString)==null?void 0:o.call(e,t))!=null?s:De(t)}});if(r)throw Error("list-child-items expects source to be an array")},In=r=>{if(r)return Cc(r,e=>{let{"data-id":t,disabled:n,id:o=t,"data-expanded":s,expanded:i=s}=e.props;return{childNodes:Si(e),disabled:n,expanded:i,header:vi(e),id:o,label:yi(e),selectable:Tc(e),value:e}})},wc=new Set(["/","-","."]),Ec=r=>wc.has(r),Tn=(r,e)=>e.startsWith(r)&&Ec(e[r.length]),Dc=new Set([".","/"]);function Mc(r,e){return e.startsWith(r)?Dc.has(e.charAt(r.length)):!1}function Ar(r,e,t){let n;return r.map(s=>s.id===e?{...s,...t}:Mc(s.id,e)&&s.childNodes?(n=Ar(s.childNodes,e,t),{...s,childNodes:n}):s)}var Pc=/[.*+?^${}()|[\]\\]/g;function Fr(r){return r.replace(Pc,"\\$&")}var Vr=(r,e)=>Object.keys(r).reduce((n,o)=>{let s=r[o],i=e[o];return typeof s=="function"&&typeof i=="function"&&(n[o]=(...a)=>{s(...a),i(...a)}),n},{...e});var Lc=r=>r&&r.replace(/^\s+/g,""),Cn=r=>new RegExp(`(${Fr(Lc(r))})`,"gi"),Vo=(r="",e=Cn)=>(t="")=>!!t.length&&!!r.length&&t.match(e(r))!==null;function Br(r,e){return Array.isArray(r)?r.includes(e.id):r===e.id}var We=require("react");function $r({controlled:r,default:e,name:t,state:n="value"}){let{current:o}=(0,We.useRef)(r!==void 0),[s,i]=(0,We.useState)(e),a=r!==void 0?r:s,{current:l}=(0,We.useRef)(e);(0,We.useEffect)(()=>{},[n,t,r]),(0,We.useEffect)(()=>{},[JSON.stringify(e,kc)]);let u=(0,We.useCallback)(p=>{o||i(p)},[o]);return[a,u,o]}function kc(r,e){return(0,We.isValidElement)(e)?null:e}var Rc={},mt=({children:r,id:e,options:t=Rc,source:n})=>{var R;let{getItemId:o}=t,[,s]=(0,ne.useState)(null),i=Lo(),a=(0,ne.useRef)([]),l=(0,ne.useRef)([]),u=(0,ne.useMemo)(()=>[],[]),p=(0,ne.useRef)((R=t.filterPattern)!=null?R:""),{getFilterRegex:c=Cn,noChildrenLabel:d,itemToString:m=De}=t,f=(0,ne.useCallback)(()=>t.defaultExpanded||!1,[t.defaultExpanded]),h=(0,ne.useCallback)((S,N,P=1,B="",F=[],K=[],X=[])=>(S.forEach((W,$,U)=>{var ve,le;let q=W.header&&t.collapsibleHeaders,Q=W.childNodes&&t.collapsibleHeaders===!1,me=!W.childNodes||W.childNodes.length===0,te=Q||me&&!q,ae=B?`${B}.${$}`:`item-${$}`,ee=(ve=W.id)!=null?ve:o?o($):`${e}-${ae}`,de=te?void 0:(le=W.expanded)!=null?le:f(),he={...W,childNodes:void 0,count:!Q&&de===void 0?0:Ao(W,U,$),description:W.description,disabled:No(W.value),focusable:Oo(W.value)?void 0:!1,id:ee,index:N.value,expanded:de,level:P};if(F.push(he),K.push(he),X.push(S[$].value),N.value+=1,W.childNodes){let[ge]=h(W.childNodes,N,P+1,ae,[],K,X);he.childNodes=ge}}),[F,X,K]),[t.collapsibleHeaders,o,e,f]),g=(0,ne.useCallback)(()=>p.current?Vo(p.current,c):null,[c]),b=(0,ne.useCallback)((S,N=g(),P=[],B={value:0})=>{let F=!1;for(let K of S)F&&!vn(K)||(K.value!==null&&(N===null||N(m(K.value)))&&(P[B.value]=K,B.value+=1),F=!1,vn(K)&&K.expanded===!1?F=!0:Ho(K)&&K.expanded!==!1&&K.childNodes&&b(K.childNodes,N,P,B));return P},[g,m]),E=(0,ne.useMemo)(()=>i?u:Sn(n,{itemToString:m,noChildrenLabel:d})||In(r)||[],[i,u,n,m,d,r]),[I,x,T]=(0,ne.useMemo)(()=>i?[u,u,u]:h(E,{value:0}),[u,h,i,E]);l.current=T,(0,ne.useMemo)(()=>i?u:a.current=b(I),[u,b,I,i]);let v=(0,ne.useRef)(I),C=(0,ne.useCallback)((S="")=>{typeof S=="string"&&(p.current=S,a.current=b(I),s({}))},[I,b]),H=(0,ne.useCallback)((S,N=I)=>{let P=N.find(B=>{var F;return B.id===S||((F=B==null?void 0:B.childNodes)==null?void 0:F.length)&&Tn(B.id,S)});if((P==null?void 0:P.id)===S)return x==null?void 0:x[P.index];if(P)return H(S,P.childNodes);throw Error(`useCollectionData itemById, id ${S} not found `)},[x,I]),w=(0,ne.useCallback)((S,N=I)=>{let P=N.find(F=>{var K;return F.id===S||((K=F==null?void 0:F.childNodes)==null?void 0:K.length)&&Tn(F.id,S)}),B=P?a.current.indexOf(P):-1;if(B!==-1)return B;throw Error(`useCollectionData indexOfItemById, id ${S} not found `)},[I]),D=(0,ne.useCallback)(S=>{let N=l.current.find(P=>(0,ne.isValidElement)(P.value)?P.label===S:P.value===S);if(N)return N;throw Error("useCollectionData toCollectionItem, item not found ")},[]),V=(0,ne.useCallback)(S=>{if(S===null)return null;if(Array.isArray(S)){let N=[];for(let P of S){let B=D(P);N.push(B)}return N}else if(S!==void 0)return D(S)},[D]),y=(0,ne.useCallback)(S=>{if(S===void 0)return;let N=V(S);return Array.isArray(N)?N.map(P=>P.id):N?[N.id]:[]},[V]),k=(0,ne.useCallback)(S=>{let N=P=>{let B=l.current.find(F=>(0,ne.isValidElement)(F.value)?F.label===P:F.value!==null&&m(F.value)===P);if(B)return B};if(S===null)return null;if(Array.isArray(S)){let P=[];for(let B of S){let F=N(B);F&&P.push(F)}return P}else if(S!==void 0)return N(S)},[m]),O=(0,ne.useCallback)(S=>{for(let N of v.current)if(S===N.value)return N.id;throw Error("useCollectionData itemToId, item not found")},[]),L=(0,ne.useCallback)(S=>{v.current=Ar(v.current,S.id,{expanded:!1}),a.current=b(v.current),s({})},[b]),M=(0,ne.useCallback)(S=>{v.current=Ar(v.current,S.id,{expanded:!0}),a.current=b(v.current),s({})},[b]);return i||{collapseGroupItem:L,data:a.current,expandGroupItem:M,setFilterPattern:C,indexOfItemById:w,itemById:H,itemToId:O,toCollectionItem:D,itemToCollectionItem:V,itemToCollectionItemId:y,stringToCollectionItem:k}};var It=require("react"),Hc=["height","width"],Bo=["width"],$o=["height"],Nt=new Map,Ti=(r,e,t)=>{switch(t){case"height":return e.height;case"clientHeight":return r.clientHeight;case"clientWidth":return r.clientWidth;case"contentHeight":return e.contentHeight;case"contentWidth":return e.contentWidth;case"scrollHeight":return Math.ceil(r.scrollHeight);case"scrollWidth":return Math.ceil(r.scrollWidth);case"width":return e.width;default:return 0}};var Ii=new ResizeObserver(r=>{for(let e of r){let{target:t,borderBoxSize:n,contentBoxSize:o}=e,s=Nt.get(t);if(s){let[{blockSize:i,inlineSize:a}]=n,[{blockSize:l,inlineSize:u}]=o,{onResize:p,measurements:c}=s,d=!1;for(let[m,f]of Object.entries(c)){let h=Ti(t,{height:i,width:a,contentHeight:l,contentWidth:u},m);h!==f&&(d=!0,c[m]=h)}d&&p&&p(c)}}});function ot(r,e,t,n=!1){let o=(0,It.useRef)(e),s=r.current,i=(0,It.useCallback)(a=>{let{width:l,height:u}=a.getBoundingClientRect(),{clientWidth:p,clientHeight:c}=a;return o.current.reduce((d,m)=>(d[m]=Ti(a,{width:l,height:u,contentHeight:c,contentWidth:p},m),d),{})},[]);(0,It.useLayoutEffect)(()=>{async function a(){Nt.set(s,{measurements:{}}),await document.fonts.ready;let l=Nt.get(s);if(l){let u=i(s);l.measurements=u,Ii.observe(s),n&&t(u)}else console.log("%cuseResizeObserver an target expected to be under observation wa snot found. This warrants investigation","font-weight:bold; color:red;")}return s&&(Nt.has(s)&&console.log("useResizeObserver attemping to observe same element twice",{target:s}),a()),()=>{s&&Nt.has(s)&&(Ii.unobserve(s),Nt.delete(s))}},[i,s]),(0,It.useEffect)(()=>{let a=r.current,l=Nt.get(a);if(l){if(o.current!==e){o.current=e;let u=i(a);l.measurements=u}l.onResize=t}},[e,i,r,t])}var _o=r=>r===void 0||r==="default"||r==="deselectable",Ot=r=>r==="multiple"||(r==null?void 0:r.startsWith("extended"))===!0,Ko=r=>r==="none",Nc=(r,e=!1)=>r==="multiple"||r==="multiple-special-key"&&e,Oc=r=>r!=="none"&&r!=="default",st=r=>r!==void 0&&r.length>0,zo=r=>r[0];var nr=require("react"),Ac=r=>typeof r!="function",Fc=r=>{let[e,t]=(0,nr.useState)(r),n=(0,nr.useRef)(e),o=(0,nr.useCallback)(s=>{if(Ac(s))n.current=s,t(s);else{let{current:i}=n;n.current=s(i),t(n.current)}},[]);return[n,o]};var Go=Y(require("classnames")),wi=require("@salt-ds/core"),ht=require("react");var wn=require("@salt-ds/core"),$e=require("react");var _r=require("react"),Vc=[],Ci=({popperRef:r,rootRef:e,isOpen:t,onClose:n})=>{let o=(0,_r.useRef)(t);(0,_r.useEffect)(()=>{o.current=t},[t]),(0,_r.useEffect)(()=>{let[s,i]=t?[a=>{var u,p;let l=a.target;!((u=r.current)!=null&&u.contains(l))&&!((p=e.current)!=null&&p.contains(l))&&n("click-away")},a=>{a.key==="Escape"&&o.current&&(n("Escape"),a.stopPropagation())}]:Vc;return s&&i&&(document.body.addEventListener("mousedown",s,!0),document.body.addEventListener("keydown",i,!0)),()=>{s&&i&&(document.body.removeEventListener("mousedown",s,!0),document.body.removeEventListener("keydown",i,!0))}},[t,n,r,e])};var Bc=[],Uo=({defaultIsOpen:r,disabled:e,fullWidth:t,id:n,isOpen:o,onOpenChange:s,onKeyDown:i,openKeys:a=["Enter","ArrowDown"," "],openOnFocus:l,popupComponent:u,popupWidth:p,rootRef:c,width:d})=>{var M;let m=(0,$e.useRef)(null),f=(0,$e.useRef)(null),h=(0,$e.useCallback)(R=>{f.current=R},[]),[g,b]=(0,wn.useControlled)({controlled:o,default:!!r,name:"useDropdown",state:"isOpen"}),[E,I]=(0,$e.useState)({width:(M=p!=null?p:d)!=null?M:0}),x=(0,$e.useCallback)(()=>{b(!0),s==null||s(!0)},[s,b]),T=(0,$e.useCallback)(R=>{b(!1),s==null||s(!1,R)},[s,b]);Ci({popperRef:f,rootRef:c,isOpen:g,onClose:T});let v=(0,$e.useCallback)(()=>{e||l&&(b(!0),s==null||s(!0),m.current=window.setTimeout(()=>{m.current=null},1e3))},[e,s,l,b]),C=(0,$e.useCallback)(R=>{if(["Enter"," "].indexOf(R.key)===-1){let S=!g;b(S),s==null||s(S)}},[g,b,s]),H=(0,$e.useCallback)(R=>{R.key==="Escape"&&g?(R.key==="Escape"&&(R.stopPropagation(),R.preventDefault()),T(R.key)):a.includes(R.key)&&!g?(R.preventDefault(),x()):i==null||i(R)},[T,g,i,a,x]),w=(0,$e.useCallback)(R=>{var S;g&&((S=f.current)!=null&&S.contains(R.relatedTarget)||T("blur"))},[T,g]),D=t!=null?t:!1;ot(c,D?Bo:Bc,I,D);let y=`${n}-dropdown`,k={"aria-expanded":g,"aria-owns":g?y:void 0,id:`${n}-control`,onClick:e||l?void 0:C,onFocus:v,role:"listbox",onBlur:w,onKeyDown:e?void 0:H,style:{width:D?void 0:d}},O={id:y,width:E.width},L=(0,wn.useForkRef)(h,u.ref);return{componentProps:O,popupComponentRef:L,isOpen:g,label:"Dropdown Button",triggerProps:k}};var Ei=require("@vuu-ui/vuu-layout"),Dn=require("@vuu-ui/vuu-popups");var Kr=require("react/jsx-runtime"),En="vuuDropdown",At=(0,ht.forwardRef)(function({PopupProps:e,"aria-labelledby":t,children:n,className:o,defaultIsOpen:s,disabled:i,fullWidth:a,id:l,isOpen:u,onKeyDown:p,onOpenChange:c,openKeys:d,openOnFocus:m,placement:f="below-full-width",popupWidth:h,width:g,...b},E){let I=(0,ht.useRef)(null),x=(0,Go.default)(En,o,{[`${En}-fullWidth`]:a,[`${En}-disabled`]:i}),[T,v]=ht.Children.toArray(n),C=(0,Ei.useId)(l),{componentProps:H,isOpen:w,popupComponentRef:D,triggerProps:V}=Uo({ariaLabelledBy:t,defaultIsOpen:s,disabled:i,fullWidth:a,id:C,isOpen:u,onOpenChange:c,onKeyDown:p,openKeys:d,openOnFocus:m,popupComponent:v,popupWidth:h,rootRef:I,width:g}),y=()=>{let{id:L,role:M,...R}=V,{id:S=L,role:N=M,...P}=T.props;return(0,ht.cloneElement)(T,Vr(P,{...R,id:S,role:N}))},k=()=>{let{id:L,width:M,...R}=H,{className:S,id:N=L,width:P,...B}=v.props;return(0,ht.cloneElement)(v,{...B,...R,className:(0,Go.default)(S,`${En}-popup-component`),id:N,ref:D,width:f.endsWith("full-width")?"auto":P!=null?P:M})},O=(0,wi.useForkRef)(I,E);return(0,Kr.jsxs)("div",{...b,className:x,id:l,ref:O,children:[y(),w&&(0,Kr.jsx)(Dn.Portal,{children:(0,Kr.jsx)(Dn.PopupComponent,{...e,anchorElement:I,placement:f,children:k()})})]})});var Di=require("@salt-ds/core"),Mi=Y(require("classnames")),Pi=require("react");var or=require("react/jsx-runtime"),zr="vuuDropdownButton",Wo=(0,Pi.forwardRef)(function({ariaHideOptionRole:e,className:t,disabled:n,icon:o="chevron-down",isOpen:s,label:i,labelId:a,fullWidth:l,posInSet:u,setSize:p,labelAriaAttributes:c,...d},m){return(0,or.jsx)(Di.Button,{className:(0,Mi.default)(zr,{[`${zr}-fullWidth`]:l},t),disabled:n,variant:"secondary",...d,ref:m,children:(0,or.jsxs)("div",{className:`${zr}-content`,children:[(0,or.jsx)("span",{"aria-hidden":e?"true":void 0,...c,className:`${zr}-buttonLabel`,id:a,role:"option",children:i}),(0,or.jsx)("span",{className:`${zr}-buttonIcon`,"data-icon":o,"aria-hidden":"true"})]})})});var Ea=require("@salt-ds/core"),bt=require("react"),Da=require("@vuu-ui/vuu-layout");function $c(r,...e){let t=new Set(r);for(let n of e)for(let o of n)t.add(o);return t}var sr="ArrowUp",ir="ArrowDown",Qo="ArrowLeft",jo="ArrowRight",Mn="Enter",_c="Escape",Pn="Home",Ur="End",Ln="PageUp",Gr="PageDown",Xo=" ",Kc=new Set(["Enter","Delete"," "]),zc=new Set(["Tab"]),Uc=new Set(["ArrowRight","ArrowLeft"]),Li=new Set([Pn,Ur,Ln,Gr,ir,sr]),Gc=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),Wc=$c(Kc,Li,Uc,Gc,zc),Wr=r=>Wc.has(r.key)?!1:r.key.length===1&&!r.ctrlKey&&!r.metaKey&&!r.altKey,Zo=({key:r})=>Li.has(r);var qo=require("react");var Qc={},jc=r=>Array.isArray(r.childNodes),Xc=r=>!0,Zc=r=>r.closest("[data-toggle],[aria-expanded]").dataset.toggle==="true",Jo=({collapsibleHeaders:r,collectionHook:e,highlightedIdx:t,onToggle:n})=>{let o=(0,qo.useCallback)(a=>{if(a.key===jo||a.key===Mn){let l=e.data[t];l&&l.expanded===!1&&l.value&&(a.preventDefault(),e.expandGroupItem(l),n==null||n(l.value))}if(a.key===Qo||a.key===Mn){let l=e.data[t];l&&l.expanded&&l.value&&(a.preventDefault(),e.collapseGroupItem(l),n==null||n(l.value))}},[e.collapseGroupItem,e.data,e.expandGroupItem,t]),i={onClick:(0,qo.useCallback)(a=>{console.log(`useCollapsibleGroups idx=${t}`);let l=e.data[t];console.log(a.target,a.currentTarget),l&&jc(l)&&(!Xc(l)||Zc(a.target))&&(a.stopPropagation(),a.preventDefault(),l.expanded===!1&&l.value?(e.expandGroupItem(l),n==null||n(l.value)):l.expanded===!0&&l.value&&(e.collapseGroupItem(l),n==null||n(l.value)))},[e.collapseGroupItem,e.data,e.expandGroupItem,t]),onKeyDown:o};return r?i:Qc};var qc=(r,e)=>r.querySelector(`:scope > [data-idx="${e}"]`);function ki(r){if(r){let e=r.dataset.index;if(e)return parseInt(e,10);if(e=r.ariaPosInSet)return parseInt(e,10)-1}return-1}var Ri=r=>r==null?void 0:r.id,Hi=r=>r.closest("[data-index],[aria-posinset]"),Jc=r=>Ri(Hi(r)),Yo=r=>ki(Hi(r));var kn=require("react"),Yc={scrollToIndex:()=>{},scrollToItem:()=>{},scrollTo:()=>{}},Qr=({collectionHook:r,forwardedRef:e,scrollableRef:t,scrollIntoView:n})=>{let o=(0,kn.useMemo)(()=>({scrollToIndex:s=>{let i=r.data[s];i&&(n==null||n(i))},scrollToItem:s=>{let i=r.toCollectionItem(s);i&&(n==null||n(i))},scrollTo:s=>{t!=null&&t.current&&(t.current.scrollTop=s)}}),[r,n,t]);(0,kn.useImperativeHandle)(e,()=>t.current?o:Yc,[o,t])};var Ai=require("@salt-ds/core"),Me=require("react");var Ft=require("@vuu-ui/vuu-utils"),Rn=-2;function Ni(r,e,t){return e===sr||e===Ur?t>0?t-1:t:t===null?0:t===r-1?t:t+1}var es=r=>{var t;let e=Array.isArray(r)?zo(r):void 0;if(e){let n=document.getElementById(e);if(n){let o=parseInt((t=n.dataset.index)!=null?t:"-1");if((0,Ft.isValidNumber)(o))return o}}return-1},ed=(r,e,t,n)=>r===Ur?n:r===Pn?-1:e!==-1?e:t,td=(r,e,t,n)=>{let{top:o}=e.getBoundingClientRect(),{scrollTop:s,clientHeight:i,scrollHeight:a}=r,l=t-1,u=Math.min(s+i,a-i);if(u!==s&&n<l){r.scrollTo(0,u);let p=n,c;do p+=1,c=(0,Ft.getElementByDataIndex)(r,p,!0).getBoundingClientRect();while(c.top<o&&p<l);return p}},rd=async(r,e,t)=>{let{top:n}=e.getBoundingClientRect(),{scrollTop:o,clientHeight:s}=r,i=Math.max(o-s,0);if(i!==o&&t>0)return r.scrollTo(0,i),new Promise(a=>{requestAnimationFrame(()=>{let l=t,u;do l-=1,u=(0,Ft.getElementByDataIndex)(r,l,!0).getBoundingClientRect();while(u.top>n&&l>0);a(l)})})},nd=r=>r!==void 0,Oi=(r,e)=>{let t=(0,Ft.getElementByDataIndex)(r,e);return nd(t)},ts=({containerRef:r,defaultHighlightedIndex:e=-1,disableHighlightOnFocus:t,highlightedIndex:n,itemCount:o,onHighlight:s,onKeyboardNavigation:i,restoreLastFocus:a,selected:l,viewportItemCount:u})=>{let p=(0,Me.useRef)(-1),[,c]=(0,Me.useState)({}),[d,m,f]=(0,Ai.useControlled)({controlled:n,default:e,name:"UseKeyboardNavigation"}),h=(0,Me.useCallback)((w,D=!1)=>{s==null||s(w),m(w),D&&(p.current=w)},[s,m]),g=(0,Me.useCallback)(async(w,D)=>{let V=(0,Ft.getElementByDataIndex)(r.current,D,!0),y;if(V){let{current:k}=r;V&&k&&(y=w===Gr?td(k,V,o,D):await rd(k,V,D))}return y!=null?y:D},[r,o]),b=(0,Me.useCallback)((w=ir,D=w===ir?-1:o)=>{if(o===0)return-1;{let V=w==="End",y=w==="Home",k=V||y||D===-1?-1:es(l),O=ed(w,D,k,o),L=Ni(o,w,O),{current:M}=r;if(L===0&&w===sr&&M&&!Oi(M,0))return D;for(;((w===ir||y)&&L<o||(w===sr||V)&&L>0)&&M&&!Oi(M,L);)L=Ni(o,w,L);return L}},[r,o,l]),E=(0,Me.useRef)(!1),I=(0,Me.useRef)(!1),x=w=>I.current=w,T=(0,Me.useCallback)(()=>{if(I.current)I.current=!1;else if(E.current=!0,o===0)h(Rn);else if(d!==-1)c({});else if(a)if(p.current!==-1)h(p.current);else{let w=es(l);h(w!==-1?w:0)}else if(st(l)){let w=es(l);h(w)}else t!==!0&&h(b())},[t,d,o,b,a,l,h]),v=(0,Me.useCallback)(async w=>{let D=w.key===Gr||w.key===Ln?await g(w.key,d):b(w.key,d);D!==d&&h(D,!0),i==null||i(w,D)},[d,b,g,i,h]),C=(0,Me.useCallback)(w=>{o>0&&Zo(w)?(w.preventDefault(),w.stopPropagation(),E.current=!0,v(w)):Wr(w)&&(E.current=!0)},[o,v]),H=(0,Me.useMemo)(()=>({onBlur:w=>{let D=w.target.closest(".vuuList"),V=w.relatedTarget;D&&!(D!=null&&D.contains(V))&&(E.current=!1,m(-1),a||(p.current=-1))},onFocus:T,onKeyDown:C,onMouseDownCapture:()=>{E.current=!1,x(!0)},onMouseMove:()=>{E.current&&(E.current=!1)},onMouseLeave:()=>{E.current=!1,x(!1),h(-1)}}),[T,C,a,m,h]);return{focusVisible:E.current?d:-1,controlledHighlighting:f,highlightedIndex:d,setHighlightedIndex:h,keyboardNavigation:E,containerProps:H,setIgnoreFocus:x}};var Je=require("@vuu-ui/vuu-utils"),Qe=require("react");var od="checkbox",Fi="none",sd="single",id="cascade",ad=["Enter"," "],ld=r=>r&&r!==Fi,rs=({containerRef:r,defaultSelected:e,disableSelection:t=!1,highlightedIndex:n,itemQuery:o,onClick:s,onSelect:i,onSelectionChange:a,selected:l,selectionStrategy:u,selectionKeys:p=ad,tabToSelect:c})=>{let d=u==="deselectable",m=u==="multiple",f=u==="extended",h=(0,Qe.useRef)(-1),g=(0,Qe.useCallback)(y=>p.includes(y.key),[p]),[b,E]=$r({controlled:l,default:e!=null?e:[],name:"UseSelection",state:"selected"}),I=(0,Qe.useCallback)(y=>b.includes(y),[b]),x=(0,Qe.useCallback)(y=>I(y)?[]:[y],[I]),T=(0,Qe.useCallback)(y=>{let k=I(y)?b.filter(O=>O!==y):b.concat(y);return k.sort(),k},[I,b]),v=(0,Qe.useCallback)((y,k)=>{let O=k?b:[],[L]=b.slice(-1),M=L?(0,Je.getElementDataIndex)(document.getElementById(L)):0,R=Math.min(y,M),S=Math.max(y,M),N=r.current,B=Array.from(N.querySelectorAll(o)).slice(R,S+1).map(K=>K.id),F=[...new Set([...O,...B])];return F.sort(),F},[r,o,b]),C=(0,Qe.useCallback)((y,k,O,L)=>{let{current:M}=r,{id:R}=(0,Je.getElementByDataIndex)(M,k,!0),S;m?S=T(R):f?L&&!O?S=T(R):O?S=v(k,L):S=[R]:d?S=x(R):S=[R],S!==b&&E(S),i==null||i(y,R),S!==b&&a&&a(y,S)},[r,m,f,d,b,i,T,v,x,E,a]),H=(0,Qe.useCallback)(y=>{let{current:k}=r,O=(0,Je.getElementByDataIndex)(k,n);(0,Je.isSelectableElement)(O)&&(g(y)||c&&y.key==="Tab")&&(y.key!=="Tab"&&y.preventDefault(),C(y,n,!1,y.ctrlKey||y.metaKey),f&&(h.current=n))},[n,r,g,c,C,f]),w=(0,Qe.useCallback)((y,k)=>{if(f&&y.shiftKey){let{current:O}=r,L=(0,Je.getElementByDataIndex)(O,k);(0,Je.isSelectableElement)(L)&&C(y,k,!0)}},[f,r,C]),D=(0,Qe.useCallback)(y=>{let{current:k}=r,O=(0,Je.getElementByDataIndex)(k,n);!t&&(0,Je.isSelectableElement)(O)&&(y.preventDefault(),y.stopPropagation(),C(y,n,y.shiftKey,y.ctrlKey||y.metaKey),f&&(h.current=n)),s==null||s(y)},[r,n,t,s,C,f]);return{listHandlers:Ko(u)?{onClick:s}:{onClick:D,onKeyDown:H,onKeyboardNavigation:w},selected:b,setSelected:E}};var Vt=require("react");var ns=({disableTypeToSelect:r,highlightedIdx:e,highlightItemAtIndex:t,typeToNavigate:n,items:o,applyIncrementalSearch:s=!0})=>{let i=(0,Vt.useRef)(null),a=(0,Vt.useRef)(""),l=(0,Vt.useRef)(-1),u=(0,Vt.useCallback)(c=>{if(c||!s){let d=new RegExp(`^${a.current}`,"i"),m=o.findIndex(({label:f},h)=>h>l.current&&d.test(f));m===-1&&(m=o.findIndex(({label:f},h)=>h<=l.current&&d.test(f))),m!==-1&&t(m)}else a.current="",i.current=null,l.current=-1},[s,t,o]),p=(0,Vt.useCallback)(c=>{let d=l.current!==-1;(Wr(c)||d&&c.key===Xo)&&n&&(c.preventDefault(),c.stopPropagation(),(l.current===-1||c.key===a.current)&&(l.current=e),i.current!==null&&(clearTimeout(i.current),i.current=null),c.key!==a.current&&(a.current+=c.key),s&&u(!0),i.current=window.setTimeout(()=>{u()},100))},[n,s,e,u]);return{onKeyDown:r?void 0:p}};var it=require("react");var _i=require("@salt-ds/core"),Vi=["height"],ud=["height","scrollHeight"],cd=[],Bi={containerOnly:[ud,cd],withContent:[Vi,Vi]},dd=r=>r?Bi.containerOnly:Bi.withContent,$i={current:null},pd=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);if(t.startsWith("matrix")){let n=t.lastIndexOf(",");return parseInt(t.slice(n+1))}else{let n=r.offsetParent;if(n===e||e===null)return r.offsetTop;{let o=r.offsetTop;for(;n!==null&&n!==e;)o+=n.offsetTop,n=n.offsetParent;return o}}},os=({containerRef:r,contentRef:e=$i,highlightedIdx:t=-1,indexPositions:n,stickyHeaders:o=!1})=>{let s=(0,it.useRef)(!1),i=(0,it.useRef)({height:0,contentHeight:0}),a=(0,it.useCallback)(h=>{s.current=!0,r.current&&(r.current.scrollTop=h),setTimeout(()=>{s.current=!1})},[]),l=(0,it.useCallback)(()=>a(0),[a]),u=(0,it.useCallback)(()=>{a(i.current.contentHeight-i.current.height)},[a]),p=(0,it.useCallback)(h=>{let g=e.current||r.current;if(h.id){let b=document.getElementById(h.id);if(b&&r.current){let{height:E}=i.current,I=b.ariaExpanded&&b.firstChild?b.firstChild:b,x=o?36:0,T=pd(I,g),v=I.offsetHeight,{scrollTop:C}=r.current,H=C+x,w=H+E-x;if(T+v>w||T<H){let D=T+v>w?C+(T+v)-w:T-x;a(D)}}}},[r,e,a,o]);(0,_i.useIsomorphicLayoutEffect)(()=>{let{height:h,contentHeight:g}=i.current,b=n[t];if(g>h&&b){let[E]=n,[I]=n.slice(-1);b===E?l():b===I?u():p(n[t])}},[t,n,p,u,l]);let c=(0,it.useCallback)(({height:h,scrollHeight:g})=>{typeof h=="number"&&(i.current.height=h),typeof g=="number"&&(i.current.contentHeight=g)},[]),d=(0,it.useCallback)(({height:h})=>{typeof h=="number"&&(i.current.contentHeight=h)},[]),[m,f]=dd(e===$i);return ot(r,m,c,!0),ot(e,f,d,!0),{isScrolling:s,scrollIntoView:p}};var Ki=require("@salt-ds/core");var ar=require("react/jsx-runtime"),fd=(0,Ki.makePrefixer)("saltHighlighter"),ss=r=>{let{matchPattern:e,text:t=""}=r,n=typeof e=="string"?new RegExp(`(${Fr(e)})`,"gi"):e;return n===void 0?(0,ar.jsx)(ar.Fragment,{children:t}):(0,ar.jsx)("span",{children:t.split(n).map((o,s)=>o.match(n)?(0,ar.jsx)("strong",{className:fd("highlight"),children:o},`${s}-${o}`):o)})};var is=require("react"),as=Y(require("classnames"));var Ui=Y(require("classnames"));var Gi=require("react/jsx-runtime"),zi="vuuCheckboxIcon",jr=({checked:r=!1,disabled:e=!1,...t})=>(0,Gi.jsx)("span",{...t,className:(0,Ui.default)(zi,{[`${zi}-checked-${e?"disabled":"enabled"}`]:r})});var Bt=require("react/jsx-runtime"),Xr="vuuListItem",Zr=(0,is.forwardRef)(function({height:e,...t},n){return(0,Bt.jsx)("div",{...t,"aria-hidden":!0,className:(0,as.default)(Xr,`${Xr}-proxy`),ref:n,style:{height:e}})}),qr=(0,is.forwardRef)(function({children:e,className:t,disabled:n,tabIndex:o,item:s,itemHeight:i,itemTextHighlightPattern:a,label:l,selectable:u,selected:p,showCheckbox:c,style:d,...m},f){let h=(0,as.default)(Xr,t,{vuuDisabled:n,[`${Xr}-checkbox`]:c}),g=i!==void 0?{...d,height:i}:d;return(0,Bt.jsxs)("div",{className:h,...m,"aria-disabled":n||void 0,"aria-selected":p||void 0,ref:f,style:g,children:[c&&(0,Bt.jsx)(jr,{"aria-hidden":!0,checked:p}),e&&typeof e!="string"?e:a==null?(0,Bt.jsx)("span",{className:`${Xr}-textWrapper`,children:l||e}):(0,Bt.jsx)(ss,{matchPattern:a,text:l||e})]})});var Kn=require("@vuu-ui/vuu-layout"),ha=require("@salt-ds/core"),_n=Y(require("classnames")),Ne=require("react");var pa=require("@vuu-ui/vuu-layout"),ut=require("react");var md="fwd",hd="bwd";var Pe=require("react");var Hn=require("@vuu-ui/vuu-utils"),at=require("react"),Wi=({onDragOverDropTarget:r,onDrop:e})=>{let t=(0,at.useRef)(),n=(0,at.useRef)(),o=(0,at.useRef)(null),s=(0,at.useRef)({x:0,y:0}),i=(0,at.useCallback)((p,c)=>{let{current:d}=n;if(d){for(let[m,f]of Object.entries(d))if((0,Hn.boxContainsPoint)(f,p,c))return m}},[]),a=(0,at.useCallback)(p=>{let{clientX:c,clientY:d}=p,{current:m}=o;if(s.current.x=c,s.current.y=d,m!=null&&m.draggableElement){let{draggableElement:f,mouseOffset:h}=m,g=s.current.x-h.x,b=s.current.y-h.y;f.style.top=`${b}px`,f.style.left=`${g}px`;let E=i(g,b);E?r(E,m)?(document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",l,!1),o.current=null,t.current=void 0):t.current=E:t.current=void 0}},[]),l=(0,at.useCallback)(()=>{document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",l,!1);let{current:p}=o;p&&(o.current=null,t.current&&e(t.current,p),p.draggableElement&&(0,Hn.dispatchCustomEvent)(p.draggableElement,"vuu-dropped"))},[a,e]),u=(0,at.useCallback)(p=>(console.log("resume drag of ",{el:p.draggableElement}),o.current=p,document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",l,!1),!0),[a,l]);return{measuredDropTargetsRef:n,resumeDrag:u}};var ji=require("react/jsx-runtime"),gd={isDragSource:void 0,isDropTarget:void 0,register:()=>{}},bd=()=>console.log("have you forgotten to provide a DragDrop Provider ?"),Qi=(0,Pe.createContext)({registerDragDropParty:bd}),xd=(r=[])=>r.reduce((e,t)=>{let n=document.getElementById(t);if(n){let{top:o,right:s,bottom:i,left:a}=n.getBoundingClientRect();e[t]={top:o,right:s,bottom:i,left:a}}return e},{}),yd=({children:r,dragSources:e})=>{let t=(0,Pe.useMemo)(()=>new Map,[]),n=(0,Pe.useMemo)(()=>new Map,[]),o=(0,Pe.useCallback)((f,h)=>{let g=t.get(f);return g?g(h):!1},[t]),s=(0,Pe.useCallback)((f,h)=>{let g=n.get(f);g&&g(h)},[n]),{measuredDropTargetsRef:i,resumeDrag:a}=Wi({onDragOverDropTarget:o,onDrop:s}),[l,u]=(0,Pe.useMemo)(()=>{let f=new Map,h=new Map;for(let[g,{dropTargets:b}]of Object.entries(e)){let E=f.get(g),I=Array.isArray(b)?b:[b];E?E.push(...I):f.set(g,I);for(let x of I){let T=h.get(x);T?T.push(g):h.set(x,[g])}}return[f,h]},[e]),p=(0,Pe.useCallback)((f,h)=>(i.current=xd(l.get(f)),a(h),!0),[l,i,a]),c=(0,Pe.useCallback)(f=>{console.log(`end of drag operation, id= ${f}`)},[]),d=(0,Pe.useCallback)((f,h,g)=>{h?t.set(f,h):g&&n.set(f,g)},[n,t]),m=(0,Pe.useMemo)(()=>({dragSources:l,dropTargets:u,onDragOut:p,onEndOfDragOperation:c,registerDragDropParty:d}),[l,u,p,c,d]);return(0,ji.jsx)(Qi.Provider,{value:m,children:r})},ls=r=>{var i,a;let{dragSources:e,dropTargets:t,onDragOut:n,onEndOfDragOperation:o,registerDragDropParty:s}=(0,Pe.useContext)(Qi);if(r&&(e||t)){let l=(i=e==null?void 0:e.has(r))!=null?i:!1,u=(a=t==null?void 0:t.has(r))!=null?a:!1;return{isDragSource:l,isDropTarget:u,onDragOut:n,onEndOfDragOperation:o,register:s}}else return gd};var la=require("@vuu-ui/vuu-layout"),ua=require("@vuu-ui/vuu-utils"),J=require("react");var Nn=class{constructor(e,t){this.draggableElement=null;this.payload=null;this.setDraggable=e=>{this.draggableElement=e};this.initialDragElement=t,this.mouseOffset=this.getMouseOffset(e,t)}setPayload(e){this.payload=e}getMouseOffset(e,t){let{clientX:n,clientY:o}=e,s=t.getBoundingClientRect();return{x:n-s.left,y:o-s.top}}};var Xi=require("@salt-ds/core"),Zi=Y(require("classnames")),$t=require("react"),An=require("@vuu-ui/vuu-popups");var On=require("react/jsx-runtime"),vd=r=>r.split(" ").map(e=>`vuuDraggable-${e}`),Fn=(0,$t.forwardRef)(function({wrapperClassName:e,element:t,onDropped:n,onTransitionEnd:o,style:s,scale:i=1},a){let l=(0,$t.useCallback)(()=>{n==null||n()},[n]),u=(0,$t.useCallback)(d=>{d&&(d.innerHTML="",d.appendChild(t),i!==1&&(d.style.transform=`scale(${i},${i})`),d.addEventListener("vuu-dropped",l))},[t,l,i]),p=(0,Xi.useForkRef)(a,u),c=(0,$t.useMemo)(()=>({left:0,top:0}),[]);return(0,On.jsx)(An.Portal,{children:(0,On.jsx)(An.PopupComponent,{anchorElement:{current:document.body},placement:"absolute",position:c,children:(0,On.jsx)("div",{className:(0,Zi.default)("vuuDraggable",...vd(e)),ref:p,onTransitionEnd:o,style:s})})})}),us=r=>{let e=document.createElement("div");return e.className="vuuDraggable-spacer",r&&e.addEventListener("transitionend",()=>{r.current=!1}),e},qi=()=>{let r=document.createElement("div");return r.className="vuuDraggable-dropIndicatorPosition",r},Ji=r=>{let e=document.createElement("div");return e.className="vuuDraggable-dropIndicator",r&&e.addEventListener("transitionend",()=>{r.current=!1}),e};var Sd=["left","right"],Id=["top","bottom"],Jr=":not(.wrapped)",cs=':not([aria-hidden="true"])',ds=r=>{let e=r.cloneNode(!0);return e.removeAttribute("id"),e.dataset.index="-1",e},Yi=(r,e="width",t=!1)=>{let n=e==="width"?"left":"top",{[e]:o,[n]:s}=r.getBoundingClientRect(),{padEnd:i=!1,padStart:a=!1}=r.dataset,l=getComputedStyle(r),[u,p]=e==="width"?Sd:Id,c=a&&!t?0:parseInt(l.getPropertyValue(`margin-${u}`),10),d=i&&!t?0:parseInt(l.getPropertyValue(`margin-${p}`),10),m=o;if(parseInt(l.getPropertyValue("flex-shrink"),10)>0){let h=parseInt(l.getPropertyValue("flex-basis"),10);!isNaN(h)&&h>0&&(m=h)}return[s,c+m+d]},Td={horizontal:{CLIENT_POS:"clientX",CLIENT_SIZE:"clientWidth",CONTRA:"top",CONTRA_CLIENT_POS:"clientY",CONTRA_END:"bottom",CONTRA_POS:"y",DIMENSION:"width",END:"right",POS:"x",SCROLL_POS:"scrollLeft",SCROLL_SIZE:"scrollWidth",START:"left"},vertical:{CLIENT_POS:"clientY",CLIENT_SIZE:"clientHeight",CONTRA:"left",CONTRA_CLIENT_POS:"clientX",CONTRA_END:"right",CONTRA_POS:"x",DIMENSION:"height",END:"bottom",POS:"y",SCROLL_POS:"scrollTop",SCROLL_SIZE:"scrollHeight",START:"top"}},Le=r=>Td[r],ps=(r,e)=>{let t=r.find(n=>n.id===e);if(t)return t},fs=(r,e)=>{r.splice(e,1);for(let t=e;t<r.length;t++)r[t].currentIndex-=1},_t=(r,e,t,n,o)=>{let s=[],{DIMENSION:i}=Le(e),a=Array.from(t?r.querySelectorAll(t):r.children),l=a.length,u=typeof(n==null?void 0:n.from)=="number"?n.atEnd?Math.max(0,n.from-1):n.from:0,p=typeof(n==null?void 0:n.to)=="number"?Math.min(n.to+2,l-1):l-1;for(let c=u;c<=p;c++){let d=a[c],[m,f]=Yi(d,i),h=c===l-1,g=d.id;s.push({currentIndex:c,id:g,index:c,isDraggedItem:o===g,isLast:h,isOverflowIndicator:d.dataset.index==="overflow",element:d,start:m,end:m+f,size:f,mid:m+f/2})}return s},Kt=(r,e=!1)=>{let t=r.findIndex(n=>n.isDraggedItem);if(e){let{index:n}=r[t],o=r.filter(i=>!i.isDraggedItem).reduce((i,a)=>Math.min(i,a.index),Number.MAX_SAFE_INTEGER);if(o>0&&!(n===0&&o===1))return o+t}return t},Vn=(r,e)=>{let t=Kt(r),n=e==="fwd"?t+1:t-1;if(n<0||n>=r.length)throw Error("switchDropTargetPosition index out of range");let o=r.at(t),s=r.at(n),i=s.size-o.size;if(e==="fwd"){let a=s.start+i,l=s.end,u={...o,start:a,mid:Math.floor(a+(l-a)/2),end:l},p=o.start,c=o.end+i,d={...s,start:p,mid:Math.floor(p+(c-p)/2),end:c};r.splice(t,2,d,u)}else{let a=s.start,l=s.end-i,u={...o,start:a,mid:Math.floor(a+(l-a)/2),end:l},p=o.start-i,c=o.end,d={...s,start:p,mid:Math.floor(p+(c-p)/2),end:c};r.splice(n,2,u,d)}},Tt=(r,e,t,n)=>{let o=r.length,s=Kt(r),i=r[s];if(n==="fwd"){let a=Math.round(e+t);for(let l=o-1;l>=0;l--){let u=r[l];if(a>u.mid)return i&&l<s?i:u}}else{let a=Math.round(e);for(let l=0;l<o;l++){let u=r[l];if(a<u.mid)return l>s?i:u}}throw Error("no dropTraget identified")};function ms(r,e){let{height:t,left:n,top:o,width:s}=r,{height:i,width:a}=e;return{height:Math.min(t,i),left:n,top:o,width:Math.min(s,a)}}var Cd=r=>r.map((e,t)=>{var n;return`
|
|
3
|
-
${e.isDraggedItem?"*":" "}[${t}] width : ${Math.floor(e.size)} ${Math.floor(e.start)} - ${Math.floor(e.end)} (mid ${Math.floor(e.mid)}) ${(n=e.element)==null?void 0:n.textContent} `}).join(""),hs=(r,e)=>{let t=r.querySelector(`${e}:not([aria-hidden="true"])`),n=t==null?void 0:t.parentElement;return n===r?r:n==null?void 0:n.parentElement},gs=(r,e)=>{let{SCROLL_SIZE:t,CLIENT_SIZE:n}=Le(e),{[t]:o,[n]:s}=r;return o>s};var Ct=require("react");var ea=({containerRef:r,onScrollingStopped:e,orientation:t="vertical"})=>{let n=(0,Ct.useRef)(null),o=(0,Ct.useRef)(!1),s=(0,Ct.useRef)(0),i=(0,Ct.useRef)("fwd"),a=(0,Ct.useCallback)((u=!1)=>{console.log("[useAutoScroll] stopScrolling"),n.current!==null&&(clearTimeout(n.current),n.current=null),o.current=!1,e==null||e(i.current,s.current,u)},[e]),l=(0,Ct.useCallback)((u,p,c=30)=>{let{current:d}=r;if(d){let{SCROLL_POS:m,SCROLL_SIZE:f,CLIENT_SIZE:h}=Le(t),{[m]:g,[f]:b,[h]:E}=d,I=u==="fwd"?b-E-g:g,x=Math.min(I,c);u==="fwd"?(i.current="fwd",d[m]=s.current=g+x):(i.current="bwd",d[m]=s.current=g-x),x===I?a(!0):(o.current=!0,n.current=window.setTimeout(()=>{l(u,p,c)},100))}},[r,t,a]);return{isScrolling:o,startScrolling:l,stopScrolling:a}};var lr=require("react"),ta=({selected:r,viewportRange:e})=>{let t=(0,lr.useRef)();t.current=e;let n=(0,lr.useCallback)(i=>{i.ariaSelected&&Array.isArray(r)&&r.length>1&&console.log("its a selected element, and we have a multi select")},[r]),o=(0,lr.useCallback)(()=>{},[]),s=(0,lr.useCallback)(()=>{},[]);return{beginDrag:n,drag:o,drop:s}};var ue=require("react");var Yr=require("react");var ra=()=>{let r=(0,Yr.useMemo)(()=>qi(),[]),e=(0,Yr.useCallback)(()=>r.remove(),[r]);return{positionDropIndicator:(0,Yr.useCallback)((n,o="end")=>(o==="end"?n.element.after(r):n.element.before(r),r),[r]),clearSpacer:e}};var oa=require("react/jsx-runtime"),wd=':not([data-overflowed="true"])',Ed=':not([aria-hidden="true"])',na=({onDrop:r,orientation:e="horizontal",containerRef:t,itemQuery:n="*",selected:o,viewportRange:s})=>{let i=(0,ue.useRef)(),a=(0,ue.useRef)(null),l=(0,ue.useRef)(null),u=(0,ue.useRef)(""),p=(0,ue.useRef)(!1),c=(0,ue.useRef)(-1),d=(0,ue.useRef)([]),m=(0,ue.useRef)(!1),[f,h]=(0,ue.useState)(!1),[g,b]=(0,ue.useState)(),{clearSpacer:E,positionDropIndicator:I}=ra(),x=(0,ue.useRef)(),T=`:is(${n}${wd}${Ed},[data-overflow-indicator])`,v=L=>d.current.findIndex(M=>M.id===L.id),C=(L,M,R)=>{L.start+=M,L.mid+=M,L.end+=M,typeof R=="number"&&(L.currentIndex+=R)},H=(0,ue.useRef)();H.current=s;let w=(0,ue.useCallback)(()=>{E()},[E]),D=(0,ue.useCallback)((L,M,R)=>{let{current:S}=t,{current:N}=x;if(S&&N){d.current=_t(S,e,T,H.current);let{size:P}=N,F=c.current+P/2,{current:K}=d,X=Tt(K,F,P,"fwd");X&&I(R&&L==="fwd"?K[K.length-1]:X,"start")}},[t,I,T,e]),V=(0,ue.useCallback)(L=>{L.ariaSelected&&Array.isArray(o)&&o.length>1&&console.log("its a selected element, and we have a multi select");let{current:M}=t;if(M&&L){let{SCROLL_SIZE:R,CLIENT_SIZE:S}=Le(e),{id:N}=L,{[R]:P,[S]:B}=M;p.current=P>B;let F=d.current=_t(M,e,T,s),K=ps(F,N);if(K&&M){let X=v(K);fs(F,X),x.current=K;let{current:W}=H;if(W!=null&&W.atEnd)for(let ee=0;ee<F.length;ee++)C(F[ee],K.size);for(let ee=X;ee<F.length;ee++)C(F[ee],-K.size,-1);let[$,U]=K.isLast?[F[F.length-1],"end"]:[F[X],"start"];l.current=$,u.current=U;let q=I($,U),{top:Q,left:me,width:te}=q.getBoundingClientRect(),ae={top:K.isLast?W!=null&&W.atEnd&&!W.atStart?Q+K.size-2:Q-2:Q-K.size-2,left:me,width:te,height:2};b((0,oa.jsx)(Fn,{wrapperClassName:"dropIndicatorContainer",style:ae,ref:a,element:Ji()}))}}},[o,t,e,T,s,I]),y=(0,ue.useCallback)((L,M)=>{let{current:R}=l,{current:S}=x;if(S&&t.current){let N=e==="horizontal"?"left":"top";c.current=L;let{current:P}=d,B=Tt(P,L,S.size,M);if(B&&B.index!==(R==null?void 0:R.index)){if(B.isOverflowIndicator)h(m.current=!0);else if(a.current){if(v(B)===P.length-1){let K=P[P.length-1],W=I(K,"start").getBoundingClientRect();a.current.style[N]=`${W.top}px`}else{let X=I(B,"start").getBoundingClientRect();a.current.style[N]=`${X.top}px`}h(m.current=!1)}l.current=B,i.current=M}}},[t,e,I]),k=(0,ue.useCallback)(()=>{E();let{current:L}=x,{current:M}=l,{current:R}=u,{current:S}=H;if(L&&S&&M){let{index:N}=L,P=R==="start",{index:B,currentIndex:F}=M;l.current=null,i.current=void 0,m.current?r(N,-1,{fromIndex:N,toIndex:-1}):N<B?r(N,P?F:F+1,{fromIndex:N,toIndex:P?F:F+1}):r(N,P?B:B+1,{fromIndex:N,toIndex:P?B:B+1}),b(void 0)}h(!1)},[E,r]),O=(0,ue.useCallback)(()=>{},[]);return{beginDrag:V,drag:y,drop:k,dropIndicator:g,handleScrollStart:w,handleScrollStop:D,releaseDrag:O,revealOverflowedItems:f}};var be=require("react");var Ye=require("react");var sa=(r="horizontal")=>{let e=(0,Ye.useRef)(0),t=(0,Ye.useRef)(!1),n=(0,Ye.useMemo)(()=>[us(t),us()],[]),o=(0,Ye.useCallback)((u,p="width")=>{let[c,d]=n;e.current=requestAnimationFrame(()=>{t.current=!0,c.style.cssText=`${p}: 0px`,d.style.cssText=`${p}: ${u}px`,n[0]=d,n[1]=c})},[n]),s=(0,Ye.useCallback)((u=!1)=>{if(u===!0){let[p]=n,c=()=>{p.removeEventListener("transitionend",c),s()},d=r==="horizontal"?"width":"height";p.addEventListener("transitionend",c),o(0,d)}else n.forEach(p=>p.remove())},[o,r,n]),i=(0,Ye.useCallback)(()=>{e.current&&(cancelAnimationFrame(e.current),e.current=0)},[]),a=(0,Ye.useCallback)((u,p,c,d=!1,m="static")=>{if(p){let f=r==="horizontal"?"width":"height",[h,g]=n;if(i(),d)t.current?(s(),h.style.cssText=`${f}: ${c}px`,g.style.cssText=`${f}: 0px`,m==="fwd"?(p.element.before(h),p.element.after(g)):(p.element.after(h),p.element.before(g))):m==="fwd"?p.element.after(g):p.element.before(g),o(c,f);else if(m==="static")h.style.cssText=`${f}: ${c}px`,p.element.before(h);else throw Error("useDragDisplacers currently only supports noTransition for static displacement");m!=="static"&&Vn(u,m)}},[o,i,s,r,n]),l=(0,Ye.useCallback)((u,p,c,d=!1,m="static")=>{let f=r==="horizontal"?"width":"height",[h,g]=n;i(),d?(t.current?(s(),h.style.cssText=`${f}: ${c}px`,g.style.cssText=`${f}: 0px`,p.element.before(h),p.element.after(g)):m==="fwd"?p.element.after(g):p.element.before(g),o(c,f)):(h.style.cssText=`${f}: ${c}px`,p.element.after(h)),m!=="static"&&Vn(u,m)},[o,i,s,r,n]);return{displaceItem:a,displaceLastItem:l,clearSpacers:s}};var bs=require("@vuu-ui/vuu-utils");var ia=({onDrop:r,orientation:e="horizontal",containerRef:t,itemQuery:n="*",selected:o,viewportRange:s})=>{let i=(0,be.useRef)(),a=(0,be.useRef)(!1),l=(0,be.useRef)(-1),u=(0,be.useRef)([]),p=(0,be.useRef)(!1),[c,d]=(0,be.useState)(!1),{clearSpacers:m,displaceItem:f,displaceLastItem:h}=sa(e),g=(0,be.useRef)(),b=`:is(${n}${Jr}${cs},.vuuOverflowContainer-OverflowIndicator)`,E=y=>u.current.findIndex(k=>k.id===y.id),I=(0,be.useRef)();I.current=s;let x=(0,be.useCallback)(()=>{m()},[m]),T=(0,be.useCallback)((y,k,O)=>{let{current:L}=t,{current:M}=g;if(L&&M){u.current=_t(L,e,b,I.current),y==="fwd"?u.current.push(M):u.current.unshift(M);let{size:R}=M,N=l.current+R/2,{current:P}=u,B=Tt(P,N,R,"fwd");if(B){let K=E(B),X=P[K];O&&y==="fwd"?h(P,P[P.length-1],R,!1,"static"):f(P,X,R,!0,"static")}}},[t,f,h,b,e]),v=(0,be.useCallback)(y=>{y.ariaSelected&&Array.isArray(o)&&o.length>1&&console.log("its a selected element, and we have a multi select");let{current:k}=t;if(k&&y){let O=k.contains(y),{SCROLL_SIZE:L,CLIENT_SIZE:M}=Le(e),{id:R}=y,{[L]:S,[M]:N}=k;a.current=S>N;let P=u.current=_t(k,e,b,s,R);if(console.log({dropTargets:P}),O){let B=Kt(P),F=P[B];F&&k&&(g.current=F,(F.isLast?h:f)(P,F,F.size,!1,"static"))}else{let{top:B,height:F}=y.getBoundingClientRect(),K=Tt(P,B,F,"fwd"),X=P.indexOf(K),{start:W,end:$,mid:U}=K,q=g.current={end:$,mid:U,start:W,isDraggedItem:!0,isExternal:!0,size:F},Q=P.indexOf(K);P.splice(Q,0,q);for(let te=X+1;te<P.length;te++){let ae=P[te];ae.mid+=F,ae.end+=F,ae.start+=F}(K.isLast?h:f)(P,K,K.size,!0,"static")}}},[t,f,h,b,e,o,s]),[C,H]=(0,be.useMemo)(()=>{let y=!1;return[L=>{if(!y){y=!0;let M=L.element.querySelector(".vuuPopupMenu");M&&(0,bs.dispatchMouseEvent)(M,"click")}},L=>{if(y){y=!1;let M=L.element.querySelector(".vuuPopupMenu");M&&(0,bs.dispatchMouseEvent)(M,"click")}}]},[]),w=(0,be.useCallback)((y,k)=>{let{current:O}=g;if(O&&t.current){l.current=y;let{current:L}=u,M=Tt(L,y,O.size,k);if(M&&!M.isDraggedItem)if(M.isOverflowIndicator)d(p.current=!0),C(M);else{let{size:R}=O;(E(M)===L.length-1?h:f)(L,M,R,!0,k);let P=L.at(-1);H(P),d(p.current=!1)}i.current=k}},[t,f,h,H,C]),D=(0,be.useCallback)(()=>{var L;m();let{current:y}=u,k=Kt(y),O=y[k];if(O)if(i.current=void 0,p.current)r(O.index,-1,{fromIndex:O.index,toIndex:-1,isExternal:O.isExternal});else{let M=Kt(y,!0);r(O.index,M,{fromIndex:O.index,toIndex:M,isExternal:O.isExternal})}if(d(!1),t.current){let M=(L=t.current)==null?void 0:L.scrollTop;k<y.length&&(t.current.scrollTop=M)}},[m,t,r]),V=(0,be.useCallback)(()=>{m(!0)},[m]);return{beginDrag:v,drag:w,drop:D,handleScrollStart:x,handleScrollStop:T,releaseDrag:V,revealOverflowedItems:c}};var ca=require("react/jsx-runtime"),Dd={beginDrag:()=>{},drag:()=>{},draggableRef:{current:null},drop:()=>{},isDragging:!1,isScrolling:!1,handleScrollStart:()=>{},handleScrollStop:()=>{},revealOverflowedItems:!1},aa={start:0,end:1e3,contraStart:0,contraEnd:1e3},Md=()=>Dd,Pd=3,Ld=(r,e)=>r.closest(e),kd=(r,e)=>{let t=`:is(${e}${Jr},.vuuOverflowContainer-OverflowIndicator)`,o=Array.from(r.querySelectorAll(t)).pop();return[o,(0,la.isOverflowElement)(o)]},en=({allowDragDrop:r,containerRef:e,draggableClassName:t,getDragPayload:n,id:o,itemQuery:s="*",onDragStart:i,onDrop:a,onDropSettle:l,orientation:u,...p})=>{let c=(0,J.useRef)({start:0,end:0,contraStart:0,contraEnd:0}),[d,m]=(0,J.useState)({draggable:void 0,draggedItemIndex:-1,isDragging:!1}),f=(0,J.useRef)(null),h=(0,J.useRef)(null),g=(0,J.useRef)(!1),b=(0,J.useRef)({x:0,y:0}),E=(0,J.useRef)({x:0,y:0}),I=(0,J.useRef)(null),x=(0,J.useRef)(null),T=(0,J.useRef)(-1),v=(0,J.useRef)(-1),C=(0,J.useRef)(),{isDragSource:H,isDropTarget:w,onDragOut:D,onEndOfDragOperation:V,register:y}=ls(o),k=(0,J.useRef)(),O=(0,J.useRef)(),L=(0,J.useCallback)(()=>{let{current:z}=k,{current:G}=O;z&&G&&(document.addEventListener("mousemove",z,!1),document.addEventListener("mouseup",G,!1))},[]),M=(0,J.useCallback)(()=>{let{current:z}=k,{current:G}=O;z&&G&&(document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1))},[]),R=(0,J.useCallback)((z,G)=>{let{current:j}=e;if(j){let[Z,A]=kd(j,s),{CONTRA:_,CONTRA_END:re,DIMENSION:ie,END:Te,START:He}=Le(u),Se=G[ie],{[He]:Ce,[Te]:Ue}=Z.getBoundingClientRect();c.current.start=z[He],c.current.end=A?Math.max(Ce,z.right-Se):g.current?z[He]+z[ie]-Se:Ue-Se,c.current.contraStart=z[_],c.current.contraEnd=z[re]}},[e,s,u]),S=(0,J.useCallback)(()=>{var Z;let{current:z}=I;I.current=null;let{current:G}=v,j=(Z=e.current)==null?void 0:Z.querySelector(`${s}[data-index="${G}"]`);j&&j.classList.remove("vuuDropTarget-settling"),v.current=-1,l==null||l(G),m(A=>({...A,draggable:void 0})),z&&(0,ua.dispatchCustomEvent)(z,"vuu-dropped")},[e,s,l]),N=(0,J.useCallback)(z=>{if(x.current&&f.current){let{mouseOffset:G}=f.current,{POS:j,SCROLL_POS:Z,SCROLL_SIZE:A,CLIENT_SIZE:_}=Le(u),{[Z]:re,[A]:ie,[_]:Te}=x.current,He=ie-Te,Se=re<He,Ce=c.current.end,Ue=re>0&&z-G[j]<=c.current.start,Ge=Se&&z-G[j]>=Ce;return Ue?"bwd":Ge?"fwd":""}},[x,u]),P=r===!0||r==="natural-movement"?ia:r==="drop-indicator"?na:r==="drag-copy"?ta:Md,B=(0,J.useCallback)((z,G,j)=>{var Z;(Z=C.current)==null||Z.call(C,z,G,j)},[]),{isScrolling:F,startScrolling:K,stopScrolling:X}=ea({containerRef:x,onScrollingStopped:B,orientation:u}),W=(0,J.useCallback)((z,G,j)=>{var Z;T.current=G,j.isExternal?a==null||a(z,G,{...j,payload:(Z=f.current)==null?void 0:Z.payload}):a==null||a(z,G,j),v.current=G,o&&(V==null||V(o)),f.current=null},[o,a,V]),{beginDrag:$,drag:U,drop:q,handleScrollStart:Q,handleScrollStop:me,releaseDrag:te,...ae}=P({...p,containerRef:e,isDragSource:H,isDropTarget:w,itemQuery:s,onDrop:W,orientation:u});C.current=me;let ee=(0,J.useCallback)((z,G)=>{let{CONTRA_POS:j}=Le(u),Z=b.current[j],A=H?Math.abs(Z-G):0;if(r===!0&&!H&&!w)return!1;let _=w===!1||A-z>5;if(f.current&&_)return D!=null&&D(o,f.current)&&(M(),te==null||te(),f.current=null),c.current=aa,!0},[r,o,H,w,D,u,te,M]),de=(0,J.useCallback)(z=>{let{CLIENT_POS:G,CONTRA_CLIENT_POS:j,POS:Z}=Le(u),{clientX:A,clientY:_}=z,{[G]:re,[j]:ie}=z,Te=b.current[Z],He=Math.abs(Te-re),{current:Se}=f;if(!ee(He,ie)&&(b.current.x=A,b.current.y=_,Se)){let{draggableElement:Ce,mouseOffset:Ue}=Se;if(c.current===aa&&Ce){let Ge=b.current.x-Ue.x,Ze=b.current.y-Ue.y;Ce.style.top=`${Ze}px`,Ce.style.left=`${Ge}px`}else if(He>0&&Ce){let Ge=Te<re?"fwd":"bwd",Ze=N(re),Do=b.current[Z]-Ue[Z];if(Ze&&g.current&&!F.current?(Q==null||Q(),K(Ze,1)):!Ze&&F.current&&X(),!F.current){let Rr=Math.round(Math.max(c.current.start,Math.min(c.current.end,Do))),mn=u==="horizontal"?"left":"top";Ce.style[mn]=`${Rr}px`,U(Rr,Ge)}}}},[U,ee,N,Q,F,u,K,X]),he=(0,J.useCallback)(()=>{M(),f.current&&(I.current=f.current.draggableElement),q(),m(z=>({...z,draggedItemIndex:-1,isDragging:!1}))},[q,M]);k.current=de,O.current=he;let ve=(0,J.useCallback)(z=>{f.current=z;let{draggableElement:G,mouseOffset:j}=z,{current:Z}=e;if(Z&&G){let A=Z.getBoundingClientRect(),_=G.getBoundingClientRect();return R(A,_),b.current.x=_.left+j.x,b.current.y=_.top+j.y,$(G),L(),!0}else return!1},[L,$,e,R]),le=(0,J.useCallback)(z=>{let{target:G}=z,j=Ld(G,s),{current:Z}=e;if(Z&&j){let A=hs(Z,s);g.current=gs(A,u),x.current=A;let _=Z.getBoundingClientRect(),re=j.getBoundingClientRect(),ie=f.current=new Nn(z,j);R(_,re),$(j);let{dataset:{index:Te="-1"}}=j;m({isDragging:!0,draggable:(0,ca.jsx)(Fn,{element:ds(j),onDropped:S,onTransitionEnd:S,ref:ie.setDraggable,style:ms(re,_),wrapperClassName:t}),draggedItemIndex:parseInt(Te)}),i==null||i(ie),L()}},[L,$,e,t,s,i,u,R,S]),ge=(0,J.useCallback)(z=>{let{CLIENT_POS:G,POS:j}=Le(u),{[G]:Z}=z;Math.abs(Z-E.current[j])>Pd&&e.current&&(h.current&&(window.clearTimeout(h.current),h.current=null),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",Re,!1),le(z))},[e,$,u]),Re=(0,J.useCallback)(()=>{h.current&&(window.clearTimeout(h.current),h.current=null),document.removeEventListener("mousemove",ge,!1),document.removeEventListener("mouseup",Re,!1)},[ge]),ze=(0,J.useCallback)(z=>{let{current:G}=e;if(z.stopPropagation(),G&&!z.defaultPrevented){let{clientX:j,clientY:Z}=z;b.current.x=E.current.x=j,b.current.y=E.current.y=Z,document.addEventListener("mousemove",ge,!1),document.addEventListener("mouseup",Re,!1),z.persist(),h.current=window.setTimeout(()=>{document.removeEventListener("mousemove",ge,!1),document.removeEventListener("mouseup",Re,!1),le(z.nativeEvent)},500)}},[e,le,ge,Re]),{current:se}=I;return(0,J.useLayoutEffect)(()=>{if(se&&e.current){let z=T.current,G=e.current.querySelector(`${s}[data-index="${z}"]`);G&&(G.classList.add("vuuDropTarget-settling"),requestAnimationFrame(()=>{let{top:j,left:Z}=G.getBoundingClientRect(),A=getComputedStyle(se),_=parseInt(A.getPropertyValue("left")),re=parseInt(A.getPropertyValue("top"));_!==Z||re!==j?(se.classList.add("vuuDraggable-settling"),se.style.top=`${j}px`,se.style.left=`${Z}px`):S()}))}},[e,s,se,S]),(0,J.useEffect)(()=>{o&&(H||w)&&y(o,r==="drop-only"?!1:ve,a)},[r,o,H,w,a,y,ve]),{...ae,...d,isScrolling:F,onMouseDown:r&&r!=="drop-only"?ze:void 0}};var lt=require("react");var da=({dataHook:r,onDrop:e,onMoveListItem:t,selected:n,setHighlightedIndex:o,setSelected:s})=>{let i=(0,lt.useRef)([]),a=(0,lt.useRef)(r);a.current=r;let l=(0,lt.useCallback)((d,m,f)=>d===m?f:d<Math.min(m,f)||d>Math.max(m,f)?d:m<d?d-1:d+1,[]),u=(0,lt.useCallback)((d,m,f)=>d.map(g=>a.current.indexOfItemById(g)).map(g=>l(g,m,f)),[l]),p=(0,lt.useCallback)((d,m,f)=>{st(n)&&(i.current=u(n,d,m)),f.isExternal?e==null||e(d,m,f):t==null||t(d,m),o(-1)},[n,o,u,e,t]),c=(0,lt.useCallback)(d=>{o(d)},[o]);return(0,lt.useEffect)(()=>{let{current:d}=i;if(st(d)){i.current=[];let m=Array.isArray(d)?d.map(f=>r.data[f].id):r.data[d].id;i.current=[],s(m)}},[r.data,s]),{handleDrop:p,onDropSettle:c}};var gt=({allowDragDrop:r=!1,collapsibleHeaders:e,collectionHook:t,containerRef:n,contentRef:o,defaultHighlightedIndex:s,defaultSelected:i,disabled:a,disableAriaActiveDescendant:l,disableHighlightOnFocus:u,disableTypeToSelect:p,highlightedIndex:c,id:d,label:m="",listHandlers:f,onClick:h,onDragStart:g,onDrop:b,onHighlight:E,onKeyboardNavigation:I,onKeyDown:x,onMoveListItem:T,onSelect:v,onSelectionChange:C,restoreLastFocus:H,scrollContainerRef:w,selected:D,selectionStrategy:V,selectionKeys:y,stickyHeaders:k,tabToSelect:O,viewportRange:L})=>{let M=(0,ut.useRef)(D||i),R=(A,_)=>{var re,ie;(ie=(re=Q.listHandlers).onKeyboardNavigation)==null||ie.call(re,A,_),I==null||I(A,_)},S=(0,ut.useCallback)((A,_)=>{v&&_!==null&&v(A,t.itemById(_))},[t,v]),N=(0,ut.useMemo)(()=>{var A,_;return w||{current:(_=(A=n.current)==null?void 0:A.querySelector(".vuuList-scrollContainer"))!=null?_:null}},[n,w]),P=(0,ut.useCallback)((A,_)=>{if(C){if(_o(V)){let[re]=_;C(A,t.itemById(re))}else if(Ot(V)){let re=_.map(ie=>t.itemById(ie));C(A,re)}}},[t,C,V]),{highlightedIndex:B,containerProps:{onKeyDown:F,onMouseMove:K,...X},setHighlightedIndex:W,...$}=ts({containerRef:N,defaultHighlightedIndex:s,disableHighlightOnFocus:u,highlightedIndex:c,itemCount:t.data.length,label:m,onHighlight:E,onKeyboardNavigation:R,restoreLastFocus:H,selected:M.current,viewportItemCount:10}),U=Jo({collapsibleHeaders:e,highlightedIdx:B,collectionHook:t}),q=(0,ut.useCallback)(A=>{W(-1),g==null||g(A)},[g,W]),Q=rs({containerRef:n,defaultSelected:i,highlightedIndex:B,itemQuery:".vuuListItem",label:`${m}:useList`,onClick:h,onSelect:S,onSelectionChange:P,selected:D,selectionStrategy:V,selectionKeys:y,tabToSelect:O}),{handleDrop:me,onDropSettle:te}=da({dataHook:t,onDrop:b,onMoveListItem:T,selected:Q.selected,setHighlightedIndex:W,setSelected:Q.setSelected}),{setSelected:ae}=Q;(0,pa.useLayoutEffectSkipFirst)(()=>{st(M.current)&&ae([])},[D,t.data,ae]);let{onMouseDown:ee,isDragging:de,isScrolling:he,...ve}=en({allowDragDrop:r,draggableClassName:"list-item",orientation:"vertical",containerRef:n,id:d,itemQuery:".vuuListItem",onDragStart:q,onDrop:me,onDropSettle:te,viewportRange:L}),{onKeyDown:le}=ns({disableTypeToSelect:p,highlightedIdx:B,highlightItemAtIndex:W,typeToNavigate:!0,items:t.data}),ge=(0,ut.useCallback)(A=>{var _,re,ie;A.defaultPrevented||le==null||le(A),F(A),A.defaultPrevented||(re=(_=Q.listHandlers).onKeyDown)==null||re.call(_,A),A.defaultPrevented||(ie=U==null?void 0:U.onKeyDown)==null||ie.call(U,A),A.defaultPrevented||x==null||x(A)},[U,F,x,Q.listHandlers,le]),{isScrolling:Re,scrollIntoView:ze}=os({containerRef:N,contentRef:o,highlightedIdx:B,indexPositions:t.data,stickyHeaders:k}),se=Re.current||he.current,z=(0,ut.useCallback)(A=>{if(!se&&!a&&!de){K();let _=Yo(A.target);if(_!==-1&&_!==B){let re=t.data[_];!re||re.disabled?W(-1):W(_)}}},[de,se,a,W,K,B,t.data]),G=()=>{var A;return B===void 0||B===-1||l||(A=t.data[B])==null?void 0:A.id};M.current=Q.selected;let j={"aria-activedescendant":G(),onBlur:X.onBlur,onFocus:X.onFocus,onKeyDown:ge,onMouseDown:ee,onMouseDownCapture:X.onMouseDownCapture,onMouseLeave:X.onMouseLeave},Z=f||{onClick:Q.listHandlers.onClick,onMouseMove:z};return{focusVisible:$.focusVisible,controlledHighlighting:$.controlledHighlighting,highlightedIndex:B,keyboardNavigation:$.keyboardNavigation,listHandlers:Z,listItemHeaderHandlers:U,listControlProps:j,scrollIntoView:ze,selected:Q.selected,setHighlightedIndex:W,setIgnoreFocus:$.setIgnoreFocus,setSelected:Q.setSelected,...ve}};var ct=require("react");var Rd=(r,e,t=0)=>r===0?0:t===0?r*e:r-1*(e+t)+e,Bn=({displayedItemCount:r,getItemHeight:e,height:t,itemCount:n,itemGapSize:o,itemHeight:s=36,size:i})=>{let[a,l]=(0,ct.useState)(s),[,u]=(0,ct.useState)({}),p=(0,ct.useRef)(null),[c,d]=(0,ct.useMemo)(()=>{let h=0,g=a!=null?a:s,b=Rd(n,g,o);if(t!==void 0)return[b,void 0];let E=Math.min(r,n)||r;return typeof e=="function"?h+=Array(E).fill(0).reduce((x,T,v)=>x+e(v)+o,0)-o:h+=E*Number(g)+(E-1)*o,[b,h]},[r,e,t,n,o,s,a]),m=(0,ct.useCallback)(({height:h})=>{typeof h=="number"&&l(h)},[]),f=(0,ct.useCallback)(h=>{p.current=h,u({})},[]);return ot(p,$o,m,!0),{computedListHeight:d,contentHeight:c,listClientHeight:i==null?void 0:i.height,listItemHeight:a,rowHeightProxyRef:f}};var ma=require("@salt-ds/core"),dt=require("react"),fa=(r,e,t,n)=>{let o=Math.ceil(e/n),s=Math.floor(r/n),i=Math.ceil(s+o-1);return{atStart:s===0,atEnd:i===t-1,from:s,to:i}},$n=({containerSize:r,itemCount:e,itemGapSize:t=0,itemSize:n,onViewportScroll:o})=>{let s=(0,dt.useRef)(0),i=(0,dt.useRef)(0),a=(0,dt.useRef)(0),l=(0,dt.useMemo)(()=>fa(a.current,r,e,n+t),[r,e,n,t]),[u,p]=(0,dt.useState)(l);return(0,ma.useIsomorphicLayoutEffect)(()=>{p(l)},[l]),{onVerticalScroll:(0,dt.useCallback)(d=>{let m=d.target.scrollTop;if(m!==a.current){a.current=m;let f=n+t,h=fa(m,r,e,f);(h.from!==s.current||h.to!==i.current)&&(s.current=h.from,i.current=h.to,o==null||o(h.from,h.to),p(h))}},[n,t,r,e,o]),viewportRange:u}};var _e=require("react/jsx-runtime"),ga=require("react"),Hd="No data to display",wt="vuuList",ur=(0,Ne.forwardRef)(function({ListItem:e=qr,ListPlaceholder:t,allowDragDrop:n,children:o,className:s,collapsibleHeaders:i=!1,defaultHighlightedIndex:a,defaultSelected:l,disabled:u=!1,disableFocus:p=!1,disableTypeToSelect:c,displayedItemCount:d=10,emptyMessage:m,focusVisible:f,getItemHeight:h,getItemId:g,height:b,highlightedIndex:E,id:I,itemGapSize:x=0,itemHeight:T,itemTextHighlightPattern:v,itemToString:C=De,listHandlers:H,maxHeight:w,maxWidth:D,minHeight:V,minWidth:y,onClick:k,onDragStart:O,onDrop:L,onMoveListItem:M,onSelect:R,onSelectionChange:S,onHighlight:N,restoreLastFocus:P,selected:B,selectionStrategy:F,checkable:K=F==="multiple",scrollingApiRef:X,selectionKeys:W,showEmptyMessage:$=!1,source:U,style:q,stickyHeaders:Q,tabIndex:me=0,tabToSelect:te,...ae},ee){var pi,fi;let de=(0,Kn.useId)(I),he=(0,Ne.useRef)(null),ve=(0,Ne.useRef)(null),le=(0,Ne.useRef)(null),[ge,Re]=(0,Ne.useState)(),ze=(0,Ne.useCallback)(qe=>{Re(qe)},[]),se=mt({id:de,label:"List",source:U,children:o,options:{collapsibleHeaders:i,getItemId:g,itemToString:C}}),{listClientHeight:z,computedListHeight:G,listItemHeight:j,rowHeightProxyRef:Z}=Bn({displayedItemCount:d,getItemHeight:h,height:b,itemCount:se.data.length,itemGapSize:x,itemHeight:T,rootRef:he,size:ge}),{onVerticalScroll:A,viewportRange:_}=$n({containerSize:(fi=(pi=z!=null?z:G)!=null?pi:ge==null?void 0:ge.height)!=null?fi:0,itemCount:se.data.length,itemGapSize:x,itemSize:j}),{draggable:re,draggedItemIndex:ie,dropIndicator:Te,focusVisible:He,highlightedIndex:Se,listControlProps:Ce,listHandlers:Ue,listItemHeaderHandlers:Ge,scrollIntoView:Ze,selected:Do}=gt({allowDragDrop:n,collapsibleHeaders:i,collectionHook:se,containerRef:he,contentRef:le,defaultHighlightedIndex:a,defaultSelected:se.itemToCollectionItemId(l),disabled:u,disableTypeToSelect:c,highlightedIndex:E,id:de,label:"List",listHandlers:H,onClick:k,onDragStart:O,onDrop:L,onMoveListItem:M,onSelect:R,onSelectionChange:S,onHighlight:N,restoreLastFocus:P,scrollContainerRef:ve,selected:se.itemToCollectionItemId(B),selectionStrategy:F,selectionKeys:W,stickyHeaders:Q,tabToSelect:te,viewportRange:_});Qr({collectionHook:se,forwardedRef:X,scrollableRef:he,scrollIntoView:Ze});let Rr=f!=null?f:He,mn=function(pe,Ve,Be,we){let Ht=(0,ga.createElement)(e,{...Ge,className:(0,_n.default)(`${wt}Header`,{focusVisible:i&&Rr===pe.value}),"aria-expanded":we,"data-index":i?pe.value:void 0,"data-highlighted":pe.value===Se||void 0,"data-sticky":Q,"data-selectable":!1,id:Ve,itemHeight:ui(pe.value),key:`header-${pe.value}`,label:Be});return pe.value+=1,Ht},ui=h===void 0?()=>T:h;function uc(qe,pe,Ve){var bn,mi;let{disabled:Be,value:we,id:Ht,label:hn}=pe,gn=(0,Ne.isValidElement)(we),Hr={className:(0,_n.default)((bn=we==null?void 0:we.props)==null?void 0:bn.className,{vuuHighlighted:Ve.value===Se,vuuFocusVisible:Rr===Ve.value,["vuuDraggable-dragAway"]:ie===Ve.value}),disabled:Be||u,id:Ht,item:gn?void 0:(mi=pe==null?void 0:pe.value)!=null?mi:void 0,itemHeight:ui(Ve.value),itemTextHighlightPattern:v,key:Ht,"data-index":Ve.value,label:hn,role:"option",selected:Br(Do,pe),showCheckbox:K};qe.push(gn?(0,Ne.cloneElement)(we,Hr):(0,_e.jsx)(e,{...Hr})),Ve.value+=1}let cc=function(pe,Ve,Be){let{count:we=0,id:Ht,expanded:hn,label:gn=""}=Ve[Be.value],Hr=mn(Be,Ht,gn,hn),bn=hn!==!1?[Hr].concat(ci(Ve,Be,Be.value+we)||[]):Hr;pe.push((0,_e.jsx)("div",{role:"group",children:bn},Ht))},ci=(qe,pe={value:0},Ve=qe.length)=>{let Be=[];for(;pe.value<Ve;){let we=qe[pe.value];we.header?Be.push(mn(pe,we.id,we.label,we.expanded===!1)):we.childNodes?cc(Be,qe,pe):uc(Be,we,pe)}return Be};function dc(){return m||$?(0,_e.jsx)("span",{className:`${wt}-empty-message`,children:m!=null?m:Hd}):null}let di=se.data.length===0,pc=()=>{if(di)dc();else{let qe=se.data;return ci(qe)}},fc="auto",mc={"--list-borderWidth":"var(--vuuList-borderWidth, var(--salt-size-border, 0))","--list-item-gap":x?`${x}px`:void 0,"--computed-list-height":G===void 0?void 0:`${G}px`,minWidth:y,minHeight:V,maxWidth:D,maxHeight:w};return(0,_e.jsxs)(Kn.MeasuredContainer,{"aria-multiselectable":F==="multiple"||F==="extended"||F==="extended-multi-range"||void 0,...ae,...Ue,...Ce,className:(0,_n.default)(wt,s,{[`${wt}-collapsible`]:i,[`${wt}-contentSized`]:G!==void 0,[`${wt}-empty`]:di,vuuFocusVisible:Se===Rn}),height:G!=null?G:b,id:`${de}`,onResize:ze,ref:(0,ha.useForkRef)(he,ee),role:"listbox",onScroll:A,style:{...q,...mc},tabIndex:u||p?void 0:me,children:[(0,_e.jsx)(Zr,{ref:Z,height:T}),se.data.length===0&&t!==void 0?(0,_e.jsx)(_e.Fragment,{children:(0,_e.jsx)(t,{})}):(0,_e.jsx)("div",{className:`${wt}-viewport`,ref:ve,children:(0,_e.jsxs)("div",{className:`${wt}-scrollingContentContainer`,ref:le,style:{height:fc},children:[pc(),Te,re]})})]})});var cr=require("@salt-ds/core");function ba(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(t=ba(r[e]))&&(n&&(n+=" "),n+=t);else for(e in r)r[e]&&(n&&(n+=" "),n+=e);return n}function xs(){for(var r,e,t=0,n="";t<arguments.length;)(r=arguments[t++])&&(e=ba(r))&&(n&&(n+=" "),n+=e);return n}var Ut=require("react");var ya=require("react");var zn=class{constructor(e=0,t=0){this.keys=new Map,this.free=[],this.nextKeyValue=0,this.reset(e,t)}next(){return this.free.length?this.free.pop():this.nextKeyValue++}reset(e,t){this.keys.forEach((o,s)=>{(s<e||s>=t)&&(this.free.push(o),this.keys.delete(s))});let n=t-e;this.keys.size+this.free.length>n&&(this.free.length=n-this.keys.size);for(let o=e;o<t;o++)if(!this.keys.has(o)){let s=this.next();this.keys.set(o,s)}}keyFor(e){return this.keys.get(e)}};var Nd=([r],[e])=>r-e,xa=5,va=({data:r,listItemGapSize:e=0,listItemHeight:t,viewportRange:n})=>{let o=(0,ya.useMemo)(()=>new zn(0,1),[]),s=t+e,i=Math.max(0,n.from-xa),a=Math.min(r.length,n.to+xa);return o.reset(i,a),r.slice(i,a).map((u,p)=>[o.keyFor(p+i),(p+i)*s,p+i+1,u]).sort(Nd)};var zt=require("react/jsx-runtime"),Od="No data to display",Un=(0,cr.makePrefixer)("saltList"),Ad=(0,Ut.memo)(qr),Fd=(0,Ut.forwardRef)(function({borderless:e,children:t,className:n,collapsibleHeaders:o=!1,defaultHighlightedIndex:s,defaultSelected:i,disabled:a=!1,disableFocus:l=!1,disableTypeToSelect:u,displayedItemCount:p=10,emptyMessage:c,getItemHeight:d,getItemId:m,height:f,highlightedIndex:h,id:g,itemGapSize:b=0,itemHeight:E,itemTextHighlightPattern:I,itemToString:x,maxHeight:T,maxWidth:v,minHeight:C,minWidth:H,onDragStart:w,onDrop:D,onSelect:V,onSelectionChange:y,onViewportScroll:k,onHighlight:O,restoreLastFocus:L,selected:M,selectionStrategy:R,scrollingApiRef:S,selectionKeys:N,showEmptyMessage:P=!1,source:B,style:F,stickyHeaders:K,tabToSelect:X,width:W,...$},U){let q=(0,cr.useIdMemo)(g),Q=(0,Ut.useRef)(null),me=(0,Ut.useRef)(null),te=mt({id:q,label:"List",source:B,children:t,options:{collapsibleHeaders:o,getItemId:m,itemToString:x}}),{contentHeight:ae,listItemHeight:ee,listHeight:de}=Bn({borderless:e,displayedItemCount:p,height:f,itemCount:te.data.length,itemGapSize:b,itemHeight:E,rootRef:Q,rowHeightRef:me}),{focusVisible:he,highlightedIndex:ve,listControlProps:le,listHandlers:ge,scrollIntoView:Re,selected:ze}=gt({collapsibleHeaders:o,collectionHook:te,containerRef:Q,defaultHighlightedIndex:s,defaultSelected:te.itemToCollectionItemId(i),disabled:a,disableTypeToSelect:u,highlightedIndex:h,label:q,onSelect:V,onSelectionChange:y,onHighlight:O,restoreLastFocus:L,selected:te.itemToCollectionItemId(M),selectionStrategy:R,selectionKeys:N,stickyHeaders:K,tabToSelect:X}),{onVerticalScroll:se,viewportRange:z}=$n({containerSize:typeof de=="number"?de:0,itemCount:te.data.length,itemGapSize:b,itemSize:ee});console.log({viewPortRange:z});let G=va({data:te.data,listItemGapSize:b,listItemHeight:ee,viewportRange:z});Qr({collectionHook:te,forwardedRef:S,scrollableRef:Q,scrollIntoView:Re});function j(ie,Te,He){let[Se,Ce,Ue,Ge]=Te,Ze=Ue-1;ie.push((0,zt.jsx)(Ad,{"aria-setsize":te.data.length,"aria-posinset":Ue,className:xs(n,{saltHighlighted:Ze===ve,saltFocusVisible:he===Ze}),"data-idx":Ze,item:Ge,label:Ge.label,"data-offset":Ce,role:"option",selected:Br(ze,Ge),id:Ge.id,translate3d:Ce},Se)),He.value+=1}function Z(ie,Te={value:0},He=ie.length){let Se=[];for(;Te.value<He;){let Ce=ie[Te.value];j(Se,Ce,Te)}return Se}function A(){return c||P?(0,zt.jsx)("span",{className:Un("empty-message"),children:c!=null?c:Od}):null}let _=()=>{if(G.length)return Z(G);A()},re={"--list-item-gap":b?`${b}px`:void 0,minWidth:H,minHeight:C,width:W!=null?W:"100%",height:f!=null?f:"100%",maxWidth:v!=null?v:W,maxHeight:T!=null?T:de};return(0,zt.jsx)("div",{...$,...ge,...le,className:xs(Un(),n,Un("virtualized")),id:`${q}`,ref:(0,cr.useForkRef)(Q,U),role:"listbox",onScroll:se,style:{...F,...re},tabIndex:a||l?void 0:0,children:(0,zt.jsxs)("div",{className:Un("scrollingContentContainer"),style:{height:ae},children:[(0,zt.jsx)(Zr,{ref:me}),_()]})})});var Ia=Y(require("classnames"));var Ta=require("react/jsx-runtime"),Sa="vuuRadioIcon",ys=({checked:r=!1,...e})=>(0,Ta.jsx)("span",{...e,className:(0,Ia.default)(Sa,{[`${Sa}-checked`]:r})});var Ca=require("@salt-ds/core"),dr=require("react");var wa=({collectionHook:r,defaultHighlightedIndex:e,defaultIsOpen:t,defaultSelected:n,highlightedIndex:o,isOpen:s,itemToString:i=De,listRef:a,onHighlight:l,onOpenChange:u,onSelectionChange:p,onSelect:c,selected:d,selectionStrategy:m})=>{let f=Ot(m),[h,g]=(0,Ca.useControlled)({controlled:s,default:t!=null?t:!1,name:"useDropdownList"}),b=(0,dr.useCallback)((v,C)=>{f||(g(!1),u==null||u(!1)),(Array.isArray(C)||C)&&(p==null||p(v,C))},[f,u,p,g]),E=(0,dr.useCallback)((v,C)=>{f||(g(!1),u==null||u(!1)),c==null||c(v,C)},[f,u,c,g]),I=gt({collectionHook:r,defaultHighlightedIndex:(e!=null?e:o===void 0)?0:void 0,defaultSelected:n,label:"DropDown",onSelectionChange:b,onSelect:E,containerRef:a,highlightedIndex:o,onHighlight:l,selected:d,selectionStrategy:m,tabToSelect:!f}),x=(0,dr.useCallback)(v=>{g(v),u==null||u(v)},[u,g]),T=(0,dr.useMemo)(()=>{if(Array.isArray(I.selected)){let v=I.selected.map(C=>r.itemById(C));if(v.length===0)return;if(v.length===1){let[C]=v;return C===null?void 0:i(C)}else return`${v.length} items selected`}},[r,i,I.selected]);return{isOpen:h,onOpenChange:x,triggerLabel:T,...I}};var pr=require("react/jsx-runtime"),Vd=(0,bt.forwardRef)(function({"aria-label":e,children:t,defaultIsOpen:n,defaultSelected:o,id:s,isOpen:i,itemToString:a=De,onOpenChange:l,onSelectionChange:u,onSelect:p,selected:c,selectionStrategy:d,source:m,triggerComponent:f,ListItem:h,ListProps:g,width:b=180,...E},I){let x=(0,Da.useId)(s),T=(0,bt.useRef)(null),v=(0,bt.useRef)(null),C=(0,Ea.useForkRef)(T,I),H=mt({id:x,source:m,children:t,options:{itemToString:a}}),{highlightedIndex:w,triggerLabel:D,listHandlers:V,listControlProps:y,selected:k,...O}=wa({collectionHook:H,defaultHighlightedIndex:g==null?void 0:g.defaultHighlightedIndex,defaultIsOpen:n,defaultSelected:H.itemToCollectionItemId(o),highlightedIndex:g==null?void 0:g.highlightedIndex,isOpen:i,itemToString:a,listRef:v,onHighlight:g==null?void 0:g.onHighlight,onOpenChange:l,onSelectionChange:u,onSelect:p,selected:H.itemToCollectionItemId(c),selectionStrategy:d}),L=(0,bt.useCallback)(R=>Array.isArray(R)?R.map(N=>H.itemById(N)):H.itemById(R),[H]),M=()=>{let R={"aria-activedescendant":O.isOpen?y==null?void 0:y["aria-activedescendant"]:void 0,"aria-label":e};if(f){let S=f.props;return(0,bt.cloneElement)(f,Vr(S,{...O.isOpen?y:{},...R}))}else return(0,pr.jsx)(Wo,{label:D,...O.isOpen?y:{},...R})};return(0,pr.jsx)(Nr,{collectionHook:H,children:(0,pr.jsxs)(At,{...E,id:x,isOpen:O.isOpen,onOpenChange:O.onOpenChange,placement:(g==null?void 0:g.width)===void 0?"below-full-width":"below",ref:C,width:b,children:[M(),(0,pr.jsx)(ur,{ListItem:h,itemToString:a,...g,highlightedIndex:w,listHandlers:V,onSelectionChange:u,onSelect:p,ref:v,selected:k===void 0?void 0:L(k),selectionStrategy:d})]})})});var vs=require("@salt-ds/core"),Ma=require("@vuu-ui/vuu-layout"),ce=require("react");var Bd=["Enter"],Pa=({allowFreeText:r,ariaLabel:e,collectionHook:t,defaultIsOpen:n,defaultSelected:o,defaultValue:s,onBlur:i,onFocus:a,onChange:l,onSelect:u,id:p,initialHighlightedIndex:c=-1,isOpen:d,itemCount:m,itemsToString:f,itemToString:h=De,listRef:g,onOpenChange:b,onSelectionChange:E,onSetSelectedText:I,selected:x,selectionStrategy:T,value:v,InputProps:C={onBlur:i,onFocus:a,onChange:l,onSelect:u}})=>{let H=Ot(T),{setFilterPattern:w}=t,D=(0,ce.useRef)(null),V=(0,ce.useRef)(H?[]:null),y=(0,ce.useRef)(!0),[k,O]=(0,vs.useControlled)({controlled:d,default:n!=null?n:!1,name:"useDropdownList"}),[L,M]=(0,vs.useControlled)({controlled:void 0,default:s!=null?s:v,name:"ComboBox",state:"value"}),[R,S]=(0,ce.useState)(!0),N=(0,ce.useCallback)(A=>{var _;Array.isArray(A)?console.log("TODO multi selection"):A==null&&((_=D.current)==null||_.call(D,-1))},[]),P=(0,ce.useCallback)((A,_=!0)=>{M(A),_&&w(A===""?void 0:A)},[w,M]),B=(0,ce.useCallback)(A=>{let _=r&&L!=null?L:"";return Array.isArray(A)?A.length===1?_=h(A[0]):A.length>1&&(_=(f==null?void 0:f(A))||""):A&&(_=h(A)),_!==L?(P(_,!H),I==null||I(_),!0):!1},[r,H,h,f,I,P,L]),F=(0,ce.useCallback)(()=>{let{current:A}=V;B(A)&&A&&(Array.isArray(A)||A)&&(E==null||E(null,A))},[E,B]),K=(0,ce.useCallback)(()=>{if(r){let A=L==null?void 0:L.trim(),{current:_}=V;if(A){if(m===0&&A)return H?E==null||E(null,[A]):E==null||E(null,A),V.current=null,!0;_&&!H&&_&&!Array.isArray(_)&&h(_)}}return!1},[r,L,m,H,E,h]),X=(0,ce.useCallback)((A,_)=>{A&&H&&P("",!1),O(A),b==null||b(A),!A&&_!=="Escape"&&(K()||F())},[F,H,b,K,O,P]),W=(0,ce.useCallback)((A,_)=>{V.current=_,H||X(!1,"select")},[X,H]),$=(0,ce.useCallback)(()=>{S(!1)},[]),{focusVisible:U,setHighlightedIndex:q,highlightedIndex:Q,listControlProps:me,listHandlers:te,selected:ae}=gt({collectionHook:t,containerRef:g,defaultHighlightedIndex:c,defaultSelected:t.itemToCollectionItemId(o),disableAriaActiveDescendant:R,disableHighlightOnFocus:!0,disableTypeToSelect:!0,onKeyboardNavigation:$,onSelectionChange:W,selected:t.itemToCollectionItemId(x),selectionKeys:Bd,selectionStrategy:T,tabToSelect:!H});D.current=q;let{onClick:ee}=te,de=(0,ce.useCallback)(A=>{var _;(_=document.getElementById(`${p}-input`))==null||_.focus(),ee==null||ee(A)},[p,ee]),he=(0,ce.useCallback)(A=>{let _=A.target.value;M(_),_&&_.trim().length?w(_):w(void 0),O(!0)},[w,O,M]),{onFocus:ve=a}=C,{onFocus:le}=me,ge=(0,ce.useCallback)(A=>{S(!1),le==null||le(A),ve==null||ve(A)},[ve,le]),Re=(0,ce.useCallback)(A=>{let _=A.relatedTarget;return(_==null?void 0:_.id)===`${p}-list`},[p]),{onBlur:ze=i}=C,{onBlur:se}=me,z=(0,ce.useCallback)(A=>{Re(A)||(se==null||se(A),ze==null||ze(A),S(!0),y.current=!0)},[Re,se,ze]),{onSelect:G}=C,j=(0,ce.useCallback)(A=>{y.current?y.current=!1:S(!0),G==null||G(A)},[G]);(0,Ma.useLayoutEffectSkipFirst)(()=>{st(ae)?N(ae):q(c)},[N,m,c,ae,q,O]);let Z={...C.inputProps,"aria-label":e,autoComplete:"off"};return{focusVisible:U,highlightedIndex:Q,isOpen:k,onOpenChange:X,inputProps:{...C,id:`${p}-input`,inputProps:Z,onChange:he,onSelect:j,role:"combobox",value:L},listControlProps:{...me,onBlur:z,onFocus:ge},listHandlers:{...te,onClick:de},selected:V.current}};var La=Y(require("classnames"));var Ra=require("react/jsx-runtime"),$d="vuuChevronIcon",ka=r=>{let{direction:e,...t}=r;return(0,Ra.jsx)("span",{...t,className:(0,La.default)($d,e)})};var Gt=require("react/jsx-runtime"),Oa=(0,fr.forwardRef)(function({InputProps:e,ListProps:t,PopupProps:n,ListItem:o,"aria-label":s,allowFreeText:i,children:a,defaultIsOpen:l,defaultSelected:u,defaultValue:p,disabled:c,onBlur:d,onFocus:m,onChange:f,onSelect:h,onSetSelectedText:g,getFilterRegex:b,id:E,initialHighlightedIndex:I=-1,isOpen:x,itemToString:T=De,itemsToString:v,onOpenChange:C,onSelectionChange:H,selected:w,selectionStrategy:D,source:V,value:y,width:k=180,...O},L){let M=(0,Ha.useId)(E),R=(0,fr.useRef)(null),S=ee=>Array.isArray(ee)&&ee.length>0?ee[0]:void 0,P=((ee,de)=>{let he=ee?S(ee):de?S(de):void 0;return he?T(he):""})(w,u),B=mt({id:M,source:V,children:a,options:{filterPattern:P,getFilterRegex:b,itemToString:T}}),{focusVisible:F,highlightedIndex:K,inputProps:{endAdornment:X,...W},isOpen:$,listHandlers:U,listControlProps:q,onOpenChange:Q,selected:me}=Pa({InputProps:e,allowFreeText:i,ariaLabel:s,collectionHook:B,defaultIsOpen:l,defaultSelected:u,defaultValue:p,disabled:c,initialHighlightedIndex:I,itemCount:B.data.length,label:O.title,listRef:R,onBlur:d,onFocus:m,onChange:f,onSelect:h,id:M,isOpen:x,itemToString:T,itemsToString:v,onOpenChange:C,onSelectionChange:H,onSetSelectedText:g,selected:w,selectionStrategy:D,value:P}),te=(0,fr.useCallback)(()=>{$?Q(!1,"toggle"):Q(!0)},[$,Q]);return(0,Gt.jsx)(Nr,{collectionHook:B,children:(0,Gt.jsxs)(At,{...O,PopupProps:n,id:M,isOpen:$,onOpenChange:Q,openOnFocus:!0,ref:L,width:k,children:[(0,Gt.jsx)(Na.Input,{...W,disabled:c,...q,endAdornment:X===null?null:(0,Gt.jsx)(ka,{direction:$?"up":"down",onClick:te})}),(0,Gt.jsx)(ur,{...t,ListItem:o,defaultSelected:void 0,focusVisible:F,highlightedIndex:K,itemTextHighlightPattern:String(W.value)||void 0,id:`${M}-list`,listHandlers:U,onSelectionChange:H,ref:R,selected:me,selectionStrategy:D,tabIndex:-1})]})})});var Fa=require("@salt-ds/core"),Va=Y(require("classnames")),Gn=require("react"),Ba=require("react/jsx-runtime"),Aa="vuuCycleStateButton",_d=(r,e)=>{let t=e.indexOf(r.toUpperCase());return t===e.length-1?e[0]:e[t+1]},Kd=(0,Gn.forwardRef)(function({className:e,onCommit:t,value:n="",values:o,...s},i){let a=(0,Gn.useCallback)(l=>{let u=_d(n,o);t(l,u).then(p=>{p!==!0&&console.error(p)})},[t,n,o]);return(0,Ba.jsx)(Fa.Button,{...s,className:(0,Va.default)(Aa,e,`${Aa}-${n.toLowerCase()}`),onClick:a,ref:i,children:n})});var $a=require("@vuu-ui/vuu-utils"),zd=r=>e=>Ud(r,e);function Ud(r,e){let t;for(let n of r){let o=(0,$a.getEditRuleValidator)(n.name);if(o){let s=o(n,e);switch(s){case!0:break;case!1:t===void 0&&(t=!1);break;default:t===void 0||t===!1?t=s:t+=`::${s}`}}else throw Error(`editable-utils applyRules, no validator registered for rule '${n.name}'`)}return t}var _a=require("@vuu-ui/vuu-layout"),Ss=require("@vuu-ui/vuu-utils"),je=require("react"),Gd=()=>(console.warn("onCommit handler has not been provided to InputCell cell renderer"),Promise.resolve(!0)),Wd=({clientSideEditValidationCheck:r,initialValue:e,onCommit:t,type:n})=>{let[o,s]=(0,je.useState)(),[i,a]=(0,je.useState)(e),l=(0,je.useRef)(e),u=(0,je.useRef)(!1),p=(0,je.useRef)(!1);(0,_a.useLayoutEffectSkipFirst)(()=>{a(e)},[e]);let c=(0,je.useCallback)(h=>{if(u.current){p.current=!0;let g=r==null?void 0:r(i);g?s(g):(s(void 0),console.log(`commit value ${i}`),t(i).then(b=>{b===!0?(u.current=!1,(0,Ss.dispatchCustomEvent)(h,"vuu-commit")):s(b)}))}else(0,Ss.dispatchCustomEvent)(h,"vuu-commit"),p.current=!1},[r,t,i]),d=(0,je.useCallback)(h=>{h.key==="Enter"?c(h.target):h.key==="ArrowRight"||h.key==="ArrowLeft"||h.key==="ArrowUp"||h.key==="ArrowDown"?h.stopPropagation():h.key==="Escape"&&u.current&&(u.current=!1,s(void 0),a(l.current))},[c]),m=(0,je.useCallback)(h=>{u.current&&c(h.target)},[c]),f=(0,je.useCallback)(h=>{let g=h.target.value;if(n==="number"&&!isNaN(parseFloat(g))&&(g=parseFloat(g)),u.current=i!==l.current,a(g),p.current&&i!==void 0){let b=r==null?void 0:r(i);b!==o&&b!==!1&&s(b)}},[r,o,n,i]);return{inputProps:{onBlur:m,onKeyDown:d},onChange:f,value:i!=null?i:"",warningMessage:o}};var Ka=Y(require("classnames")),et=require("react"),tn=require("@salt-ds/core");var Qn=require("react/jsx-runtime"),Wn="vuuEditableLabel",Is=(0,et.forwardRef)(function({className:e,defaultEditing:t,defaultValue:n,editing:o,onChange:s,onEnterEditMode:i,onExitEditMode:a,value:l,...u},p){let c=(0,et.useRef)(null),d=(0,et.useRef)(!1),[m,f]=(0,tn.useControlled)({controlled:l,default:n!=null?n:"",name:"EditableLabel",state:"value"}),[h,g]=(0,tn.useControlled)({controlled:o,default:t!=null?t:!1,name:"EditableLabel",state:"editing"}),b=(0,et.useCallback)(D=>{g(d.current=D)},[g]),E=(0,et.useRef)(m);(0,et.useLayoutEffect)(()=>{h&&c.current!==null&&(c.current.select(),c.current.focus())},[h,c]);let I=(0,et.useCallback)(()=>{b(!0),i&&i()},[i,b]),x=({cancelEdit:D=!1,allowDeactivation:V=!1}={})=>{b(!1);let y=E.current;y!==m&&(D?f(y):E.current=m),a&&a(y,m,V,D)},T=D=>{let{value:V}=D.target;f(V),s&&s(V)},v=()=>{I()},C=()=>{d.current&&x({allowDeactivation:!0})},H=D=>{h&&D.key==="Enter"?(D.stopPropagation(),x()):D.key==="ArrowRight"||D.key==="ArrowLeft"?D.stopPropagation():D.key==="Escape"&&x({cancelEdit:!0})},w=(0,Ka.default)(Wn,e,{[`${Wn}-editing`]:h});return(0,Qn.jsx)("div",{...u,className:w,onDoubleClick:v,"data-text":m,ref:p,children:h?(0,Qn.jsx)(tn.Input,{inputProps:{className:`${Wn}-input`,spellCheck:!1},value:m,onBlur:C,onChange:T,onKeyDown:H,inputRef:c,style:{padding:0},textAlign:"left",variant:"secondary"}):(0,Qn.jsx)("span",{className:`${Wn}-label`,children:m})})});var za=Y(require("classnames")),Ua=require("react");var Cs=require("react/jsx-runtime"),Ts="vuuExpandoInput",Qd=()=>{},jd=(0,Ua.forwardRef)(function({className:e,errorMessage:t,value:n,inputProps:o,onCommit:s=Qd,...i},a){return(0,Cs.jsx)("div",{className:(0,za.default)(Ts,e,{[`${Ts}-error`]:t}),"data-text":n,children:(0,Cs.jsx)(jn,{...i,errorMessage:t,inputProps:{...o,className:`${Ts}-input`},onCommit:s,ref:a,style:{padding:0},textAlign:"left",value:n,variant:"secondary"})})});var Xn=require("react/jsx-runtime"),Ga=r=>{let{onToggle:e,checked:t,label:n}=r;return(0,Xn.jsxs)("div",{className:"vuuCheckbox",onClick:e,onKeyUp:o=>o.key===" "&&e(),children:[(0,Xn.jsx)(jr,{tabIndex:0,checked:t}),n]})};var mr=require("react/jsx-runtime"),Wa=r=>{let{onClick:e,checked:t,label:n,groupName:o}=r;return(0,mr.jsxs)("div",{className:"vuuRadioButton",onClick:e,children:[(0,mr.jsxs)("div",{className:"radio",children:[(0,mr.jsx)("input",{type:"radio",name:o}),(0,mr.jsx)(ys,{checked:t})]}),n]})};var Za=require("@vuu-ui/vuu-layout"),qa=require("@vuu-ui/vuu-table"),Ja=require("@salt-ds/core"),qn=require("react");var Qa=require("@vuu-ui/vuu-utils");var Zn=require("react/jsx-runtime"),Xd="vuuSearchCell",Zd=({column:r,columnMap:e,row:t})=>{let n=e[r.name],o=t[n];return(0,Zn.jsxs)("div",{className:Xd,tabIndex:-1,children:[(0,Zn.jsx)("span",{"data-icon":"draggable"}),o]})};(0,Qa.registerComponent)("search-cell",Zd,"cell-renderer",{serverDataType:"private"});var ja=require("@vuu-ui/vuu-table"),Et=require("react");var qd=(r,e)=>t=>r.map(({name:n})=>t[e[n]]).join(" "),Xa=({columnMap:r,columns:e,dataSource:t,defaultIsOpen:n,isOpen:o,itemToString:s=qd(e,r),onOpenChange:i,onSelect:a,searchColumns:l})=>{let[u,p]=(0,Et.useState)(""),[c,d]=$r({controlled:o,default:n!=null?n:!1,name:"useDropdownList"}),{highlightedIndexRef:m,onKeyDown:f,tableRef:h}=(0,ja.useControlledTableNavigation)(-1,t.size),g=(0,Et.useMemo)(()=>l.map(v=>`${v} starts "__VALUE__"`).join(" or "),[l]),b=(0,Et.useCallback)((v,C)=>{d(v),i==null||i(v,C)},[i,d]),E=(0,Et.useCallback)(v=>{let{value:C}=v.target;if(p(C),C&&C.trim().length){let H=g.replaceAll("__VALUE__",C);t.filter={filter:H}}else t.filter={filter:""};d(!0)},[g,t,d]),I=(0,Et.useCallback)(v=>{let C=s(v);p(C),a(v),b==null||b(!1,"select")},[b,s,a]),x={inputProps:{autoComplete:"off",onKeyDown:f},onChange:E},T={onSelect:I};return{highlightedIndex:m.current,inputProps:x,isOpen:c,onOpenChange:b,tableHandlers:T,tableRef:h,value:u}};var hr=require("react/jsx-runtime"),Jd="vuuInstrumentPicker",Yd=(0,qn.forwardRef)(function({TableProps:{dataSource:e,...t},className:n,columnMap:o,disabled:s,id:i,itemToString:a,onOpenChange:l,onSelect:u,schema:p,searchColumns:c,width:d,...m},f){let h=(0,Za.useId)(i),{highlightedIndex:g,inputProps:b,isOpen:E,onOpenChange:I,tableHandlers:x,tableRef:T,value:v}=Xa({columnMap:o,columns:t.config.columns,dataSource:e,itemToString:a,onOpenChange:l,onSelect:u,searchColumns:c}),C=(0,qn.useMemo)(()=>(0,hr.jsx)("span",{"data-icon":"chevron-down"}),[]),H={...t,config:{...t.config,zebraStripes:!1}};return(0,hr.jsxs)(At,{...m,fullWidth:!0,id:h,isOpen:E,onOpenChange:I,openOnFocus:!0,placement:"below-full-width",ref:f,width:d,children:[(0,hr.jsx)(Ja.Input,{...b,disabled:s,endAdornment:C,value:v}),(0,hr.jsx)(qa.Table,{rowHeight:25,renderBufferSize:100,...H,...x,className:`${Jd}-list`,height:200,highlightedIndex:g,dataSource:e,navigationStyle:"row",ref:T,showColumnHeaders:!1})]})});var tu=require("@vuu-ui/vuu-layout"),po=require("@vuu-ui/vuu-table"),ru=require("@salt-ds/core"),nu=Y(require("classnames")),ou=require("react");var Ya=require("@vuu-ui/vuu-utils");var Jn=require("react/jsx-runtime"),ep="vuuSearchCell",tp=({column:r,columnMap:e,row:t})=>{let n=e[r.name],o=t[n];return(0,Jn.jsxs)("div",{className:ep,tabIndex:-1,children:[(0,Jn.jsx)("span",{"data-icon":"draggable"}),o]})};(0,Ya.registerComponent)("search-cell",tp,"cell-renderer",{serverDataType:"private"});var ql=require("@vuu-ui/vuu-data");var Yn=require("@vuu-ui/vuu-utils"),rn=require("react"),{SELECTED:tv}=Yn.metadataKeys;var Bp=require("@vuu-ui/vuu-data");var sp=require("react"),ip=Y(require("classnames")),ap=require("@vuu-ui/vuu-layout");var eo=require("react"),ws=require("@salt-ds/core");var rp=require("react"),el=require("react/jsx-runtime");var np=Y(require("classnames"));var tl=require("react/jsx-runtime");var op=require("@vuu-ui/vuu-utils");var lp=require("@salt-ds/core"),rl=require("react/jsx-runtime");var Es=Y(require("react")),up=Y(require("classnames"));var Ds=require("react/jsx-runtime");var cp=require("react"),dp=Y(require("classnames")),pp=require("react/jsx-runtime");var Qt=Y(require("react")),al=require("@vuu-ui/vuu-layout");var nl=Y(require("react")),Wt=require("react/jsx-runtime"),to=class extends nl.default.Component{constructor(e){super(e),this.state={errorMessage:null}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidCatch(e,t){console.log(`error creating component at ${this.props.url}`),console.log(e,t)}render(){return this.state.errorMessage?(0,Wt.jsxs)(Wt.Fragment,{children:[(0,Wt.jsx)("h1",{children:"An error occured while creating component."}),(0,Wt.jsx)("p",{children:this.state.errorMessage})]}):this.props.children}};var sl=require("react/jsx-runtime"),ol=()=>(0,sl.jsx)("div",{className:"hwLoader"});var il=async r=>{let e=new CSSStyleSheet;return fetch(r).then(t=>t.text()).then(t=>e.replace(t))};var nn=require("react/jsx-runtime"),ro=new Map,fp=r=>{(0,Qt.useEffect)(()=>()=>{ro.delete(r)},[r]),ro.has(r)||ro.set(r,Qt.default.lazy(()=>import(r)));let e=ro.get(r);if(e)return e;throw Error(`Unable to load Lazy Feature at url ${r}`)};function mp({url:r,css:e,ComponentProps:t,...n}){e&&il(e).then(s=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,s]});let o=fp(r);return(0,nn.jsx)(to,{url:r,children:(0,nn.jsx)(Qt.Suspense,{fallback:(0,nn.jsx)(ol,{}),children:(0,nn.jsx)(o,{...n,...t})})})}var Ms=Qt.default.memo(mp);Ms.displayName="Feature";(0,al.registerComponent)("Feature",Ms,"view");var ll=require("react"),on=require("@salt-ds/core");var hp=require("@vuu-ui/vuu-utils");var ul=require("react/jsx-runtime"),gp="saveLayoutPanel",Yv=`${gp}-formField`;var jt=Y(require("react")),sn=require("@vuu-ui/vuu-layout"),cl=require("@vuu-ui/vuu-popups"),bp=require("react/jsx-runtime");var iS=jt.default.createContext({layoutMetadata:[],saveLayout:()=>{},applicationJson:sn.defaultApplicationJson,saveApplicationLayout:()=>{},saveApplicationSettings:()=>{},loadLayoutById:()=>{}});var Ps=require("react/jsx-runtime");var dl=require("react"),fe=require("react/jsx-runtime"),pl=(0,dl.memo)(()=>(0,fe.jsxs)("svg",{width:"44",height:"45",viewBox:"0 0 44 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,fe.jsxs)("g",{clipPath:"url(#clip0_217_6990)",children:[(0,fe.jsx)("path",{d:"M39.8642 15.5509L35.9196 7.58974L34.3369 6.85464L24.6235 22.0825L39.1628 30.618L42.3152 25.6347L39.8642 15.5509Z",fill:"url(#paint0_linear_217_6990)"}),(0,fe.jsx)("path",{d:"M42.6246 24.8716C41.9199 25.9157 40.9625 26.824 39.767 27.4905C38.424 28.2396 36.9563 28.597 35.5081 28.597C32.7541 28.597 30.0715 27.3094 28.4466 24.9855L15.772 3.90967L15.7655 3.9206C13.3615 0.137431 8.25372 -1.13143 4.24754 1.10507C0.178173 3.37435 -1.20852 8.39359 1.14854 12.3125L18.3445 40.9095C19.1108 42.1846 20.1816 43.1834 21.4144 43.8764C21.4241 43.8826 21.4338 43.8889 21.4435 43.8951C21.4484 43.8982 21.4549 43.9013 21.4597 43.9045C22.0332 44.2228 22.6423 44.471 23.2725 44.6536C23.3194 44.6677 23.368 44.6817 23.415 44.6942C23.6418 44.7551 23.8702 44.8097 24.1019 44.8534C24.1456 44.8612 24.1894 44.8659 24.2331 44.8737C24.4194 44.9049 24.6073 44.9314 24.7952 44.9501C24.8698 44.9579 24.9443 44.9658 25.0188 44.9704C25.2342 44.9876 25.4497 44.9985 25.6668 45.0001C25.6781 45.0001 25.6895 45.0001 25.6992 45.0001C25.7024 45.0001 25.704 45.0001 25.7073 45.0001C25.7105 45.0001 25.7121 45.0001 25.7154 45.0001C25.9503 45.0001 26.1868 44.9876 26.4217 44.9689C26.4751 44.9642 26.5286 44.9595 26.5837 44.9533C26.8137 44.9299 27.0438 44.9002 27.2738 44.8596C27.277 44.8596 27.2803 44.8596 27.2835 44.8596C27.5362 44.8144 27.7889 44.7551 28.0384 44.6864C28.0546 44.6817 28.0692 44.677 28.0854 44.6723C28.4483 44.5709 28.8063 44.4445 29.1594 44.2931C29.1659 44.29 29.174 44.2868 29.1805 44.2837C29.4494 44.1682 29.7151 44.0418 29.9759 43.8967C30.24 43.75 30.491 43.5908 30.7308 43.4206C30.9398 43.2739 31.1407 43.1179 31.3367 42.9524C31.5748 42.7495 31.8 42.5373 32.009 42.3141C32.1661 42.1471 32.3168 41.9723 32.4609 41.7913C32.5079 41.732 32.5517 41.6711 32.5954 41.6118C32.6942 41.4807 32.7882 41.3465 32.8789 41.2091C32.9259 41.1373 32.9728 41.0671 33.0182 40.9953C33.036 40.9672 33.0555 40.9407 33.0717 40.9126L42.7153 24.8763H42.6214L42.6246 24.8716Z",fill:"url(#paint1_linear_217_6990)"}),(0,fe.jsx)("path",{d:"M42.8402 16.4218L42.1112 15.2232L38.9636 9.58433L37.504 7.19644C37.2286 6.56123 36.579 6.11331 35.8176 6.11331C34.8083 6.11331 33.9919 6.90147 33.9919 7.87223C33.9919 8.20154 34.0907 8.50432 34.2543 8.76808L34.2349 8.78056L39.9048 18.0808C40.5884 19.2186 40.7715 20.5437 40.4199 21.8141C40.0684 23.0845 39.226 24.1458 38.045 24.806C37.2675 25.2398 36.3846 25.4693 35.4936 25.4693C33.6727 25.4693 31.9766 24.5281 31.0662 23.0143L22.9161 9.63271H22.9323L19.4899 3.90958L19.4834 3.92051C19.4235 3.8253 19.3538 3.73947 19.2907 3.64738L19.1935 3.48663C19.1935 3.48663 19.1854 3.49131 19.1821 3.49443C17.5654 1.27666 14.9799 0.0390178 12.3118 0.00936427V0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.961 26.8255 41.9168 25.9156 42.6231 24.8731H42.717L42.6846 24.9261C43.1366 24.2347 43.4833 23.4731 43.7068 22.6615C44.2916 20.5452 43.9871 18.3352 42.8369 16.4234L42.8402 16.4218Z",fill:"#F37880"}),(0,fe.jsxs)("g",{opacity:"0.86",children:[(0,fe.jsx)("path",{d:"M34.2332 8.78212L39.9031 18.0824C40.5868 19.2202 40.7698 20.5452 40.4183 21.8156C40.2044 22.5897 39.8059 23.2858 39.2616 23.8617C39.9744 23.2343 40.4879 22.4243 40.7423 21.5035C41.0938 20.2331 40.9107 18.908 40.2271 17.7703L34.5572 8.46998L34.5767 8.4575C34.413 8.19374 34.3142 7.89096 34.3142 7.56165C34.3142 7.15586 34.4584 6.78285 34.6982 6.48476C34.2672 6.80626 33.9902 7.30881 33.9902 7.87379C33.9902 8.2031 34.0891 8.50588 34.2527 8.76964L34.2332 8.78212Z",fill:"white"}),(0,fe.jsx)("path",{d:"M42.6917 24.9169L42.6863 24.9256C42.6863 24.9256 42.6899 24.9187 42.6935 24.9152C42.6935 24.9152 42.6935 24.9152 42.6935 24.9169H42.6917Z",fill:"white"}),(0,fe.jsx)("path",{d:"M40.0911 27.1798C38.7481 27.9289 37.2804 28.2863 35.8322 28.2863C33.0782 28.2863 30.3955 26.9988 28.7707 24.6749L16.0961 3.59744L16.0896 3.60837C14.9281 1.78077 13.1364 0.543128 11.1422 0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.4815 27.0924 41.1084 26.6055 41.6511 26.0561C41.1862 26.479 40.6662 26.8583 40.0894 27.1798H40.0911Z",fill:"white"})]})]}),(0,fe.jsxs)("defs",{children:[(0,fe.jsxs)("linearGradient",{id:"paint0_linear_217_6990",x1:"24.6235",y1:"18.7363",x2:"42.3152",y2:"18.7363",gradientUnits:"userSpaceOnUse",children:[(0,fe.jsx)("stop",{stopColor:"#4906A5"}),(0,fe.jsx)("stop",{offset:"1",stopColor:"#D3423A"})]}),(0,fe.jsxs)("linearGradient",{id:"paint1_linear_217_6990",x1:"-2.35794e-05",y1:"22.5009",x2:"42.7186",y2:"22.5009",gradientUnits:"userSpaceOnUse",children:[(0,fe.jsx)("stop",{stopColor:"#7C06A5"}),(0,fe.jsx)("stop",{offset:"1",stopColor:"#D3423A"})]}),(0,fe.jsx)("clipPath",{id:"clip0_217_6990",children:(0,fe.jsx)("rect",{width:"44",height:"45",fill:"white"})})]})]}));pl.displayName="VuuLogo";var yl=require("@vuu-ui/vuu-layout");var Cp=Y(require("classnames"));var vl=require("react");var fl=require("@vuu-ui/vuu-layout");var ml=require("react/jsx-runtime");var Dt=require("react"),gl=Y(require("classnames")),xl=require("react/jsx-runtime"),yp="medium",vp="salt-theme",Sp="light",hl=(0,Dt.createContext)({density:"high",theme:"vuu",themeMode:"light"});var Ip=(r,e,t,n)=>{var o;return(0,Dt.isValidElement)(r)?(0,Dt.cloneElement)(r,{className:(0,gl.default)((o=r.props)==null?void 0:o.className,`${e}-theme`,`${e}-density-${n}`),"data-mode":t}):(console.warn(`
|
|
2
|
+
`)),""):String(r)}var ne=require("react");var rr=require("react");var ko=r=>null;var Ro=r=>null;var yn=(r,e)=>r!==null&&Object.prototype.hasOwnProperty.call(r,e),vn=r=>yn(r,"header"),Ho=r=>yn(r,"childNodes"),Or=(r,e)=>r&&Object.prototype.hasOwnProperty.call(r.props,e),No=r=>{if((0,rr.isValidElement)(r)){if(Or(r,"disabled"))return r.props.disabled===!0}else if(yn(r,"disabled"))return r.disabled===!0;return!1},Oo=r=>(0,rr.isValidElement)(r)&&Or(r,"focusable")?r.props.focusable:!0,Ao=(r,e,t)=>{if(r.childNodes)return r.childNodes.length;if(r.header){let n=t+1,o=0;for(;n<e.length&&!e[n].header;)o++,n++;return o}else return 0},yi=r=>{if(typeof r.props.children=="string")return r.props.children;if(r.props.title)return r.props.title;if(r.props.label)return r.props.label},vi=r=>r.type===Ro||Or(r,"data-header"),Fo=r=>r.type===ko||Or(r,"data-group"),Tc=r=>Or(r,"selectable")?r.props.selectable===!0:!Fo(r)&&!vi(r),Si=r=>{if(Fo(r)){let{props:{children:e}}=r;if(typeof e!="string")return In(e)}},Cc=(r,e)=>{let t=[];return rr.Children.forEach(r,n=>{(0,rr.isValidElement)(n)&&t.push(e(n))}),t},Sn=(r,e)=>{if(Array.isArray(r))return r.length===0&&(e!=null&&e.noChildrenLabel)?[{label:e.noChildrenLabel,value:null}]:r.map((t,n)=>{var o,s;return{childNodes:Sn(t.childNodes,e),description:t.description,expanded:t.expanded,value:t,label:(s=(o=e==null?void 0:e.itemToString)==null?void 0:o.call(e,t))!=null?s:De(t)}});if(r)throw Error("list-child-items expects source to be an array")},In=r=>{if(r)return Cc(r,e=>{let{"data-id":t,disabled:n,id:o=t,"data-expanded":s,expanded:i=s}=e.props;return{childNodes:Si(e),disabled:n,expanded:i,header:vi(e),id:o,label:yi(e),selectable:Tc(e),value:e}})},wc=new Set(["/","-","."]),Ec=r=>wc.has(r),Tn=(r,e)=>e.startsWith(r)&&Ec(e[r.length]),Dc=new Set([".","/"]);function Mc(r,e){return e.startsWith(r)?Dc.has(e.charAt(r.length)):!1}function Ar(r,e,t){let n;return r.map(s=>s.id===e?{...s,...t}:Mc(s.id,e)&&s.childNodes?(n=Ar(s.childNodes,e,t),{...s,childNodes:n}):s)}var Pc=/[.*+?^${}()|[\]\\]/g;function Fr(r){return r.replace(Pc,"\\$&")}var Vr=(r,e)=>Object.keys(r).reduce((n,o)=>{let s=r[o],i=e[o];return typeof s=="function"&&typeof i=="function"&&(n[o]=(...a)=>{s(...a),i(...a)}),n},{...e});var Lc=r=>r&&r.replace(/^\s+/g,""),Cn=r=>new RegExp(`(${Fr(Lc(r))})`,"gi"),Vo=(r="",e=Cn)=>(t="")=>!!t.length&&!!r.length&&t.match(e(r))!==null;function Br(r,e){return Array.isArray(r)?r.includes(e.id):r===e.id}var We=require("react");function $r({controlled:r,default:e,name:t,state:n="value"}){let{current:o}=(0,We.useRef)(r!==void 0),[s,i]=(0,We.useState)(e),a=r!==void 0?r:s,{current:l}=(0,We.useRef)(e);(0,We.useEffect)(()=>{},[n,t,r]),(0,We.useEffect)(()=>{},[JSON.stringify(e,kc)]);let u=(0,We.useCallback)(p=>{o||i(p)},[o]);return[a,u,o]}function kc(r,e){return(0,We.isValidElement)(e)?null:e}var Rc={},mt=({children:r,id:e,options:t=Rc,source:n})=>{var R;let{getItemId:o}=t,[,s]=(0,ne.useState)(null),i=Lo(),a=(0,ne.useRef)([]),l=(0,ne.useRef)([]),u=(0,ne.useMemo)(()=>[],[]),p=(0,ne.useRef)((R=t.filterPattern)!=null?R:""),{getFilterRegex:c=Cn,noChildrenLabel:d,itemToString:m=De}=t,f=(0,ne.useCallback)(()=>t.defaultExpanded||!1,[t.defaultExpanded]),h=(0,ne.useCallback)((S,N,P=1,B="",F=[],K=[],X=[])=>(S.forEach((W,$,U)=>{var ve,le;let q=W.header&&t.collapsibleHeaders,Q=W.childNodes&&t.collapsibleHeaders===!1,me=!W.childNodes||W.childNodes.length===0,te=Q||me&&!q,ae=B?`${B}.${$}`:`item-${$}`,ee=(ve=W.id)!=null?ve:o?o($):`${e}-${ae}`,de=te?void 0:(le=W.expanded)!=null?le:f(),he={...W,childNodes:void 0,count:!Q&&de===void 0?0:Ao(W,U,$),description:W.description,disabled:No(W.value),focusable:Oo(W.value)?void 0:!1,id:ee,index:N.value,expanded:de,level:P};if(F.push(he),K.push(he),X.push(S[$].value),N.value+=1,W.childNodes){let[ge]=h(W.childNodes,N,P+1,ae,[],K,X);he.childNodes=ge}}),[F,X,K]),[t.collapsibleHeaders,o,e,f]),g=(0,ne.useCallback)(()=>p.current?Vo(p.current,c):null,[c]),b=(0,ne.useCallback)((S,N=g(),P=[],B={value:0})=>{let F=!1;for(let K of S)F&&!vn(K)||(K.value!==null&&(N===null||N(m(K.value)))&&(P[B.value]=K,B.value+=1),F=!1,vn(K)&&K.expanded===!1?F=!0:Ho(K)&&K.expanded!==!1&&K.childNodes&&b(K.childNodes,N,P,B));return P},[g,m]),E=(0,ne.useMemo)(()=>i?u:Sn(n,{itemToString:m,noChildrenLabel:d})||In(r)||[],[i,u,n,m,d,r]),[I,x,T]=(0,ne.useMemo)(()=>i?[u,u,u]:h(E,{value:0}),[u,h,i,E]);l.current=T,(0,ne.useMemo)(()=>i?u:a.current=b(I),[u,b,I,i]);let v=(0,ne.useRef)(I),C=(0,ne.useCallback)((S="")=>{typeof S=="string"&&(p.current=S,a.current=b(I),s({}))},[I,b]),H=(0,ne.useCallback)((S,N=I)=>{let P=N.find(B=>{var F;return B.id===S||((F=B==null?void 0:B.childNodes)==null?void 0:F.length)&&Tn(B.id,S)});if((P==null?void 0:P.id)===S)return x==null?void 0:x[P.index];if(P)return H(S,P.childNodes);throw Error(`useCollectionData itemById, id ${S} not found `)},[x,I]),w=(0,ne.useCallback)((S,N=I)=>{let P=N.find(F=>{var K;return F.id===S||((K=F==null?void 0:F.childNodes)==null?void 0:K.length)&&Tn(F.id,S)}),B=P?a.current.indexOf(P):-1;if(B!==-1)return B;throw Error(`useCollectionData indexOfItemById, id ${S} not found `)},[I]),D=(0,ne.useCallback)(S=>{let N=l.current.find(P=>(0,ne.isValidElement)(P.value)?P.label===S:P.value===S);if(N)return N;throw Error("useCollectionData toCollectionItem, item not found ")},[]),V=(0,ne.useCallback)(S=>{if(S===null)return null;if(Array.isArray(S)){let N=[];for(let P of S){let B=D(P);N.push(B)}return N}else if(S!==void 0)return D(S)},[D]),y=(0,ne.useCallback)(S=>{if(S===void 0)return;let N=V(S);return Array.isArray(N)?N.map(P=>P.id):N?[N.id]:[]},[V]),k=(0,ne.useCallback)(S=>{let N=P=>{let B=l.current.find(F=>(0,ne.isValidElement)(F.value)?F.label===P:F.value!==null&&m(F.value)===P);if(B)return B};if(S===null)return null;if(Array.isArray(S)){let P=[];for(let B of S){let F=N(B);F&&P.push(F)}return P}else if(S!==void 0)return N(S)},[m]),O=(0,ne.useCallback)(S=>{for(let N of v.current)if(S===N.value)return N.id;throw Error("useCollectionData itemToId, item not found")},[]),L=(0,ne.useCallback)(S=>{v.current=Ar(v.current,S.id,{expanded:!1}),a.current=b(v.current),s({})},[b]),M=(0,ne.useCallback)(S=>{v.current=Ar(v.current,S.id,{expanded:!0}),a.current=b(v.current),s({})},[b]);return i||{collapseGroupItem:L,data:a.current,expandGroupItem:M,setFilterPattern:C,indexOfItemById:w,itemById:H,itemToId:O,toCollectionItem:D,itemToCollectionItem:V,itemToCollectionItemId:y,stringToCollectionItem:k}};var It=require("react"),Hc=["height","width"],Bo=["width"],$o=["height"],Nt=new Map,Ti=(r,e,t)=>{switch(t){case"height":return e.height;case"clientHeight":return r.clientHeight;case"clientWidth":return r.clientWidth;case"contentHeight":return e.contentHeight;case"contentWidth":return e.contentWidth;case"scrollHeight":return Math.ceil(r.scrollHeight);case"scrollWidth":return Math.ceil(r.scrollWidth);case"width":return e.width;default:return 0}};var Ii=new ResizeObserver(r=>{for(let e of r){let{target:t,borderBoxSize:n,contentBoxSize:o}=e,s=Nt.get(t);if(s){let[{blockSize:i,inlineSize:a}]=n,[{blockSize:l,inlineSize:u}]=o,{onResize:p,measurements:c}=s,d=!1;for(let[m,f]of Object.entries(c)){let h=Ti(t,{height:i,width:a,contentHeight:l,contentWidth:u},m);h!==f&&(d=!0,c[m]=h)}d&&p&&p(c)}}});function ot(r,e,t,n=!1){let o=(0,It.useRef)(e),s=r.current,i=(0,It.useCallback)(a=>{let{width:l,height:u}=a.getBoundingClientRect(),{clientWidth:p,clientHeight:c}=a;return o.current.reduce((d,m)=>(d[m]=Ti(a,{width:l,height:u,contentHeight:c,contentWidth:p},m),d),{})},[]);(0,It.useLayoutEffect)(()=>{async function a(){Nt.set(s,{measurements:{}}),await document.fonts.ready;let l=Nt.get(s);if(l){let u=i(s);l.measurements=u,Ii.observe(s),n&&t(u)}else console.log("%cuseResizeObserver an target expected to be under observation wa snot found. This warrants investigation","font-weight:bold; color:red;")}return s&&(Nt.has(s)&&console.log("useResizeObserver attemping to observe same element twice",{target:s}),a()),()=>{s&&Nt.has(s)&&(Ii.unobserve(s),Nt.delete(s))}},[i,s]),(0,It.useEffect)(()=>{let a=r.current,l=Nt.get(a);if(l){if(o.current!==e){o.current=e;let u=i(a);l.measurements=u}l.onResize=t}},[e,i,r,t])}var _o=r=>r===void 0||r==="default"||r==="deselectable",Ot=r=>r==="multiple"||(r==null?void 0:r.startsWith("extended"))===!0,Ko=r=>r==="none",Nc=(r,e=!1)=>r==="multiple"||r==="multiple-special-key"&&e,Oc=r=>r!=="none"&&r!=="default",st=r=>r!==void 0&&r.length>0,zo=r=>r[0];var nr=require("react"),Ac=r=>typeof r!="function",Fc=r=>{let[e,t]=(0,nr.useState)(r),n=(0,nr.useRef)(e),o=(0,nr.useCallback)(s=>{if(Ac(s))n.current=s,t(s);else{let{current:i}=n;n.current=s(i),t(n.current)}},[]);return[n,o]};var Go=Y(require("classnames")),wi=require("@salt-ds/core"),ht=require("react");var wn=require("@salt-ds/core"),$e=require("react");var _r=require("react"),Vc=[],Ci=({popperRef:r,rootRef:e,isOpen:t,onClose:n})=>{let o=(0,_r.useRef)(t);(0,_r.useEffect)(()=>{o.current=t},[t]),(0,_r.useEffect)(()=>{let[s,i]=t?[a=>{var u,p;let l=a.target;!((u=r.current)!=null&&u.contains(l))&&!((p=e.current)!=null&&p.contains(l))&&n("click-away")},a=>{a.key==="Escape"&&o.current&&(n("Escape"),a.stopPropagation())}]:Vc;return s&&i&&(document.body.addEventListener("mousedown",s,!0),document.body.addEventListener("keydown",i,!0)),()=>{s&&i&&(document.body.removeEventListener("mousedown",s,!0),document.body.removeEventListener("keydown",i,!0))}},[t,n,r,e])};var Bc=[],Uo=({defaultIsOpen:r,disabled:e,fullWidth:t,id:n,isOpen:o,onOpenChange:s,onKeyDown:i,openKeys:a=["Enter","ArrowDown"," "],openOnFocus:l,popupComponent:u,popupWidth:p,rootRef:c,width:d})=>{var M;let m=(0,$e.useRef)(null),f=(0,$e.useRef)(null),h=(0,$e.useCallback)(R=>{f.current=R},[]),[g,b]=(0,wn.useControlled)({controlled:o,default:!!r,name:"useDropdown",state:"isOpen"}),[E,I]=(0,$e.useState)({width:(M=p!=null?p:d)!=null?M:0}),x=(0,$e.useCallback)(()=>{b(!0),s==null||s(!0)},[s,b]),T=(0,$e.useCallback)(R=>{b(!1),s==null||s(!1,R)},[s,b]);Ci({popperRef:f,rootRef:c,isOpen:g,onClose:T});let v=(0,$e.useCallback)(()=>{e||l&&(b(!0),s==null||s(!0),m.current=window.setTimeout(()=>{m.current=null},1e3))},[e,s,l,b]),C=(0,$e.useCallback)(R=>{if(["Enter"," "].indexOf(R.key)===-1){let S=!g;b(S),s==null||s(S)}},[g,b,s]),H=(0,$e.useCallback)(R=>{R.key==="Escape"&&g?(R.key==="Escape"&&(R.stopPropagation(),R.preventDefault()),T(R.key)):a.includes(R.key)&&!g?(R.preventDefault(),x()):i==null||i(R)},[T,g,i,a,x]),w=(0,$e.useCallback)(R=>{var S;g&&((S=f.current)!=null&&S.contains(R.relatedTarget)||T("blur"))},[T,g]),D=t!=null?t:!1;ot(c,D?Bo:Bc,I,D);let y=`${n}-dropdown`,k={"aria-expanded":g,"aria-owns":g?y:void 0,id:`${n}-control`,onClick:e||l?void 0:C,onFocus:v,role:"listbox",onBlur:w,onKeyDown:e?void 0:H,style:{width:D?void 0:d}},O={id:y,width:E.width},L=(0,wn.useForkRef)(h,u.ref);return{componentProps:O,popupComponentRef:L,isOpen:g,label:"Dropdown Button",triggerProps:k}};var Ei=require("@vuu-ui/vuu-layout"),Dn=require("@vuu-ui/vuu-popups");var Kr=require("react/jsx-runtime"),En="vuuDropdown",At=(0,ht.forwardRef)(function({PopupProps:e,"aria-labelledby":t,children:n,className:o,defaultIsOpen:s,disabled:i,fullWidth:a,id:l,isOpen:u,onKeyDown:p,onOpenChange:c,openKeys:d,openOnFocus:m,placement:f="below-full-width",popupWidth:h,width:g,...b},E){let I=(0,ht.useRef)(null),x=(0,Go.default)(En,o,{[`${En}-fullWidth`]:a,[`${En}-disabled`]:i}),[T,v]=ht.Children.toArray(n),C=(0,Ei.useId)(l),{componentProps:H,isOpen:w,popupComponentRef:D,triggerProps:V}=Uo({ariaLabelledBy:t,defaultIsOpen:s,disabled:i,fullWidth:a,id:C,isOpen:u,onOpenChange:c,onKeyDown:p,openKeys:d,openOnFocus:m,popupComponent:v,popupWidth:h,rootRef:I,width:g}),y=()=>{let{id:L,role:M,...R}=V,{id:S=L,role:N=M,...P}=T.props;return(0,ht.cloneElement)(T,Vr(P,{...R,id:S,role:N}))},k=()=>{let{id:L,width:M,...R}=H,{className:S,id:N=L,width:P,...B}=v.props;return(0,ht.cloneElement)(v,{...B,...R,className:(0,Go.default)(S,`${En}-popup-component`),id:N,ref:D,width:f.endsWith("full-width")?"auto":P!=null?P:M})},O=(0,wi.useForkRef)(I,E);return(0,Kr.jsxs)("div",{...b,className:x,id:l,ref:O,children:[y(),w&&(0,Kr.jsx)(Dn.Portal,{children:(0,Kr.jsx)(Dn.PopupComponent,{...e,anchorElement:I,placement:f,children:k()})})]})});var Di=require("@salt-ds/core"),Mi=Y(require("classnames")),Pi=require("react");var or=require("react/jsx-runtime"),zr="vuuDropdownButton",Wo=(0,Pi.forwardRef)(function({ariaHideOptionRole:e,className:t,disabled:n,icon:o="chevron-down",isOpen:s,label:i,labelId:a,fullWidth:l,posInSet:u,setSize:p,labelAriaAttributes:c,...d},m){return(0,or.jsx)(Di.Button,{className:(0,Mi.default)(zr,{[`${zr}-fullWidth`]:l},t),disabled:n,variant:"secondary",...d,ref:m,children:(0,or.jsxs)("div",{className:`${zr}-content`,children:[(0,or.jsx)("span",{"aria-hidden":e?"true":void 0,...c,className:`${zr}-buttonLabel`,id:a,role:"option",children:i}),(0,or.jsx)("span",{className:`${zr}-buttonIcon`,"data-icon":o,"aria-hidden":"true"})]})})});var Ea=require("@salt-ds/core"),bt=require("react"),Da=require("@vuu-ui/vuu-layout");function $c(r,...e){let t=new Set(r);for(let n of e)for(let o of n)t.add(o);return t}var sr="ArrowUp",ir="ArrowDown",Qo="ArrowLeft",jo="ArrowRight",Mn="Enter",_c="Escape",Pn="Home",Ur="End",Ln="PageUp",Gr="PageDown",Xo=" ",Kc=new Set(["Enter","Delete"," "]),zc=new Set(["Tab"]),Uc=new Set(["ArrowRight","ArrowLeft"]),Li=new Set([Pn,Ur,Ln,Gr,ir,sr]),Gc=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),Wc=$c(Kc,Li,Uc,Gc,zc),Wr=r=>Wc.has(r.key)?!1:r.key.length===1&&!r.ctrlKey&&!r.metaKey&&!r.altKey,Zo=({key:r})=>Li.has(r);var qo=require("react");var Qc={},jc=r=>Array.isArray(r.childNodes),Xc=r=>!0,Zc=r=>r.closest("[data-toggle],[aria-expanded]").dataset.toggle==="true",Jo=({collapsibleHeaders:r,collectionHook:e,highlightedIdx:t,onToggle:n})=>{let o=(0,qo.useCallback)(a=>{if(a.key===jo||a.key===Mn){let l=e.data[t];l&&l.expanded===!1&&l.value&&(a.preventDefault(),e.expandGroupItem(l),n==null||n(l.value))}if(a.key===Qo||a.key===Mn){let l=e.data[t];l&&l.expanded&&l.value&&(a.preventDefault(),e.collapseGroupItem(l),n==null||n(l.value))}},[e.collapseGroupItem,e.data,e.expandGroupItem,t]),i={onClick:(0,qo.useCallback)(a=>{console.log(`useCollapsibleGroups idx=${t}`);let l=e.data[t];console.log(a.target,a.currentTarget),l&&jc(l)&&(!Xc(l)||Zc(a.target))&&(a.stopPropagation(),a.preventDefault(),l.expanded===!1&&l.value?(e.expandGroupItem(l),n==null||n(l.value)):l.expanded===!0&&l.value&&(e.collapseGroupItem(l),n==null||n(l.value)))},[e.collapseGroupItem,e.data,e.expandGroupItem,t]),onKeyDown:o};return r?i:Qc};var qc=(r,e)=>r.querySelector(`:scope > [data-idx="${e}"]`);function ki(r){if(r){let e=r.dataset.index;if(e)return parseInt(e,10);if(e=r.ariaPosInSet)return parseInt(e,10)-1}return-1}var Ri=r=>r==null?void 0:r.id,Hi=r=>r.closest("[data-index],[aria-posinset]"),Jc=r=>Ri(Hi(r)),Yo=r=>ki(Hi(r));var kn=require("react"),Yc={scrollToIndex:()=>{},scrollToItem:()=>{},scrollTo:()=>{}},Qr=({collectionHook:r,forwardedRef:e,scrollableRef:t,scrollIntoView:n})=>{let o=(0,kn.useMemo)(()=>({scrollToIndex:s=>{let i=r.data[s];i&&(n==null||n(i))},scrollToItem:s=>{let i=r.toCollectionItem(s);i&&(n==null||n(i))},scrollTo:s=>{t!=null&&t.current&&(t.current.scrollTop=s)}}),[r,n,t]);(0,kn.useImperativeHandle)(e,()=>t.current?o:Yc,[o,t])};var Ai=require("@salt-ds/core"),Me=require("react");var Ft=require("@vuu-ui/vuu-utils"),Rn=-2;function Ni(r,e,t){return e===sr||e===Ur?t>0?t-1:t:t===null?0:t===r-1?t:t+1}var es=r=>{var t;let e=Array.isArray(r)?zo(r):void 0;if(e){let n=document.getElementById(e);if(n){let o=parseInt((t=n.dataset.index)!=null?t:"-1");if((0,Ft.isValidNumber)(o))return o}}return-1},ed=(r,e,t,n)=>r===Ur?n:r===Pn?-1:e!==-1?e:t,td=(r,e,t,n)=>{let{top:o}=e.getBoundingClientRect(),{scrollTop:s,clientHeight:i,scrollHeight:a}=r,l=t-1,u=Math.min(s+i,a-i);if(u!==s&&n<l){r.scrollTo(0,u);let p=n,c;do p+=1,c=(0,Ft.getElementByDataIndex)(r,p,!0).getBoundingClientRect();while(c.top<o&&p<l);return p}},rd=async(r,e,t)=>{let{top:n}=e.getBoundingClientRect(),{scrollTop:o,clientHeight:s}=r,i=Math.max(o-s,0);if(i!==o&&t>0)return r.scrollTo(0,i),new Promise(a=>{requestAnimationFrame(()=>{let l=t,u;do l-=1,u=(0,Ft.getElementByDataIndex)(r,l,!0).getBoundingClientRect();while(u.top>n&&l>0);a(l)})})},nd=r=>r!==void 0,Oi=(r,e)=>{let t=(0,Ft.getElementByDataIndex)(r,e);return nd(t)},ts=({containerRef:r,defaultHighlightedIndex:e=-1,disableHighlightOnFocus:t,highlightedIndex:n,itemCount:o,onHighlight:s,onKeyboardNavigation:i,restoreLastFocus:a,selected:l,viewportItemCount:u})=>{let p=(0,Me.useRef)(-1),[,c]=(0,Me.useState)({}),[d,m,f]=(0,Ai.useControlled)({controlled:n,default:e,name:"UseKeyboardNavigation"}),h=(0,Me.useCallback)((w,D=!1)=>{s==null||s(w),m(w),D&&(p.current=w)},[s,m]),g=(0,Me.useCallback)(async(w,D)=>{let V=(0,Ft.getElementByDataIndex)(r.current,D,!0),y;if(V){let{current:k}=r;V&&k&&(y=w===Gr?td(k,V,o,D):await rd(k,V,D))}return y!=null?y:D},[r,o]),b=(0,Me.useCallback)((w=ir,D=w===ir?-1:o)=>{if(o===0)return-1;{let V=w==="End",y=w==="Home",k=V||y||D===-1?-1:es(l),O=ed(w,D,k,o),L=Ni(o,w,O),{current:M}=r;if(L===0&&w===sr&&M&&!Oi(M,0))return D;for(;((w===ir||y)&&L<o||(w===sr||V)&&L>0)&&M&&!Oi(M,L);)L=Ni(o,w,L);return L}},[r,o,l]),E=(0,Me.useRef)(!1),I=(0,Me.useRef)(!1),x=w=>I.current=w,T=(0,Me.useCallback)(()=>{if(I.current)I.current=!1;else if(E.current=!0,o===0)h(Rn);else if(d!==-1)c({});else if(a)if(p.current!==-1)h(p.current);else{let w=es(l);h(w!==-1?w:0)}else if(st(l)){let w=es(l);h(w)}else t!==!0&&h(b())},[t,d,o,b,a,l,h]),v=(0,Me.useCallback)(async w=>{let D=w.key===Gr||w.key===Ln?await g(w.key,d):b(w.key,d);D!==d&&h(D,!0),i==null||i(w,D)},[d,b,g,i,h]),C=(0,Me.useCallback)(w=>{o>0&&Zo(w)?(w.preventDefault(),w.stopPropagation(),E.current=!0,v(w)):Wr(w)&&(E.current=!0)},[o,v]),H=(0,Me.useMemo)(()=>({onBlur:w=>{let D=w.target.closest(".vuuList"),V=w.relatedTarget;D&&!(D!=null&&D.contains(V))&&(E.current=!1,m(-1),a||(p.current=-1))},onFocus:T,onKeyDown:C,onMouseDownCapture:()=>{E.current=!1,x(!0)},onMouseMove:()=>{E.current&&(E.current=!1)},onMouseLeave:()=>{E.current=!1,x(!1),h(-1)}}),[T,C,a,m,h]);return{focusVisible:E.current?d:-1,controlledHighlighting:f,highlightedIndex:d,setHighlightedIndex:h,keyboardNavigation:E,containerProps:H,setIgnoreFocus:x}};var Je=require("@vuu-ui/vuu-utils"),Qe=require("react");var od="checkbox",Fi="none",sd="single",id="cascade",ad=["Enter"," "],ld=r=>r&&r!==Fi,rs=({containerRef:r,defaultSelected:e,disableSelection:t=!1,highlightedIndex:n,itemQuery:o,onClick:s,onSelect:i,onSelectionChange:a,selected:l,selectionStrategy:u,selectionKeys:p=ad,tabToSelect:c})=>{let d=u==="deselectable",m=u==="multiple",f=u==="extended",h=(0,Qe.useRef)(-1),g=(0,Qe.useCallback)(y=>p.includes(y.key),[p]),[b,E]=$r({controlled:l,default:e!=null?e:[],name:"UseSelection",state:"selected"}),I=(0,Qe.useCallback)(y=>b.includes(y),[b]),x=(0,Qe.useCallback)(y=>I(y)?[]:[y],[I]),T=(0,Qe.useCallback)(y=>{let k=I(y)?b.filter(O=>O!==y):b.concat(y);return k.sort(),k},[I,b]),v=(0,Qe.useCallback)((y,k)=>{let O=k?b:[],[L]=b.slice(-1),M=L?(0,Je.getElementDataIndex)(document.getElementById(L)):0,R=Math.min(y,M),S=Math.max(y,M),N=r.current,B=Array.from(N.querySelectorAll(o)).slice(R,S+1).map(K=>K.id),F=[...new Set([...O,...B])];return F.sort(),F},[r,o,b]),C=(0,Qe.useCallback)((y,k,O,L)=>{let{current:M}=r,{id:R}=(0,Je.getElementByDataIndex)(M,k,!0),S;m?S=T(R):f?L&&!O?S=T(R):O?S=v(k,L):S=[R]:d?S=x(R):S=[R],S!==b&&E(S),i==null||i(y,R),S!==b&&a&&a(y,S)},[r,m,f,d,b,i,T,v,x,E,a]),H=(0,Qe.useCallback)(y=>{let{current:k}=r,O=(0,Je.getElementByDataIndex)(k,n);(0,Je.isSelectableElement)(O)&&(g(y)||c&&y.key==="Tab")&&(y.key!=="Tab"&&y.preventDefault(),C(y,n,!1,y.ctrlKey||y.metaKey),f&&(h.current=n))},[n,r,g,c,C,f]),w=(0,Qe.useCallback)((y,k)=>{if(f&&y.shiftKey){let{current:O}=r,L=(0,Je.getElementByDataIndex)(O,k);(0,Je.isSelectableElement)(L)&&C(y,k,!0)}},[f,r,C]),D=(0,Qe.useCallback)(y=>{let{current:k}=r,O=(0,Je.getElementByDataIndex)(k,n);!t&&(0,Je.isSelectableElement)(O)&&(y.preventDefault(),y.stopPropagation(),C(y,n,y.shiftKey,y.ctrlKey||y.metaKey),f&&(h.current=n)),s==null||s(y)},[r,n,t,s,C,f]);return{listHandlers:Ko(u)?{onClick:s}:{onClick:D,onKeyDown:H,onKeyboardNavigation:w},selected:b,setSelected:E}};var Vt=require("react");var ns=({disableTypeToSelect:r,highlightedIdx:e,highlightItemAtIndex:t,typeToNavigate:n,items:o,applyIncrementalSearch:s=!0})=>{let i=(0,Vt.useRef)(null),a=(0,Vt.useRef)(""),l=(0,Vt.useRef)(-1),u=(0,Vt.useCallback)(c=>{if(c||!s){let d=new RegExp(`^${a.current}`,"i"),m=o.findIndex(({label:f},h)=>h>l.current&&d.test(f));m===-1&&(m=o.findIndex(({label:f},h)=>h<=l.current&&d.test(f))),m!==-1&&t(m)}else a.current="",i.current=null,l.current=-1},[s,t,o]),p=(0,Vt.useCallback)(c=>{let d=l.current!==-1;(Wr(c)||d&&c.key===Xo)&&n&&(c.preventDefault(),c.stopPropagation(),(l.current===-1||c.key===a.current)&&(l.current=e),i.current!==null&&(clearTimeout(i.current),i.current=null),c.key!==a.current&&(a.current+=c.key),s&&u(!0),i.current=window.setTimeout(()=>{u()},100))},[n,s,e,u]);return{onKeyDown:r?void 0:p}};var it=require("react");var _i=require("@salt-ds/core"),Vi=["height"],ud=["height","scrollHeight"],cd=[],Bi={containerOnly:[ud,cd],withContent:[Vi,Vi]},dd=r=>r?Bi.containerOnly:Bi.withContent,$i={current:null},pd=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);if(t.startsWith("matrix")){let n=t.lastIndexOf(",");return parseInt(t.slice(n+1))}else{let n=r.offsetParent;if(n===e||e===null)return r.offsetTop;{let o=r.offsetTop;for(;n!==null&&n!==e;)o+=n.offsetTop,n=n.offsetParent;return o}}},os=({containerRef:r,contentRef:e=$i,highlightedIdx:t=-1,indexPositions:n,stickyHeaders:o=!1})=>{let s=(0,it.useRef)(!1),i=(0,it.useRef)({height:0,contentHeight:0}),a=(0,it.useCallback)(h=>{s.current=!0,r.current&&(r.current.scrollTop=h),setTimeout(()=>{s.current=!1})},[]),l=(0,it.useCallback)(()=>a(0),[a]),u=(0,it.useCallback)(()=>{a(i.current.contentHeight-i.current.height)},[a]),p=(0,it.useCallback)(h=>{let g=e.current||r.current;if(h.id){let b=document.getElementById(h.id);if(b&&r.current){let{height:E}=i.current,I=b.ariaExpanded&&b.firstChild?b.firstChild:b,x=o?36:0,T=pd(I,g),v=I.offsetHeight,{scrollTop:C}=r.current,H=C+x,w=H+E-x;if(T+v>w||T<H){let D=T+v>w?C+(T+v)-w:T-x;a(D)}}}},[r,e,a,o]);(0,_i.useIsomorphicLayoutEffect)(()=>{let{height:h,contentHeight:g}=i.current,b=n[t];if(g>h&&b){let[E]=n,[I]=n.slice(-1);b===E?l():b===I?u():p(n[t])}},[t,n,p,u,l]);let c=(0,it.useCallback)(({height:h,scrollHeight:g})=>{typeof h=="number"&&(i.current.height=h),typeof g=="number"&&(i.current.contentHeight=g)},[]),d=(0,it.useCallback)(({height:h})=>{typeof h=="number"&&(i.current.contentHeight=h)},[]),[m,f]=dd(e===$i);return ot(r,m,c,!0),ot(e,f,d,!0),{isScrolling:s,scrollIntoView:p}};var Ki=require("@salt-ds/core");var ar=require("react/jsx-runtime"),fd=(0,Ki.makePrefixer)("saltHighlighter"),ss=r=>{let{matchPattern:e,text:t=""}=r,n=typeof e=="string"?new RegExp(`(${Fr(e)})`,"gi"):e;return n===void 0?(0,ar.jsx)(ar.Fragment,{children:t}):(0,ar.jsx)("span",{children:t.split(n).map((o,s)=>o.match(n)?(0,ar.jsx)("strong",{className:fd("highlight"),children:o},`${s}-${o}`):o)})};var is=require("react"),as=Y(require("classnames"));var Ui=Y(require("react")),Gi=Y(require("classnames"));var zi="vuuCheckboxIcon",jr=({checked:r=!1,disabled:e=!1,...t})=>Ui.default.createElement("span",{...t,className:(0,Gi.default)(zi,{[`${zi}-checked-${e?"disabled":"enabled"}`]:r})});var Bt=require("react/jsx-runtime"),Xr="vuuListItem",Zr=(0,is.forwardRef)(function({height:e,...t},n){return(0,Bt.jsx)("div",{...t,"aria-hidden":!0,className:(0,as.default)(Xr,`${Xr}-proxy`),ref:n,style:{height:e}})}),qr=(0,is.forwardRef)(function({children:e,className:t,disabled:n,tabIndex:o,item:s,itemHeight:i,itemTextHighlightPattern:a,label:l,selectable:u,selected:p,showCheckbox:c,style:d,...m},f){let h=(0,as.default)(Xr,t,{vuuDisabled:n,[`${Xr}-checkbox`]:c}),g=i!==void 0?{...d,height:i}:d;return(0,Bt.jsxs)("div",{className:h,...m,"aria-disabled":n||void 0,"aria-selected":p||void 0,ref:f,style:g,children:[c&&(0,Bt.jsx)(jr,{"aria-hidden":!0,checked:p}),e&&typeof e!="string"?e:a==null?(0,Bt.jsx)("span",{className:`${Xr}-textWrapper`,children:l||e}):(0,Bt.jsx)(ss,{matchPattern:a,text:l||e})]})});var Kn=require("@vuu-ui/vuu-layout"),ha=require("@salt-ds/core"),_n=Y(require("classnames")),Ne=require("react");var pa=require("@vuu-ui/vuu-layout"),ut=require("react");var md="fwd",hd="bwd";var Pe=require("react");var Hn=require("@vuu-ui/vuu-utils"),at=require("react"),Wi=({onDragOverDropTarget:r,onDrop:e})=>{let t=(0,at.useRef)(),n=(0,at.useRef)(),o=(0,at.useRef)(null),s=(0,at.useRef)({x:0,y:0}),i=(0,at.useCallback)((p,c)=>{let{current:d}=n;if(d){for(let[m,f]of Object.entries(d))if((0,Hn.boxContainsPoint)(f,p,c))return m}},[]),a=(0,at.useCallback)(p=>{let{clientX:c,clientY:d}=p,{current:m}=o;if(s.current.x=c,s.current.y=d,m!=null&&m.draggableElement){let{draggableElement:f,mouseOffset:h}=m,g=s.current.x-h.x,b=s.current.y-h.y;f.style.top=`${b}px`,f.style.left=`${g}px`;let E=i(g,b);E?r(E,m)?(document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",l,!1),o.current=null,t.current=void 0):t.current=E:t.current=void 0}},[]),l=(0,at.useCallback)(()=>{document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",l,!1);let{current:p}=o;p&&(o.current=null,t.current&&e(t.current,p),p.draggableElement&&(0,Hn.dispatchCustomEvent)(p.draggableElement,"vuu-dropped"))},[a,e]),u=(0,at.useCallback)(p=>(console.log("resume drag of ",{el:p.draggableElement}),o.current=p,document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",l,!1),!0),[a,l]);return{measuredDropTargetsRef:n,resumeDrag:u}};var ji=require("react/jsx-runtime"),gd={isDragSource:void 0,isDropTarget:void 0,register:()=>{}},bd=()=>console.log("have you forgotten to provide a DragDrop Provider ?"),Qi=(0,Pe.createContext)({registerDragDropParty:bd}),xd=(r=[])=>r.reduce((e,t)=>{let n=document.getElementById(t);if(n){let{top:o,right:s,bottom:i,left:a}=n.getBoundingClientRect();e[t]={top:o,right:s,bottom:i,left:a}}return e},{}),yd=({children:r,dragSources:e})=>{let t=(0,Pe.useMemo)(()=>new Map,[]),n=(0,Pe.useMemo)(()=>new Map,[]),o=(0,Pe.useCallback)((f,h)=>{let g=t.get(f);return g?g(h):!1},[t]),s=(0,Pe.useCallback)((f,h)=>{let g=n.get(f);g&&g(h)},[n]),{measuredDropTargetsRef:i,resumeDrag:a}=Wi({onDragOverDropTarget:o,onDrop:s}),[l,u]=(0,Pe.useMemo)(()=>{let f=new Map,h=new Map;for(let[g,{dropTargets:b}]of Object.entries(e)){let E=f.get(g),I=Array.isArray(b)?b:[b];E?E.push(...I):f.set(g,I);for(let x of I){let T=h.get(x);T?T.push(g):h.set(x,[g])}}return[f,h]},[e]),p=(0,Pe.useCallback)((f,h)=>(i.current=xd(l.get(f)),a(h),!0),[l,i,a]),c=(0,Pe.useCallback)(f=>{console.log(`end of drag operation, id= ${f}`)},[]),d=(0,Pe.useCallback)((f,h,g)=>{h?t.set(f,h):g&&n.set(f,g)},[n,t]),m=(0,Pe.useMemo)(()=>({dragSources:l,dropTargets:u,onDragOut:p,onEndOfDragOperation:c,registerDragDropParty:d}),[l,u,p,c,d]);return(0,ji.jsx)(Qi.Provider,{value:m,children:r})},ls=r=>{var i,a;let{dragSources:e,dropTargets:t,onDragOut:n,onEndOfDragOperation:o,registerDragDropParty:s}=(0,Pe.useContext)(Qi);if(r&&(e||t)){let l=(i=e==null?void 0:e.has(r))!=null?i:!1,u=(a=t==null?void 0:t.has(r))!=null?a:!1;return{isDragSource:l,isDropTarget:u,onDragOut:n,onEndOfDragOperation:o,register:s}}else return gd};var la=require("@vuu-ui/vuu-layout"),ua=require("@vuu-ui/vuu-utils"),J=require("react");var Nn=class{constructor(e,t){this.draggableElement=null;this.payload=null;this.setDraggable=e=>{this.draggableElement=e};this.initialDragElement=t,this.mouseOffset=this.getMouseOffset(e,t)}setPayload(e){this.payload=e}getMouseOffset(e,t){let{clientX:n,clientY:o}=e,s=t.getBoundingClientRect();return{x:n-s.left,y:o-s.top}}};var Xi=require("@salt-ds/core"),Zi=Y(require("classnames")),$t=require("react"),An=require("@vuu-ui/vuu-popups");var On=require("react/jsx-runtime"),vd=r=>r.split(" ").map(e=>`vuuDraggable-${e}`),Fn=(0,$t.forwardRef)(function({wrapperClassName:e,element:t,onDropped:n,onTransitionEnd:o,style:s,scale:i=1},a){let l=(0,$t.useCallback)(()=>{n==null||n()},[n]),u=(0,$t.useCallback)(d=>{d&&(d.innerHTML="",d.appendChild(t),i!==1&&(d.style.transform=`scale(${i},${i})`),d.addEventListener("vuu-dropped",l))},[t,l,i]),p=(0,Xi.useForkRef)(a,u),c=(0,$t.useMemo)(()=>({left:0,top:0}),[]);return(0,On.jsx)(An.Portal,{children:(0,On.jsx)(An.PopupComponent,{anchorElement:{current:document.body},placement:"absolute",position:c,children:(0,On.jsx)("div",{className:(0,Zi.default)("vuuDraggable",...vd(e)),ref:p,onTransitionEnd:o,style:s})})})}),us=r=>{let e=document.createElement("div");return e.className="vuuDraggable-spacer",r&&e.addEventListener("transitionend",()=>{r.current=!1}),e},qi=()=>{let r=document.createElement("div");return r.className="vuuDraggable-dropIndicatorPosition",r},Ji=r=>{let e=document.createElement("div");return e.className="vuuDraggable-dropIndicator",r&&e.addEventListener("transitionend",()=>{r.current=!1}),e};var Sd=["left","right"],Id=["top","bottom"],Jr=":not(.wrapped)",cs=':not([aria-hidden="true"])',ds=r=>{let e=r.cloneNode(!0);return e.removeAttribute("id"),e.dataset.index="-1",e},Yi=(r,e="width",t=!1)=>{let n=e==="width"?"left":"top",{[e]:o,[n]:s}=r.getBoundingClientRect(),{padEnd:i=!1,padStart:a=!1}=r.dataset,l=getComputedStyle(r),[u,p]=e==="width"?Sd:Id,c=a&&!t?0:parseInt(l.getPropertyValue(`margin-${u}`),10),d=i&&!t?0:parseInt(l.getPropertyValue(`margin-${p}`),10),m=o;if(parseInt(l.getPropertyValue("flex-shrink"),10)>0){let h=parseInt(l.getPropertyValue("flex-basis"),10);!isNaN(h)&&h>0&&(m=h)}return[s,c+m+d]},Td={horizontal:{CLIENT_POS:"clientX",CLIENT_SIZE:"clientWidth",CONTRA:"top",CONTRA_CLIENT_POS:"clientY",CONTRA_END:"bottom",CONTRA_POS:"y",DIMENSION:"width",END:"right",POS:"x",SCROLL_POS:"scrollLeft",SCROLL_SIZE:"scrollWidth",START:"left"},vertical:{CLIENT_POS:"clientY",CLIENT_SIZE:"clientHeight",CONTRA:"left",CONTRA_CLIENT_POS:"clientX",CONTRA_END:"right",CONTRA_POS:"x",DIMENSION:"height",END:"bottom",POS:"y",SCROLL_POS:"scrollTop",SCROLL_SIZE:"scrollHeight",START:"top"}},Le=r=>Td[r],ps=(r,e)=>{let t=r.find(n=>n.id===e);if(t)return t},fs=(r,e)=>{r.splice(e,1);for(let t=e;t<r.length;t++)r[t].currentIndex-=1},_t=(r,e,t,n,o)=>{let s=[],{DIMENSION:i}=Le(e),a=Array.from(t?r.querySelectorAll(t):r.children),l=a.length,u=typeof(n==null?void 0:n.from)=="number"?n.atEnd?Math.max(0,n.from-1):n.from:0,p=typeof(n==null?void 0:n.to)=="number"?Math.min(n.to+2,l-1):l-1;for(let c=u;c<=p;c++){let d=a[c],[m,f]=Yi(d,i),h=c===l-1,g=d.id;s.push({currentIndex:c,id:g,index:c,isDraggedItem:o===g,isLast:h,isOverflowIndicator:d.dataset.index==="overflow",element:d,start:m,end:m+f,size:f,mid:m+f/2})}return s},Kt=(r,e=!1)=>{let t=r.findIndex(n=>n.isDraggedItem);if(e){let{index:n}=r[t],o=r.filter(i=>!i.isDraggedItem).reduce((i,a)=>Math.min(i,a.index),Number.MAX_SAFE_INTEGER);if(o>0&&!(n===0&&o===1))return o+t}return t},Vn=(r,e)=>{let t=Kt(r),n=e==="fwd"?t+1:t-1;if(n<0||n>=r.length)throw Error("switchDropTargetPosition index out of range");let o=r.at(t),s=r.at(n),i=s.size-o.size;if(e==="fwd"){let a=s.start+i,l=s.end,u={...o,start:a,mid:Math.floor(a+(l-a)/2),end:l},p=o.start,c=o.end+i,d={...s,start:p,mid:Math.floor(p+(c-p)/2),end:c};r.splice(t,2,d,u)}else{let a=s.start,l=s.end-i,u={...o,start:a,mid:Math.floor(a+(l-a)/2),end:l},p=o.start-i,c=o.end,d={...s,start:p,mid:Math.floor(p+(c-p)/2),end:c};r.splice(n,2,u,d)}},Tt=(r,e,t,n)=>{let o=r.length,s=Kt(r),i=r[s];if(n==="fwd"){let a=Math.round(e+t);for(let l=o-1;l>=0;l--){let u=r[l];if(a>u.mid)return i&&l<s?i:u}}else{let a=Math.round(e);for(let l=0;l<o;l++){let u=r[l];if(a<u.mid)return l>s?i:u}}throw Error("no dropTraget identified")};function ms(r,e){let{height:t,left:n,top:o,width:s}=r,{height:i,width:a}=e;return{height:Math.min(t,i),left:n,top:o,width:Math.min(s,a)}}var Cd=r=>r.map((e,t)=>{var n;return`
|
|
3
|
+
${e.isDraggedItem?"*":" "}[${t}] width : ${Math.floor(e.size)} ${Math.floor(e.start)} - ${Math.floor(e.end)} (mid ${Math.floor(e.mid)}) ${(n=e.element)==null?void 0:n.textContent} `}).join(""),hs=(r,e)=>{let t=r.querySelector(`${e}:not([aria-hidden="true"])`),n=t==null?void 0:t.parentElement;return n===r?r:n==null?void 0:n.parentElement},gs=(r,e)=>{let{SCROLL_SIZE:t,CLIENT_SIZE:n}=Le(e),{[t]:o,[n]:s}=r;return o>s};var Ct=require("react");var ea=({containerRef:r,onScrollingStopped:e,orientation:t="vertical"})=>{let n=(0,Ct.useRef)(null),o=(0,Ct.useRef)(!1),s=(0,Ct.useRef)(0),i=(0,Ct.useRef)("fwd"),a=(0,Ct.useCallback)((u=!1)=>{console.log("[useAutoScroll] stopScrolling"),n.current!==null&&(clearTimeout(n.current),n.current=null),o.current=!1,e==null||e(i.current,s.current,u)},[e]),l=(0,Ct.useCallback)((u,p,c=30)=>{let{current:d}=r;if(d){let{SCROLL_POS:m,SCROLL_SIZE:f,CLIENT_SIZE:h}=Le(t),{[m]:g,[f]:b,[h]:E}=d,I=u==="fwd"?b-E-g:g,x=Math.min(I,c);u==="fwd"?(i.current="fwd",d[m]=s.current=g+x):(i.current="bwd",d[m]=s.current=g-x),x===I?a(!0):(o.current=!0,n.current=window.setTimeout(()=>{l(u,p,c)},100))}},[r,t,a]);return{isScrolling:o,startScrolling:l,stopScrolling:a}};var lr=require("react"),ta=({selected:r,viewportRange:e})=>{let t=(0,lr.useRef)();t.current=e;let n=(0,lr.useCallback)(i=>{i.ariaSelected&&Array.isArray(r)&&r.length>1&&console.log("its a selected element, and we have a multi select")},[r]),o=(0,lr.useCallback)(()=>{},[]),s=(0,lr.useCallback)(()=>{},[]);return{beginDrag:n,drag:o,drop:s}};var ue=require("react");var Yr=require("react");var ra=()=>{let r=(0,Yr.useMemo)(()=>qi(),[]),e=(0,Yr.useCallback)(()=>r.remove(),[r]);return{positionDropIndicator:(0,Yr.useCallback)((n,o="end")=>(o==="end"?n.element.after(r):n.element.before(r),r),[r]),clearSpacer:e}};var oa=require("react/jsx-runtime"),wd=':not([data-overflowed="true"])',Ed=':not([aria-hidden="true"])',na=({onDrop:r,orientation:e="horizontal",containerRef:t,itemQuery:n="*",selected:o,viewportRange:s})=>{let i=(0,ue.useRef)(),a=(0,ue.useRef)(null),l=(0,ue.useRef)(null),u=(0,ue.useRef)(""),p=(0,ue.useRef)(!1),c=(0,ue.useRef)(-1),d=(0,ue.useRef)([]),m=(0,ue.useRef)(!1),[f,h]=(0,ue.useState)(!1),[g,b]=(0,ue.useState)(),{clearSpacer:E,positionDropIndicator:I}=ra(),x=(0,ue.useRef)(),T=`:is(${n}${wd}${Ed},[data-overflow-indicator])`,v=L=>d.current.findIndex(M=>M.id===L.id),C=(L,M,R)=>{L.start+=M,L.mid+=M,L.end+=M,typeof R=="number"&&(L.currentIndex+=R)},H=(0,ue.useRef)();H.current=s;let w=(0,ue.useCallback)(()=>{E()},[E]),D=(0,ue.useCallback)((L,M,R)=>{let{current:S}=t,{current:N}=x;if(S&&N){d.current=_t(S,e,T,H.current);let{size:P}=N,F=c.current+P/2,{current:K}=d,X=Tt(K,F,P,"fwd");X&&I(R&&L==="fwd"?K[K.length-1]:X,"start")}},[t,I,T,e]),V=(0,ue.useCallback)(L=>{L.ariaSelected&&Array.isArray(o)&&o.length>1&&console.log("its a selected element, and we have a multi select");let{current:M}=t;if(M&&L){let{SCROLL_SIZE:R,CLIENT_SIZE:S}=Le(e),{id:N}=L,{[R]:P,[S]:B}=M;p.current=P>B;let F=d.current=_t(M,e,T,s),K=ps(F,N);if(K&&M){let X=v(K);fs(F,X),x.current=K;let{current:W}=H;if(W!=null&&W.atEnd)for(let ee=0;ee<F.length;ee++)C(F[ee],K.size);for(let ee=X;ee<F.length;ee++)C(F[ee],-K.size,-1);let[$,U]=K.isLast?[F[F.length-1],"end"]:[F[X],"start"];l.current=$,u.current=U;let q=I($,U),{top:Q,left:me,width:te}=q.getBoundingClientRect(),ae={top:K.isLast?W!=null&&W.atEnd&&!W.atStart?Q+K.size-2:Q-2:Q-K.size-2,left:me,width:te,height:2};b((0,oa.jsx)(Fn,{wrapperClassName:"dropIndicatorContainer",style:ae,ref:a,element:Ji()}))}}},[o,t,e,T,s,I]),y=(0,ue.useCallback)((L,M)=>{let{current:R}=l,{current:S}=x;if(S&&t.current){let N=e==="horizontal"?"left":"top";c.current=L;let{current:P}=d,B=Tt(P,L,S.size,M);if(B&&B.index!==(R==null?void 0:R.index)){if(B.isOverflowIndicator)h(m.current=!0);else if(a.current){if(v(B)===P.length-1){let K=P[P.length-1],W=I(K,"start").getBoundingClientRect();a.current.style[N]=`${W.top}px`}else{let X=I(B,"start").getBoundingClientRect();a.current.style[N]=`${X.top}px`}h(m.current=!1)}l.current=B,i.current=M}}},[t,e,I]),k=(0,ue.useCallback)(()=>{E();let{current:L}=x,{current:M}=l,{current:R}=u,{current:S}=H;if(L&&S&&M){let{index:N}=L,P=R==="start",{index:B,currentIndex:F}=M;l.current=null,i.current=void 0,m.current?r(N,-1,{fromIndex:N,toIndex:-1}):N<B?r(N,P?F:F+1,{fromIndex:N,toIndex:P?F:F+1}):r(N,P?B:B+1,{fromIndex:N,toIndex:P?B:B+1}),b(void 0)}h(!1)},[E,r]),O=(0,ue.useCallback)(()=>{},[]);return{beginDrag:V,drag:y,drop:k,dropIndicator:g,handleScrollStart:w,handleScrollStop:D,releaseDrag:O,revealOverflowedItems:f}};var be=require("react");var Ye=require("react");var sa=(r="horizontal")=>{let e=(0,Ye.useRef)(0),t=(0,Ye.useRef)(!1),n=(0,Ye.useMemo)(()=>[us(t),us()],[]),o=(0,Ye.useCallback)((u,p="width")=>{let[c,d]=n;e.current=requestAnimationFrame(()=>{t.current=!0,c.style.cssText=`${p}: 0px`,d.style.cssText=`${p}: ${u}px`,n[0]=d,n[1]=c})},[n]),s=(0,Ye.useCallback)((u=!1)=>{if(u===!0){let[p]=n,c=()=>{p.removeEventListener("transitionend",c),s()},d=r==="horizontal"?"width":"height";p.addEventListener("transitionend",c),o(0,d)}else n.forEach(p=>p.remove())},[o,r,n]),i=(0,Ye.useCallback)(()=>{e.current&&(cancelAnimationFrame(e.current),e.current=0)},[]),a=(0,Ye.useCallback)((u,p,c,d=!1,m="static")=>{if(p){let f=r==="horizontal"?"width":"height",[h,g]=n;if(i(),d)t.current?(s(),h.style.cssText=`${f}: ${c}px`,g.style.cssText=`${f}: 0px`,m==="fwd"?(p.element.before(h),p.element.after(g)):(p.element.after(h),p.element.before(g))):m==="fwd"?p.element.after(g):p.element.before(g),o(c,f);else if(m==="static")h.style.cssText=`${f}: ${c}px`,p.element.before(h);else throw Error("useDragDisplacers currently only supports noTransition for static displacement");m!=="static"&&Vn(u,m)}},[o,i,s,r,n]),l=(0,Ye.useCallback)((u,p,c,d=!1,m="static")=>{let f=r==="horizontal"?"width":"height",[h,g]=n;i(),d?(t.current?(s(),h.style.cssText=`${f}: ${c}px`,g.style.cssText=`${f}: 0px`,p.element.before(h),p.element.after(g)):m==="fwd"?p.element.after(g):p.element.before(g),o(c,f)):(h.style.cssText=`${f}: ${c}px`,p.element.after(h)),m!=="static"&&Vn(u,m)},[o,i,s,r,n]);return{displaceItem:a,displaceLastItem:l,clearSpacers:s}};var bs=require("@vuu-ui/vuu-utils");var ia=({onDrop:r,orientation:e="horizontal",containerRef:t,itemQuery:n="*",selected:o,viewportRange:s})=>{let i=(0,be.useRef)(),a=(0,be.useRef)(!1),l=(0,be.useRef)(-1),u=(0,be.useRef)([]),p=(0,be.useRef)(!1),[c,d]=(0,be.useState)(!1),{clearSpacers:m,displaceItem:f,displaceLastItem:h}=sa(e),g=(0,be.useRef)(),b=`:is(${n}${Jr}${cs},.vuuOverflowContainer-OverflowIndicator)`,E=y=>u.current.findIndex(k=>k.id===y.id),I=(0,be.useRef)();I.current=s;let x=(0,be.useCallback)(()=>{m()},[m]),T=(0,be.useCallback)((y,k,O)=>{let{current:L}=t,{current:M}=g;if(L&&M){u.current=_t(L,e,b,I.current),y==="fwd"?u.current.push(M):u.current.unshift(M);let{size:R}=M,N=l.current+R/2,{current:P}=u,B=Tt(P,N,R,"fwd");if(B){let K=E(B),X=P[K];O&&y==="fwd"?h(P,P[P.length-1],R,!1,"static"):f(P,X,R,!0,"static")}}},[t,f,h,b,e]),v=(0,be.useCallback)(y=>{y.ariaSelected&&Array.isArray(o)&&o.length>1&&console.log("its a selected element, and we have a multi select");let{current:k}=t;if(k&&y){let O=k.contains(y),{SCROLL_SIZE:L,CLIENT_SIZE:M}=Le(e),{id:R}=y,{[L]:S,[M]:N}=k;a.current=S>N;let P=u.current=_t(k,e,b,s,R);if(console.log({dropTargets:P}),O){let B=Kt(P),F=P[B];F&&k&&(g.current=F,(F.isLast?h:f)(P,F,F.size,!1,"static"))}else{let{top:B,height:F}=y.getBoundingClientRect(),K=Tt(P,B,F,"fwd"),X=P.indexOf(K),{start:W,end:$,mid:U}=K,q=g.current={end:$,mid:U,start:W,isDraggedItem:!0,isExternal:!0,size:F},Q=P.indexOf(K);P.splice(Q,0,q);for(let te=X+1;te<P.length;te++){let ae=P[te];ae.mid+=F,ae.end+=F,ae.start+=F}(K.isLast?h:f)(P,K,K.size,!0,"static")}}},[t,f,h,b,e,o,s]),[C,H]=(0,be.useMemo)(()=>{let y=!1;return[L=>{if(!y){y=!0;let M=L.element.querySelector(".vuuPopupMenu");M&&(0,bs.dispatchMouseEvent)(M,"click")}},L=>{if(y){y=!1;let M=L.element.querySelector(".vuuPopupMenu");M&&(0,bs.dispatchMouseEvent)(M,"click")}}]},[]),w=(0,be.useCallback)((y,k)=>{let{current:O}=g;if(O&&t.current){l.current=y;let{current:L}=u,M=Tt(L,y,O.size,k);if(M&&!M.isDraggedItem)if(M.isOverflowIndicator)d(p.current=!0),C(M);else{let{size:R}=O;(E(M)===L.length-1?h:f)(L,M,R,!0,k);let P=L.at(-1);H(P),d(p.current=!1)}i.current=k}},[t,f,h,H,C]),D=(0,be.useCallback)(()=>{var L;m();let{current:y}=u,k=Kt(y),O=y[k];if(O)if(i.current=void 0,p.current)r(O.index,-1,{fromIndex:O.index,toIndex:-1,isExternal:O.isExternal});else{let M=Kt(y,!0);r(O.index,M,{fromIndex:O.index,toIndex:M,isExternal:O.isExternal})}if(d(!1),t.current){let M=(L=t.current)==null?void 0:L.scrollTop;k<y.length&&(t.current.scrollTop=M)}},[m,t,r]),V=(0,be.useCallback)(()=>{m(!0)},[m]);return{beginDrag:v,drag:w,drop:D,handleScrollStart:x,handleScrollStop:T,releaseDrag:V,revealOverflowedItems:c}};var ca=require("react/jsx-runtime"),Dd={beginDrag:()=>{},drag:()=>{},draggableRef:{current:null},drop:()=>{},isDragging:!1,isScrolling:!1,handleScrollStart:()=>{},handleScrollStop:()=>{},revealOverflowedItems:!1},aa={start:0,end:1e3,contraStart:0,contraEnd:1e3},Md=()=>Dd,Pd=3,Ld=(r,e)=>r.closest(e),kd=(r,e)=>{let t=`:is(${e}${Jr},.vuuOverflowContainer-OverflowIndicator)`,o=Array.from(r.querySelectorAll(t)).pop();return[o,(0,la.isOverflowElement)(o)]},en=({allowDragDrop:r,containerRef:e,draggableClassName:t,getDragPayload:n,id:o,itemQuery:s="*",onDragStart:i,onDrop:a,onDropSettle:l,orientation:u,...p})=>{let c=(0,J.useRef)({start:0,end:0,contraStart:0,contraEnd:0}),[d,m]=(0,J.useState)({draggable:void 0,draggedItemIndex:-1,isDragging:!1}),f=(0,J.useRef)(null),h=(0,J.useRef)(null),g=(0,J.useRef)(!1),b=(0,J.useRef)({x:0,y:0}),E=(0,J.useRef)({x:0,y:0}),I=(0,J.useRef)(null),x=(0,J.useRef)(null),T=(0,J.useRef)(-1),v=(0,J.useRef)(-1),C=(0,J.useRef)(),{isDragSource:H,isDropTarget:w,onDragOut:D,onEndOfDragOperation:V,register:y}=ls(o),k=(0,J.useRef)(),O=(0,J.useRef)(),L=(0,J.useCallback)(()=>{let{current:z}=k,{current:G}=O;z&&G&&(document.addEventListener("mousemove",z,!1),document.addEventListener("mouseup",G,!1))},[]),M=(0,J.useCallback)(()=>{let{current:z}=k,{current:G}=O;z&&G&&(document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1))},[]),R=(0,J.useCallback)((z,G)=>{let{current:j}=e;if(j){let[Z,A]=kd(j,s),{CONTRA:_,CONTRA_END:re,DIMENSION:ie,END:Te,START:He}=Le(u),Se=G[ie],{[He]:Ce,[Te]:Ue}=Z.getBoundingClientRect();c.current.start=z[He],c.current.end=A?Math.max(Ce,z.right-Se):g.current?z[He]+z[ie]-Se:Ue-Se,c.current.contraStart=z[_],c.current.contraEnd=z[re]}},[e,s,u]),S=(0,J.useCallback)(()=>{var Z;let{current:z}=I;I.current=null;let{current:G}=v,j=(Z=e.current)==null?void 0:Z.querySelector(`${s}[data-index="${G}"]`);j&&j.classList.remove("vuuDropTarget-settling"),v.current=-1,l==null||l(G),m(A=>({...A,draggable:void 0})),z&&(0,ua.dispatchCustomEvent)(z,"vuu-dropped")},[e,s,l]),N=(0,J.useCallback)(z=>{if(x.current&&f.current){let{mouseOffset:G}=f.current,{POS:j,SCROLL_POS:Z,SCROLL_SIZE:A,CLIENT_SIZE:_}=Le(u),{[Z]:re,[A]:ie,[_]:Te}=x.current,He=ie-Te,Se=re<He,Ce=c.current.end,Ue=re>0&&z-G[j]<=c.current.start,Ge=Se&&z-G[j]>=Ce;return Ue?"bwd":Ge?"fwd":""}},[x,u]),P=r===!0||r==="natural-movement"?ia:r==="drop-indicator"?na:r==="drag-copy"?ta:Md,B=(0,J.useCallback)((z,G,j)=>{var Z;(Z=C.current)==null||Z.call(C,z,G,j)},[]),{isScrolling:F,startScrolling:K,stopScrolling:X}=ea({containerRef:x,onScrollingStopped:B,orientation:u}),W=(0,J.useCallback)((z,G,j)=>{var Z;T.current=G,j.isExternal?a==null||a(z,G,{...j,payload:(Z=f.current)==null?void 0:Z.payload}):a==null||a(z,G,j),v.current=G,o&&(V==null||V(o)),f.current=null},[o,a,V]),{beginDrag:$,drag:U,drop:q,handleScrollStart:Q,handleScrollStop:me,releaseDrag:te,...ae}=P({...p,containerRef:e,isDragSource:H,isDropTarget:w,itemQuery:s,onDrop:W,orientation:u});C.current=me;let ee=(0,J.useCallback)((z,G)=>{let{CONTRA_POS:j}=Le(u),Z=b.current[j],A=H?Math.abs(Z-G):0;if(r===!0&&!H&&!w)return!1;let _=w===!1||A-z>5;if(f.current&&_)return D!=null&&D(o,f.current)&&(M(),te==null||te(),f.current=null),c.current=aa,!0},[r,o,H,w,D,u,te,M]),de=(0,J.useCallback)(z=>{let{CLIENT_POS:G,CONTRA_CLIENT_POS:j,POS:Z}=Le(u),{clientX:A,clientY:_}=z,{[G]:re,[j]:ie}=z,Te=b.current[Z],He=Math.abs(Te-re),{current:Se}=f;if(!ee(He,ie)&&(b.current.x=A,b.current.y=_,Se)){let{draggableElement:Ce,mouseOffset:Ue}=Se;if(c.current===aa&&Ce){let Ge=b.current.x-Ue.x,Ze=b.current.y-Ue.y;Ce.style.top=`${Ze}px`,Ce.style.left=`${Ge}px`}else if(He>0&&Ce){let Ge=Te<re?"fwd":"bwd",Ze=N(re),Do=b.current[Z]-Ue[Z];if(Ze&&g.current&&!F.current?(Q==null||Q(),K(Ze,1)):!Ze&&F.current&&X(),!F.current){let Rr=Math.round(Math.max(c.current.start,Math.min(c.current.end,Do))),mn=u==="horizontal"?"left":"top";Ce.style[mn]=`${Rr}px`,U(Rr,Ge)}}}},[U,ee,N,Q,F,u,K,X]),he=(0,J.useCallback)(()=>{M(),f.current&&(I.current=f.current.draggableElement),q(),m(z=>({...z,draggedItemIndex:-1,isDragging:!1}))},[q,M]);k.current=de,O.current=he;let ve=(0,J.useCallback)(z=>{f.current=z;let{draggableElement:G,mouseOffset:j}=z,{current:Z}=e;if(Z&&G){let A=Z.getBoundingClientRect(),_=G.getBoundingClientRect();return R(A,_),b.current.x=_.left+j.x,b.current.y=_.top+j.y,$(G),L(),!0}else return!1},[L,$,e,R]),le=(0,J.useCallback)(z=>{let{target:G}=z,j=Ld(G,s),{current:Z}=e;if(Z&&j){let A=hs(Z,s);g.current=gs(A,u),x.current=A;let _=Z.getBoundingClientRect(),re=j.getBoundingClientRect(),ie=f.current=new Nn(z,j);R(_,re),$(j);let{dataset:{index:Te="-1"}}=j;m({isDragging:!0,draggable:(0,ca.jsx)(Fn,{element:ds(j),onDropped:S,onTransitionEnd:S,ref:ie.setDraggable,style:ms(re,_),wrapperClassName:t}),draggedItemIndex:parseInt(Te)}),i==null||i(ie),L()}},[L,$,e,t,s,i,u,R,S]),ge=(0,J.useCallback)(z=>{let{CLIENT_POS:G,POS:j}=Le(u),{[G]:Z}=z;Math.abs(Z-E.current[j])>Pd&&e.current&&(h.current&&(window.clearTimeout(h.current),h.current=null),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",Re,!1),le(z))},[e,$,u]),Re=(0,J.useCallback)(()=>{h.current&&(window.clearTimeout(h.current),h.current=null),document.removeEventListener("mousemove",ge,!1),document.removeEventListener("mouseup",Re,!1)},[ge]),ze=(0,J.useCallback)(z=>{let{current:G}=e;if(z.stopPropagation(),G&&!z.defaultPrevented){let{clientX:j,clientY:Z}=z;b.current.x=E.current.x=j,b.current.y=E.current.y=Z,document.addEventListener("mousemove",ge,!1),document.addEventListener("mouseup",Re,!1),z.persist(),h.current=window.setTimeout(()=>{document.removeEventListener("mousemove",ge,!1),document.removeEventListener("mouseup",Re,!1),le(z.nativeEvent)},500)}},[e,le,ge,Re]),{current:se}=I;return(0,J.useLayoutEffect)(()=>{if(se&&e.current){let z=T.current,G=e.current.querySelector(`${s}[data-index="${z}"]`);G&&(G.classList.add("vuuDropTarget-settling"),requestAnimationFrame(()=>{let{top:j,left:Z}=G.getBoundingClientRect(),A=getComputedStyle(se),_=parseInt(A.getPropertyValue("left")),re=parseInt(A.getPropertyValue("top"));_!==Z||re!==j?(se.classList.add("vuuDraggable-settling"),se.style.top=`${j}px`,se.style.left=`${Z}px`):S()}))}},[e,s,se,S]),(0,J.useEffect)(()=>{o&&(H||w)&&y(o,r==="drop-only"?!1:ve,a)},[r,o,H,w,a,y,ve]),{...ae,...d,isScrolling:F,onMouseDown:r&&r!=="drop-only"?ze:void 0}};var lt=require("react");var da=({dataHook:r,onDrop:e,onMoveListItem:t,selected:n,setHighlightedIndex:o,setSelected:s})=>{let i=(0,lt.useRef)([]),a=(0,lt.useRef)(r);a.current=r;let l=(0,lt.useCallback)((d,m,f)=>d===m?f:d<Math.min(m,f)||d>Math.max(m,f)?d:m<d?d-1:d+1,[]),u=(0,lt.useCallback)((d,m,f)=>d.map(g=>a.current.indexOfItemById(g)).map(g=>l(g,m,f)),[l]),p=(0,lt.useCallback)((d,m,f)=>{st(n)&&(i.current=u(n,d,m)),f.isExternal?e==null||e(d,m,f):t==null||t(d,m),o(-1)},[n,o,u,e,t]),c=(0,lt.useCallback)(d=>{o(d)},[o]);return(0,lt.useEffect)(()=>{let{current:d}=i;if(st(d)){i.current=[];let m=Array.isArray(d)?d.map(f=>r.data[f].id):r.data[d].id;i.current=[],s(m)}},[r.data,s]),{handleDrop:p,onDropSettle:c}};var gt=({allowDragDrop:r=!1,collapsibleHeaders:e,collectionHook:t,containerRef:n,contentRef:o,defaultHighlightedIndex:s,defaultSelected:i,disabled:a,disableAriaActiveDescendant:l,disableHighlightOnFocus:u,disableTypeToSelect:p,highlightedIndex:c,id:d,label:m="",listHandlers:f,onClick:h,onDragStart:g,onDrop:b,onHighlight:E,onKeyboardNavigation:I,onKeyDown:x,onMoveListItem:T,onSelect:v,onSelectionChange:C,restoreLastFocus:H,scrollContainerRef:w,selected:D,selectionStrategy:V,selectionKeys:y,stickyHeaders:k,tabToSelect:O,viewportRange:L})=>{let M=(0,ut.useRef)(D||i),R=(A,_)=>{var re,ie;(ie=(re=Q.listHandlers).onKeyboardNavigation)==null||ie.call(re,A,_),I==null||I(A,_)},S=(0,ut.useCallback)((A,_)=>{v&&_!==null&&v(A,t.itemById(_))},[t,v]),N=(0,ut.useMemo)(()=>{var A,_;return w||{current:(_=(A=n.current)==null?void 0:A.querySelector(".vuuList-scrollContainer"))!=null?_:null}},[n,w]),P=(0,ut.useCallback)((A,_)=>{if(C){if(_o(V)){let[re]=_;C(A,t.itemById(re))}else if(Ot(V)){let re=_.map(ie=>t.itemById(ie));C(A,re)}}},[t,C,V]),{highlightedIndex:B,containerProps:{onKeyDown:F,onMouseMove:K,...X},setHighlightedIndex:W,...$}=ts({containerRef:N,defaultHighlightedIndex:s,disableHighlightOnFocus:u,highlightedIndex:c,itemCount:t.data.length,label:m,onHighlight:E,onKeyboardNavigation:R,restoreLastFocus:H,selected:M.current,viewportItemCount:10}),U=Jo({collapsibleHeaders:e,highlightedIdx:B,collectionHook:t}),q=(0,ut.useCallback)(A=>{W(-1),g==null||g(A)},[g,W]),Q=rs({containerRef:n,defaultSelected:i,highlightedIndex:B,itemQuery:".vuuListItem",label:`${m}:useList`,onClick:h,onSelect:S,onSelectionChange:P,selected:D,selectionStrategy:V,selectionKeys:y,tabToSelect:O}),{handleDrop:me,onDropSettle:te}=da({dataHook:t,onDrop:b,onMoveListItem:T,selected:Q.selected,setHighlightedIndex:W,setSelected:Q.setSelected}),{setSelected:ae}=Q;(0,pa.useLayoutEffectSkipFirst)(()=>{st(M.current)&&ae([])},[D,t.data,ae]);let{onMouseDown:ee,isDragging:de,isScrolling:he,...ve}=en({allowDragDrop:r,draggableClassName:"list-item",orientation:"vertical",containerRef:n,id:d,itemQuery:".vuuListItem",onDragStart:q,onDrop:me,onDropSettle:te,viewportRange:L}),{onKeyDown:le}=ns({disableTypeToSelect:p,highlightedIdx:B,highlightItemAtIndex:W,typeToNavigate:!0,items:t.data}),ge=(0,ut.useCallback)(A=>{var _,re,ie;A.defaultPrevented||le==null||le(A),F(A),A.defaultPrevented||(re=(_=Q.listHandlers).onKeyDown)==null||re.call(_,A),A.defaultPrevented||(ie=U==null?void 0:U.onKeyDown)==null||ie.call(U,A),A.defaultPrevented||x==null||x(A)},[U,F,x,Q.listHandlers,le]),{isScrolling:Re,scrollIntoView:ze}=os({containerRef:N,contentRef:o,highlightedIdx:B,indexPositions:t.data,stickyHeaders:k}),se=Re.current||he.current,z=(0,ut.useCallback)(A=>{if(!se&&!a&&!de){K();let _=Yo(A.target);if(_!==-1&&_!==B){let re=t.data[_];!re||re.disabled?W(-1):W(_)}}},[de,se,a,W,K,B,t.data]),G=()=>{var A;return B===void 0||B===-1||l||(A=t.data[B])==null?void 0:A.id};M.current=Q.selected;let j={"aria-activedescendant":G(),onBlur:X.onBlur,onFocus:X.onFocus,onKeyDown:ge,onMouseDown:ee,onMouseDownCapture:X.onMouseDownCapture,onMouseLeave:X.onMouseLeave},Z=f||{onClick:Q.listHandlers.onClick,onMouseMove:z};return{focusVisible:$.focusVisible,controlledHighlighting:$.controlledHighlighting,highlightedIndex:B,keyboardNavigation:$.keyboardNavigation,listHandlers:Z,listItemHeaderHandlers:U,listControlProps:j,scrollIntoView:ze,selected:Q.selected,setHighlightedIndex:W,setIgnoreFocus:$.setIgnoreFocus,setSelected:Q.setSelected,...ve}};var ct=require("react");var Rd=(r,e,t=0)=>r===0?0:t===0?r*e:r-1*(e+t)+e,Bn=({displayedItemCount:r,getItemHeight:e,height:t,itemCount:n,itemGapSize:o,itemHeight:s=36,size:i})=>{let[a,l]=(0,ct.useState)(s),[,u]=(0,ct.useState)({}),p=(0,ct.useRef)(null),[c,d]=(0,ct.useMemo)(()=>{let h=0,g=a!=null?a:s,b=Rd(n,g,o);if(t!==void 0)return[b,void 0];let E=Math.min(r,n)||r;return typeof e=="function"?h+=Array(E).fill(0).reduce((x,T,v)=>x+e(v)+o,0)-o:h+=E*Number(g)+(E-1)*o,[b,h]},[r,e,t,n,o,s,a]),m=(0,ct.useCallback)(({height:h})=>{typeof h=="number"&&l(h)},[]),f=(0,ct.useCallback)(h=>{p.current=h,u({})},[]);return ot(p,$o,m,!0),{computedListHeight:d,contentHeight:c,listClientHeight:i==null?void 0:i.height,listItemHeight:a,rowHeightProxyRef:f}};var ma=require("@salt-ds/core"),dt=require("react"),fa=(r,e,t,n)=>{let o=Math.ceil(e/n),s=Math.floor(r/n),i=Math.ceil(s+o-1);return{atStart:s===0,atEnd:i===t-1,from:s,to:i}},$n=({containerSize:r,itemCount:e,itemGapSize:t=0,itemSize:n,onViewportScroll:o})=>{let s=(0,dt.useRef)(0),i=(0,dt.useRef)(0),a=(0,dt.useRef)(0),l=(0,dt.useMemo)(()=>fa(a.current,r,e,n+t),[r,e,n,t]),[u,p]=(0,dt.useState)(l);return(0,ma.useIsomorphicLayoutEffect)(()=>{p(l)},[l]),{onVerticalScroll:(0,dt.useCallback)(d=>{let m=d.target.scrollTop;if(m!==a.current){a.current=m;let f=n+t,h=fa(m,r,e,f);(h.from!==s.current||h.to!==i.current)&&(s.current=h.from,i.current=h.to,o==null||o(h.from,h.to),p(h))}},[n,t,r,e,o]),viewportRange:u}};var _e=require("react/jsx-runtime"),ga=require("react"),Hd="No data to display",wt="vuuList",ur=(0,Ne.forwardRef)(function({ListItem:e=qr,ListPlaceholder:t,allowDragDrop:n,children:o,className:s,collapsibleHeaders:i=!1,defaultHighlightedIndex:a,defaultSelected:l,disabled:u=!1,disableFocus:p=!1,disableTypeToSelect:c,displayedItemCount:d=10,emptyMessage:m,focusVisible:f,getItemHeight:h,getItemId:g,height:b,highlightedIndex:E,id:I,itemGapSize:x=0,itemHeight:T,itemTextHighlightPattern:v,itemToString:C=De,listHandlers:H,maxHeight:w,maxWidth:D,minHeight:V,minWidth:y,onClick:k,onDragStart:O,onDrop:L,onMoveListItem:M,onSelect:R,onSelectionChange:S,onHighlight:N,restoreLastFocus:P,selected:B,selectionStrategy:F,checkable:K=F==="multiple",scrollingApiRef:X,selectionKeys:W,showEmptyMessage:$=!1,source:U,style:q,stickyHeaders:Q,tabIndex:me=0,tabToSelect:te,...ae},ee){var pi,fi;let de=(0,Kn.useId)(I),he=(0,Ne.useRef)(null),ve=(0,Ne.useRef)(null),le=(0,Ne.useRef)(null),[ge,Re]=(0,Ne.useState)(),ze=(0,Ne.useCallback)(qe=>{Re(qe)},[]),se=mt({id:de,label:"List",source:U,children:o,options:{collapsibleHeaders:i,getItemId:g,itemToString:C}}),{listClientHeight:z,computedListHeight:G,listItemHeight:j,rowHeightProxyRef:Z}=Bn({displayedItemCount:d,getItemHeight:h,height:b,itemCount:se.data.length,itemGapSize:x,itemHeight:T,rootRef:he,size:ge}),{onVerticalScroll:A,viewportRange:_}=$n({containerSize:(fi=(pi=z!=null?z:G)!=null?pi:ge==null?void 0:ge.height)!=null?fi:0,itemCount:se.data.length,itemGapSize:x,itemSize:j}),{draggable:re,draggedItemIndex:ie,dropIndicator:Te,focusVisible:He,highlightedIndex:Se,listControlProps:Ce,listHandlers:Ue,listItemHeaderHandlers:Ge,scrollIntoView:Ze,selected:Do}=gt({allowDragDrop:n,collapsibleHeaders:i,collectionHook:se,containerRef:he,contentRef:le,defaultHighlightedIndex:a,defaultSelected:se.itemToCollectionItemId(l),disabled:u,disableTypeToSelect:c,highlightedIndex:E,id:de,label:"List",listHandlers:H,onClick:k,onDragStart:O,onDrop:L,onMoveListItem:M,onSelect:R,onSelectionChange:S,onHighlight:N,restoreLastFocus:P,scrollContainerRef:ve,selected:se.itemToCollectionItemId(B),selectionStrategy:F,selectionKeys:W,stickyHeaders:Q,tabToSelect:te,viewportRange:_});Qr({collectionHook:se,forwardedRef:X,scrollableRef:he,scrollIntoView:Ze});let Rr=f!=null?f:He,mn=function(pe,Ve,Be,we){let Ht=(0,ga.createElement)(e,{...Ge,className:(0,_n.default)(`${wt}Header`,{focusVisible:i&&Rr===pe.value}),"aria-expanded":we,"data-index":i?pe.value:void 0,"data-highlighted":pe.value===Se||void 0,"data-sticky":Q,"data-selectable":!1,id:Ve,itemHeight:ui(pe.value),key:`header-${pe.value}`,label:Be});return pe.value+=1,Ht},ui=h===void 0?()=>T:h;function uc(qe,pe,Ve){var bn,mi;let{disabled:Be,value:we,id:Ht,label:hn}=pe,gn=(0,Ne.isValidElement)(we),Hr={className:(0,_n.default)((bn=we==null?void 0:we.props)==null?void 0:bn.className,{vuuHighlighted:Ve.value===Se,vuuFocusVisible:Rr===Ve.value,["vuuDraggable-dragAway"]:ie===Ve.value}),disabled:Be||u,id:Ht,item:gn?void 0:(mi=pe==null?void 0:pe.value)!=null?mi:void 0,itemHeight:ui(Ve.value),itemTextHighlightPattern:v,key:Ht,"data-index":Ve.value,label:hn,role:"option",selected:Br(Do,pe),showCheckbox:K};qe.push(gn?(0,Ne.cloneElement)(we,Hr):(0,_e.jsx)(e,{...Hr})),Ve.value+=1}let cc=function(pe,Ve,Be){let{count:we=0,id:Ht,expanded:hn,label:gn=""}=Ve[Be.value],Hr=mn(Be,Ht,gn,hn),bn=hn!==!1?[Hr].concat(ci(Ve,Be,Be.value+we)||[]):Hr;pe.push((0,_e.jsx)("div",{role:"group",children:bn},Ht))},ci=(qe,pe={value:0},Ve=qe.length)=>{let Be=[];for(;pe.value<Ve;){let we=qe[pe.value];we.header?Be.push(mn(pe,we.id,we.label,we.expanded===!1)):we.childNodes?cc(Be,qe,pe):uc(Be,we,pe)}return Be};function dc(){return m||$?(0,_e.jsx)("span",{className:`${wt}-empty-message`,children:m!=null?m:Hd}):null}let di=se.data.length===0,pc=()=>{if(di)dc();else{let qe=se.data;return ci(qe)}},fc="auto",mc={"--list-borderWidth":"var(--vuuList-borderWidth, var(--salt-size-border, 0))","--list-item-gap":x?`${x}px`:void 0,"--computed-list-height":G===void 0?void 0:`${G}px`,minWidth:y,minHeight:V,maxWidth:D,maxHeight:w};return(0,_e.jsxs)(Kn.MeasuredContainer,{"aria-multiselectable":F==="multiple"||F==="extended"||F==="extended-multi-range"||void 0,...ae,...Ue,...Ce,className:(0,_n.default)(wt,s,{[`${wt}-collapsible`]:i,[`${wt}-contentSized`]:G!==void 0,[`${wt}-empty`]:di,vuuFocusVisible:Se===Rn}),height:G!=null?G:b,id:`${de}`,onResize:ze,ref:(0,ha.useForkRef)(he,ee),role:"listbox",onScroll:A,style:{...q,...mc},tabIndex:u||p?void 0:me,children:[(0,_e.jsx)(Zr,{ref:Z,height:T}),se.data.length===0&&t!==void 0?(0,_e.jsx)(_e.Fragment,{children:(0,_e.jsx)(t,{})}):(0,_e.jsx)("div",{className:`${wt}-viewport`,ref:ve,children:(0,_e.jsxs)("div",{className:`${wt}-scrollingContentContainer`,ref:le,style:{height:fc},children:[pc(),Te,re]})})]})});var cr=require("@salt-ds/core");function ba(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(t=ba(r[e]))&&(n&&(n+=" "),n+=t);else for(e in r)r[e]&&(n&&(n+=" "),n+=e);return n}function xs(){for(var r,e,t=0,n="";t<arguments.length;)(r=arguments[t++])&&(e=ba(r))&&(n&&(n+=" "),n+=e);return n}var Ut=require("react");var ya=require("react");var zn=class{constructor(e=0,t=0){this.keys=new Map,this.free=[],this.nextKeyValue=0,this.reset(e,t)}next(){return this.free.length?this.free.pop():this.nextKeyValue++}reset(e,t){this.keys.forEach((o,s)=>{(s<e||s>=t)&&(this.free.push(o),this.keys.delete(s))});let n=t-e;this.keys.size+this.free.length>n&&(this.free.length=n-this.keys.size);for(let o=e;o<t;o++)if(!this.keys.has(o)){let s=this.next();this.keys.set(o,s)}}keyFor(e){return this.keys.get(e)}};var Nd=([r],[e])=>r-e,xa=5,va=({data:r,listItemGapSize:e=0,listItemHeight:t,viewportRange:n})=>{let o=(0,ya.useMemo)(()=>new zn(0,1),[]),s=t+e,i=Math.max(0,n.from-xa),a=Math.min(r.length,n.to+xa);return o.reset(i,a),r.slice(i,a).map((u,p)=>[o.keyFor(p+i),(p+i)*s,p+i+1,u]).sort(Nd)};var zt=require("react/jsx-runtime"),Od="No data to display",Un=(0,cr.makePrefixer)("saltList"),Ad=(0,Ut.memo)(qr),Fd=(0,Ut.forwardRef)(function({borderless:e,children:t,className:n,collapsibleHeaders:o=!1,defaultHighlightedIndex:s,defaultSelected:i,disabled:a=!1,disableFocus:l=!1,disableTypeToSelect:u,displayedItemCount:p=10,emptyMessage:c,getItemHeight:d,getItemId:m,height:f,highlightedIndex:h,id:g,itemGapSize:b=0,itemHeight:E,itemTextHighlightPattern:I,itemToString:x,maxHeight:T,maxWidth:v,minHeight:C,minWidth:H,onDragStart:w,onDrop:D,onSelect:V,onSelectionChange:y,onViewportScroll:k,onHighlight:O,restoreLastFocus:L,selected:M,selectionStrategy:R,scrollingApiRef:S,selectionKeys:N,showEmptyMessage:P=!1,source:B,style:F,stickyHeaders:K,tabToSelect:X,width:W,...$},U){let q=(0,cr.useIdMemo)(g),Q=(0,Ut.useRef)(null),me=(0,Ut.useRef)(null),te=mt({id:q,label:"List",source:B,children:t,options:{collapsibleHeaders:o,getItemId:m,itemToString:x}}),{contentHeight:ae,listItemHeight:ee,listHeight:de}=Bn({borderless:e,displayedItemCount:p,height:f,itemCount:te.data.length,itemGapSize:b,itemHeight:E,rootRef:Q,rowHeightRef:me}),{focusVisible:he,highlightedIndex:ve,listControlProps:le,listHandlers:ge,scrollIntoView:Re,selected:ze}=gt({collapsibleHeaders:o,collectionHook:te,containerRef:Q,defaultHighlightedIndex:s,defaultSelected:te.itemToCollectionItemId(i),disabled:a,disableTypeToSelect:u,highlightedIndex:h,label:q,onSelect:V,onSelectionChange:y,onHighlight:O,restoreLastFocus:L,selected:te.itemToCollectionItemId(M),selectionStrategy:R,selectionKeys:N,stickyHeaders:K,tabToSelect:X}),{onVerticalScroll:se,viewportRange:z}=$n({containerSize:typeof de=="number"?de:0,itemCount:te.data.length,itemGapSize:b,itemSize:ee});console.log({viewPortRange:z});let G=va({data:te.data,listItemGapSize:b,listItemHeight:ee,viewportRange:z});Qr({collectionHook:te,forwardedRef:S,scrollableRef:Q,scrollIntoView:Re});function j(ie,Te,He){let[Se,Ce,Ue,Ge]=Te,Ze=Ue-1;ie.push((0,zt.jsx)(Ad,{"aria-setsize":te.data.length,"aria-posinset":Ue,className:xs(n,{saltHighlighted:Ze===ve,saltFocusVisible:he===Ze}),"data-idx":Ze,item:Ge,label:Ge.label,"data-offset":Ce,role:"option",selected:Br(ze,Ge),id:Ge.id,translate3d:Ce},Se)),He.value+=1}function Z(ie,Te={value:0},He=ie.length){let Se=[];for(;Te.value<He;){let Ce=ie[Te.value];j(Se,Ce,Te)}return Se}function A(){return c||P?(0,zt.jsx)("span",{className:Un("empty-message"),children:c!=null?c:Od}):null}let _=()=>{if(G.length)return Z(G);A()},re={"--list-item-gap":b?`${b}px`:void 0,minWidth:H,minHeight:C,width:W!=null?W:"100%",height:f!=null?f:"100%",maxWidth:v!=null?v:W,maxHeight:T!=null?T:de};return(0,zt.jsx)("div",{...$,...ge,...le,className:xs(Un(),n,Un("virtualized")),id:`${q}`,ref:(0,cr.useForkRef)(Q,U),role:"listbox",onScroll:se,style:{...F,...re},tabIndex:a||l?void 0:0,children:(0,zt.jsxs)("div",{className:Un("scrollingContentContainer"),style:{height:ae},children:[(0,zt.jsx)(Zr,{ref:me}),_()]})})});var Ia=Y(require("classnames"));var Ta=require("react/jsx-runtime"),Sa="vuuRadioIcon",ys=({checked:r=!1,...e})=>(0,Ta.jsx)("span",{...e,className:(0,Ia.default)(Sa,{[`${Sa}-checked`]:r})});var Ca=require("@salt-ds/core"),dr=require("react");var wa=({collectionHook:r,defaultHighlightedIndex:e,defaultIsOpen:t,defaultSelected:n,highlightedIndex:o,isOpen:s,itemToString:i=De,listRef:a,onHighlight:l,onOpenChange:u,onSelectionChange:p,onSelect:c,selected:d,selectionStrategy:m})=>{let f=Ot(m),[h,g]=(0,Ca.useControlled)({controlled:s,default:t!=null?t:!1,name:"useDropdownList"}),b=(0,dr.useCallback)((v,C)=>{f||(g(!1),u==null||u(!1)),(Array.isArray(C)||C)&&(p==null||p(v,C))},[f,u,p,g]),E=(0,dr.useCallback)((v,C)=>{f||(g(!1),u==null||u(!1)),c==null||c(v,C)},[f,u,c,g]),I=gt({collectionHook:r,defaultHighlightedIndex:(e!=null?e:o===void 0)?0:void 0,defaultSelected:n,label:"DropDown",onSelectionChange:b,onSelect:E,containerRef:a,highlightedIndex:o,onHighlight:l,selected:d,selectionStrategy:m,tabToSelect:!f}),x=(0,dr.useCallback)(v=>{g(v),u==null||u(v)},[u,g]),T=(0,dr.useMemo)(()=>{if(Array.isArray(I.selected)){let v=I.selected.map(C=>r.itemById(C));if(v.length===0)return;if(v.length===1){let[C]=v;return C===null?void 0:i(C)}else return`${v.length} items selected`}},[r,i,I.selected]);return{isOpen:h,onOpenChange:x,triggerLabel:T,...I}};var pr=require("react/jsx-runtime"),Vd=(0,bt.forwardRef)(function({"aria-label":e,children:t,defaultIsOpen:n,defaultSelected:o,id:s,isOpen:i,itemToString:a=De,onOpenChange:l,onSelectionChange:u,onSelect:p,selected:c,selectionStrategy:d,source:m,triggerComponent:f,ListItem:h,ListProps:g,width:b=180,...E},I){let x=(0,Da.useId)(s),T=(0,bt.useRef)(null),v=(0,bt.useRef)(null),C=(0,Ea.useForkRef)(T,I),H=mt({id:x,source:m,children:t,options:{itemToString:a}}),{highlightedIndex:w,triggerLabel:D,listHandlers:V,listControlProps:y,selected:k,...O}=wa({collectionHook:H,defaultHighlightedIndex:g==null?void 0:g.defaultHighlightedIndex,defaultIsOpen:n,defaultSelected:H.itemToCollectionItemId(o),highlightedIndex:g==null?void 0:g.highlightedIndex,isOpen:i,itemToString:a,listRef:v,onHighlight:g==null?void 0:g.onHighlight,onOpenChange:l,onSelectionChange:u,onSelect:p,selected:H.itemToCollectionItemId(c),selectionStrategy:d}),L=(0,bt.useCallback)(R=>Array.isArray(R)?R.map(N=>H.itemById(N)):H.itemById(R),[H]),M=()=>{let R={"aria-activedescendant":O.isOpen?y==null?void 0:y["aria-activedescendant"]:void 0,"aria-label":e};if(f){let S=f.props;return(0,bt.cloneElement)(f,Vr(S,{...O.isOpen?y:{},...R}))}else return(0,pr.jsx)(Wo,{label:D,...O.isOpen?y:{},...R})};return(0,pr.jsx)(Nr,{collectionHook:H,children:(0,pr.jsxs)(At,{...E,id:x,isOpen:O.isOpen,onOpenChange:O.onOpenChange,placement:(g==null?void 0:g.width)===void 0?"below-full-width":"below",ref:C,width:b,children:[M(),(0,pr.jsx)(ur,{ListItem:h,itemToString:a,...g,highlightedIndex:w,listHandlers:V,onSelectionChange:u,onSelect:p,ref:v,selected:k===void 0?void 0:L(k),selectionStrategy:d})]})})});var vs=require("@salt-ds/core"),Ma=require("@vuu-ui/vuu-layout"),ce=require("react");var Bd=["Enter"],Pa=({allowFreeText:r,ariaLabel:e,collectionHook:t,defaultIsOpen:n,defaultSelected:o,defaultValue:s,onBlur:i,onFocus:a,onChange:l,onSelect:u,id:p,initialHighlightedIndex:c=-1,isOpen:d,itemCount:m,itemsToString:f,itemToString:h=De,listRef:g,onOpenChange:b,onSelectionChange:E,onSetSelectedText:I,selected:x,selectionStrategy:T,value:v,InputProps:C={onBlur:i,onFocus:a,onChange:l,onSelect:u}})=>{let H=Ot(T),{setFilterPattern:w}=t,D=(0,ce.useRef)(null),V=(0,ce.useRef)(H?[]:null),y=(0,ce.useRef)(!0),[k,O]=(0,vs.useControlled)({controlled:d,default:n!=null?n:!1,name:"useDropdownList"}),[L,M]=(0,vs.useControlled)({controlled:void 0,default:s!=null?s:v,name:"ComboBox",state:"value"}),[R,S]=(0,ce.useState)(!0),N=(0,ce.useCallback)(A=>{var _;Array.isArray(A)?console.log("TODO multi selection"):A==null&&((_=D.current)==null||_.call(D,-1))},[]),P=(0,ce.useCallback)((A,_=!0)=>{M(A),_&&w(A===""?void 0:A)},[w,M]),B=(0,ce.useCallback)(A=>{let _=r&&L!=null?L:"";return Array.isArray(A)?A.length===1?_=h(A[0]):A.length>1&&(_=(f==null?void 0:f(A))||""):A&&(_=h(A)),_!==L?(P(_,!H),I==null||I(_),!0):!1},[r,H,h,f,I,P,L]),F=(0,ce.useCallback)(()=>{let{current:A}=V;B(A)&&A&&(Array.isArray(A)||A)&&(E==null||E(null,A))},[E,B]),K=(0,ce.useCallback)(()=>{if(r){let A=L==null?void 0:L.trim(),{current:_}=V;if(A){if(m===0&&A)return H?E==null||E(null,[A]):E==null||E(null,A),V.current=null,!0;_&&!H&&_&&!Array.isArray(_)&&h(_)}}return!1},[r,L,m,H,E,h]),X=(0,ce.useCallback)((A,_)=>{A&&H&&P("",!1),O(A),b==null||b(A),!A&&_!=="Escape"&&(K()||F())},[F,H,b,K,O,P]),W=(0,ce.useCallback)((A,_)=>{V.current=_,H||X(!1,"select")},[X,H]),$=(0,ce.useCallback)(()=>{S(!1)},[]),{focusVisible:U,setHighlightedIndex:q,highlightedIndex:Q,listControlProps:me,listHandlers:te,selected:ae}=gt({collectionHook:t,containerRef:g,defaultHighlightedIndex:c,defaultSelected:t.itemToCollectionItemId(o),disableAriaActiveDescendant:R,disableHighlightOnFocus:!0,disableTypeToSelect:!0,onKeyboardNavigation:$,onSelectionChange:W,selected:t.itemToCollectionItemId(x),selectionKeys:Bd,selectionStrategy:T,tabToSelect:!H});D.current=q;let{onClick:ee}=te,de=(0,ce.useCallback)(A=>{var _;(_=document.getElementById(`${p}-input`))==null||_.focus(),ee==null||ee(A)},[p,ee]),he=(0,ce.useCallback)(A=>{let _=A.target.value;M(_),_&&_.trim().length?w(_):w(void 0),O(!0)},[w,O,M]),{onFocus:ve=a}=C,{onFocus:le}=me,ge=(0,ce.useCallback)(A=>{S(!1),le==null||le(A),ve==null||ve(A)},[ve,le]),Re=(0,ce.useCallback)(A=>{let _=A.relatedTarget;return(_==null?void 0:_.id)===`${p}-list`},[p]),{onBlur:ze=i}=C,{onBlur:se}=me,z=(0,ce.useCallback)(A=>{Re(A)||(se==null||se(A),ze==null||ze(A),S(!0),y.current=!0)},[Re,se,ze]),{onSelect:G}=C,j=(0,ce.useCallback)(A=>{y.current?y.current=!1:S(!0),G==null||G(A)},[G]);(0,Ma.useLayoutEffectSkipFirst)(()=>{st(ae)?N(ae):q(c)},[N,m,c,ae,q,O]);let Z={...C.inputProps,"aria-label":e,autoComplete:"off"};return{focusVisible:U,highlightedIndex:Q,isOpen:k,onOpenChange:X,inputProps:{...C,id:`${p}-input`,inputProps:Z,onChange:he,onSelect:j,role:"combobox",value:L},listControlProps:{...me,onBlur:z,onFocus:ge},listHandlers:{...te,onClick:de},selected:V.current}};var La=Y(require("classnames"));var Ra=require("react/jsx-runtime"),$d="vuuChevronIcon",ka=r=>{let{direction:e,...t}=r;return(0,Ra.jsx)("span",{...t,className:(0,La.default)($d,e)})};var Gt=require("react/jsx-runtime"),Oa=(0,fr.forwardRef)(function({InputProps:e,ListProps:t,PopupProps:n,ListItem:o,"aria-label":s,allowFreeText:i,children:a,defaultIsOpen:l,defaultSelected:u,defaultValue:p,disabled:c,onBlur:d,onFocus:m,onChange:f,onSelect:h,onSetSelectedText:g,getFilterRegex:b,id:E,initialHighlightedIndex:I=-1,isOpen:x,itemToString:T=De,itemsToString:v,onOpenChange:C,onSelectionChange:H,selected:w,selectionStrategy:D,source:V,value:y,width:k=180,...O},L){let M=(0,Ha.useId)(E),R=(0,fr.useRef)(null),S=ee=>Array.isArray(ee)&&ee.length>0?ee[0]:void 0,P=((ee,de)=>{let he=ee?S(ee):de?S(de):void 0;return he?T(he):""})(w,u),B=mt({id:M,source:V,children:a,options:{filterPattern:P,getFilterRegex:b,itemToString:T}}),{focusVisible:F,highlightedIndex:K,inputProps:{endAdornment:X,...W},isOpen:$,listHandlers:U,listControlProps:q,onOpenChange:Q,selected:me}=Pa({InputProps:e,allowFreeText:i,ariaLabel:s,collectionHook:B,defaultIsOpen:l,defaultSelected:u,defaultValue:p,disabled:c,initialHighlightedIndex:I,itemCount:B.data.length,label:O.title,listRef:R,onBlur:d,onFocus:m,onChange:f,onSelect:h,id:M,isOpen:x,itemToString:T,itemsToString:v,onOpenChange:C,onSelectionChange:H,onSetSelectedText:g,selected:w,selectionStrategy:D,value:P}),te=(0,fr.useCallback)(()=>{$?Q(!1,"toggle"):Q(!0)},[$,Q]);return(0,Gt.jsx)(Nr,{collectionHook:B,children:(0,Gt.jsxs)(At,{...O,PopupProps:n,id:M,isOpen:$,onOpenChange:Q,openOnFocus:!0,ref:L,width:k,children:[(0,Gt.jsx)(Na.Input,{...W,disabled:c,...q,endAdornment:X===null?null:(0,Gt.jsx)(ka,{direction:$?"up":"down",onClick:te})}),(0,Gt.jsx)(ur,{...t,ListItem:o,defaultSelected:void 0,focusVisible:F,highlightedIndex:K,itemTextHighlightPattern:String(W.value)||void 0,id:`${M}-list`,listHandlers:U,onSelectionChange:H,ref:R,selected:me,selectionStrategy:D,tabIndex:-1})]})})});var Fa=require("@salt-ds/core"),Va=Y(require("classnames")),Gn=require("react"),Ba=require("react/jsx-runtime"),Aa="vuuCycleStateButton",_d=(r,e)=>{let t=e.indexOf(r.toUpperCase());return t===e.length-1?e[0]:e[t+1]},Kd=(0,Gn.forwardRef)(function({className:e,onCommit:t,value:n="",values:o,...s},i){let a=(0,Gn.useCallback)(l=>{let u=_d(n,o);t(l,u).then(p=>{p!==!0&&console.error(p)})},[t,n,o]);return(0,Ba.jsx)(Fa.Button,{...s,className:(0,Va.default)(Aa,e,`${Aa}-${n.toLowerCase()}`),onClick:a,ref:i,children:n})});var $a=require("@vuu-ui/vuu-utils"),zd=r=>e=>Ud(r,e);function Ud(r,e){let t;for(let n of r){let o=(0,$a.getEditRuleValidator)(n.name);if(o){let s=o(n,e);switch(s){case!0:break;case!1:t===void 0&&(t=!1);break;default:t===void 0||t===!1?t=s:t+=`::${s}`}}else throw Error(`editable-utils applyRules, no validator registered for rule '${n.name}'`)}return t}var _a=require("@vuu-ui/vuu-layout"),Ss=require("@vuu-ui/vuu-utils"),je=require("react"),Gd=()=>(console.warn("onCommit handler has not been provided to InputCell cell renderer"),Promise.resolve(!0)),Wd=({clientSideEditValidationCheck:r,initialValue:e,onCommit:t,type:n})=>{let[o,s]=(0,je.useState)(),[i,a]=(0,je.useState)(e),l=(0,je.useRef)(e),u=(0,je.useRef)(!1),p=(0,je.useRef)(!1);(0,_a.useLayoutEffectSkipFirst)(()=>{a(e)},[e]);let c=(0,je.useCallback)(h=>{if(u.current){p.current=!0;let g=r==null?void 0:r(i);g?s(g):(s(void 0),console.log(`commit value ${i}`),t(i).then(b=>{b===!0?(u.current=!1,(0,Ss.dispatchCustomEvent)(h,"vuu-commit")):s(b)}))}else(0,Ss.dispatchCustomEvent)(h,"vuu-commit"),p.current=!1},[r,t,i]),d=(0,je.useCallback)(h=>{h.key==="Enter"?c(h.target):h.key==="ArrowRight"||h.key==="ArrowLeft"||h.key==="ArrowUp"||h.key==="ArrowDown"?h.stopPropagation():h.key==="Escape"&&u.current&&(u.current=!1,s(void 0),a(l.current))},[c]),m=(0,je.useCallback)(h=>{u.current&&c(h.target)},[c]),f=(0,je.useCallback)(h=>{let g=h.target.value;if(n==="number"&&!isNaN(parseFloat(g))&&(g=parseFloat(g)),u.current=i!==l.current,a(g),p.current&&i!==void 0){let b=r==null?void 0:r(i);b!==o&&b!==!1&&s(b)}},[r,o,n,i]);return{inputProps:{onBlur:m,onKeyDown:d},onChange:f,value:i!=null?i:"",warningMessage:o}};var Ka=Y(require("classnames")),et=require("react"),tn=require("@salt-ds/core");var Qn=require("react/jsx-runtime"),Wn="vuuEditableLabel",Is=(0,et.forwardRef)(function({className:e,defaultEditing:t,defaultValue:n,editing:o,onChange:s,onEnterEditMode:i,onExitEditMode:a,value:l,...u},p){let c=(0,et.useRef)(null),d=(0,et.useRef)(!1),[m,f]=(0,tn.useControlled)({controlled:l,default:n!=null?n:"",name:"EditableLabel",state:"value"}),[h,g]=(0,tn.useControlled)({controlled:o,default:t!=null?t:!1,name:"EditableLabel",state:"editing"}),b=(0,et.useCallback)(D=>{g(d.current=D)},[g]),E=(0,et.useRef)(m);(0,et.useLayoutEffect)(()=>{h&&c.current!==null&&(c.current.select(),c.current.focus())},[h,c]);let I=(0,et.useCallback)(()=>{b(!0),i&&i()},[i,b]),x=({cancelEdit:D=!1,allowDeactivation:V=!1}={})=>{b(!1);let y=E.current;y!==m&&(D?f(y):E.current=m),a&&a(y,m,V,D)},T=D=>{let{value:V}=D.target;f(V),s&&s(V)},v=()=>{I()},C=()=>{d.current&&x({allowDeactivation:!0})},H=D=>{h&&D.key==="Enter"?(D.stopPropagation(),x()):D.key==="ArrowRight"||D.key==="ArrowLeft"?D.stopPropagation():D.key==="Escape"&&x({cancelEdit:!0})},w=(0,Ka.default)(Wn,e,{[`${Wn}-editing`]:h});return(0,Qn.jsx)("div",{...u,className:w,onDoubleClick:v,"data-text":m,ref:p,children:h?(0,Qn.jsx)(tn.Input,{inputProps:{className:`${Wn}-input`,spellCheck:!1},value:m,onBlur:C,onChange:T,onKeyDown:H,inputRef:c,style:{padding:0},textAlign:"left",variant:"secondary"}):(0,Qn.jsx)("span",{className:`${Wn}-label`,children:m})})});var za=Y(require("classnames")),Ua=require("react");var Cs=require("react/jsx-runtime"),Ts="vuuExpandoInput",Qd=()=>{},jd=(0,Ua.forwardRef)(function({className:e,errorMessage:t,value:n,inputProps:o,onCommit:s=Qd,...i},a){return(0,Cs.jsx)("div",{className:(0,za.default)(Ts,e,{[`${Ts}-error`]:t}),"data-text":n,children:(0,Cs.jsx)(jn,{...i,errorMessage:t,inputProps:{...o,className:`${Ts}-input`},onCommit:s,ref:a,style:{padding:0},textAlign:"left",value:n,variant:"secondary"})})});var Xn=require("react/jsx-runtime"),Ga=r=>{let{onToggle:e,checked:t,label:n}=r;return(0,Xn.jsxs)("div",{className:"vuuCheckbox",onClick:e,onKeyUp:o=>o.key===" "&&e(),children:[(0,Xn.jsx)(jr,{tabIndex:0,checked:t}),n]})};var mr=require("react/jsx-runtime"),Wa=r=>{let{onClick:e,checked:t,label:n,groupName:o}=r;return(0,mr.jsxs)("div",{className:"vuuRadioButton",onClick:e,children:[(0,mr.jsxs)("div",{className:"radio",children:[(0,mr.jsx)("input",{type:"radio",name:o}),(0,mr.jsx)(ys,{checked:t})]}),n]})};var Za=require("@vuu-ui/vuu-layout"),qa=require("@vuu-ui/vuu-table"),Ja=require("@salt-ds/core"),qn=require("react");var Qa=require("@vuu-ui/vuu-utils");var Zn=require("react/jsx-runtime"),Xd="vuuSearchCell",Zd=({column:r,columnMap:e,row:t})=>{let n=e[r.name],o=t[n];return(0,Zn.jsxs)("div",{className:Xd,tabIndex:-1,children:[(0,Zn.jsx)("span",{"data-icon":"draggable"}),o]})};(0,Qa.registerComponent)("search-cell",Zd,"cell-renderer",{serverDataType:"private"});var ja=require("@vuu-ui/vuu-table"),Et=require("react");var qd=(r,e)=>t=>r.map(({name:n})=>t[e[n]]).join(" "),Xa=({columnMap:r,columns:e,dataSource:t,defaultIsOpen:n,isOpen:o,itemToString:s=qd(e,r),onOpenChange:i,onSelect:a,searchColumns:l})=>{let[u,p]=(0,Et.useState)(""),[c,d]=$r({controlled:o,default:n!=null?n:!1,name:"useDropdownList"}),{highlightedIndexRef:m,onKeyDown:f,tableRef:h}=(0,ja.useControlledTableNavigation)(-1,t.size),g=(0,Et.useMemo)(()=>l.map(v=>`${v} starts "__VALUE__"`).join(" or "),[l]),b=(0,Et.useCallback)((v,C)=>{d(v),i==null||i(v,C)},[i,d]),E=(0,Et.useCallback)(v=>{let{value:C}=v.target;if(p(C),C&&C.trim().length){let H=g.replaceAll("__VALUE__",C);t.filter={filter:H}}else t.filter={filter:""};d(!0)},[g,t,d]),I=(0,Et.useCallback)(v=>{let C=s(v);p(C),a(v),b==null||b(!1,"select")},[b,s,a]),x={inputProps:{autoComplete:"off",onKeyDown:f},onChange:E},T={onSelect:I};return{highlightedIndex:m.current,inputProps:x,isOpen:c,onOpenChange:b,tableHandlers:T,tableRef:h,value:u}};var hr=require("react/jsx-runtime"),Jd="vuuInstrumentPicker",Yd=(0,qn.forwardRef)(function({TableProps:{dataSource:e,...t},className:n,columnMap:o,disabled:s,id:i,itemToString:a,onOpenChange:l,onSelect:u,schema:p,searchColumns:c,width:d,...m},f){let h=(0,Za.useId)(i),{highlightedIndex:g,inputProps:b,isOpen:E,onOpenChange:I,tableHandlers:x,tableRef:T,value:v}=Xa({columnMap:o,columns:t.config.columns,dataSource:e,itemToString:a,onOpenChange:l,onSelect:u,searchColumns:c}),C=(0,qn.useMemo)(()=>(0,hr.jsx)("span",{"data-icon":"chevron-down"}),[]),H={...t,config:{...t.config,zebraStripes:!1}};return(0,hr.jsxs)(At,{...m,fullWidth:!0,id:h,isOpen:E,onOpenChange:I,openOnFocus:!0,placement:"below-full-width",ref:f,width:d,children:[(0,hr.jsx)(Ja.Input,{...b,disabled:s,endAdornment:C,value:v}),(0,hr.jsx)(qa.Table,{rowHeight:25,renderBufferSize:100,...H,...x,className:`${Jd}-list`,height:200,highlightedIndex:g,dataSource:e,navigationStyle:"row",ref:T,showColumnHeaders:!1})]})});var tu=require("@vuu-ui/vuu-layout"),po=require("@vuu-ui/vuu-table"),ru=require("@salt-ds/core"),nu=Y(require("classnames")),ou=require("react");var Ya=require("@vuu-ui/vuu-utils");var Jn=require("react/jsx-runtime"),ep="vuuSearchCell",tp=({column:r,columnMap:e,row:t})=>{let n=e[r.name],o=t[n];return(0,Jn.jsxs)("div",{className:ep,tabIndex:-1,children:[(0,Jn.jsx)("span",{"data-icon":"draggable"}),o]})};(0,Ya.registerComponent)("search-cell",tp,"cell-renderer",{serverDataType:"private"});var ql=require("@vuu-ui/vuu-data");var Yn=require("@vuu-ui/vuu-utils"),rn=require("react"),{SELECTED:rv}=Yn.metadataKeys;var Bp=require("@vuu-ui/vuu-data");var sp=require("react"),ip=Y(require("classnames")),ap=require("@vuu-ui/vuu-layout");var eo=require("react"),ws=require("@salt-ds/core");var rp=require("react"),el=require("react/jsx-runtime");var np=Y(require("classnames"));var tl=require("react/jsx-runtime");var op=require("@vuu-ui/vuu-utils");var lp=require("@salt-ds/core"),rl=require("react/jsx-runtime");var Es=Y(require("react")),up=Y(require("classnames"));var Ds=require("react/jsx-runtime");var cp=require("react"),dp=Y(require("classnames")),pp=require("react/jsx-runtime");var Qt=Y(require("react")),al=require("@vuu-ui/vuu-layout");var nl=Y(require("react")),Wt=require("react/jsx-runtime"),to=class extends nl.default.Component{constructor(e){super(e),this.state={errorMessage:null}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidCatch(e,t){console.log(`error creating component at ${this.props.url}`),console.log(e,t)}render(){return this.state.errorMessage?(0,Wt.jsxs)(Wt.Fragment,{children:[(0,Wt.jsx)("h1",{children:"An error occured while creating component."}),(0,Wt.jsx)("p",{children:this.state.errorMessage})]}):this.props.children}};var sl=require("react/jsx-runtime"),ol=()=>(0,sl.jsx)("div",{className:"hwLoader"});var il=async r=>{let e=new CSSStyleSheet;return fetch(r).then(t=>t.text()).then(t=>e.replace(t))};var nn=require("react/jsx-runtime"),ro=new Map,fp=r=>{(0,Qt.useEffect)(()=>()=>{ro.delete(r)},[r]),ro.has(r)||ro.set(r,Qt.default.lazy(()=>import(r)));let e=ro.get(r);if(e)return e;throw Error(`Unable to load Lazy Feature at url ${r}`)};function mp({url:r,css:e,ComponentProps:t,...n}){e&&il(e).then(s=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,s]});let o=fp(r);return(0,nn.jsx)(to,{url:r,children:(0,nn.jsx)(Qt.Suspense,{fallback:(0,nn.jsx)(ol,{}),children:(0,nn.jsx)(o,{...n,...t})})})}var Ms=Qt.default.memo(mp);Ms.displayName="Feature";(0,al.registerComponent)("Feature",Ms,"view");var ll=require("react"),on=require("@salt-ds/core");var hp=require("@vuu-ui/vuu-utils");var ul=require("react/jsx-runtime"),gp="saveLayoutPanel",eS=`${gp}-formField`;var jt=Y(require("react")),sn=require("@vuu-ui/vuu-layout"),cl=require("@vuu-ui/vuu-popups"),bp=require("react/jsx-runtime");var aS=jt.default.createContext({layoutMetadata:[],saveLayout:()=>{},applicationJson:sn.defaultApplicationJson,saveApplicationLayout:()=>{},saveApplicationSettings:()=>{},loadLayoutById:()=>{}});var Ps=require("react/jsx-runtime");var dl=require("react"),fe=require("react/jsx-runtime"),pl=(0,dl.memo)(()=>(0,fe.jsxs)("svg",{width:"44",height:"45",viewBox:"0 0 44 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,fe.jsxs)("g",{clipPath:"url(#clip0_217_6990)",children:[(0,fe.jsx)("path",{d:"M39.8642 15.5509L35.9196 7.58974L34.3369 6.85464L24.6235 22.0825L39.1628 30.618L42.3152 25.6347L39.8642 15.5509Z",fill:"url(#paint0_linear_217_6990)"}),(0,fe.jsx)("path",{d:"M42.6246 24.8716C41.9199 25.9157 40.9625 26.824 39.767 27.4905C38.424 28.2396 36.9563 28.597 35.5081 28.597C32.7541 28.597 30.0715 27.3094 28.4466 24.9855L15.772 3.90967L15.7655 3.9206C13.3615 0.137431 8.25372 -1.13143 4.24754 1.10507C0.178173 3.37435 -1.20852 8.39359 1.14854 12.3125L18.3445 40.9095C19.1108 42.1846 20.1816 43.1834 21.4144 43.8764C21.4241 43.8826 21.4338 43.8889 21.4435 43.8951C21.4484 43.8982 21.4549 43.9013 21.4597 43.9045C22.0332 44.2228 22.6423 44.471 23.2725 44.6536C23.3194 44.6677 23.368 44.6817 23.415 44.6942C23.6418 44.7551 23.8702 44.8097 24.1019 44.8534C24.1456 44.8612 24.1894 44.8659 24.2331 44.8737C24.4194 44.9049 24.6073 44.9314 24.7952 44.9501C24.8698 44.9579 24.9443 44.9658 25.0188 44.9704C25.2342 44.9876 25.4497 44.9985 25.6668 45.0001C25.6781 45.0001 25.6895 45.0001 25.6992 45.0001C25.7024 45.0001 25.704 45.0001 25.7073 45.0001C25.7105 45.0001 25.7121 45.0001 25.7154 45.0001C25.9503 45.0001 26.1868 44.9876 26.4217 44.9689C26.4751 44.9642 26.5286 44.9595 26.5837 44.9533C26.8137 44.9299 27.0438 44.9002 27.2738 44.8596C27.277 44.8596 27.2803 44.8596 27.2835 44.8596C27.5362 44.8144 27.7889 44.7551 28.0384 44.6864C28.0546 44.6817 28.0692 44.677 28.0854 44.6723C28.4483 44.5709 28.8063 44.4445 29.1594 44.2931C29.1659 44.29 29.174 44.2868 29.1805 44.2837C29.4494 44.1682 29.7151 44.0418 29.9759 43.8967C30.24 43.75 30.491 43.5908 30.7308 43.4206C30.9398 43.2739 31.1407 43.1179 31.3367 42.9524C31.5748 42.7495 31.8 42.5373 32.009 42.3141C32.1661 42.1471 32.3168 41.9723 32.4609 41.7913C32.5079 41.732 32.5517 41.6711 32.5954 41.6118C32.6942 41.4807 32.7882 41.3465 32.8789 41.2091C32.9259 41.1373 32.9728 41.0671 33.0182 40.9953C33.036 40.9672 33.0555 40.9407 33.0717 40.9126L42.7153 24.8763H42.6214L42.6246 24.8716Z",fill:"url(#paint1_linear_217_6990)"}),(0,fe.jsx)("path",{d:"M42.8402 16.4218L42.1112 15.2232L38.9636 9.58433L37.504 7.19644C37.2286 6.56123 36.579 6.11331 35.8176 6.11331C34.8083 6.11331 33.9919 6.90147 33.9919 7.87223C33.9919 8.20154 34.0907 8.50432 34.2543 8.76808L34.2349 8.78056L39.9048 18.0808C40.5884 19.2186 40.7715 20.5437 40.4199 21.8141C40.0684 23.0845 39.226 24.1458 38.045 24.806C37.2675 25.2398 36.3846 25.4693 35.4936 25.4693C33.6727 25.4693 31.9766 24.5281 31.0662 23.0143L22.9161 9.63271H22.9323L19.4899 3.90958L19.4834 3.92051C19.4235 3.8253 19.3538 3.73947 19.2907 3.64738L19.1935 3.48663C19.1935 3.48663 19.1854 3.49131 19.1821 3.49443C17.5654 1.27666 14.9799 0.0390178 12.3118 0.00936427V0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.961 26.8255 41.9168 25.9156 42.6231 24.8731H42.717L42.6846 24.9261C43.1366 24.2347 43.4833 23.4731 43.7068 22.6615C44.2916 20.5452 43.9871 18.3352 42.8369 16.4234L42.8402 16.4218Z",fill:"#F37880"}),(0,fe.jsxs)("g",{opacity:"0.86",children:[(0,fe.jsx)("path",{d:"M34.2332 8.78212L39.9031 18.0824C40.5868 19.2202 40.7698 20.5452 40.4183 21.8156C40.2044 22.5897 39.8059 23.2858 39.2616 23.8617C39.9744 23.2343 40.4879 22.4243 40.7423 21.5035C41.0938 20.2331 40.9107 18.908 40.2271 17.7703L34.5572 8.46998L34.5767 8.4575C34.413 8.19374 34.3142 7.89096 34.3142 7.56165C34.3142 7.15586 34.4584 6.78285 34.6982 6.48476C34.2672 6.80626 33.9902 7.30881 33.9902 7.87379C33.9902 8.2031 34.0891 8.50588 34.2527 8.76964L34.2332 8.78212Z",fill:"white"}),(0,fe.jsx)("path",{d:"M42.6917 24.9169L42.6863 24.9256C42.6863 24.9256 42.6899 24.9187 42.6935 24.9152C42.6935 24.9152 42.6935 24.9152 42.6935 24.9169H42.6917Z",fill:"white"}),(0,fe.jsx)("path",{d:"M40.0911 27.1798C38.7481 27.9289 37.2804 28.2863 35.8322 28.2863C33.0782 28.2863 30.3955 26.9988 28.7707 24.6749L16.0961 3.59744L16.0896 3.60837C14.9281 1.78077 13.1364 0.543128 11.1422 0H7.91199V0.02185C10.9851 -0.184164 14.0582 1.23296 15.7656 3.92051L15.7721 3.90958L28.4451 24.987C30.0699 27.3093 32.7542 28.5985 35.5066 28.5985C36.9548 28.5985 38.4225 28.2426 39.7655 27.4919C40.4815 27.0924 41.1084 26.6055 41.6511 26.0561C41.1862 26.479 40.6662 26.8583 40.0894 27.1798H40.0911Z",fill:"white"})]})]}),(0,fe.jsxs)("defs",{children:[(0,fe.jsxs)("linearGradient",{id:"paint0_linear_217_6990",x1:"24.6235",y1:"18.7363",x2:"42.3152",y2:"18.7363",gradientUnits:"userSpaceOnUse",children:[(0,fe.jsx)("stop",{stopColor:"#4906A5"}),(0,fe.jsx)("stop",{offset:"1",stopColor:"#D3423A"})]}),(0,fe.jsxs)("linearGradient",{id:"paint1_linear_217_6990",x1:"-2.35794e-05",y1:"22.5009",x2:"42.7186",y2:"22.5009",gradientUnits:"userSpaceOnUse",children:[(0,fe.jsx)("stop",{stopColor:"#7C06A5"}),(0,fe.jsx)("stop",{offset:"1",stopColor:"#D3423A"})]}),(0,fe.jsx)("clipPath",{id:"clip0_217_6990",children:(0,fe.jsx)("rect",{width:"44",height:"45",fill:"white"})})]})]}));pl.displayName="VuuLogo";var yl=require("@vuu-ui/vuu-layout");var Cp=Y(require("classnames"));var vl=require("react");var fl=require("@vuu-ui/vuu-layout");var ml=require("react/jsx-runtime");var Dt=require("react"),gl=Y(require("classnames")),xl=require("react/jsx-runtime"),yp="medium",vp="salt-theme",Sp="light",hl=(0,Dt.createContext)({density:"high",theme:"vuu",themeMode:"light"});var Ip=(r,e,t,n)=>{var o;return(0,Dt.isValidElement)(r)?(0,Dt.cloneElement)(r,{className:(0,gl.default)((o=r.props)==null?void 0:o.className,`${e}-theme`,`${e}-density-${n}`),"data-mode":t}):(console.warn(`
|
|
4
4
|
ThemeProvider can only apply CSS classes for theming to a single nested child element of the ThemeProvider.
|
|
5
|
-
Wrap elements with a single container`),r)},bl=({applyThemeClasses:r=!1,children:e,theme:t,themeMode:n,density:o})=>{var d,m,f;let{density:s,themeMode:i,theme:a}=(0,Dt.useContext)(hl),l=(d=o!=null?o:s)!=null?d:yp,u=(m=n!=null?n:i)!=null?m:Sp,p=(f=t!=null?t:a)!=null?f:vp,c=r?Ip(e,p,u,l):e;return(0,xl.jsx)(hl.Provider,{value:{themeMode:u,density:l,theme:p},children:c})};bl.displayName="ThemeProvider";var Sl=require("react/jsx-runtime");var an=require("react"),wp=Y(require("classnames")),Ep=require("@salt-ds/core"),Dp=require("@salt-ds/core"),Ls=require("@vuu-ui/vuu-data"),ks=require("@vuu-ui/vuu-utils");var Cl=require("react/jsx-runtime");var Hp=require("@vuu-ui/vuu-data"),no=require("@vuu-ui/vuu-layout"),Ll=require("@vuu-ui/vuu-utils"),Np=Y(require("classnames")),Ns=require("react");var Mp=require("@salt-ds/core"),Pp=Y(require("classnames")),wl=require("react"),Rs=require("@vuu-ui/vuu-layout");var El=require("react/jsx-runtime");var Dl=require("@vuu-ui/vuu-layout");var Lp=require("react"),kp=Y(require("classnames"));var Rp=require("react/jsx-runtime");var Ml=require("react/jsx-runtime");var ln=require("@vuu-ui/vuu-layout"),Hs=require("react"),Pl=require("react/jsx-runtime");var kl=require("@vuu-ui/vuu-popups");var Rl=require("react/jsx-runtime"),{error:t0}=(0,Ll.logger)("Shell");var Os=require("react"),Ap=require("react/jsx-runtime"),Op={},i0=(0,Os.createContext)(Op);var Fp=Y(require("classnames")),As=require("@salt-ds/core"),Vp=require("react");var Hl=require("react/jsx-runtime");var Fs=require("@vuu-ui/vuu-utils"),Nl=require("react");var Vs=require("react"),$p=require("@vuu-ui/vuu-data");var Bs=require("react"),_p=require("@vuu-ui/vuu-data");var Kp=require("react"),zp=require("@vuu-ui/vuu-data");var Up=0,un=class{constructor(e,t){this.from=e,this.to=t}},oe=class{constructor(e={}){this.id=Up++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};oe.closedBy=new oe({deserialize:r=>r.split(" ")});oe.openedBy=new oe({deserialize:r=>r.split(" ")});oe.group=new oe({deserialize:r=>r.split(" ")});oe.contextHash=new oe({perNode:!0});oe.lookAhead=new oe({perNode:!0});oe.mounted=new oe({perNode:!0});var Gp=Object.create(null),Oe=class{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Gp,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(o)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(oe.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return n=>{for(let o=n.prop(oe.group),s=-1;s<(o?o.length:0);s++){let i=t[s<0?n.name:o[s]];if(i)return i}}}};Oe.none=new Oe("",Object.create(null),0,8);var gr=class{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let o=null;for(let s of e){let i=s(n);i&&(o||(o=Object.assign({},n.props)),o[i[0].id]=i[1])}t.push(o?new Oe(n.name,o,n.id,n.flags):n)}return new gr(t)}},oo=new WeakMap,Ol=new WeakMap,xe;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays"})(xe||(xe={}));var Ie=class{constructor(e,t,n,o,s){if(this.type=e,this.children=t,this.positions=n,this.length=o,this.props=null,s&&s.length){this.props=Object.create(null);for(let[i,a]of s)this.props[typeof i=="number"?i:i.id]=a}}toString(){let e=this.prop(oe.mounted);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let o=n.toString();o&&(t&&(t+=","),t+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new xr(this.topNode,e)}cursorAt(e,t=0,n=0){let o=oo.get(this)||this.topNode,s=new xr(o);return s.moveTo(e,t),oo.set(this,s._tree),s}get topNode(){return new tt(this,0,0,null)}resolve(e,t=0){let n=br(oo.get(this)||this.topNode,e,t,!1);return oo.set(this,n),n}resolveInner(e,t=0){let n=br(Ol.get(this)||this.topNode,e,t,!0);return Ol.set(this,n),n}iterate(e){let{enter:t,leave:n,from:o=0,to:s=this.length}=e,i=e.mode||0,a=(i&xe.IncludeAnonymous)>0;for(let l=this.cursor(i|xe.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=o&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:zs(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,o)=>new Ie(this.type,t,n,o,this.propValues),e.makeTree||((t,n,o)=>new Ie(Oe.none,t,n,o)))}static build(e){return Wp(e)}};Ie.empty=new Ie(Oe.none,[],[],0);var cn=class{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new cn(this.buffer,this.index)}},xt=class{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],o=this.set.types[t],s=o.name;if(/\W/.test(s)&&!o.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let i=[];for(;e<n;)i.push(this.childString(e)),e=this.buffer[e+3];return s+"("+i.join(",")+")"}findChild(e,t,n,o,s){let{buffer:i}=this,a=-1;for(let l=e;l!=t&&!(Fl(s,o,i[l+1],i[l+2])&&(a=l,n>0));l=i[l+3]);return a}slice(e,t,n){let o=this.buffer,s=new Uint16Array(t-e),i=0;for(let a=e,l=0;a<t;){s[l++]=o[a++],s[l++]=o[a++]-n;let u=s[l++]=o[a++]-n;s[l++]=o[a++]-e,i=Math.max(i,u)}return new xt(s,i,this.set)}};function Fl(r,e,t,n){switch(r){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Vl(r,e){let t=r.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(r=t,t=n.prevSibling):t=n}return r}function br(r,e,t,n){for(var o;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to<e);){let i=!n&&r instanceof tt&&r.index<0?null:r.parent;if(!i)return r;r=i}let s=n?0:xe.IgnoreOverlays;if(n)for(let i=r,a=i.parent;a;i=a,a=i.parent)i instanceof tt&&i.index<0&&((o=a.enter(e,t,s))===null||o===void 0?void 0:o.from)!=i.from&&(r=a);for(;;){let i=r.enter(e,t,s);if(!i)return r;r=i}}var tt=class{constructor(e,t,n,o){this._tree=e,this.from=t,this.index=n,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,o,s=0){for(let i=this;;){for(let{children:a,positions:l}=i._tree,u=t>0?a.length:-1;e!=u;e+=t){let p=a[e],c=l[e]+i.from;if(Fl(o,n,c,c+p.length)){if(p instanceof xt){if(s&xe.ExcludeBuffers)continue;let d=p.findChild(0,p.buffer.length,t,n-c,o);if(d>-1)return new pt(new $s(i,p,e,c),null,d)}else if(s&xe.IncludeAnonymous||!p.type.isAnonymous||Ks(p)){let d;if(!(s&xe.IgnoreMounts)&&p.props&&(d=p.prop(oe.mounted))&&!d.overlay)return new tt(d.tree,c,e,i);let m=new tt(p,c,e,i);return s&xe.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?p.children.length-1:0,t,n,o)}}}if(s&xe.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?e=i.index+t:e=t<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&xe.IgnoreOverlays)&&(o=this._tree.prop(oe.mounted))&&o.overlay){let s=e-this.from;for(let{from:i,to:a}of o.overlay)if((t>0?i<=s:i<s)&&(t<0?a>=s:a>s))return new tt(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new xr(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return br(this,e,t,!1)}resolveInner(e,t=0){return br(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Vl(this,e)}getChild(e,t=null,n=null){let o=io(this,e,t,n);return o.length?o[0]:null}getChildren(e,t=null,n=null){return io(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return ao(this,e)}};function io(r,e,t,n){let o=r.cursor(),s=[];if(!o.firstChild())return s;if(t!=null){for(;!o.type.is(t);)if(!o.nextSibling())return s}for(;;){if(n!=null&&o.type.is(n))return s;if(o.type.is(e)&&s.push(o.node),!o.nextSibling())return n==null?s:[]}}function ao(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var $s=class{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}},pt=class{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new pt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&xe.ExcludeBuffers)return null;let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new pt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new pt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new pt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new xr(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,s=n.buffer[this.index+3];if(s>o){let i=n.buffer[this.index+1];e.push(n.slice(o,s,i)),t.push(0)}return new Ie(this.type,e,t,this.to-this.from)}resolve(e,t=0){return br(this,e,t,!1)}resolveInner(e,t=0){return br(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Vl(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let o=io(this,e,t,n);return o.length?o[0]:null}getChildren(e,t=null,n=null){return io(this,e,t,n)}get node(){return this}matchContext(e){return ao(this,e)}},xr=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof tt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:o}=this.buffer;return this.type=t||o.set.types[o.buffer[e]],this.from=n+o.buffer[e+1],this.to=n+o.buffer[e+2],!0}yield(e){return e?e instanceof tt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:o}=this.buffer,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xe.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let o=n<0?0:this.stack[n]+4;if(this.index!=o)return this.yieldBuf(t.findChild(o,this.index,-1,0,4))}else{let o=t.buffer[this.index+3];if(o<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(o)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(o.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:n}=o)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let s=t+e,i=e<0?-1:n._tree.children.length;s!=i;s+=e){let a=n._tree.children[s];if(this.mode&xe.IncludeAnonymous||a instanceof xt||!a.type.isAnonymous||Ks(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let o=this.index,s=this.stack.length;s>=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=s+1;break e}o=this.stack[--s]}for(let o=n;o<this.stack.length;o++)t=new pt(this.buffer,t,this.stack[o]);return this.bufferNode=new pt(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(o=!0)}for(;o&&t&&t(this),o=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,o=!0}}}matchContext(e){if(!this.buffer)return ao(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let o=e.length-1,s=this.stack.length-1;o>=0;s--){if(s<0)return ao(this.node,e,o);let i=n[t.buffer[this.stack[s]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}};function Ks(r){return r.children.some(e=>e instanceof xt||!e.type.isAnonymous||Ks(e))}function Wp(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:o=1024,reused:s=[],minRepeatType:i=n.types.length}=r,a=Array.isArray(t)?new cn(t,t.length):t,l=n.types,u=0,p=0;function c(x,T,v,C,H){let{id:w,start:D,end:V,size:y}=a,k=p;for(;y<0;)if(a.next(),y==-1){let S=s[w];v.push(S),C.push(D-x);return}else if(y==-3){u=w;return}else if(y==-4){p=w;return}else throw new RangeError(`Unrecognized record size: ${y}`);let O=l[w],L,M,R=D-x;if(V-D<=o&&(M=h(a.pos-T,H))){let S=new Uint16Array(M.size-M.skip),N=a.pos-M.size,P=S.length;for(;a.pos>N;)P=g(M.start,S,P);L=new xt(S,V-M.start,n),R=M.start-x}else{let S=a.pos-y;a.next();let N=[],P=[],B=w>=i?w:-1,F=0,K=V;for(;a.pos>S;)B>=0&&a.id==B&&a.size>=0?(a.end<=K-o&&(m(N,P,D,F,a.end,K,B,k),F=N.length,K=a.end),a.next()):c(D,S,N,P,B);if(B>=0&&F>0&&F<N.length&&m(N,P,D,F,D,K,B,k),N.reverse(),P.reverse(),B>-1&&F>0){let X=d(O);L=zs(O,N,P,0,N.length,0,V-D,X,X)}else L=f(O,N,P,V-D,k-V)}v.push(L),C.push(R)}function d(x){return(T,v,C)=>{let H=0,w=T.length-1,D,V;if(w>=0&&(D=T[w])instanceof Ie){if(!w&&D.type==x&&D.length==C)return D;(V=D.prop(oe.lookAhead))&&(H=v[w]+D.length+V)}return f(x,T,v,C,H)}}function m(x,T,v,C,H,w,D,V){let y=[],k=[];for(;x.length>C;)y.push(x.pop()),k.push(T.pop()+v-H);x.push(f(n.types[D],y,k,w-H,V-w)),T.push(H-v)}function f(x,T,v,C,H=0,w){if(u){let D=[oe.contextHash,u];w=w?[D].concat(w):[D]}if(H>25){let D=[oe.lookAhead,H];w=w?[D].concat(w):[D]}return new Ie(x,T,v,C,w)}function h(x,T){let v=a.fork(),C=0,H=0,w=0,D=v.end-o,V={size:0,start:0,skip:0};e:for(let y=v.pos-x;v.pos>y;){let k=v.size;if(v.id==T&&k>=0){V.size=C,V.start=H,V.skip=w,w+=4,C+=4,v.next();continue}let O=v.pos-k;if(k<0||O<y||v.start<D)break;let L=v.id>=i?4:0,M=v.start;for(v.next();v.pos>O;){if(v.size<0)if(v.size==-3)L+=4;else break e;else v.id>=i&&(L+=4);v.next()}H=M,C+=k,w+=L}return(T<0||C==x)&&(V.size=C,V.start=H,V.skip=w),V.size>4?V:void 0}function g(x,T,v){let{id:C,start:H,end:w,size:D}=a;if(a.next(),D>=0&&C<i){let V=v;if(D>4){let y=a.pos-(D-4);for(;a.pos>y;)v=g(x,T,v)}T[--v]=V,T[--v]=w-x,T[--v]=H-x,T[--v]=C}else D==-3?u=C:D==-4&&(p=C);return v}let b=[],E=[];for(;a.pos>0;)c(r.start||0,r.bufferStart||0,b,E,-1);let I=(e=r.length)!==null&&e!==void 0?e:b.length?E[0]+b[0].length:0;return new Ie(l[r.topID],b.reverse(),E.reverse(),I)}var Al=new WeakMap;function so(r,e){if(!r.isAnonymous||e instanceof xt||e.type!=r)return 1;let t=Al.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof Ie)){t=1;break}t+=so(r,n)}Al.set(e,t)}return t}function zs(r,e,t,n,o,s,i,a,l){let u=0;for(let f=n;f<o;f++)u+=so(r,e[f]);let p=Math.ceil(u*1.5/8),c=[],d=[];function m(f,h,g,b,E){for(let I=g;I<b;){let x=I,T=h[I],v=so(r,f[I]);for(I++;I<b;I++){let C=so(r,f[I]);if(v+C>=p)break;v+=C}if(I==x+1){if(v>p){let C=f[x];m(C.children,C.positions,0,C.children.length,h[x]+E);continue}c.push(f[x])}else{let C=h[I-1]+f[I-1].length-T;c.push(zs(r,f,h,x,I,T,C,null,l))}d.push(T+E-s)}}return m(e,t,n,o,0),(a||l)(c,d,i)}var lo=class{startParse(e,t,n){return typeof e=="string"&&(e=new _s(e)),n=n?n.length?n.map(o=>new un(o.from,o.to)):[new un(0,0)]:[new un(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let s=o.advance();if(s)return s}}},_s=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var B0=new oe({perNode:!0});var vr=class{constructor(e,t,n,o,s,i,a,l,u,p=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=s,this.score=i,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new vr(e,[],t,n,n,0,[],0,o?new uo(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(o);if(i&&(this.score+=i),n==0){this.pushState(s.getGoto(this.state,o,!0),this.reducePos),o<s.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,4,!0),this.reduceContext(o,this.reducePos);return}let a=this.stack.length-(n-1)*3-(e&262144?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,u=this.reducePos-l;u>=2e3&&!(!((t=this.p.parser.nodeSet.types[o])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let p=a?this.stack[a-1]:0,c=this.bufferBase+this.buffer.length-p;if(o<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,l,d,c+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,o,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(o,l)}storeNode(e,t,n,o=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,a=this.buffer.length;if(a==0&&i.parent&&(a=i.bufferBase-i.parent.bufferBase,i=i.parent),a>0&&i.buffer[a-4]==0&&i.buffer[a-1]>-1){if(t==n)return;if(i.buffer[a-2]>=t){i.buffer[a-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,o);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,o>4&&(o-=4);this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=o}}shift(e,t,n){let o=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=n,this.shiftContext(t,o),t<=this.p.parser.maxNode&&this.buffer.push(t,o,n,4);else{let s=e,{parser:i}=this.p;(n>this.pos||t<=i.maxNode)&&(this.pos=n,i.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,o),this.shiftContext(t,o),t<=i.maxNode&&this.buffer.push(t,o,n,4)}}apply(e,t,n){e&65536?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new vr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Gs(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let o=[];for(let s=0,i;s<t.length;s+=2)(i=t[s+1])!=this.state&&this.p.parser.hasAction(i,e)&&o.push(t[s],i);if(this.stack.length<120)for(let s=0;o.length<4<<1&&s<t.length;s+=2){let i=t[s+1];o.some((a,l)=>l&1&&a==i)||o.push(t[s],i)}t=o}let n=[];for(let o=0;o<t.length&&n.length<4;o+=2){let s=t[o+1];if(s==this.state)continue;let i=this.split();i.pushState(s,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[o],this.pos),i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,o=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],o,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,s)=>{if(!t.includes(o))return t.push(o),e.allActions(o,i=>{if(!(i&393216))if(i&65536){let a=(i>>19)-s;if(a>1){let l=i&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=n(i,s+1);if(a!=null)return a}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new uo(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},uo=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Bl;(function(r){r[r.Insert=200]="Insert",r[r.Delete=190]="Delete",r[r.Reduce=100]="Reduce",r[r.MaxNext=4]="MaxNext",r[r.MaxInsertStackDepth=300]="MaxInsertStackDepth",r[r.DampenInsertStackDepth=120]="DampenInsertStackDepth",r[r.MinBigReduction=2e3]="MinBigReduction"})(Bl||(Bl={}));var Gs=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}},Sr=class{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Sr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Sr(this.stack,this.pos,this.index)}};function dn(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,o=0;n<r.length;){let s=0;for(;;){let i=r.charCodeAt(n++),a=!1;if(i==126){s=65535;break}i>=92&&i--,i>=34&&i--;let l=i-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[o++]=s:t=new e(s)}return t}var yr=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},$l=new yr,Ws=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=$l,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!o)return null;let i=this.ranges[--o];s-=n.from-i.to,n=i}for(;t<0?s>n.to:s>=n.to;){if(o==this.ranges.length-1)return null;let i=this.ranges[++o];s+=i.from-n.to,n=i}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,o;if(t>=0&&t<this.chunk.length)n=this.pos+e,o=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let i=this.rangeIndex,a=this.range;for(;a.to<=n;)a=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),o=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),o}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=$l,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}},Mt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ql(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Mt.prototype.contextual=Mt.prototype.fallback=Mt.prototype.extend=!1;var Qs=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?dn(e):e}token(e,t){let n=e.pos,o=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(Ql(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||o++,i==null)break;e.reset(i,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}};Qs.prototype.contextual=Mt.prototype.fallback=Mt.prototype.extend=!1;function Ql(r,e,t,n,o,s){let i=0,a=1<<n,{dialect:l}=t.p.parser;e:for(;a&r[i];){let u=r[i+1];for(let m=i+3;m<u;m+=2)if((r[m+1]&a)>0){let f=r[m];if(l.allows(f)&&(e.token.value==-1||e.token.value==f||jp(f,e.token.value,o,s))){e.acceptToken(f);break}}let p=e.next,c=0,d=r[i+2];if(e.next<0&&d>c&&r[u+d*3-3]==65535&&r[u+d*3-3]==65535){i=r[u+d*3-1];continue e}for(;c<d;){let m=c+d>>1,f=u+m+(m<<1),h=r[f],g=r[f+1]||65536;if(p<h)d=m;else if(p>=g)c=m+1;else{i=r[f+2],e.advance();continue e}}break}}function _l(r,e,t){for(let n=e,o;(o=r[n])!=65535;n++)if(o==t)return n-e;return-1}function jp(r,e,t,n){let o=_l(t,n,e);return o<0||_l(t,n,r)<o}var rt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),Us=null,Kl;(function(r){r[r.Margin=25]="Margin"})(Kl||(Kl={}));function zl(r,e,t){let n=r.cursor(xe.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}var js=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?zl(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?zl(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],o=this.index[t];if(o==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[o],i=this.start[t]+n.positions[o];if(i>e)return this.nextStart=i,null;if(s instanceof Ie){if(i==e){if(i<this.safeFrom)return null;let a=i+s.length;if(a<=this.safeTo){let l=s.prop(oe.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,i+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}},Xs=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new yr)}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:s}=o,i=o.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;u<s.length;u++){if(!(1<<u&i))continue;let p=s[u],c=this.tokens[u];if(!(n&&!p.fallback)&&((p.contextual||c.start!=e.pos||c.mask!=i||c.context!=a)&&(this.updateCachedToken(c,p,e),c.mask=i,c.context=a),c.lookAhead>c.end+25&&(l=Math.max(c.lookAhead,l)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!p.extend&&(n=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new yr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new yr,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:s}=n.p;for(let i=0;i<s.specialized.length;i++)if(s.specialized[i]==e.value){let a=s.specializers[i](this.stream.read(e.start,e.end),n);if(a>=0&&n.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let s=0;s<o;s+=3)if(this.actions[s]==e)return o;return this.actions[o++]=e,this.actions[o++]=t,this.actions[o++]=n,o}addActions(e,t,n,o){let{state:s}=e,{parser:i}=e.p,{data:a}=i;for(let l=0;l<2;l++)for(let u=i.stateSlot(s,l?2:1);;u+=3){if(a[u]==65535)if(a[u+1]==1)u=yt(a,u+2);else{o==0&&a[u+1]==2&&(o=this.putAction(yt(a,u+2),t,n,o));break}a[u]==t&&(o=this.putAction(yt(a,u+1),t,n,o))}return o}},Ul;(function(r){r[r.Distance=5]="Distance",r[r.MaxRemainingPerStep=3]="MaxRemainingPerStep",r[r.MinBufferLengthPrune=500]="MinBufferLengthPrune",r[r.ForceReduceLimit=10]="ForceReduceLimit",r[r.CutDepth=15e3]="CutDepth",r[r.CutTo=9e3]="CutTo",r[r.MaxLeftAssociativeReductionCount=300]="MaxLeftAssociativeReductionCount",r[r.MaxStackCount=12]="MaxStackCount"})(Ul||(Ul={}));var Zs=class{constructor(e,t,n,o){this.parser=e,this.input=t,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Ws(t,o),this.tokens=new Xs(e,this.stream),this.topTerm=e.top[1];let{from:s}=o[0];this.stacks=[vr.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new js(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],o,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<e.length;i++){let a=e[i];for(;;){if(this.tokens.mainToken=null,a.pos>t)n.push(a);else{if(this.advanceStack(a,n,e))continue;{o||(o=[],s=[]),o.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!n.length){let i=o&&Xp(o);if(i)return this.stackToTree(i);if(this.parser.strict)throw rt&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&o){let i=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,s,n);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(n.length>i)for(n.sort((a,l)=>l.score-a.score);n.length>i;)n.pop();n.some(a=>a.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let i=0;i<n.length-1;i++){let a=n[i];for(let l=i+1;l<n.length;l++){let u=n[l];if(a.sameState(u)||a.buffer.length>500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(i--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let i=1;i<n.length;i++)n[i].pos<this.minStackPos&&(this.minStackPos=n[i].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let o=e.pos,{parser:s}=this,i=rt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,p=u?e.curContext.hash:0;for(let c=this.fragments.nodeAt(o);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(d>-1&&c.length&&(!u||(c.prop(oe.contextHash)||0)==p))return e.useNode(c,d),rt&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof Ie)||c.children.length==0||c.positions[0]>0)break;let m=c.children[0];if(m instanceof Ie&&c.positions[0]==0)c=m;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),rt&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;u<l.length;){let p=l[u++],c=l[u++],d=l[u++],m=u==l.length||!n,f=m?e:e.split();if(f.apply(p,c,d),rt&&console.log(i+this.stackID(f)+` (via ${p&65536?`reduce of ${s.getName(p&65535)}`:"shift"} for ${s.getName(c)} @ ${o}${f==e?"":", split"})`),m)return!0;f.pos>o?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Gl(e,t),!0}}runRecovery(e,t,n){let o=null,s=!1;for(let i=0;i<e.length;i++){let a=e[i],l=t[i<<1],u=t[(i<<1)+1],p=rt?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),rt&&console.log(p+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),d=p;for(let m=0;c.forceReduce()&&m<10&&(rt&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));m++)rt&&(d=this.stackID(c)+" -> ");for(let m of a.recoverByInsert(l))rt&&console.log(p+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,n);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),rt&&console.log(p+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Gl(a,n)):(!o||o.score<a.score)&&(o=a)}return o}stackToTree(e){return e.close(),Ie.build({buffer:Sr.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Us||(Us=new WeakMap)).get(e);return t||Us.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Gl(r,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==r.pos&&n.sameState(r)){e[t].score<r.score&&(e[t]=r);return}}e.push(r)}var qs=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}};var Xt=class extends lo{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let n=Object.keys(e.topRules).map(a=>e.topRules[a][1]),o=[];for(let a=0;a<t.length;a++)o.push([]);function s(a,l,u){o[a].push([l,l.deserialize(String(u))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=oe[l]);for(let u=1;u<a.length;){let p=a[u++];if(p>=0)s(p,l,a[u++]);else{let c=a[u+-p];for(let d=-p;d>0;d--)s(a[u++],l,c);u++}}}this.nodeSet=new gr(t.map((a,l)=>Oe.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:o[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let i=dn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Wl),this.states=dn(e.states,Uint32Array),this.data=dn(e.stateData),this.goto=dn(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Mt(i,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Zs(this,e,t,n);for(let s of this.wrappers)o=s(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let s=o[t+1];;){let i=o[s++],a=i&1,l=o[s++];if(a&&n)return l;for(let u=s+(i>>1);s<u;s++)if(o[s]==e)return l;if(a)return-1}}hasAction(e,t){let n=this.data;for(let o=0;o<2;o++)for(let s=this.stateSlot(e,o?2:1),i;;s+=3){if((i=n[s])==65535)if(n[s+1]==1)i=n[s=yt(n,s+2)];else{if(n[s+1]==2)return yt(n,s+2);break}if(i==t||i==0)return yt(n,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let s=this.stateSlot(e,1);o==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yt(this.data,s+2);else break;o=t(yt(this.data,s+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=yt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let o=this.data[n+1];t.some((s,i)=>i&1&&s==o)||t.push(this.data[n],o)}}return t}configure(e){let t=Object.assign(Object.create(Xt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let o=e.tokenizers.find(s=>s.from==n);return o?o.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,o)=>{let s=e.specializers.find(a=>a.from==n.external);if(!s)return n;let i=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[o]=Wl(i),i})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let i=t.indexOf(s);i>=0&&(n[i]=!0)}let o=null;for(let s=0;s<t.length;s++)if(!n[s])for(let i=this.dialects[t[s]],a;(a=this.data[i++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[a]=1;return new qs(e,n,o)}static deserialize(e){return new Xt(e)}};function yt(r,e){return r[e]|r[e+1]<<16}function Xp(r){let e=null;for(let t of r){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function Wl(r){if(r.external){let e=r.extend?1:0;return(t,n)=>r.external(t,n)<<1|e}return r.get}var Js=Xt.deserialize({version:14,states:"%QOVQPOOOOQO'#C_'#C_O_QQO'#C^OOQO'#DO'#DOOvQQO'#C|OOQO'#DR'#DROVQPO'#CuOOQO'#C}'#C}QOQPOOOOQO'#C`'#C`O!UQQO,58xO!dQPO,59VOVQPO,59]OVQPO,59_O!iQPO,59hO!nQQO,59aOOQO'#DQ'#DQOOQO1G.d1G.dO!UQQO1G.qO!yQQO1G.wOOQO1G.y1G.yOOQO'#Cw'#CwOOQO1G/S1G/SOOQO1G.{1G.{O#[QPO'#CnO#dQPO7+$]O!UQQO'#CxO#iQPO,59YOOQO<<Gw<<GwOOQO,59d,59dOOQO-E6v-E6v",stateData:"#q~OoOS~OsPOvUO~OTXOUXOVXOWXOXXOYXO`ZO~Of[Oh]Oj^OmpX~OZ`O[`O]`O^`O~OabO~OseO~Of[Oh]OwgO~Oh]Ofeijeimeiwei~OcjOdbX~OdlO~OcjOdba~O",goto:"#YvPPw}!TPPPPPPPPPPwPP!WPP!ZP!ZP!aP!g!jPPP!p!s!aP#P!aXROU[]XQOU[]RYQRibXTOU[]XVOU[]Rf^QkhRnkRWOQSOQ_UQc[Rd]QaYQhbRmj",nodeNames:"\u26A0 Filter ColumnValueExpression Column Operator Eq NotEq Gt Lt Starts Ends Number String True False ColumnSetExpression In LBrack Values Comma RBrack AndExpression And OrExpression Or ParenthesizedExpression As FilterName",maxTerm:39,skippedNodes:[0],repeatNodeCount:1,tokenData:"6p~RnXY#PYZ#P]^#Ppq#Pqr#brs#mxy$eyz$j|}$o!O!P$t!Q![%S!^!_%_!_!`%d!`!a%i!c!}%n!}#O&V#P#Q&[#R#S%n#T#U&a#U#X%n#X#Y(w#Y#Z+]#Z#]%n#]#^.]#^#c%n#c#d/e#d#g%n#g#h0m#h#i4[#i#o%n~#USo~XY#PYZ#P]^#Ppq#P~#eP!_!`#h~#mOU~~#pWOX#mZ]#m^r#mrs$Ys#O#m#P;'S#m;'S;=`$_<%lO#m~$_O[~~$bP;=`<%l#m~$jOv~~$oOw~~$tOc~~$wP!Q![$z~%PPZ~!Q![$z~%XQZ~!O!P$t!Q![%S~%dOW~~%iOT~~%nOV~P%sUsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%n~&[Oa~~&aOd~R&fYsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c'U#c#g%n#g#h(^#h#o%nR'ZWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#W%n#W#X's#X#o%nR'zUfQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR(eUjQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR(|WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c)f#c#o%nR)kWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#W%n#W#X*T#X#o%nR*YWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h*r#h#o%nR*yUYQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR+bVsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#U+w#U#o%nR+|WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#`%n#`#a,f#a#o%nR,kWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h-T#h#o%nR-YWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#X%n#X#Y-r#Y#o%nR-yU^QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR.bWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c.z#c#o%nR/RU`QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR/jWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g0S#g#o%nR0ZUhQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR0rWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#h%n#h#i1[#i#o%nR1aVsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#U1v#U#o%nR1{WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g2e#g#o%nR2jWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#h%n#h#i3S#i#o%nR3XWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h3q#h#o%nR3xUXQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR4aWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g4y#g#o%nR5OWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#i%n#i#j5h#j#o%nR5mWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#X%n#X#Y6V#Y#o%nR6^U]QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%n",tokenizers:[0,1],topRules:{Filter:[0,1]},tokenPrec:0});var ft=require("@vuu-ui/vuu-utils");var Ae,jl=class{constructor(){bi(this,Ae,void 0)}setFilterCombinatorOp(e,t=nt(this,Ae)){(0,ft.isMultiClauseFilter)(t)&&t.op===e||Mo(this,Ae,{op:e,filters:[nt(this,Ae)]})}add(e){if(nt(this,Ae)===void 0)Mo(this,Ae,e);else if((0,ft.isMultiClauseFilter)(nt(this,Ae)))nt(this,Ae).filters.push(e);else throw Error("Invalid filter passed to FilterExpression")}setColumn(e,t=nt(this,Ae)){if((0,ft.isMultiClauseFilter)(t)){let n=t.filters.at(-1);n&&this.setColumn(e,n)}else t&&(t.column=e)}setOp(e,t=nt(this,Ae)){if((0,ft.isMultiClauseFilter)(t)){let n=t.filters.at(-1);n&&this.setOp(e,n)}else t&&(t.op=e)}setValue(e,t=nt(this,Ae)){var n;if((0,ft.isMultiClauseFilter)(t)){let o=t.filters.at(-1);o&&this.setValue(e,o)}else(0,ft.isMultiValueFilter)(t)?((n=t.values)!=null||(t.values=[]),t.values.push(e)):(0,ft.isSingleValueFilter)(t)&&(t.value=e)}toJSON(e=nt(this,Ae)){return this.name?{...e,name:this.name}:e}};Ae=new WeakMap;var X0=Js.configure({strict:!0});var co=require("@vuu-ui/vuu-utils"),Jp=require("react");var{KEY:aT}=co.metadataKeys;var Xl=require("@vuu-ui/vuu-data"),Ys=require("react");var Zl=r=>(0,Xl.getServerAPI)().then(e=>e.getTableSchema(r));var Jl=require("@vuu-ui/vuu-layout"),Pt=require("react"),Yl=({dataSource:r,searchColumns:e=["description"],table:t})=>{let[n,o]=(0,Pt.useState)(r),{loadSession:s,saveSession:i}=(0,Jl.useViewContext)(),[a,l]=(0,Pt.useState)({searchText:"",filter:""}),u=(0,Pt.useMemo)(()=>e.map(c=>`${c} starts "__VALUE__"`).join(" or "),[e]);(0,Pt.useMemo)(()=>{if(r===void 0)if(t){let c=`instrument-search-${t.module}-${t.table}`,d=s==null?void 0:s(c);d?o(d):Zl(t).then(m=>{let f=new ql.RemoteDataSource({columns:m.columns.map(h=>h.name),table:m.table});o(f),i==null||i(f,c)})}else throw Error("useInstrumentSearch, if dataSource ismnot provided as prop, Vuu table must be provided")},[r,s,i,t]);let p=(0,Pt.useCallback)(c=>{let{value:d}=c.target,m=u.replaceAll("__VALUE__",d);l({searchText:d,filter:m}),n&&(n.filter={filter:m})},[u,n]);return{dataSource:n,onChange:p,searchState:a}};var Zt=require("react/jsx-runtime"),ei="vuuInstrumentSearch",Yp={columns:[{name:"bbg",hidden:!0},{name:"description",width:200,type:{name:"string",renderer:{name:"search-cell"}}}],rowSeparators:!0},ef=(0,Zt.jsx)("span",{"data-icon":"search"}),su=({TableProps:r,autoFocus:e=!1,className:t,dataSource:n,placeHolder:o,searchColumns:s,table:i,...a})=>{var g;let{dataSource:l,onChange:u,searchState:p}=Yl({dataSource:n,searchColumns:s,table:i}),{highlightedIndexRef:c,onHighlight:d,onKeyDown:m,tableRef:f}=(0,po.useControlledTableNavigation)(-1,(g=l==null?void 0:l.size)!=null?g:0),h=(0,ou.useCallback)(b=>{setTimeout(()=>{var E;(E=b==null?void 0:b.querySelector("input"))==null||E.focus()},100)},[]);return(0,Zt.jsxs)("div",{...a,className:(0,nu.default)(ei,t),children:[(0,Zt.jsx)("div",{className:`${ei}-inputField`,children:(0,Zt.jsx)(ru.Input,{inputProps:{onKeyDown:m},endAdornment:ef,placeholder:o,ref:e?h:null,value:p.searchText,onChange:u})}),l?(0,Zt.jsx)(po.Table,{disableFocus:!0,id:"instrument-search",rowHeight:25,config:Yp,highlightedIndex:c.current,renderBufferSize:100,...r,className:`${ei}-list`,dataSource:l,navigationStyle:"row",onHighlight:d,ref:f,showColumnHeaders:!1}):null]})},eu;(eu=tu.registerComponent)==null||eu("InstrumentSearch",su,"view");var Ir=require("@vuu-ui/vuu-utils"),Tr=require("react"),iu=Y(require("classnames"));var fo=require("react/jsx-runtime"),tf="vuuPriceTicker",rf=r=>(0,Ir.numericFormatter)({type:{name:"number",formatting:{decimals:r,zeroPad:!0}}}),nf=[void 0,void 0],au=(0,Tr.memo)(({className:r,decimals:e=2,price:t,showArrow:n,...o})=>{let s=(0,Tr.useRef)(nf),[i,a]=s.current,l=(0,Tr.useMemo)(()=>rf(e),[e]),u=(0,Ir.isValidNumber)(i)?(0,Ir.getMovingValueDirection)(t,a,i,e):"";return s.current=[t,u],(0,fo.jsxs)("div",{...o,className:(0,iu.default)(tf,r,u),children:[l(t),n?(0,fo.jsx)("span",{"data-icon":"price-arrow"}):null]})});au.displayName="PriceTicker";var wr=require("@vuu-ui/vuu-layout"),Iu=require("@salt-ds/core"),bo=Y(require("classnames")),Er=Y(require("react"));var vu=require("@vuu-ui/vuu-utils"),Ee=require("react");var lu=r=>typeof r=="object"&&r!==null&&"tabIndex"in r&&typeof r.tabIndex=="number",uu=r=>({label:"Close",location:"tab",action:"close-tab",options:r}),cu=r=>({label:"Rename",location:"tab",action:"rename-tab",options:r});var du=require("@vuu-ui/vuu-utils"),pu=(r,e)=>{if(r){let t=r.querySelector(`[data-index]:has(${e})`);return(0,du.getElementDataIndex)(t)}return-1},mo=r=>pu(r,'[aria-selected="true"]'),ti=r=>pu(r,".vuuEditableLabel-editing");var Cr=require("@vuu-ui/vuu-utils"),vt=require("react"),fu=(r,e,t="horizontal")=>{let n=(0,vt.useRef)(!1),o=(0,vt.useCallback)(()=>{n.current=!0},[]),s=(0,vt.useCallback)(()=>{n.current=!1},[]),i=(0,vt.useCallback)(()=>{var l,u;(l=r.current)==null||l.style.setProperty("--tab-thumb-transition","none"),(u=r.current)==null||u.removeEventListener("transitionend",i)},[r]),a=(0,vt.useRef)(-1);return(0,vt.useMemo)(()=>{var p,c;let l=0,u=0;if(a.current!==-1){let d=(p=r.current)==null?void 0:p.querySelector(".vuuTab-selected"),m=(c=r.current)==null?void 0:c.querySelector(`[data-index="${e}"] .vuuTab`),{positionProp:f,sizeProp:h}=Cr.MEASURES[t];if(d&&m&&!n.current){let{[f]:g,[h]:b}=d.getBoundingClientRect(),{[f]:E}=m.getBoundingClientRect();if((0,Cr.isValidNumber)(g)&&(0,Cr.isValidNumber)(E)&&(0,Cr.isValidNumber)(b)){l=g-E,u=b;let x=Math.abs(l/(t==="horizontal"?1100:700));requestAnimationFrame(()=>{var T,v,C,H;(T=r.current)==null||T.style.setProperty("--tab-thumb-offset","0px"),(v=r.current)==null||v.style.setProperty("--tab-thumb-size","100%"),(C=r.current)==null||C.style.setProperty("--tab-thumb-transition",`all ${x}s ease`),(H=r.current)==null||H.addEventListener("transitionend",i)})}}}return a.current=e,n.current?{containerStyle:{"--tab-thumb-offset":"0px","--tab-thumb-size":"100%"},resumeAnimation:s,suspendAnimation:o}:{containerStyle:{"--tab-thumb-offset":`${l}px`,"--tab-thumb-size":u?`${u}px`:void 0},resumeAnimation:s,suspendAnimation:o}},[e,r,t,i,s,o])};var hu=require("@salt-ds/core"),go=require("@vuu-ui/vuu-utils"),ye=require("react"),ke=require("@vuu-ui/vuu-utils");var gu={horizontal:{[ke.Home]:"start",[ke.End]:"end",[ke.ArrowLeft]:"bwd",[ke.ArrowRight]:"fwd"},vertical:{[ke.Home]:"start",[ke.End]:"end",[ke.ArrowUp]:"bwd",[ke.ArrowDown]:"fwd"}},of=(r,e="horizontal")=>gu[e][r]!==void 0,sf=r=>r===ke.ArrowDown;function mu(r,e,t){return e==="start"?0:e==="end"?r-1:e==="bwd"?t>0?t-1:t:t===null?0:t===r-1?t:t+1}var af=r=>r!==null&&!r.classList.contains("wrapped"),ho=(r,e)=>r?r.querySelector(`[data-index="${e}"]`):null,bu=({containerRef:r,defaultHighlightedIdx:e=-1,highlightedIdx:t,keyBoardActivation:n,orientation:o,selectedIndex:s=0})=>{let i=n==="manual",a=(0,ye.useRef)(!1),l=(0,ye.useRef)(-1),[u,p]=(0,ye.useState)(!1),[,c]=(0,ye.useState)({}),[d,m]=(0,hu.useControlled)({controlled:t,default:e,name:"UseKeyboardNavigation"}),f=(0,ye.useCallback)(y=>{m(l.current=y)},[m]),h=(0,ye.useRef)(!1),g=(0,ye.useCallback)((y,k=!1,O,L=70)=>{f(y),O===!0&&!h.current&&(h.current=!0);let M=()=>{let R=ho(r.current,y);if(R){let S=(0,go.getFocusableElement)(R);S==null||S.focus()}};k?M():setTimeout(M,L)},[r,f]),b=y=>{if(l.current===-1&&y.target.tabIndex!==-1){let k=ti(r.current);k!==-1?requestAnimationFrame(()=>{f(k)}):setTimeout(()=>{l.current===-1&&s!==null&&f(s)},200)}},E=(0,ye.useCallback)(()=>{var y,k;return(k=(y=r.current)==null?void 0:y.querySelectorAll("[data-index]").length)!=null?k:0},[r]),I=(0,ye.useCallback)((y="fwd",k)=>{let O=E(),M=mu(O,y,typeof k=="number"?k:O),R=y==="start"?"fwd":y==="end"?"bwd":y;for(;(R==="fwd"&&M<O||R==="bwd"&&M>0)&&!af(ho(r.current,M));){let S=mu(O,R,M);if(S===M)break;M=S}return M},[r,E]),x=(0,ye.useCallback)((y,k=!1)=>{let O=gu[o][y.key],L=I(O,d);L!==d?i&&g(L,!0):k&&c({})},[d,i,I,g,o]),T=(0,ye.useCallback)(()=>{let y=ho(r.current,d);return y?y.querySelector(".vuuPopupMenu")!=null:!1},[r,d]),v=(0,ye.useCallback)(()=>{let y=ho(r.current,d),k=y==null?void 0:y.querySelector(".vuuPopupMenu");return k&&(0,go.dispatchMouseEvent)(k,"click"),!1},[r,d]),C=(0,ye.useCallback)(y=>{E()>0&&of(y.key,o)?(y.preventDefault(),h.current?x(y):(h.current=!0,x(y,!0))):sf(y.key)&&T()&&v()},[v,E,T,x,o]),H=(y,k)=>{f(k)},w=(0,ye.useCallback)(()=>{u||(p(!0),a.current?a.current=!1:h.current=!0)},[u]),D=(0,ye.useCallback)(()=>{u||(a.current=!0),h.current=!1},[u]);return{containerProps:{onBlur:y=>{let k=y.target.closest(".vuuTabstrip"),O=y.relatedTarget;k&&!(k!=null&&k.contains(O))&&(f(-1),p(!1))},onMouseDownCapture:D,onFocus:w,onMouseLeave:()=>{h.current=!0,f(-1),a.current=!1}},focusVisible:h.current?d:-1,focusIsWithinComponent:u,highlightedIdx:d,focusTab:g,onClick:H,onFocus:b,onKeyDown:C,setHighlightedIdx:f}};var xu=require("@salt-ds/core"),pn=require("react"),lf=["Enter"," "],uf=r=>r&&r.matches('[class*="vuuTab "]'),yu=({defaultSelected:r,highlightedIdx:e,onSelectionChange:t,selected:n})=>{let[o,s,i]=(0,xu.useControlled)({controlled:n,default:r!=null?r:0,name:"Tabstrip",state:"value"}),a=(0,pn.useCallback)(c=>lf.includes(c.key),[]),l=(0,pn.useCallback)(c=>{s(c),t==null||t(c)},[t,s]),u=(0,pn.useCallback)(c=>{let d=c.target;a(c)&&e!==o&&uf(d)&&(c.stopPropagation(),c.preventDefault(),l(e))},[a,e,o,l]),p=(0,pn.useCallback)((c,d)=>{d!==o&&l(d)},[l,o]);return{activateTab:l,isControlled:i,onClick:p,onKeyDown:u,selected:o}};var cf=new Set(["Enter"," "]),df=r=>cf.has(r),pf=(r,e)=>r?r.querySelector(`[data-index="${e}"]`):null,Su=({activeTabIndex:r,allowDragDrop:e,animateSelectionThumb:t,containerRef:n,onActiveChange:o,onAddTab:s,onCloseTab:i,onExitEditMode:a,onMoveTab:l,orientation:u,keyBoardActivation:p})=>{let c=(0,Ee.useRef)(r),{focusTab:d,highlightedIdx:m,onClick:f,onKeyDown:h,setHighlightedIdx:g,...b}=bu({containerRef:n,keyBoardActivation:p,orientation:u,selectedIndex:c.current}),{activateTab:E,onClick:I,onKeyDown:x,selected:T}=yu({highlightedIdx:m,onSelectionChange:o,selected:r});c.current=T;let{containerStyle:v,resumeAnimation:C,suspendAnimation:H}=fu(n,t?T:-1,u),w=(0,Ee.useCallback)(($,U)=>{let{current:q}=c;console.log(`useTabstrip handleDrop ${$} - ${U} ${q}`),l==null||l($,U);let Q=-1;U!==-1&&(q===$?Q=U:$>q&&U<=q?Q=q+1:$<q&&U>=q&&(Q=q-1),Q!==-1&&(H(),E(Q),requestAnimationFrame(C)),d(U,!1,!1,350))},[d,l,C,E,H]),{onMouseDown:D,...V}=en({allowDragDrop:e,containerRef:n,draggableClassName:`tabstrip-${u}`,onDrop:w,orientation:"horizontal",itemQuery:".vuuOverflowContainer-item"}),y=(0,Ee.useCallback)(($,U,q,Q)=>{console.log(`handleExitEditMode ${$} ${U} ${q} ${Q}`),a==null||a($,U,q,Q),q||d(Q,!1,!0)},[d,a]),k=(0,Ee.useCallback)(($,U)=>{f($,U),I($,U)},[f,I]),O=(0,Ee.useCallback)(($=m)=>{let U=pf(n.current,$);if(U)return U.querySelector(".vuuEditableLabel")},[n,m]),L=(0,Ee.useCallback)(($=m)=>{let U=O($);return U?U.classList.contains("vuuEditableLabel-editing"):!1},[O,m]),M=(0,Ee.useCallback)(($=m)=>{let U=O($);U&&(0,vu.dispatchMouseEvent)(U,"dblclick")},[O,m]),R=(0,Ee.useCallback)($=>{h($),$.defaultPrevented||x($),!$.defaultPrevented&&df($.key)&&M()},[M,h,x]),S=(0,Ee.useCallback)($=>{let U=mo(n.current),q=U>$?U-1:U===$?0:U;return H(),i==null||i($,q),setTimeout(()=>{C()},200),!0},[n,i,C,H]),N=(0,Ee.useCallback)($=>(M($),!0),[M]),P=(0,Ee.useCallback)($=>{if(lu($.options))switch($.menuId){case"close-tab":return S($.options.tabIndex);case"rename-tab":return N($.options.tabIndex);default:console.log(`tab menu action ${$.menuId}`)}return!1},[S,N]),B=(0,Ee.useCallback)(()=>{L()?g(m):d(m)},[m,d,g,L]),F=(0,Ee.useCallback)($=>{let U=parseInt($.index);isNaN(U)||E(U)},[E]),K={onFocus:b.onFocus,onKeyDown:R},X=(0,Ee.useCallback)(()=>{s==null||s(),requestAnimationFrame(()=>{let $=mo(n.current);$!==-1&&d($)})},[n,d,s]),W={onClick:k,onKeyDown:R,onExitEditMode:y,onMenuAction:P,onMenuClose:B,onMouseDown:D};return{activeTabIndex:T,containerStyle:v,focusVisible:b.focusVisible,containerProps:{...b.containerProps,onSwitchWrappedItemIntoView:F},navigationProps:K,onClickAddTab:X,tabProps:W,...V}};var Dr=require("react/jsx-runtime"),Tu=require("react"),ri="vuuTabstrip",Il=({activeTabIndex:r,allowAddTab:e,allowCloseTab:t,allowDragDrop:n=!1,allowRenameTab:o=!1,animateSelectionThumb:s=!1,children:i,className:a,id:l,keyBoardActivation:u="manual",location:p,onActiveChange:c,onAddTab:d,onCloseTab:m,onExitEditMode:f,onMoveTab:h,orientation:g="horizontal",showTabMenuButton:b,style:E,tabClassName:I,...x})=>{let T=(0,Er.useRef)(null),{activeTabIndex:v,focusVisible:C,containerStyle:H,draggedItemIndex:w,onClickAddTab:D,tabProps:V,...y}=Su({activeTabIndex:r,allowDragDrop:n,animateSelectionThumb:s,containerRef:T,keyBoardActivation:u,onActiveChange:c,onAddTab:d,onCloseTab:m,onExitEditMode:f,onMoveTab:h,orientation:g}),k=(0,wr.useId)(l),O=(0,bo.default)(ri,`${ri}-${g}`,a),L=E||H?{...E,...H}:void 0,M=(0,Er.useMemo)(()=>(0,wr.asReactElements)(i).map((R,S)=>{let{id:N=`${k}-tab-${S}`,className:P,closeable:B=t,editable:F=o,location:K,showMenuButton:X=b}=R.props,W=S===v;return Er.default.cloneElement(R,{...V,...y.navigationProps,className:(0,bo.default)(P,I),closeable:B,"data-overflow-priority":W?"1":void 0,dragging:w===S,editable:F,focusVisible:C===S,id:N,index:S,key:S,location:(0,bo.default)(p,K),selected:W,showMenuButton:X,tabIndex:W?0:-1})}).concat(e?(0,Tu.createElement)(Iu.Button,{...y.navigationProps,"aria-label":"Create Tab",className:`${ri}-addTabButton`,"data-icon":"add","data-overflow-priority":"1",key:"addButton",onClick:D,variant:"secondary",tabIndex:-1}):[]),[i,e,y.navigationProps,D,k,t,o,b,v,V,I,w,C,p]);return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(wr.OverflowContainer,{...x,...y.containerProps,className:O,height:29,id:k,orientation:g,overflowIcon:"more-horiz",ref:T,style:L,children:M}),y.draggable]})};var Lu=require("@salt-ds/core"),ku=Y(require("classnames")),Yt=require("react");var Cu=require("@vuu-ui/vuu-popups"),wu=require("react"),Eu=Y(require("classnames"));var Mu=require("react/jsx-runtime"),ff="vuuTabMenu",Du=({allowClose:r,allowRename:e,controlledComponentId:t,controlledComponentTitle:n,location:o,onMenuAction:s,onMenuClose:i,index:a})=>{let[l,u]=(0,wu.useMemo)(()=>[(p,c)=>{let d=[];return e&&d.push(cu(c)),r&&d.push(uu(c)),d},{controlledComponentId:t,controlledComponentTitle:n,tabIndex:a}],[r,e,t,a]);return(0,Mu.jsx)(Cu.PopupMenu,{className:ff,menuBuilder:l,menuActionHandler:s,menuLocation:(0,Eu.default)("tab",o),menuOptions:u,onMenuClose:i,tabIndex:-1})};var Jt=require("react/jsx-runtime"),qt="vuuTab",Pu=()=>{},Tl=(0,Yt.forwardRef)(function({ariaControls:e,children:t,className:n,closeable:o=!1,dragging:s,editable:i=!1,editing:a,focusVisible:l,index:u=-1,label:p,location:c,onClick:d,onClose:m,onEnterEditMode:f=Pu,onExitEditMode:h=Pu,onFocus:g,onKeyUp:b,onMenuAction:E,onMenuClose:I,orientation:x,selected:T,showMenuButton:v=o||i||!!c,tabIndex:C,...H},w){if(v&&typeof E!="function")throw Error("Tab onMenuAction must be provided if showMenuButton is set");let D=(0,Yt.useRef)(null),V=(0,Yt.useRef)(null),y=(0,Lu.useForkRef)(w,D),k=(0,Yt.useCallback)(S=>{a||(S.preventDefault(),d==null||d(S,u))},[a,u,d]),O=(S="",N="",P=!0)=>h(S,N,P,u),L=S=>{switch(S.key){case"Backspace":case"Delete":o&&(S.stopPropagation(),m&&m(u));break;default:b&&b(S,u)}},M=()=>i?(0,Jt.jsx)(Is,{editing:a,defaultValue:p,onEnterEditMode:f,onExitEditMode:O,ref:V},p):p,R=S=>{if(V.current){let P=V.current.querySelector(".vuuEditableLabel-input");P==null||P.focus()}g==null||g(S)};return(0,Jt.jsxs)("div",{...H,"aria-controls":e,"aria-selected":T,className:(0,ku.default)(qt,n,{[`${qt}-closeable`]:o,"vuuDraggable-dragAway":s,[`${qt}-editing`]:a,[`${qt}-selected`]:T||void 0,[`${qt}-vertical`]:x==="vertical",vuuFocusVisible:l}),onClick:k,onFocus:R,onKeyUp:L,ref:y,role:"tab",tabIndex:C,children:[(0,Jt.jsx)("div",{className:`${qt}-main`,children:(0,Jt.jsx)("span",{className:`${qt}-text`,"data-text":i?void 0:p,children:t!=null?t:M()})}),v?(0,Jt.jsx)(Du,{allowClose:o,allowRename:i,controlledComponentId:e,controlledComponentTitle:p,location:c,onMenuAction:E,onMenuClose:I,index:u}):null]})});var Co=require("@salt-ds/core"),To=Y(require("classnames")),wo=require("react");function mf(r){var e;if(r){let t=r.dataset.idx;if(t)return parseInt(t,10);if(t=(e=r.ariaPosInSet)!=null?e:"-1")return parseInt(t,10)-1}}var ni=r=>r.closest("[data-idx],[aria-posinset]");var Ru=r=>mf(ni(r));var Mr=require("react"),hf=new Set(["/","-","."]),gf=r=>hf.has(r),Hu=(r,e)=>e.startsWith(r)&&gf(e[r.length]),oi=(r,e="root",{collapsibleHeaders:t=void 0,defaultExpanded:n=!1,revealSelected:o=!1}={})=>{let s=(d,m,f)=>{if(d.childNodes)return d.childNodes.length;if(d.header){let h=f+1,g=0;for(;h<m.length&&!m[h].header;)g++,h++;return g}else return 0},i=(0,Mr.useCallback)(d=>Array.isArray(o)?o.some(m=>Hu(d,m)):n,[n,o]),a=(0,Mr.useCallback)((d,m,f=1,h="",g=[],b=[])=>{let E=0;return d.forEach((I,x,T)=>{var O;let v=I.header&&t,C=I.childNodes&&t===!1,H=!I.childNodes||I.childNodes.length===0,w=C||H&&!v,D=h?`${h}.${x}`:`${x}`,V=(O=I.id)!=null?O:`${e}-${D}`,y=w?void 0:i(V),k={...I,childNodes:void 0,id:V,count:!C&&y===void 0?0:s(I,T,x),expanded:y,index:m.index,level:f};if(g.push(k),b.push(d[x]),E+=1,m.index+=1,I.childNodes){let[L,M]=a(I.childNodes,m,f+1,D,[],b);k.childNodes=M,(y===!0||C)&&(E+=L)}}),[E,g,b]},[t,e,i]),[l,u,p]=(0,Mr.useMemo)(()=>a(r,{index:0}),[a,r]),c=(0,Mr.useCallback)((d,m=u)=>{let f=m.find(h=>{var g;return h.id===d||((g=h==null?void 0:h.childNodes)==null?void 0:g.length)&&Hu(h.id,d)});if((f==null?void 0:f.id)===d)return p[f.index];if(f)return c(d,f.childNodes)},[p,u]);return[l,u,c]};var Lt=require("react"),Au=require("@salt-ds/core"),Nu="single",bf="checkbox",xf="multi",yf="extended",vf=["Enter"," "],Ou={},Sf=r=>r.expanded!==void 0,Fu=r=>r&&r!=="none",Vu=({defaultSelected:r,highlightedIdx:e,treeNodes:t,onChange:n,selected:o,selection:s=Nu,selectionKeys:i=vf})=>{let a=s===Nu,l=s===xf||s.startsWith(bf),u=s===yf,p=(0,Lt.useRef)(-1),c=(0,Lt.useCallback)(x=>i.includes(x.key),[i]),[d,m]=(0,Au.useControlled)({controlled:o,default:r!=null?r:[],name:"selected"}),f=(0,Lt.useCallback)((x,T,v,C,H=!1)=>{let{current:w}=p,D=d==null?void 0:d.includes(v),y=a||u&&!H&&(!C||w===-1),k=l||u&&H&&!C,O=[];if(y&&D)O=[];else if(y)O=[v];else if(k&&D)O=d.filter(L=>L!==v);else if(k)O=d.concat(v);else if(u){let[L,M]=T>w?[w,T]:[T,w];O=d.slice();for(let R=L;R<=M;R++){let{id:S}=t[R];d.includes(S)||O.push(S)}}m(O),n&&n(x,O)},[u,t,l,n,d,m,a]),h=(0,Lt.useCallback)(x=>{if(~e&&c(x)){x.preventDefault();let T=t[e];f(x,e,T.id,!1,x.ctrlKey||x.metaKey),u&&(p.current=e)}},[u,e,t,c,f]),g=(0,Lt.useCallback)((x,T)=>{if(u&&x.shiftKey){let v=t[T];f(x,T,v.id,!0)}},[u,t,f]),b=s==="none"?Ou:{onKeyDown:h,onKeyboardNavigation:g},E=(0,Lt.useCallback)(x=>{if(e!==-1){let T=t[e];Sf(T)||(x.preventDefault(),x.stopPropagation(),f(x,e,T.id,x.shiftKey,x.ctrlKey||x.metaKey),u&&(p.current=e))}},[u,e,t,f]);return{listHandlers:b,listItemHandlers:s==="none"?Ou:{onClick:E},selected:d,setSelected:m}};var Fe=require("react");var If=["height","scrollHeight"],Bu=(r,e,t=!1)=>{let n=(0,Fe.useRef)(0),o=(0,Fe.useRef)(!1),s=(0,Fe.useRef)(0),i=(0,Fe.useRef)(0),a=(0,Fe.useCallback)(p=>{let c=p.ariaExpanded?p.firstChild:p,d=t?30:0,m=c.offsetTop,f=c.offsetHeight,h=n.current+d,g=h+s.current-d;(m+f>g||m<h)&&(n.current=m+f>g?n.current+(m+f)-g:m-d,o.current=!0,r.current&&(r.current.scrollTop=n.current),setTimeout(()=>{o.current=!1}))},[r,t]),l=(0,Fe.useCallback)(p=>{n.current=p.target.scrollTop},[]);(0,Fe.useEffect)(()=>{let{current:p}=r;return p&&p.addEventListener("scroll",l),()=>{p&&p.removeEventListener("scroll",l)}},[r,l]),(0,Fe.useLayoutEffect)(()=>{if(e!==-1&&i.current>s.current&&r.current){let p=r.current.querySelector(`
|
|
5
|
+
Wrap elements with a single container`),r)},bl=({applyThemeClasses:r=!1,children:e,theme:t,themeMode:n,density:o})=>{var d,m,f;let{density:s,themeMode:i,theme:a}=(0,Dt.useContext)(hl),l=(d=o!=null?o:s)!=null?d:yp,u=(m=n!=null?n:i)!=null?m:Sp,p=(f=t!=null?t:a)!=null?f:vp,c=r?Ip(e,p,u,l):e;return(0,xl.jsx)(hl.Provider,{value:{themeMode:u,density:l,theme:p},children:c})};bl.displayName="ThemeProvider";var Sl=require("react/jsx-runtime");var an=require("react"),wp=Y(require("classnames")),Ep=require("@salt-ds/core"),Dp=require("@salt-ds/core"),Ls=require("@vuu-ui/vuu-data"),ks=require("@vuu-ui/vuu-utils");var Cl=require("react/jsx-runtime");var Hp=require("@vuu-ui/vuu-data"),no=require("@vuu-ui/vuu-layout"),Ll=require("@vuu-ui/vuu-utils"),Np=Y(require("classnames")),Ns=require("react");var Mp=require("@salt-ds/core"),Pp=Y(require("classnames")),wl=require("react"),Rs=require("@vuu-ui/vuu-layout");var El=require("react/jsx-runtime");var Dl=require("@vuu-ui/vuu-layout");var Lp=require("react"),kp=Y(require("classnames"));var Rp=require("react/jsx-runtime");var Ml=require("react/jsx-runtime");var ln=require("@vuu-ui/vuu-layout"),Hs=require("react"),Pl=require("react/jsx-runtime");var kl=require("@vuu-ui/vuu-popups");var Rl=require("react/jsx-runtime"),{error:r0}=(0,Ll.logger)("Shell");var Os=require("react"),Ap=require("react/jsx-runtime"),Op={},a0=(0,Os.createContext)(Op);var Fp=Y(require("classnames")),As=require("@salt-ds/core"),Vp=require("react");var Hl=require("react/jsx-runtime");var Fs=require("@vuu-ui/vuu-utils"),Nl=require("react");var Vs=require("react"),$p=require("@vuu-ui/vuu-data");var Bs=require("react"),_p=require("@vuu-ui/vuu-data");var Kp=require("react"),zp=require("@vuu-ui/vuu-data");var Up=0,un=class{constructor(e,t){this.from=e,this.to=t}},oe=class{constructor(e={}){this.id=Up++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};oe.closedBy=new oe({deserialize:r=>r.split(" ")});oe.openedBy=new oe({deserialize:r=>r.split(" ")});oe.group=new oe({deserialize:r=>r.split(" ")});oe.contextHash=new oe({perNode:!0});oe.lookAhead=new oe({perNode:!0});oe.mounted=new oe({perNode:!0});var Gp=Object.create(null),Oe=class{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Gp,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(o)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(oe.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return n=>{for(let o=n.prop(oe.group),s=-1;s<(o?o.length:0);s++){let i=t[s<0?n.name:o[s]];if(i)return i}}}};Oe.none=new Oe("",Object.create(null),0,8);var gr=class{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let o=null;for(let s of e){let i=s(n);i&&(o||(o=Object.assign({},n.props)),o[i[0].id]=i[1])}t.push(o?new Oe(n.name,o,n.id,n.flags):n)}return new gr(t)}},oo=new WeakMap,Ol=new WeakMap,xe;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays"})(xe||(xe={}));var Ie=class{constructor(e,t,n,o,s){if(this.type=e,this.children=t,this.positions=n,this.length=o,this.props=null,s&&s.length){this.props=Object.create(null);for(let[i,a]of s)this.props[typeof i=="number"?i:i.id]=a}}toString(){let e=this.prop(oe.mounted);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let o=n.toString();o&&(t&&(t+=","),t+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new xr(this.topNode,e)}cursorAt(e,t=0,n=0){let o=oo.get(this)||this.topNode,s=new xr(o);return s.moveTo(e,t),oo.set(this,s._tree),s}get topNode(){return new tt(this,0,0,null)}resolve(e,t=0){let n=br(oo.get(this)||this.topNode,e,t,!1);return oo.set(this,n),n}resolveInner(e,t=0){let n=br(Ol.get(this)||this.topNode,e,t,!0);return Ol.set(this,n),n}iterate(e){let{enter:t,leave:n,from:o=0,to:s=this.length}=e,i=e.mode||0,a=(i&xe.IncludeAnonymous)>0;for(let l=this.cursor(i|xe.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=o&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:zs(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,o)=>new Ie(this.type,t,n,o,this.propValues),e.makeTree||((t,n,o)=>new Ie(Oe.none,t,n,o)))}static build(e){return Wp(e)}};Ie.empty=new Ie(Oe.none,[],[],0);var cn=class{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new cn(this.buffer,this.index)}},xt=class{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],o=this.set.types[t],s=o.name;if(/\W/.test(s)&&!o.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let i=[];for(;e<n;)i.push(this.childString(e)),e=this.buffer[e+3];return s+"("+i.join(",")+")"}findChild(e,t,n,o,s){let{buffer:i}=this,a=-1;for(let l=e;l!=t&&!(Fl(s,o,i[l+1],i[l+2])&&(a=l,n>0));l=i[l+3]);return a}slice(e,t,n){let o=this.buffer,s=new Uint16Array(t-e),i=0;for(let a=e,l=0;a<t;){s[l++]=o[a++],s[l++]=o[a++]-n;let u=s[l++]=o[a++]-n;s[l++]=o[a++]-e,i=Math.max(i,u)}return new xt(s,i,this.set)}};function Fl(r,e,t,n){switch(r){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Vl(r,e){let t=r.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(r=t,t=n.prevSibling):t=n}return r}function br(r,e,t,n){for(var o;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to<e);){let i=!n&&r instanceof tt&&r.index<0?null:r.parent;if(!i)return r;r=i}let s=n?0:xe.IgnoreOverlays;if(n)for(let i=r,a=i.parent;a;i=a,a=i.parent)i instanceof tt&&i.index<0&&((o=a.enter(e,t,s))===null||o===void 0?void 0:o.from)!=i.from&&(r=a);for(;;){let i=r.enter(e,t,s);if(!i)return r;r=i}}var tt=class{constructor(e,t,n,o){this._tree=e,this.from=t,this.index=n,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,o,s=0){for(let i=this;;){for(let{children:a,positions:l}=i._tree,u=t>0?a.length:-1;e!=u;e+=t){let p=a[e],c=l[e]+i.from;if(Fl(o,n,c,c+p.length)){if(p instanceof xt){if(s&xe.ExcludeBuffers)continue;let d=p.findChild(0,p.buffer.length,t,n-c,o);if(d>-1)return new pt(new $s(i,p,e,c),null,d)}else if(s&xe.IncludeAnonymous||!p.type.isAnonymous||Ks(p)){let d;if(!(s&xe.IgnoreMounts)&&p.props&&(d=p.prop(oe.mounted))&&!d.overlay)return new tt(d.tree,c,e,i);let m=new tt(p,c,e,i);return s&xe.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?p.children.length-1:0,t,n,o)}}}if(s&xe.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?e=i.index+t:e=t<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&xe.IgnoreOverlays)&&(o=this._tree.prop(oe.mounted))&&o.overlay){let s=e-this.from;for(let{from:i,to:a}of o.overlay)if((t>0?i<=s:i<s)&&(t<0?a>=s:a>s))return new tt(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new xr(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return br(this,e,t,!1)}resolveInner(e,t=0){return br(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Vl(this,e)}getChild(e,t=null,n=null){let o=io(this,e,t,n);return o.length?o[0]:null}getChildren(e,t=null,n=null){return io(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return ao(this,e)}};function io(r,e,t,n){let o=r.cursor(),s=[];if(!o.firstChild())return s;if(t!=null){for(;!o.type.is(t);)if(!o.nextSibling())return s}for(;;){if(n!=null&&o.type.is(n))return s;if(o.type.is(e)&&s.push(o.node),!o.nextSibling())return n==null?s:[]}}function ao(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var $s=class{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}},pt=class{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new pt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&xe.ExcludeBuffers)return null;let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new pt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new pt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new pt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new xr(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,s=n.buffer[this.index+3];if(s>o){let i=n.buffer[this.index+1];e.push(n.slice(o,s,i)),t.push(0)}return new Ie(this.type,e,t,this.to-this.from)}resolve(e,t=0){return br(this,e,t,!1)}resolveInner(e,t=0){return br(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Vl(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let o=io(this,e,t,n);return o.length?o[0]:null}getChildren(e,t=null,n=null){return io(this,e,t,n)}get node(){return this}matchContext(e){return ao(this,e)}},xr=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof tt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:o}=this.buffer;return this.type=t||o.set.types[o.buffer[e]],this.from=n+o.buffer[e+1],this.to=n+o.buffer[e+2],!0}yield(e){return e?e instanceof tt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:o}=this.buffer,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xe.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let o=n<0?0:this.stack[n]+4;if(this.index!=o)return this.yieldBuf(t.findChild(o,this.index,-1,0,4))}else{let o=t.buffer[this.index+3];if(o<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(o)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(o.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:n}=o)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let s=t+e,i=e<0?-1:n._tree.children.length;s!=i;s+=e){let a=n._tree.children[s];if(this.mode&xe.IncludeAnonymous||a instanceof xt||!a.type.isAnonymous||Ks(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let o=this.index,s=this.stack.length;s>=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=s+1;break e}o=this.stack[--s]}for(let o=n;o<this.stack.length;o++)t=new pt(this.buffer,t,this.stack[o]);return this.bufferNode=new pt(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(o=!0)}for(;o&&t&&t(this),o=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,o=!0}}}matchContext(e){if(!this.buffer)return ao(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let o=e.length-1,s=this.stack.length-1;o>=0;s--){if(s<0)return ao(this.node,e,o);let i=n[t.buffer[this.stack[s]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}};function Ks(r){return r.children.some(e=>e instanceof xt||!e.type.isAnonymous||Ks(e))}function Wp(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:o=1024,reused:s=[],minRepeatType:i=n.types.length}=r,a=Array.isArray(t)?new cn(t,t.length):t,l=n.types,u=0,p=0;function c(x,T,v,C,H){let{id:w,start:D,end:V,size:y}=a,k=p;for(;y<0;)if(a.next(),y==-1){let S=s[w];v.push(S),C.push(D-x);return}else if(y==-3){u=w;return}else if(y==-4){p=w;return}else throw new RangeError(`Unrecognized record size: ${y}`);let O=l[w],L,M,R=D-x;if(V-D<=o&&(M=h(a.pos-T,H))){let S=new Uint16Array(M.size-M.skip),N=a.pos-M.size,P=S.length;for(;a.pos>N;)P=g(M.start,S,P);L=new xt(S,V-M.start,n),R=M.start-x}else{let S=a.pos-y;a.next();let N=[],P=[],B=w>=i?w:-1,F=0,K=V;for(;a.pos>S;)B>=0&&a.id==B&&a.size>=0?(a.end<=K-o&&(m(N,P,D,F,a.end,K,B,k),F=N.length,K=a.end),a.next()):c(D,S,N,P,B);if(B>=0&&F>0&&F<N.length&&m(N,P,D,F,D,K,B,k),N.reverse(),P.reverse(),B>-1&&F>0){let X=d(O);L=zs(O,N,P,0,N.length,0,V-D,X,X)}else L=f(O,N,P,V-D,k-V)}v.push(L),C.push(R)}function d(x){return(T,v,C)=>{let H=0,w=T.length-1,D,V;if(w>=0&&(D=T[w])instanceof Ie){if(!w&&D.type==x&&D.length==C)return D;(V=D.prop(oe.lookAhead))&&(H=v[w]+D.length+V)}return f(x,T,v,C,H)}}function m(x,T,v,C,H,w,D,V){let y=[],k=[];for(;x.length>C;)y.push(x.pop()),k.push(T.pop()+v-H);x.push(f(n.types[D],y,k,w-H,V-w)),T.push(H-v)}function f(x,T,v,C,H=0,w){if(u){let D=[oe.contextHash,u];w=w?[D].concat(w):[D]}if(H>25){let D=[oe.lookAhead,H];w=w?[D].concat(w):[D]}return new Ie(x,T,v,C,w)}function h(x,T){let v=a.fork(),C=0,H=0,w=0,D=v.end-o,V={size:0,start:0,skip:0};e:for(let y=v.pos-x;v.pos>y;){let k=v.size;if(v.id==T&&k>=0){V.size=C,V.start=H,V.skip=w,w+=4,C+=4,v.next();continue}let O=v.pos-k;if(k<0||O<y||v.start<D)break;let L=v.id>=i?4:0,M=v.start;for(v.next();v.pos>O;){if(v.size<0)if(v.size==-3)L+=4;else break e;else v.id>=i&&(L+=4);v.next()}H=M,C+=k,w+=L}return(T<0||C==x)&&(V.size=C,V.start=H,V.skip=w),V.size>4?V:void 0}function g(x,T,v){let{id:C,start:H,end:w,size:D}=a;if(a.next(),D>=0&&C<i){let V=v;if(D>4){let y=a.pos-(D-4);for(;a.pos>y;)v=g(x,T,v)}T[--v]=V,T[--v]=w-x,T[--v]=H-x,T[--v]=C}else D==-3?u=C:D==-4&&(p=C);return v}let b=[],E=[];for(;a.pos>0;)c(r.start||0,r.bufferStart||0,b,E,-1);let I=(e=r.length)!==null&&e!==void 0?e:b.length?E[0]+b[0].length:0;return new Ie(l[r.topID],b.reverse(),E.reverse(),I)}var Al=new WeakMap;function so(r,e){if(!r.isAnonymous||e instanceof xt||e.type!=r)return 1;let t=Al.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof Ie)){t=1;break}t+=so(r,n)}Al.set(e,t)}return t}function zs(r,e,t,n,o,s,i,a,l){let u=0;for(let f=n;f<o;f++)u+=so(r,e[f]);let p=Math.ceil(u*1.5/8),c=[],d=[];function m(f,h,g,b,E){for(let I=g;I<b;){let x=I,T=h[I],v=so(r,f[I]);for(I++;I<b;I++){let C=so(r,f[I]);if(v+C>=p)break;v+=C}if(I==x+1){if(v>p){let C=f[x];m(C.children,C.positions,0,C.children.length,h[x]+E);continue}c.push(f[x])}else{let C=h[I-1]+f[I-1].length-T;c.push(zs(r,f,h,x,I,T,C,null,l))}d.push(T+E-s)}}return m(e,t,n,o,0),(a||l)(c,d,i)}var lo=class{startParse(e,t,n){return typeof e=="string"&&(e=new _s(e)),n=n?n.length?n.map(o=>new un(o.from,o.to)):[new un(0,0)]:[new un(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let s=o.advance();if(s)return s}}},_s=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var $0=new oe({perNode:!0});var vr=class{constructor(e,t,n,o,s,i,a,l,u,p=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=s,this.score=i,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new vr(e,[],t,n,n,0,[],0,o?new uo(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(o);if(i&&(this.score+=i),n==0){this.pushState(s.getGoto(this.state,o,!0),this.reducePos),o<s.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,4,!0),this.reduceContext(o,this.reducePos);return}let a=this.stack.length-(n-1)*3-(e&262144?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,u=this.reducePos-l;u>=2e3&&!(!((t=this.p.parser.nodeSet.types[o])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let p=a?this.stack[a-1]:0,c=this.bufferBase+this.buffer.length-p;if(o<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,l,d,c+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,o,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(o,l)}storeNode(e,t,n,o=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,a=this.buffer.length;if(a==0&&i.parent&&(a=i.bufferBase-i.parent.bufferBase,i=i.parent),a>0&&i.buffer[a-4]==0&&i.buffer[a-1]>-1){if(t==n)return;if(i.buffer[a-2]>=t){i.buffer[a-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,o);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,o>4&&(o-=4);this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=o}}shift(e,t,n){let o=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=n,this.shiftContext(t,o),t<=this.p.parser.maxNode&&this.buffer.push(t,o,n,4);else{let s=e,{parser:i}=this.p;(n>this.pos||t<=i.maxNode)&&(this.pos=n,i.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,o),this.shiftContext(t,o),t<=i.maxNode&&this.buffer.push(t,o,n,4)}}apply(e,t,n){e&65536?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new vr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Gs(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let o=[];for(let s=0,i;s<t.length;s+=2)(i=t[s+1])!=this.state&&this.p.parser.hasAction(i,e)&&o.push(t[s],i);if(this.stack.length<120)for(let s=0;o.length<4<<1&&s<t.length;s+=2){let i=t[s+1];o.some((a,l)=>l&1&&a==i)||o.push(t[s],i)}t=o}let n=[];for(let o=0;o<t.length&&n.length<4;o+=2){let s=t[o+1];if(s==this.state)continue;let i=this.split();i.pushState(s,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[o],this.pos),i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,o=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],o,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,s)=>{if(!t.includes(o))return t.push(o),e.allActions(o,i=>{if(!(i&393216))if(i&65536){let a=(i>>19)-s;if(a>1){let l=i&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=n(i,s+1);if(a!=null)return a}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new uo(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},uo=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Bl;(function(r){r[r.Insert=200]="Insert",r[r.Delete=190]="Delete",r[r.Reduce=100]="Reduce",r[r.MaxNext=4]="MaxNext",r[r.MaxInsertStackDepth=300]="MaxInsertStackDepth",r[r.DampenInsertStackDepth=120]="DampenInsertStackDepth",r[r.MinBigReduction=2e3]="MinBigReduction"})(Bl||(Bl={}));var Gs=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}},Sr=class{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Sr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Sr(this.stack,this.pos,this.index)}};function dn(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,o=0;n<r.length;){let s=0;for(;;){let i=r.charCodeAt(n++),a=!1;if(i==126){s=65535;break}i>=92&&i--,i>=34&&i--;let l=i-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[o++]=s:t=new e(s)}return t}var yr=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},$l=new yr,Ws=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=$l,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!o)return null;let i=this.ranges[--o];s-=n.from-i.to,n=i}for(;t<0?s>n.to:s>=n.to;){if(o==this.ranges.length-1)return null;let i=this.ranges[++o];s+=i.from-n.to,n=i}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,o;if(t>=0&&t<this.chunk.length)n=this.pos+e,o=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let i=this.rangeIndex,a=this.range;for(;a.to<=n;)a=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),o=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),o}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=$l,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}},Mt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ql(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Mt.prototype.contextual=Mt.prototype.fallback=Mt.prototype.extend=!1;var Qs=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?dn(e):e}token(e,t){let n=e.pos,o=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(Ql(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||o++,i==null)break;e.reset(i,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}};Qs.prototype.contextual=Mt.prototype.fallback=Mt.prototype.extend=!1;function Ql(r,e,t,n,o,s){let i=0,a=1<<n,{dialect:l}=t.p.parser;e:for(;a&r[i];){let u=r[i+1];for(let m=i+3;m<u;m+=2)if((r[m+1]&a)>0){let f=r[m];if(l.allows(f)&&(e.token.value==-1||e.token.value==f||jp(f,e.token.value,o,s))){e.acceptToken(f);break}}let p=e.next,c=0,d=r[i+2];if(e.next<0&&d>c&&r[u+d*3-3]==65535&&r[u+d*3-3]==65535){i=r[u+d*3-1];continue e}for(;c<d;){let m=c+d>>1,f=u+m+(m<<1),h=r[f],g=r[f+1]||65536;if(p<h)d=m;else if(p>=g)c=m+1;else{i=r[f+2],e.advance();continue e}}break}}function _l(r,e,t){for(let n=e,o;(o=r[n])!=65535;n++)if(o==t)return n-e;return-1}function jp(r,e,t,n){let o=_l(t,n,e);return o<0||_l(t,n,r)<o}var rt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),Us=null,Kl;(function(r){r[r.Margin=25]="Margin"})(Kl||(Kl={}));function zl(r,e,t){let n=r.cursor(xe.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}var js=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?zl(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?zl(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],o=this.index[t];if(o==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[o],i=this.start[t]+n.positions[o];if(i>e)return this.nextStart=i,null;if(s instanceof Ie){if(i==e){if(i<this.safeFrom)return null;let a=i+s.length;if(a<=this.safeTo){let l=s.prop(oe.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,i+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}},Xs=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new yr)}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:s}=o,i=o.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;u<s.length;u++){if(!(1<<u&i))continue;let p=s[u],c=this.tokens[u];if(!(n&&!p.fallback)&&((p.contextual||c.start!=e.pos||c.mask!=i||c.context!=a)&&(this.updateCachedToken(c,p,e),c.mask=i,c.context=a),c.lookAhead>c.end+25&&(l=Math.max(c.lookAhead,l)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!p.extend&&(n=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new yr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new yr,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:s}=n.p;for(let i=0;i<s.specialized.length;i++)if(s.specialized[i]==e.value){let a=s.specializers[i](this.stream.read(e.start,e.end),n);if(a>=0&&n.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let s=0;s<o;s+=3)if(this.actions[s]==e)return o;return this.actions[o++]=e,this.actions[o++]=t,this.actions[o++]=n,o}addActions(e,t,n,o){let{state:s}=e,{parser:i}=e.p,{data:a}=i;for(let l=0;l<2;l++)for(let u=i.stateSlot(s,l?2:1);;u+=3){if(a[u]==65535)if(a[u+1]==1)u=yt(a,u+2);else{o==0&&a[u+1]==2&&(o=this.putAction(yt(a,u+2),t,n,o));break}a[u]==t&&(o=this.putAction(yt(a,u+1),t,n,o))}return o}},Ul;(function(r){r[r.Distance=5]="Distance",r[r.MaxRemainingPerStep=3]="MaxRemainingPerStep",r[r.MinBufferLengthPrune=500]="MinBufferLengthPrune",r[r.ForceReduceLimit=10]="ForceReduceLimit",r[r.CutDepth=15e3]="CutDepth",r[r.CutTo=9e3]="CutTo",r[r.MaxLeftAssociativeReductionCount=300]="MaxLeftAssociativeReductionCount",r[r.MaxStackCount=12]="MaxStackCount"})(Ul||(Ul={}));var Zs=class{constructor(e,t,n,o){this.parser=e,this.input=t,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Ws(t,o),this.tokens=new Xs(e,this.stream),this.topTerm=e.top[1];let{from:s}=o[0];this.stacks=[vr.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new js(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],o,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<e.length;i++){let a=e[i];for(;;){if(this.tokens.mainToken=null,a.pos>t)n.push(a);else{if(this.advanceStack(a,n,e))continue;{o||(o=[],s=[]),o.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!n.length){let i=o&&Xp(o);if(i)return this.stackToTree(i);if(this.parser.strict)throw rt&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&o){let i=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,s,n);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(n.length>i)for(n.sort((a,l)=>l.score-a.score);n.length>i;)n.pop();n.some(a=>a.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let i=0;i<n.length-1;i++){let a=n[i];for(let l=i+1;l<n.length;l++){let u=n[l];if(a.sameState(u)||a.buffer.length>500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(i--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let i=1;i<n.length;i++)n[i].pos<this.minStackPos&&(this.minStackPos=n[i].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let o=e.pos,{parser:s}=this,i=rt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,p=u?e.curContext.hash:0;for(let c=this.fragments.nodeAt(o);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(d>-1&&c.length&&(!u||(c.prop(oe.contextHash)||0)==p))return e.useNode(c,d),rt&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof Ie)||c.children.length==0||c.positions[0]>0)break;let m=c.children[0];if(m instanceof Ie&&c.positions[0]==0)c=m;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),rt&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;u<l.length;){let p=l[u++],c=l[u++],d=l[u++],m=u==l.length||!n,f=m?e:e.split();if(f.apply(p,c,d),rt&&console.log(i+this.stackID(f)+` (via ${p&65536?`reduce of ${s.getName(p&65535)}`:"shift"} for ${s.getName(c)} @ ${o}${f==e?"":", split"})`),m)return!0;f.pos>o?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Gl(e,t),!0}}runRecovery(e,t,n){let o=null,s=!1;for(let i=0;i<e.length;i++){let a=e[i],l=t[i<<1],u=t[(i<<1)+1],p=rt?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),rt&&console.log(p+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),d=p;for(let m=0;c.forceReduce()&&m<10&&(rt&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));m++)rt&&(d=this.stackID(c)+" -> ");for(let m of a.recoverByInsert(l))rt&&console.log(p+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,n);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),rt&&console.log(p+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Gl(a,n)):(!o||o.score<a.score)&&(o=a)}return o}stackToTree(e){return e.close(),Ie.build({buffer:Sr.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Us||(Us=new WeakMap)).get(e);return t||Us.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Gl(r,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==r.pos&&n.sameState(r)){e[t].score<r.score&&(e[t]=r);return}}e.push(r)}var qs=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}};var Xt=class extends lo{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let n=Object.keys(e.topRules).map(a=>e.topRules[a][1]),o=[];for(let a=0;a<t.length;a++)o.push([]);function s(a,l,u){o[a].push([l,l.deserialize(String(u))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=oe[l]);for(let u=1;u<a.length;){let p=a[u++];if(p>=0)s(p,l,a[u++]);else{let c=a[u+-p];for(let d=-p;d>0;d--)s(a[u++],l,c);u++}}}this.nodeSet=new gr(t.map((a,l)=>Oe.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:o[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let i=dn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Wl),this.states=dn(e.states,Uint32Array),this.data=dn(e.stateData),this.goto=dn(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Mt(i,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Zs(this,e,t,n);for(let s of this.wrappers)o=s(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let s=o[t+1];;){let i=o[s++],a=i&1,l=o[s++];if(a&&n)return l;for(let u=s+(i>>1);s<u;s++)if(o[s]==e)return l;if(a)return-1}}hasAction(e,t){let n=this.data;for(let o=0;o<2;o++)for(let s=this.stateSlot(e,o?2:1),i;;s+=3){if((i=n[s])==65535)if(n[s+1]==1)i=n[s=yt(n,s+2)];else{if(n[s+1]==2)return yt(n,s+2);break}if(i==t||i==0)return yt(n,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let s=this.stateSlot(e,1);o==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=yt(this.data,s+2);else break;o=t(yt(this.data,s+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=yt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let o=this.data[n+1];t.some((s,i)=>i&1&&s==o)||t.push(this.data[n],o)}}return t}configure(e){let t=Object.assign(Object.create(Xt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let o=e.tokenizers.find(s=>s.from==n);return o?o.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,o)=>{let s=e.specializers.find(a=>a.from==n.external);if(!s)return n;let i=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[o]=Wl(i),i})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let i=t.indexOf(s);i>=0&&(n[i]=!0)}let o=null;for(let s=0;s<t.length;s++)if(!n[s])for(let i=this.dialects[t[s]],a;(a=this.data[i++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[a]=1;return new qs(e,n,o)}static deserialize(e){return new Xt(e)}};function yt(r,e){return r[e]|r[e+1]<<16}function Xp(r){let e=null;for(let t of r){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function Wl(r){if(r.external){let e=r.extend?1:0;return(t,n)=>r.external(t,n)<<1|e}return r.get}var Js=Xt.deserialize({version:14,states:"%QOVQPOOOOQO'#C_'#C_O_QQO'#C^OOQO'#DO'#DOOvQQO'#C|OOQO'#DR'#DROVQPO'#CuOOQO'#C}'#C}QOQPOOOOQO'#C`'#C`O!UQQO,58xO!dQPO,59VOVQPO,59]OVQPO,59_O!iQPO,59hO!nQQO,59aOOQO'#DQ'#DQOOQO1G.d1G.dO!UQQO1G.qO!yQQO1G.wOOQO1G.y1G.yOOQO'#Cw'#CwOOQO1G/S1G/SOOQO1G.{1G.{O#[QPO'#CnO#dQPO7+$]O!UQQO'#CxO#iQPO,59YOOQO<<Gw<<GwOOQO,59d,59dOOQO-E6v-E6v",stateData:"#q~OoOS~OsPOvUO~OTXOUXOVXOWXOXXOYXO`ZO~Of[Oh]Oj^OmpX~OZ`O[`O]`O^`O~OabO~OseO~Of[Oh]OwgO~Oh]Ofeijeimeiwei~OcjOdbX~OdlO~OcjOdba~O",goto:"#YvPPw}!TPPPPPPPPPPwPP!WPP!ZP!ZP!aP!g!jPPP!p!s!aP#P!aXROU[]XQOU[]RYQRibXTOU[]XVOU[]Rf^QkhRnkRWOQSOQ_UQc[Rd]QaYQhbRmj",nodeNames:"\u26A0 Filter ColumnValueExpression Column Operator Eq NotEq Gt Lt Starts Ends Number String True False ColumnSetExpression In LBrack Values Comma RBrack AndExpression And OrExpression Or ParenthesizedExpression As FilterName",maxTerm:39,skippedNodes:[0],repeatNodeCount:1,tokenData:"6p~RnXY#PYZ#P]^#Ppq#Pqr#brs#mxy$eyz$j|}$o!O!P$t!Q![%S!^!_%_!_!`%d!`!a%i!c!}%n!}#O&V#P#Q&[#R#S%n#T#U&a#U#X%n#X#Y(w#Y#Z+]#Z#]%n#]#^.]#^#c%n#c#d/e#d#g%n#g#h0m#h#i4[#i#o%n~#USo~XY#PYZ#P]^#Ppq#P~#eP!_!`#h~#mOU~~#pWOX#mZ]#m^r#mrs$Ys#O#m#P;'S#m;'S;=`$_<%lO#m~$_O[~~$bP;=`<%l#m~$jOv~~$oOw~~$tOc~~$wP!Q![$z~%PPZ~!Q![$z~%XQZ~!O!P$t!Q![%S~%dOW~~%iOT~~%nOV~P%sUsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%n~&[Oa~~&aOd~R&fYsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c'U#c#g%n#g#h(^#h#o%nR'ZWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#W%n#W#X's#X#o%nR'zUfQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR(eUjQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR(|WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c)f#c#o%nR)kWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#W%n#W#X*T#X#o%nR*YWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h*r#h#o%nR*yUYQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR+bVsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#U+w#U#o%nR+|WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#`%n#`#a,f#a#o%nR,kWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h-T#h#o%nR-YWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#X%n#X#Y-r#Y#o%nR-yU^QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR.bWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#b%n#b#c.z#c#o%nR/RU`QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR/jWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g0S#g#o%nR0ZUhQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR0rWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#h%n#h#i1[#i#o%nR1aVsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#U1v#U#o%nR1{WsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g2e#g#o%nR2jWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#h%n#h#i3S#i#o%nR3XWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#g%n#g#h3q#h#o%nR3xUXQsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%nR4aWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#f%n#f#g4y#g#o%nR5OWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#i%n#i#j5h#j#o%nR5mWsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#X%n#X#Y6V#Y#o%nR6^U]QsP}!O%n!O!P%n!Q![%n!c!}%n#R#S%n#T#o%n",tokenizers:[0,1],topRules:{Filter:[0,1]},tokenPrec:0});var ft=require("@vuu-ui/vuu-utils");var Ae,jl=class{constructor(){bi(this,Ae,void 0)}setFilterCombinatorOp(e,t=nt(this,Ae)){(0,ft.isMultiClauseFilter)(t)&&t.op===e||Mo(this,Ae,{op:e,filters:[nt(this,Ae)]})}add(e){if(nt(this,Ae)===void 0)Mo(this,Ae,e);else if((0,ft.isMultiClauseFilter)(nt(this,Ae)))nt(this,Ae).filters.push(e);else throw Error("Invalid filter passed to FilterExpression")}setColumn(e,t=nt(this,Ae)){if((0,ft.isMultiClauseFilter)(t)){let n=t.filters.at(-1);n&&this.setColumn(e,n)}else t&&(t.column=e)}setOp(e,t=nt(this,Ae)){if((0,ft.isMultiClauseFilter)(t)){let n=t.filters.at(-1);n&&this.setOp(e,n)}else t&&(t.op=e)}setValue(e,t=nt(this,Ae)){var n;if((0,ft.isMultiClauseFilter)(t)){let o=t.filters.at(-1);o&&this.setValue(e,o)}else(0,ft.isMultiValueFilter)(t)?((n=t.values)!=null||(t.values=[]),t.values.push(e)):(0,ft.isSingleValueFilter)(t)&&(t.value=e)}toJSON(e=nt(this,Ae)){return this.name?{...e,name:this.name}:e}};Ae=new WeakMap;var Z0=Js.configure({strict:!0});var co=require("@vuu-ui/vuu-utils"),Jp=require("react");var{KEY:lT}=co.metadataKeys;var Xl=require("@vuu-ui/vuu-data"),Ys=require("react");var Zl=r=>(0,Xl.getServerAPI)().then(e=>e.getTableSchema(r));var Jl=require("@vuu-ui/vuu-layout"),Pt=require("react"),Yl=({dataSource:r,searchColumns:e=["description"],table:t})=>{let[n,o]=(0,Pt.useState)(r),{loadSession:s,saveSession:i}=(0,Jl.useViewContext)(),[a,l]=(0,Pt.useState)({searchText:"",filter:""}),u=(0,Pt.useMemo)(()=>e.map(c=>`${c} starts "__VALUE__"`).join(" or "),[e]);(0,Pt.useMemo)(()=>{if(r===void 0)if(t){let c=`instrument-search-${t.module}-${t.table}`,d=s==null?void 0:s(c);d?o(d):Zl(t).then(m=>{let f=new ql.RemoteDataSource({columns:m.columns.map(h=>h.name),table:m.table});o(f),i==null||i(f,c)})}else throw Error("useInstrumentSearch, if dataSource ismnot provided as prop, Vuu table must be provided")},[r,s,i,t]);let p=(0,Pt.useCallback)(c=>{let{value:d}=c.target,m=u.replaceAll("__VALUE__",d);l({searchText:d,filter:m}),n&&(n.filter={filter:m})},[u,n]);return{dataSource:n,onChange:p,searchState:a}};var Zt=require("react/jsx-runtime"),ei="vuuInstrumentSearch",Yp={columns:[{name:"bbg",hidden:!0},{name:"description",width:200,type:{name:"string",renderer:{name:"search-cell"}}}],rowSeparators:!0},ef=(0,Zt.jsx)("span",{"data-icon":"search"}),su=({TableProps:r,autoFocus:e=!1,className:t,dataSource:n,placeHolder:o,searchColumns:s,table:i,...a})=>{var g;let{dataSource:l,onChange:u,searchState:p}=Yl({dataSource:n,searchColumns:s,table:i}),{highlightedIndexRef:c,onHighlight:d,onKeyDown:m,tableRef:f}=(0,po.useControlledTableNavigation)(-1,(g=l==null?void 0:l.size)!=null?g:0),h=(0,ou.useCallback)(b=>{setTimeout(()=>{var E;(E=b==null?void 0:b.querySelector("input"))==null||E.focus()},100)},[]);return(0,Zt.jsxs)("div",{...a,className:(0,nu.default)(ei,t),children:[(0,Zt.jsx)("div",{className:`${ei}-inputField`,children:(0,Zt.jsx)(ru.Input,{inputProps:{onKeyDown:m},endAdornment:ef,placeholder:o,ref:e?h:null,value:p.searchText,onChange:u})}),l?(0,Zt.jsx)(po.Table,{disableFocus:!0,id:"instrument-search",rowHeight:25,config:Yp,highlightedIndex:c.current,renderBufferSize:100,...r,className:`${ei}-list`,dataSource:l,navigationStyle:"row",onHighlight:d,ref:f,showColumnHeaders:!1}):null]})},eu;(eu=tu.registerComponent)==null||eu("InstrumentSearch",su,"view");var Ir=require("@vuu-ui/vuu-utils"),Tr=require("react"),iu=Y(require("classnames"));var fo=require("react/jsx-runtime"),tf="vuuPriceTicker",rf=r=>(0,Ir.numericFormatter)({type:{name:"number",formatting:{decimals:r,zeroPad:!0}}}),nf=[void 0,void 0],au=(0,Tr.memo)(({className:r,decimals:e=2,price:t,showArrow:n,...o})=>{let s=(0,Tr.useRef)(nf),[i,a]=s.current,l=(0,Tr.useMemo)(()=>rf(e),[e]),u=(0,Ir.isValidNumber)(i)?(0,Ir.getMovingValueDirection)(t,a,i,e):"";return s.current=[t,u],(0,fo.jsxs)("div",{...o,className:(0,iu.default)(tf,r,u),children:[l(t),n?(0,fo.jsx)("span",{"data-icon":"price-arrow"}):null]})});au.displayName="PriceTicker";var wr=require("@vuu-ui/vuu-layout"),Iu=require("@salt-ds/core"),bo=Y(require("classnames")),Er=Y(require("react"));var vu=require("@vuu-ui/vuu-utils"),Ee=require("react");var lu=r=>typeof r=="object"&&r!==null&&"tabIndex"in r&&typeof r.tabIndex=="number",uu=r=>({label:"Close",location:"tab",action:"close-tab",options:r}),cu=r=>({label:"Rename",location:"tab",action:"rename-tab",options:r});var du=require("@vuu-ui/vuu-utils"),pu=(r,e)=>{if(r){let t=r.querySelector(`[data-index]:has(${e})`);return(0,du.getElementDataIndex)(t)}return-1},mo=r=>pu(r,'[aria-selected="true"]'),ti=r=>pu(r,".vuuEditableLabel-editing");var Cr=require("@vuu-ui/vuu-utils"),vt=require("react"),fu=(r,e,t="horizontal")=>{let n=(0,vt.useRef)(!1),o=(0,vt.useCallback)(()=>{n.current=!0},[]),s=(0,vt.useCallback)(()=>{n.current=!1},[]),i=(0,vt.useCallback)(()=>{var l,u;(l=r.current)==null||l.style.setProperty("--tab-thumb-transition","none"),(u=r.current)==null||u.removeEventListener("transitionend",i)},[r]),a=(0,vt.useRef)(-1);return(0,vt.useMemo)(()=>{var p,c;let l=0,u=0;if(a.current!==-1){let d=(p=r.current)==null?void 0:p.querySelector(".vuuTab-selected"),m=(c=r.current)==null?void 0:c.querySelector(`[data-index="${e}"] .vuuTab`),{positionProp:f,sizeProp:h}=Cr.MEASURES[t];if(d&&m&&!n.current){let{[f]:g,[h]:b}=d.getBoundingClientRect(),{[f]:E}=m.getBoundingClientRect();if((0,Cr.isValidNumber)(g)&&(0,Cr.isValidNumber)(E)&&(0,Cr.isValidNumber)(b)){l=g-E,u=b;let x=Math.abs(l/(t==="horizontal"?1100:700));requestAnimationFrame(()=>{var T,v,C,H;(T=r.current)==null||T.style.setProperty("--tab-thumb-offset","0px"),(v=r.current)==null||v.style.setProperty("--tab-thumb-size","100%"),(C=r.current)==null||C.style.setProperty("--tab-thumb-transition",`all ${x}s ease`),(H=r.current)==null||H.addEventListener("transitionend",i)})}}}return a.current=e,n.current?{containerStyle:{"--tab-thumb-offset":"0px","--tab-thumb-size":"100%"},resumeAnimation:s,suspendAnimation:o}:{containerStyle:{"--tab-thumb-offset":`${l}px`,"--tab-thumb-size":u?`${u}px`:void 0},resumeAnimation:s,suspendAnimation:o}},[e,r,t,i,s,o])};var hu=require("@salt-ds/core"),go=require("@vuu-ui/vuu-utils"),ye=require("react"),ke=require("@vuu-ui/vuu-utils");var gu={horizontal:{[ke.Home]:"start",[ke.End]:"end",[ke.ArrowLeft]:"bwd",[ke.ArrowRight]:"fwd"},vertical:{[ke.Home]:"start",[ke.End]:"end",[ke.ArrowUp]:"bwd",[ke.ArrowDown]:"fwd"}},of=(r,e="horizontal")=>gu[e][r]!==void 0,sf=r=>r===ke.ArrowDown;function mu(r,e,t){return e==="start"?0:e==="end"?r-1:e==="bwd"?t>0?t-1:t:t===null?0:t===r-1?t:t+1}var af=r=>r!==null&&!r.classList.contains("wrapped"),ho=(r,e)=>r?r.querySelector(`[data-index="${e}"]`):null,bu=({containerRef:r,defaultHighlightedIdx:e=-1,highlightedIdx:t,keyBoardActivation:n,orientation:o,selectedIndex:s=0})=>{let i=n==="manual",a=(0,ye.useRef)(!1),l=(0,ye.useRef)(-1),[u,p]=(0,ye.useState)(!1),[,c]=(0,ye.useState)({}),[d,m]=(0,hu.useControlled)({controlled:t,default:e,name:"UseKeyboardNavigation"}),f=(0,ye.useCallback)(y=>{m(l.current=y)},[m]),h=(0,ye.useRef)(!1),g=(0,ye.useCallback)((y,k=!1,O,L=70)=>{f(y),O===!0&&!h.current&&(h.current=!0);let M=()=>{let R=ho(r.current,y);if(R){let S=(0,go.getFocusableElement)(R);S==null||S.focus()}};k?M():setTimeout(M,L)},[r,f]),b=y=>{if(l.current===-1&&y.target.tabIndex!==-1){let k=ti(r.current);k!==-1?requestAnimationFrame(()=>{f(k)}):setTimeout(()=>{l.current===-1&&s!==null&&f(s)},200)}},E=(0,ye.useCallback)(()=>{var y,k;return(k=(y=r.current)==null?void 0:y.querySelectorAll("[data-index]").length)!=null?k:0},[r]),I=(0,ye.useCallback)((y="fwd",k)=>{let O=E(),M=mu(O,y,typeof k=="number"?k:O),R=y==="start"?"fwd":y==="end"?"bwd":y;for(;(R==="fwd"&&M<O||R==="bwd"&&M>0)&&!af(ho(r.current,M));){let S=mu(O,R,M);if(S===M)break;M=S}return M},[r,E]),x=(0,ye.useCallback)((y,k=!1)=>{let O=gu[o][y.key],L=I(O,d);L!==d?i&&g(L,!0):k&&c({})},[d,i,I,g,o]),T=(0,ye.useCallback)(()=>{let y=ho(r.current,d);return y?y.querySelector(".vuuPopupMenu")!=null:!1},[r,d]),v=(0,ye.useCallback)(()=>{let y=ho(r.current,d),k=y==null?void 0:y.querySelector(".vuuPopupMenu");return k&&(0,go.dispatchMouseEvent)(k,"click"),!1},[r,d]),C=(0,ye.useCallback)(y=>{E()>0&&of(y.key,o)?(y.preventDefault(),h.current?x(y):(h.current=!0,x(y,!0))):sf(y.key)&&T()&&v()},[v,E,T,x,o]),H=(y,k)=>{f(k)},w=(0,ye.useCallback)(()=>{u||(p(!0),a.current?a.current=!1:h.current=!0)},[u]),D=(0,ye.useCallback)(()=>{u||(a.current=!0),h.current=!1},[u]);return{containerProps:{onBlur:y=>{let k=y.target.closest(".vuuTabstrip"),O=y.relatedTarget;k&&!(k!=null&&k.contains(O))&&(f(-1),p(!1))},onMouseDownCapture:D,onFocus:w,onMouseLeave:()=>{h.current=!0,f(-1),a.current=!1}},focusVisible:h.current?d:-1,focusIsWithinComponent:u,highlightedIdx:d,focusTab:g,onClick:H,onFocus:b,onKeyDown:C,setHighlightedIdx:f}};var xu=require("@salt-ds/core"),pn=require("react"),lf=["Enter"," "],uf=r=>r&&r.matches('[class*="vuuTab "]'),yu=({defaultSelected:r,highlightedIdx:e,onSelectionChange:t,selected:n})=>{let[o,s,i]=(0,xu.useControlled)({controlled:n,default:r!=null?r:0,name:"Tabstrip",state:"value"}),a=(0,pn.useCallback)(c=>lf.includes(c.key),[]),l=(0,pn.useCallback)(c=>{s(c),t==null||t(c)},[t,s]),u=(0,pn.useCallback)(c=>{let d=c.target;a(c)&&e!==o&&uf(d)&&(c.stopPropagation(),c.preventDefault(),l(e))},[a,e,o,l]),p=(0,pn.useCallback)((c,d)=>{d!==o&&l(d)},[l,o]);return{activateTab:l,isControlled:i,onClick:p,onKeyDown:u,selected:o}};var cf=new Set(["Enter"," "]),df=r=>cf.has(r),pf=(r,e)=>r?r.querySelector(`[data-index="${e}"]`):null,Su=({activeTabIndex:r,allowDragDrop:e,animateSelectionThumb:t,containerRef:n,onActiveChange:o,onAddTab:s,onCloseTab:i,onExitEditMode:a,onMoveTab:l,orientation:u,keyBoardActivation:p})=>{let c=(0,Ee.useRef)(r),{focusTab:d,highlightedIdx:m,onClick:f,onKeyDown:h,setHighlightedIdx:g,...b}=bu({containerRef:n,keyBoardActivation:p,orientation:u,selectedIndex:c.current}),{activateTab:E,onClick:I,onKeyDown:x,selected:T}=yu({highlightedIdx:m,onSelectionChange:o,selected:r});c.current=T;let{containerStyle:v,resumeAnimation:C,suspendAnimation:H}=fu(n,t?T:-1,u),w=(0,Ee.useCallback)(($,U)=>{let{current:q}=c;console.log(`useTabstrip handleDrop ${$} - ${U} ${q}`),l==null||l($,U);let Q=-1;U!==-1&&(q===$?Q=U:$>q&&U<=q?Q=q+1:$<q&&U>=q&&(Q=q-1),Q!==-1&&(H(),E(Q),requestAnimationFrame(C)),d(U,!1,!1,350))},[d,l,C,E,H]),{onMouseDown:D,...V}=en({allowDragDrop:e,containerRef:n,draggableClassName:`tabstrip-${u}`,onDrop:w,orientation:"horizontal",itemQuery:".vuuOverflowContainer-item"}),y=(0,Ee.useCallback)(($,U,q,Q)=>{console.log(`handleExitEditMode ${$} ${U} ${q} ${Q}`),a==null||a($,U,q,Q),q||d(Q,!1,!0)},[d,a]),k=(0,Ee.useCallback)(($,U)=>{f($,U),I($,U)},[f,I]),O=(0,Ee.useCallback)(($=m)=>{let U=pf(n.current,$);if(U)return U.querySelector(".vuuEditableLabel")},[n,m]),L=(0,Ee.useCallback)(($=m)=>{let U=O($);return U?U.classList.contains("vuuEditableLabel-editing"):!1},[O,m]),M=(0,Ee.useCallback)(($=m)=>{let U=O($);U&&(0,vu.dispatchMouseEvent)(U,"dblclick")},[O,m]),R=(0,Ee.useCallback)($=>{h($),$.defaultPrevented||x($),!$.defaultPrevented&&df($.key)&&M()},[M,h,x]),S=(0,Ee.useCallback)($=>{let U=mo(n.current),q=U>$?U-1:U===$?0:U;return H(),i==null||i($,q),setTimeout(()=>{C()},200),!0},[n,i,C,H]),N=(0,Ee.useCallback)($=>(M($),!0),[M]),P=(0,Ee.useCallback)($=>{if(lu($.options))switch($.menuId){case"close-tab":return S($.options.tabIndex);case"rename-tab":return N($.options.tabIndex);default:console.log(`tab menu action ${$.menuId}`)}return!1},[S,N]),B=(0,Ee.useCallback)(()=>{L()?g(m):d(m)},[m,d,g,L]),F=(0,Ee.useCallback)($=>{let U=parseInt($.index);isNaN(U)||E(U)},[E]),K={onFocus:b.onFocus,onKeyDown:R},X=(0,Ee.useCallback)(()=>{s==null||s(),requestAnimationFrame(()=>{let $=mo(n.current);$!==-1&&d($)})},[n,d,s]),W={onClick:k,onKeyDown:R,onExitEditMode:y,onMenuAction:P,onMenuClose:B,onMouseDown:D};return{activeTabIndex:T,containerStyle:v,focusVisible:b.focusVisible,containerProps:{...b.containerProps,onSwitchWrappedItemIntoView:F},navigationProps:K,onClickAddTab:X,tabProps:W,...V}};var Dr=require("react/jsx-runtime"),Tu=require("react"),ri="vuuTabstrip",Il=({activeTabIndex:r,allowAddTab:e,allowCloseTab:t,allowDragDrop:n=!1,allowRenameTab:o=!1,animateSelectionThumb:s=!1,children:i,className:a,id:l,keyBoardActivation:u="manual",location:p,onActiveChange:c,onAddTab:d,onCloseTab:m,onExitEditMode:f,onMoveTab:h,orientation:g="horizontal",showTabMenuButton:b,style:E,tabClassName:I,...x})=>{let T=(0,Er.useRef)(null),{activeTabIndex:v,focusVisible:C,containerStyle:H,draggedItemIndex:w,onClickAddTab:D,tabProps:V,...y}=Su({activeTabIndex:r,allowDragDrop:n,animateSelectionThumb:s,containerRef:T,keyBoardActivation:u,onActiveChange:c,onAddTab:d,onCloseTab:m,onExitEditMode:f,onMoveTab:h,orientation:g}),k=(0,wr.useId)(l),O=(0,bo.default)(ri,`${ri}-${g}`,a),L=E||H?{...E,...H}:void 0,M=(0,Er.useMemo)(()=>(0,wr.asReactElements)(i).map((R,S)=>{let{id:N=`${k}-tab-${S}`,className:P,closeable:B=t,editable:F=o,location:K,showMenuButton:X=b}=R.props,W=S===v;return Er.default.cloneElement(R,{...V,...y.navigationProps,className:(0,bo.default)(P,I),closeable:B,"data-overflow-priority":W?"1":void 0,dragging:w===S,editable:F,focusVisible:C===S,id:N,index:S,key:S,location:(0,bo.default)(p,K),selected:W,showMenuButton:X,tabIndex:W?0:-1})}).concat(e?(0,Tu.createElement)(Iu.Button,{...y.navigationProps,"aria-label":"Create Tab",className:`${ri}-addTabButton`,"data-icon":"add","data-overflow-priority":"1",key:"addButton",onClick:D,variant:"secondary",tabIndex:-1}):[]),[i,e,y.navigationProps,D,k,t,o,b,v,V,I,w,C,p]);return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(wr.OverflowContainer,{...x,...y.containerProps,className:O,height:29,id:k,orientation:g,overflowIcon:"more-horiz",ref:T,style:L,children:M}),y.draggable]})};var Lu=require("@salt-ds/core"),ku=Y(require("classnames")),Yt=require("react");var Cu=require("@vuu-ui/vuu-popups"),wu=require("react"),Eu=Y(require("classnames"));var Mu=require("react/jsx-runtime"),ff="vuuTabMenu",Du=({allowClose:r,allowRename:e,controlledComponentId:t,controlledComponentTitle:n,location:o,onMenuAction:s,onMenuClose:i,index:a})=>{let[l,u]=(0,wu.useMemo)(()=>[(p,c)=>{let d=[];return e&&d.push(cu(c)),r&&d.push(uu(c)),d},{controlledComponentId:t,controlledComponentTitle:n,tabIndex:a}],[r,e,t,a]);return(0,Mu.jsx)(Cu.PopupMenu,{className:ff,menuBuilder:l,menuActionHandler:s,menuLocation:(0,Eu.default)("tab",o),menuOptions:u,onMenuClose:i,tabIndex:-1})};var Jt=require("react/jsx-runtime"),qt="vuuTab",Pu=()=>{},Tl=(0,Yt.forwardRef)(function({ariaControls:e,children:t,className:n,closeable:o=!1,dragging:s,editable:i=!1,editing:a,focusVisible:l,index:u=-1,label:p,location:c,onClick:d,onClose:m,onEnterEditMode:f=Pu,onExitEditMode:h=Pu,onFocus:g,onKeyUp:b,onMenuAction:E,onMenuClose:I,orientation:x,selected:T,showMenuButton:v=o||i||!!c,tabIndex:C,...H},w){if(v&&typeof E!="function")throw Error("Tab onMenuAction must be provided if showMenuButton is set");let D=(0,Yt.useRef)(null),V=(0,Yt.useRef)(null),y=(0,Lu.useForkRef)(w,D),k=(0,Yt.useCallback)(S=>{a||(S.preventDefault(),d==null||d(S,u))},[a,u,d]),O=(S="",N="",P=!0)=>h(S,N,P,u),L=S=>{switch(S.key){case"Backspace":case"Delete":o&&(S.stopPropagation(),m&&m(u));break;default:b&&b(S,u)}},M=()=>i?(0,Jt.jsx)(Is,{editing:a,defaultValue:p,onEnterEditMode:f,onExitEditMode:O,ref:V},p):p,R=S=>{if(V.current){let P=V.current.querySelector(".vuuEditableLabel-input");P==null||P.focus()}g==null||g(S)};return(0,Jt.jsxs)("div",{...H,"aria-controls":e,"aria-selected":T,className:(0,ku.default)(qt,n,{[`${qt}-closeable`]:o,"vuuDraggable-dragAway":s,[`${qt}-editing`]:a,[`${qt}-selected`]:T||void 0,[`${qt}-vertical`]:x==="vertical",vuuFocusVisible:l}),onClick:k,onFocus:R,onKeyUp:L,ref:y,role:"tab",tabIndex:C,children:[(0,Jt.jsx)("div",{className:`${qt}-main`,children:(0,Jt.jsx)("span",{className:`${qt}-text`,"data-text":i?void 0:p,children:t!=null?t:M()})}),v?(0,Jt.jsx)(Du,{allowClose:o,allowRename:i,controlledComponentId:e,controlledComponentTitle:p,location:c,onMenuAction:E,onMenuClose:I,index:u}):null]})});var Co=require("@salt-ds/core"),To=Y(require("classnames")),wo=require("react");function mf(r){var e;if(r){let t=r.dataset.idx;if(t)return parseInt(t,10);if(t=(e=r.ariaPosInSet)!=null?e:"-1")return parseInt(t,10)-1}}var ni=r=>r.closest("[data-idx],[aria-posinset]");var Ru=r=>mf(ni(r));var Mr=require("react"),hf=new Set(["/","-","."]),gf=r=>hf.has(r),Hu=(r,e)=>e.startsWith(r)&&gf(e[r.length]),oi=(r,e="root",{collapsibleHeaders:t=void 0,defaultExpanded:n=!1,revealSelected:o=!1}={})=>{let s=(d,m,f)=>{if(d.childNodes)return d.childNodes.length;if(d.header){let h=f+1,g=0;for(;h<m.length&&!m[h].header;)g++,h++;return g}else return 0},i=(0,Mr.useCallback)(d=>Array.isArray(o)?o.some(m=>Hu(d,m)):n,[n,o]),a=(0,Mr.useCallback)((d,m,f=1,h="",g=[],b=[])=>{let E=0;return d.forEach((I,x,T)=>{var O;let v=I.header&&t,C=I.childNodes&&t===!1,H=!I.childNodes||I.childNodes.length===0,w=C||H&&!v,D=h?`${h}.${x}`:`${x}`,V=(O=I.id)!=null?O:`${e}-${D}`,y=w?void 0:i(V),k={...I,childNodes:void 0,id:V,count:!C&&y===void 0?0:s(I,T,x),expanded:y,index:m.index,level:f};if(g.push(k),b.push(d[x]),E+=1,m.index+=1,I.childNodes){let[L,M]=a(I.childNodes,m,f+1,D,[],b);k.childNodes=M,(y===!0||C)&&(E+=L)}}),[E,g,b]},[t,e,i]),[l,u,p]=(0,Mr.useMemo)(()=>a(r,{index:0}),[a,r]),c=(0,Mr.useCallback)((d,m=u)=>{let f=m.find(h=>{var g;return h.id===d||((g=h==null?void 0:h.childNodes)==null?void 0:g.length)&&Hu(h.id,d)});if((f==null?void 0:f.id)===d)return p[f.index];if(f)return c(d,f.childNodes)},[p,u]);return[l,u,c]};var Lt=require("react"),Au=require("@salt-ds/core"),Nu="single",bf="checkbox",xf="multi",yf="extended",vf=["Enter"," "],Ou={},Sf=r=>r.expanded!==void 0,Fu=r=>r&&r!=="none",Vu=({defaultSelected:r,highlightedIdx:e,treeNodes:t,onChange:n,selected:o,selection:s=Nu,selectionKeys:i=vf})=>{let a=s===Nu,l=s===xf||s.startsWith(bf),u=s===yf,p=(0,Lt.useRef)(-1),c=(0,Lt.useCallback)(x=>i.includes(x.key),[i]),[d,m]=(0,Au.useControlled)({controlled:o,default:r!=null?r:[],name:"selected"}),f=(0,Lt.useCallback)((x,T,v,C,H=!1)=>{let{current:w}=p,D=d==null?void 0:d.includes(v),y=a||u&&!H&&(!C||w===-1),k=l||u&&H&&!C,O=[];if(y&&D)O=[];else if(y)O=[v];else if(k&&D)O=d.filter(L=>L!==v);else if(k)O=d.concat(v);else if(u){let[L,M]=T>w?[w,T]:[T,w];O=d.slice();for(let R=L;R<=M;R++){let{id:S}=t[R];d.includes(S)||O.push(S)}}m(O),n&&n(x,O)},[u,t,l,n,d,m,a]),h=(0,Lt.useCallback)(x=>{if(~e&&c(x)){x.preventDefault();let T=t[e];f(x,e,T.id,!1,x.ctrlKey||x.metaKey),u&&(p.current=e)}},[u,e,t,c,f]),g=(0,Lt.useCallback)((x,T)=>{if(u&&x.shiftKey){let v=t[T];f(x,T,v.id,!0)}},[u,t,f]),b=s==="none"?Ou:{onKeyDown:h,onKeyboardNavigation:g},E=(0,Lt.useCallback)(x=>{if(e!==-1){let T=t[e];Sf(T)||(x.preventDefault(),x.stopPropagation(),f(x,e,T.id,x.shiftKey,x.ctrlKey||x.metaKey),u&&(p.current=e))}},[u,e,t,f]);return{listHandlers:b,listItemHandlers:s==="none"?Ou:{onClick:E},selected:d,setSelected:m}};var Fe=require("react");var If=["height","scrollHeight"],Bu=(r,e,t=!1)=>{let n=(0,Fe.useRef)(0),o=(0,Fe.useRef)(!1),s=(0,Fe.useRef)(0),i=(0,Fe.useRef)(0),a=(0,Fe.useCallback)(p=>{let c=p.ariaExpanded?p.firstChild:p,d=t?30:0,m=c.offsetTop,f=c.offsetHeight,h=n.current+d,g=h+s.current-d;(m+f>g||m<h)&&(n.current=m+f>g?n.current+(m+f)-g:m-d,o.current=!0,r.current&&(r.current.scrollTop=n.current),setTimeout(()=>{o.current=!1}))},[r,t]),l=(0,Fe.useCallback)(p=>{n.current=p.target.scrollTop},[]);(0,Fe.useEffect)(()=>{let{current:p}=r;return p&&p.addEventListener("scroll",l),()=>{p&&p.removeEventListener("scroll",l)}},[r,l]),(0,Fe.useLayoutEffect)(()=>{if(e!==-1&&i.current>s.current&&r.current){let p=r.current.querySelector(`
|
|
6
6
|
[data-idx='${e}'],
|
|
7
7
|
[aria-posinset='${e+1}']
|
|
8
|
-
`);p===null?console.log("[useViewportTracking], is this virtualised ? we're going to have to know rowHeight"):a(p)}},[e,r,a]),(0,Fe.useEffect)(()=>{},[t]);let u=(0,Fe.useCallback)(({height:p,scrollHeight:c})=>{s.current=p,i.current=c},[]);return ot(r,If,u,!0),o};var fn=require("react");var Xe=require("react");var $u=({id:r})=>{let e=r.lastIndexOf("-");if(e!==-1){let n=r.slice(e+1).split(".");return n.length===1?null:(n.pop(),`${r.slice(0,e)}-${n.join(".")}`)}else if((e=r.lastIndexOf("/"))!==-1)return r.slice(0,e)},_u=r=>r.childNodes!==void 0;var si=r=>r.header===!0,Tf=new Set([".","/"]),Ku=(r,e)=>e.startsWith(r.id)?Tf.has(e.charAt(r.id.length)):!1,er=(r,e)=>{for(let t of r){if(t.id===e)return t;if(Ku(t,e))return er(t.childNodes,e)}},xo=(r,e)=>{let t=typeof e=="string"?e:e.id;for(let n=0;n<r.length;n++)if(r[n].id===t)return n},yo=(r,e,t)=>{let n;return r.map(s=>s.id===e?{...s,...t}:Ku(s,e)?(n=yo(s.childNodes,e,t),{...s,childNodes:n}):s)};var Xu=require("@salt-ds/core");function Cf(r,...e){let t=new Set(r);for(let n of e)for(let o of n)t.add(o);return t}var ii="ArrowUp",zu="ArrowDown",Pr="ArrowLeft";var Uu="ArrowRight",vo="Enter";var wf="Delete",Ef=new Set([vo,wf]),Df=new Set(["Tab"]),Mf=new Set(["ArrowRight","ArrowLeft"]),Gu=new Set(["Home","End","ArrowDown","ArrowUp"]),Wu=new Set(["Home","End","ArrowRight","ArrowLeft"]),Pf=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),
|
|
8
|
+
`);p===null?console.log("[useViewportTracking], is this virtualised ? we're going to have to know rowHeight"):a(p)}},[e,r,a]),(0,Fe.useEffect)(()=>{},[t]);let u=(0,Fe.useCallback)(({height:p,scrollHeight:c})=>{s.current=p,i.current=c},[]);return ot(r,If,u,!0),o};var fn=require("react");var Xe=require("react");var $u=({id:r})=>{let e=r.lastIndexOf("-");if(e!==-1){let n=r.slice(e+1).split(".");return n.length===1?null:(n.pop(),`${r.slice(0,e)}-${n.join(".")}`)}else if((e=r.lastIndexOf("/"))!==-1)return r.slice(0,e)},_u=r=>r.childNodes!==void 0;var si=r=>r.header===!0,Tf=new Set([".","/"]),Ku=(r,e)=>e.startsWith(r.id)?Tf.has(e.charAt(r.id.length)):!1,er=(r,e)=>{for(let t of r){if(t.id===e)return t;if(Ku(t,e))return er(t.childNodes,e)}},xo=(r,e)=>{let t=typeof e=="string"?e:e.id;for(let n=0;n<r.length;n++)if(r[n].id===t)return n},yo=(r,e,t)=>{let n;return r.map(s=>s.id===e?{...s,...t}:Ku(s,e)?(n=yo(s.childNodes,e,t),{...s,childNodes:n}):s)};var Xu=require("@salt-ds/core");function Cf(r,...e){let t=new Set(r);for(let n of e)for(let o of n)t.add(o);return t}var ii="ArrowUp",zu="ArrowDown",Pr="ArrowLeft";var Uu="ArrowRight",vo="Enter";var wf="Delete",Ef=new Set([vo,wf]),Df=new Set(["Tab"]),Mf=new Set(["ArrowRight","ArrowLeft"]),Gu=new Set(["Home","End","ArrowDown","ArrowUp"]),Wu=new Set(["Home","End","ArrowRight","ArrowLeft"]),Pf=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),nw=Cf(Ef,Wu,Gu,Mf,Pf,Df);var Qu=({key:r},e="vertical")=>(e==="vertical"?Gu:Wu).has(r);function ju(r,e,t){return e===ii||e===Pr?t>0?t-1:t:t===null?0:t===r-1?t:t+1}var Lf=r=>!r.header&&!r.childNodes,kf=r=>Lf(r)||r.expanded!==void 0,Zu=({defaultHighlightedIdx:r=-1,highlightedIdx:e,treeNodes:t,onHighlight:n,onKeyboardNavigation:o,selected:s=[]})=>{let{bwd:i,fwd:a}=(0,Xe.useMemo)(()=>({bwd:ii,fwd:zu}),[]),[l,u,p]=(0,Xu.useControlled)({controlled:e,default:r,name:"highlightedIdx"}),c=(0,Xe.useCallback)(x=>{n==null||n(x),u(x)},[n,u]),d=(0,Xe.useCallback)((x=a,T=x===a?-1:t.length)=>{let v=ju(t.length,x,T);for(;v!==-1&&(x===a&&v<t.length||x===i&&v>0)&&!kf(t[v]);)v=ju(t.length,x,v);return v},[i,a,t]),m=(0,Xe.useRef)(!0),f=(0,Xe.useRef)(!1),h=x=>f.current=x,g=(0,Xe.useCallback)(()=>{if(f.current)f.current=!1;else if(s.length>0){let x=er(t,s[0]);if(x){let T=xo(t,x);c(T)}}else c(d())},[t,d,s,c]),b=(0,Xe.useCallback)(x=>{let T=d(x.key,l);T!==l&&(c(T),o==null||o(x,T))},[l,d,o,c]),E=(0,Xe.useCallback)(x=>{t.length>0&&Qu(x,"vertical")&&(x.preventDefault(),x.stopPropagation(),m.current=!0,b(x))},[t,b]),I=(0,Xe.useMemo)(()=>({onBlur:()=>{c(-1)},onFocus:g,onKeyDown:E,onMouseDownCapture:()=>{m.current=!1,h(!0)},onMouseMove:()=>{m.current&&(m.current=!1)},onMouseLeave:()=>{m.current=!0,h(!1),c(-1)}}),[g,E,c]);return{focusVisible:m.current?l:-1,controlledHighlighting:p,highlightedIdx:l,hiliteItemAtIndex:c,keyBoardNavigation:m,listProps:I,setIgnoreFocus:h}};var Lr=require("react");var So=(r,e=[],t={value:0})=>{let n=!1;for(let o of r)n&&!si(o)||(e[t.value]=o,t.value+=1,n=!1,si(o)&&o.expanded===!1?n=!0:_u(o)&&Io(o)&&So(o.childNodes,e,t));return e},qu=r=>{let e=(0,Lr.useRef)(r),t=(0,Lr.useRef)(r),n=(0,Lr.useRef)(So(r)),[,o]=(0,Lr.useState)({});r!==e.current&&(e.current=r,t.current=r,n.current=So(r));let s=i=>{t.current=i,n.current=So(i),o({})};return{data:t.current,indexPositions:n.current,setData:s}};var St=require("react");var Rf={},Hf=r=>r&&r.hasAttribute("aria-expanded"),Ju=({collapsibleHeaders:r,highlightedIdx:e,treeNodes:t,setVisibleData:n,source:o})=>{let s=(0,St.useRef)(o),i=(0,St.useRef)(s.current),a=(0,St.useCallback)(f=>{n(i.current=f)},[n]),l=(0,St.useCallback)((f,{id:h})=>yo(f,h,{expanded:!0}),[]),u=(0,St.useCallback)((f,{id:h})=>yo(f,h,{expanded:!1}),[]),p=(0,St.useCallback)(f=>{if(f.key===Uu||f.key===vo){let h=t[e];h&&h.expanded===!1&&(f.preventDefault(),a(l(i.current,h)))}if(f.key===Pr||f.key===vo){let h=t[e];h&&h.expanded&&(f.preventDefault(),a(u(i.current,h)))}},[u,l,e,t,a]),c=r?{onKeyDown:p}:Rf,m={onClick:(0,St.useCallback)(f=>{let h=ni(f.target);if(Hf(h)){f.stopPropagation(),f.preventDefault();let g=er(o,h.id);(g==null?void 0:g.expanded)===!1?a(l(o,g)):(g==null?void 0:g.expanded)===!0&&a(u(o,g))}},[u,l,a,o])};return{listHandlers:c,listItemHandlers:m}};var Yu=require("react");var ec=({highlightedIdx:r,hiliteItemAtIndex:e,indexPositions:t,source:n})=>({listHandlers:{onKeyDown:(0,Yu.useCallback)(i=>{if(i.key===Pr){let a=t[r],l=$u(a);if(l){i.preventDefault();let u=er(n,l);if(u){let p=xo(t,u);p!==void 0&&e(p)}}}},[r,e,t,n])}});var Nf=[],tc=({defaultSelected:r,sourceWithIds:e,onChange:t,onHighlight:n,selected:o,selection:s})=>{let i=(0,fn.useRef)(Nf),a=qu(e),l=(I,x)=>{var T,v;(v=(T=d.listHandlers).onKeyboardNavigation)==null||v.call(T,I,x)},{highlightedIdx:u,...p}=Zu({treeNodes:a.indexPositions,onHighlight:n,onKeyboardNavigation:l,selected:i.current}),c=Ju({collapsibleHeaders:!0,highlightedIdx:u,treeNodes:a.indexPositions,setVisibleData:a.setData,source:a.data}),d=Vu({defaultSelected:r,highlightedIdx:u,treeNodes:a.indexPositions,onChange:t,selected:o,selection:s}),m=ec({source:a.data,highlightedIdx:u,hiliteItemAtIndex:p.hiliteItemAtIndex,indexPositions:a.indexPositions}),f=(0,fn.useCallback)(I=>{var x,T,v;(x=c.listItemHandlers)==null||x.onClick(I),I.defaultPrevented||(v=(T=d.listItemHandlers)==null?void 0:T.onClick)==null||v.call(T,I)},[c,d]),h=(0,fn.useCallback)(I=>{var x,T,v,C,H,w,D,V;(T=(x=p.listProps).onKeyDown)==null||T.call(x,I),I.defaultPrevented||(C=(v=d.listHandlers).onKeyDown)==null||C.call(v,I),I.defaultPrevented||(w=(H=c.listHandlers).onKeyDown)==null||w.call(H,I),I.defaultPrevented||(V=(D=m.listHandlers).onKeyDown)==null||V.call(D,I)},[c.listHandlers,p.listProps,d.listHandlers,m.listHandlers]),g=()=>{var I;return u===void 0||u===-1||(I=a.indexPositions[u])==null?void 0:I.id};i.current=d.selected;let b={"aria-activedescendant":g(),onBlur:p.listProps.onBlur,onFocus:p.listProps.onFocus,onKeyDown:h,onMouseDownCapture:p.listProps.onMouseDownCapture,onMouseLeave:p.listProps.onMouseLeave,onMouseMove:p.listProps.onMouseMove},E={onClick:f};return{focusVisible:p.focusVisible,highlightedIdx:u,hiliteItemAtIndex:p.hiliteItemAtIndex,listProps:b,listItemHandlers:E,selected:d.selected,visibleData:a.data}};var Ke=require("react/jsx-runtime"),oc=require("react"),kt="vuuTree",Io=r=>r.expanded===!0,ai=({children:r,idx:e,...t})=>(0,Ke.jsx)("li",{...t,children:r}),rc=(0,wo.forwardRef)(function({allowDragDrop:e,className:t,defaultSelected:n,groupSelection:o="none",id:s,onHighlight:i,onSelectionChange:a,revealSelected:l,selected:u,selection:p="single",source:c,...d},m){var M;let f=(0,Co.useIdMemo)(s),h=(0,wo.useRef)(null),[,g,b]=oi(c,f,{revealSelected:l?(M=u!=null?u:n)!=null?M:!1:void 0}),E=(R,S)=>{if(a){let N=S.map(P=>b(P)).filter(P=>P!==void 0);a(N)}},{focusVisible:I,highlightedIdx:x,hiliteItemAtIndex:T,listProps:v,listItemHandlers:C,selected:H,visibleData:w}=tc({defaultSelected:n,groupSelection:o,onChange:E,onHighlight:i,selected:u,selection:p,sourceWithIds:g});Bu(h,x);let V={...{onMouseEnter:R=>{let S=R.target,N=Ru(S);T(N)}},...C,role:"treeitem"},y=Fu(o);function k(R,S,N){R.push((0,Ke.jsxs)(ai,{...V,...Of(S,N,x,H,I),children:[S.icon?(0,Ke.jsx)("span",{className:`${kt}Node-icon`,"data-icon":S.icon}):null,(0,Ke.jsx)("span",{children:S.label})]})),N.value+=1}function O(R,S,N,P,B){let{value:F}=N;N.value+=1,R.push((0,oc.createElement)(ai,{...C,"aria-expanded":S.expanded,"aria-level":S.level,"aria-selected":H.includes(P)||void 0,className:(0,To.default)(`${kt}Node`,{focusVisible:I===F,[`${kt}Node-toggle`]:!y}),"data-idx":F,"data-highlighted":F===x||void 0,"data-selectable":!0,id:P,key:`header-${F}`},y?(0,Ke.jsxs)("div",{className:`${kt}Node-label`,children:[(0,Ke.jsx)("span",{className:`${kt}Node-toggle`}),B]}):(0,Ke.jsxs)("div",{className:`${kt}Node-label`,children:[S.icon?(0,Ke.jsx)("span",{className:`${kt}Node-icon`,"data-icon":S.icon}):null,(0,Ke.jsx)("span",{children:B})]}),(0,Ke.jsx)("ul",{role:"group",children:Io(S)?L(S.childNodes,N):""})))}function L(R,S={value:0}){if((R==null?void 0:R.length)>0){let N=[];for(let P of R)P.childNodes?O(N,P,S,P.id,P.label):k(N,P,S);return N}}return(0,Ke.jsx)("ul",{...d,...v,className:(0,To.default)(kt,t),id:`Tree-${f}`,ref:(0,Co.useForkRef)(h,m),role:"tree",tabIndex:0,children:L(w)})}),Of=(r,e,t,n,o,s)=>({id:r.id,key:r.id,"aria-level":r.level,"aria-selected":n.includes(r.id)||void 0,"data-idx":e.value,"data-highlighted":e.value===t||void 0,className:(0,To.default)("vuuTreeNode",s,{focusVisible:o===e.value})});rc.displayName="Tree";var nc=rc;var sc=require("@vuu-ui/vuu-utils"),ic=require("@salt-ds/core"),ac=Y(require("classnames")),kr=require("react"),Eo=require("@vuu-ui/vuu-popups"),lc=require("@vuu-ui/vuu-layout");var Rt=require("react/jsx-runtime"),li="vuuInput",Af={autoComplete:"off"},jn=(0,kr.forwardRef)(function({className:e,errorMessage:t,id:n,onCommit:o,onKeyDown:s,type:i,...a},l){let u=(0,lc.useId)(n),{anchorProps:p,tooltipProps:c}=(0,Eo.useTooltip)({id:u,tooltipContent:t}),d=(0,kr.useCallback)((g,b)=>{if(i==="number"){let E=parseFloat(b);if((0,sc.isValidNumber)(E))o(g,E);else throw Error("Invalid value")}else i==="boolean"?o(g,!!b):o(g,b)},[o,i]),m=(0,kr.useCallback)(g=>{if(g.key==="Enter"){g.preventDefault(),g.stopPropagation();let{value:b}=g.target;d(g,b)}s==null||s(g)},[d,s]),f=(0,kr.useCallback)(g=>{let{value:b}=g.target;d(g,b)},[d]),h=t?(0,Rt.jsx)("span",{...p,className:`${li}-errorIcon`,"data-icon":"error"}):void 0;return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(ic.Input,{...a,endAdornment:h,id:u,inputProps:{...Af,...a.inputProps},className:(0,ac.default)(li,e,{[`${li}-errror`]:t}),onBlur:f,ref:l,onKeyDown:m}),c?(0,Rt.jsx)(Eo.Tooltip,{...c,status:"error"}):null]})});
|
|
9
9
|
//# sourceMappingURL=index.js.map
|