andoncloud-dashboard-toolkit 1.5.39 → 1.5.41

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.
@@ -2345,6 +2345,7 @@ export type StatusInsightsInput = {
2345
2345
  dateTo: Scalars['ISO8601DateTime']['input'];
2346
2346
  dayType: DayType;
2347
2347
  reasonId: Scalars['ID']['input'];
2348
+ shiftIds: Array<Scalars['ID']['input']>;
2348
2349
  };
2349
2350
  export type StatusInsightsResult = {
2350
2351
  __typename?: 'StatusInsightsResult';
@@ -3408,6 +3409,7 @@ export type WorkplacePerformanceInsightsInput = {
3408
3409
  availabilityStatuses?: InputMaybe<Array<AvailabilityStatus>>;
3409
3410
  dayType?: InputMaybe<DayType>;
3410
3411
  endDate: Scalars['ISO8601DateTime']['input'];
3412
+ shiftIds: Array<Scalars['ID']['input']>;
3411
3413
  sortOrder?: InputMaybe<Scalars['String']['input']>;
3412
3414
  startDate: Scalars['ISO8601DateTime']['input'];
3413
3415
  userIds?: InputMaybe<Array<Scalars['ID']['input']>>;
package/dist/index.js CHANGED
@@ -12,5 +12,5 @@ return N.createElement("div",null,u)}var c=a[0]?this.getOptionValue(a[0]):"";/*#
12
12
  return N.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,n=this.state,t=n.ariaSelection,r=n.focusedOption,i=n.focusedValue,o=n.isFocused,a=n.selectValue,s=this.getFocusableOptions();/*#__PURE__*/
13
13
  return N.createElement(Pa,ao({},e,{id:this.getElementId("live-region"),ariaSelection:t,focusedOption:r,focusedValue:i,isFocused:o,selectValue:a,focusableOptions:s,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),n=e.Control,t=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,o=this.props,a=o.className,s=o.id,u=o.isDisabled,c=o.menuIsOpen,l=this.state.isFocused,d=this.commonProps=this.getCommonProps();/*#__PURE__*/
14
14
  return N.createElement(r,ao({},d,{className:a,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:l}),this.renderLiveRegion(),/*#__PURE__*/N.createElement(n,ao({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:l,menuIsOpen:c}),/*#__PURE__*/N.createElement(i,ao({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),/*#__PURE__*/N.createElement(t,ao({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,n){var t=n.prevProps,r=n.clearFocusValueOnUpdate,i=n.inputIsHiddenAfterUpdate,o=n.ariaSelection,a=n.isFocused,s=n.prevWasFocused,u=n.instancePrefix,c=e.options,l=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,m=Lo(l),g={};if(t&&(l!==t.value||c!==t.options||d!==t.menuIsOpen||p!==t.inputValue)){var b=d?function(e,n){return gs(ms(e,n))}(e,m):[],h=d?bs(ms(e,m),"".concat(u,"-option")):[],v=r?function(e,n){var t=e.focusedValue,r=e.selectValue.indexOf(t);if(r>-1){if(n.indexOf(t)>-1)return t;if(r<n.length)return n[r]}return null}(n,m):null,I=function(e,n){var t=e.focusedOption;return t&&n.indexOf(t)>-1?t:n[0]}(n,b);g={selectValue:m,focusedOption:I,focusedOptionId:vs(h,I),focusableOptionsWithIds:h,focusedValue:v,clearFocusValueOnUpdate:!1}}var y=null!=i&&e!==t?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},C=o,x=a&&s;return a&&!x&&(C={value:na(f,m,m[0]||null),options:m,action:"initial-input-focus"},x=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(C=null),eo(eo(eo({},g),y),{},{prevProps:e,ariaSelection:C,prevWasFocused:x})}}]),i}();Rs.defaultProps=ps;var Ts=/*#__PURE__*/e.forwardRef(function(n,t){var r=function(n){var t=n.defaultInputValue,r=void 0===t?"":t,i=n.defaultMenuIsOpen,o=void 0!==i&&i,a=n.defaultValue,s=void 0===a?null:a,u=n.inputValue,c=n.menuIsOpen,l=n.onChange,d=n.onInputChange,p=n.onMenuClose,f=n.onMenuOpen,m=n.value,g=io(n,oo),b=ro(e.useState(void 0!==u?u:r),2),h=b[0],v=b[1],I=ro(e.useState(void 0!==c?c:o),2),y=I[0],C=I[1],x=ro(e.useState(void 0!==m?m:s),2),A=x[0],E=x[1],w=e.useCallback(function(e,n){"function"==typeof l&&l(e,n),E(e)},[l]),R=e.useCallback(function(e,n){var t;"function"==typeof d&&(t=d(e,n)),v(void 0!==t?t:e)},[d]),T=e.useCallback(function(){"function"==typeof f&&f(),C(!0)},[f]),S=e.useCallback(function(){"function"==typeof p&&p(),C(!1)},[p]),N=void 0!==u?u:h,O=void 0!==c?c:y,D=void 0!==m?m:A;return eo(eo({},g),{},{inputValue:N,menuIsOpen:O,onChange:w,onInputChange:R,onMenuClose:S,onMenuOpen:T,value:D})}(n);/*#__PURE__*/
15
- return N.createElement(Rs,ao({ref:t},r))}),Ss=Ts;const Ns="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Os(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function Ds(e){return"nodeType"in e}function ks(e){var n,t;return e?Os(e)?e:Ds(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function Gs(e){const{Document:n}=ks(e);return e instanceof n}function Bs(e){return!Os(e)&&e instanceof ks(e).HTMLElement}function Ps(e){return e instanceof ks(e).SVGElement}function Ms(e){return e?Os(e)?e.document:Ds(e)?Gs(e)?e:Bs(e)||Ps(e)?e.ownerDocument:document:document:document}const Vs=Ns?e.useLayoutEffect:e.useEffect;function Ws(n){const t=e.useRef(n);return Vs(()=>{t.current=n}),e.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Fs(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return Vs(()=>{r.current!==n&&(r.current=n)},t),r}function Hs(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function Xs(n){const t=Ws(n),r=e.useRef(null),i=e.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,i]}function Ls(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let Zs={};function Ys(n,t){return e.useMemo(()=>{if(t)return t;const e=null==Zs[n]?0:Zs[n]+1;return Zs[n]=e,n+"-"+e},[n,t])}function js(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>{const r=Object.entries(t);for(const[t,i]of r){const r=n[t];null!=r&&(n[t]=r+e*i)}return n},{...n})}}const Js=/*#__PURE__*/js(1),zs=/*#__PURE__*/js(-1);function _s(e){if(!e)return!1;const{KeyboardEvent:n}=ks(e.target);return n&&e instanceof n}function Us(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=ks(e.target);return n&&e instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const qs=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[qs.Translate.toString(e),qs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),Qs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $s(e){return e.matches(Qs)?e:e.querySelector(Qs)}const Ks={display:"none"};function eu(e){let{id:n,value:t}=e;return S.default.createElement("div",{id:n,style:Ks},t)}function nu(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return S.default.createElement("div",{id:n,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},t)}const tu=/*#__PURE__*/e.createContext(null),ru={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},iu={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function ou(n){let{announcements:t=iu,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=ru}=n;const{announce:a,announcement:s}=function(){const[n,t]=e.useState("");return{announce:e.useCallback(e=>{null!=e&&t(e)},[]),announcement:n}}(),u=Ys("DndLiveRegion"),[c,l]=e.useState(!1);if(e.useEffect(()=>{l(!0)},[]),function(n){const t=e.useContext(tu);e.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(n)},[n,t])}(e.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;const d=S.default.createElement(S.default.Fragment,null,S.default.createElement(eu,{id:i,value:o.draggable}),S.default.createElement(nu,{id:u,announcement:s}));return r?I.createPortal(d,r):d}var au;function su(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(au||(au={}));const uu=/*#__PURE__*/Object.freeze({x:0,y:0});function cu(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function lu(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),i=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height);if(r<i&&t<o){const a=(i-r)*(o-t);return Number((a/(n.width*n.height+e.width*e.height-a)).toFixed(4))}return 0}const du=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,o=t.get(r);if(o){const t=lu(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(cu)};function pu(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:uu}function fu(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>({...n,top:n.top+e*t.y,bottom:n.bottom+e*t.y,left:n.left+e*t.x,right:n.right+e*t.x}),{...n})}}const mu=/*#__PURE__*/fu(1),gu={ignoreTransform:!1};function bu(e,n){void 0===n&&(n=gu);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=ks(e).getComputedStyle(e);n&&(t=function(e,n,t){const r=function(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}(n);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(t),c=e.top-s-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),l=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:l,height:d,top:c,right:u+l,bottom:c+d,left:u}}(t,n,r))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=t;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function hu(e){return bu(e,{ignoreTransform:!0})}function vu(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(Gs(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Bs(i)||Ps(i))return t;if(t.includes(i))return t;const o=ks(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=ks(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=n[e];return"string"==typeof r&&t.test(r)})}(i,o)&&t.push(i),function(e,n){return void 0===n&&(n=ks(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function Iu(e){const[n]=vu(e,1);return null!=n?n:null}function yu(e){return Ns&&e?Os(e)?e:Ds(e)?Gs(e)||e===Ms(e).scrollingElement?window:Bs(e)?e:null:null:null}function Cu(e){return Os(e)?e.scrollX:e.scrollLeft}function xu(e){return Os(e)?e.scrollY:e.scrollTop}function Au(e){return{x:Cu(e),y:xu(e)}}var Eu;function wu(e){return!(!Ns||!e)&&e===document.scrollingElement}function Ru(e){const n={x:0,y:0},t=wu(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height};return{isTop:e.scrollTop<=n.y,isLeft:e.scrollLeft<=n.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:n}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Eu||(Eu={}));const Tu={x:.2,y:.2};function Su(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=Tu);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=Ru(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,b=n.width*i.x;return!c&&o<=n.top+g?(f.y=Eu.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=Eu.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-b?(f.x=Eu.Forward,m.x=r*Math.abs((n.right-b-s)/b)):!d&&a<=n.left+b&&(f.x=Eu.Backward,m.x=r*Math.abs((n.left+b-a)/b)),{direction:f,speed:m}}function Nu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:n}=window;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}const{top:n,left:t,right:r,bottom:i}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ou(e){return e.reduce((e,n)=>Js(e,Au(n)),uu)}const Du=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+Cu(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+xu(n),0)}]];class ku{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const t=vu(n),r=Ou(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of Du)for(const o of n)Object.defineProperty(this,o,{get:()=>{const n=i(t);return this.rect[o]+(r[e]-n)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Gu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var n;return null==(n=this.target)?void 0:n.removeEventListener(...e)})},this.target=e}add(e,n,t){var r;null==(r=this.target)||r.addEventListener(e,n,t),this.listeners.push([e,n,t])}}function Bu(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof n?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n&&r>n.y}var Pu,Mu;function Vu(e){e.preventDefault()}function Wu(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Pu||(Pu={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Mu||(Mu={}));const Fu={start:[Mu.Space,Mu.Enter],cancel:[Mu.Esc],end:[Mu.Space,Mu.Enter,Mu.Tab]},Hu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case Mu.Right:return{...t,x:t.x+25};case Mu.Left:return{...t,x:t.x-25};case Mu.Down:return{...t,y:t.y+25};case Mu.Up:return{...t,y:t.y-25}}};class Xu{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Gu(Ms(n)),this.windowListeners=new Gu(ks(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pu.Resize,this.handleCancel),this.windowListeners.add(Pu.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Pu.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=bu),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);Iu(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(uu)}handleKeyDown(e){if(_s(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=Fu,coordinateGetter:o=Hu,scrollBehavior:a="smooth"}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=t.current,c=u?{x:u.left,y:u.top}:uu;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=zs(l,c),r={x:0,y:0},{scrollableAncestors:i}=t.current;for(const t of i){const i=e.code,{isTop:o,isRight:s,isLeft:u,isBottom:c,maxScroll:d,minScroll:p}=Ru(t),f=Nu(t),m={x:Math.min(i===Mu.Right?f.right-f.width/2:f.right,Math.max(i===Mu.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===Mu.Down?f.bottom-f.height/2:f.bottom,Math.max(i===Mu.Down?f.top:f.top+f.height/2,l.y))},g=i===Mu.Down&&!c||i===Mu.Up&&!o;if((i===Mu.Right&&!s||i===Mu.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===Mu.Right&&e<=d.x||i===Mu.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===Mu.Right?t.scrollLeft-d.x:t.scrollLeft-p.x,r.x&&t.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==l.y){const e=t.scrollTop+n.y,o=i===Mu.Down&&e<=d.y||i===Mu.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===Mu.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Js(zs(l,this.referenceCoordinates),r))}}}handleMove(e,n){const{onMove:t}=this.props;e.preventDefault(),t(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Lu(e){return Boolean(e&&"distance"in e)}function Zu(e){return Boolean(e&&"delay"in e)}Xu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=Fu,onActivation:i}=n,{active:o}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const n=o.activatorNode.current;return!(n&&e.target!==n||(e.preventDefault(),null==i||i({event:e.nativeEvent}),0))}return!1}}];class Yu{constructor(e,n,t){var r;void 0===t&&(t=function(e){const{EventTarget:n}=ks(e);return e instanceof n?e:Ms(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Ms(o),this.documentListeners=new Gu(this.document),this.listeners=new Gu(t),this.windowListeners=new Gu(ks(o)),this.initialCoordinates=null!=(r=Us(i))?r:uu,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Pu.Resize,this.handleCancel),this.windowListeners.add(Pu.DragStart,Vu),this.windowListeners.add(Pu.VisibilityChange,this.handleCancel),this.windowListeners.add(Pu.ContextMenu,Vu),this.documentListeners.add(Pu.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Lu(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:t,onPending:r}=this.props;r(t,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Pu.Click,Wu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pu.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:t,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!r)return;const s=null!=(n=Us(e))?n:uu,u=zs(r,s);if(!t&&a){if(Lu(a)){if(null!=a.tolerance&&Bu(u,a.tolerance))return this.handleCancel();if(Bu(u,a.distance))return this.handleStart()}return Zu(a)&&Bu(u,a.tolerance)?this.handleCancel():void this.handlePending(a,u)}e.cancelable&&e.preventDefault(),o(s)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Mu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ju={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ju extends Yu{constructor(e){const{event:n}=e,t=Ms(n.target);super(e,ju,t)}}Ju.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!(!t.isPrimary||0!==t.button||(null==r||r({event:t}),0))}}];const zu={move:{name:"mousemove"},end:{name:"mouseup"}};var _u;!function(e){e[e.RightClick=2]="RightClick"}(_u||(_u={})),class extends Yu{constructor(e){super(e,zu,Ms(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==_u.RightClick&&(null==r||r({event:t}),!0)}}];const Uu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var qu,Qu;(class extends Yu{constructor(e){super(e,Uu)}static setup(){return window.addEventListener(Uu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Uu.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:i}=t;return!(i.length>1||(null==r||r({event:t}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(qu||(qu={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Qu||(Qu={}));const $u={x:{[Eu.Backward]:!1,[Eu.Forward]:!1},y:{[Eu.Backward]:!1,[Eu.Forward]:!1}};var Ku,ec;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ku||(Ku={})),function(e){e.Optimized="optimized"}(ec||(ec={}));const nc=/*#__PURE__*/new Map;function tc(e,n){return Hs(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function rc(n){let{callback:t,disabled:r}=n;const i=Ws(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)},[r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function ic(e){return new ku(bu(e),e)}function oc(n,t,r){void 0===t&&(t=ic);const[i,o]=e.useState(null);function a(){o(e=>{if(!n)return null;var i;if(!1===n.isConnected)return null!=(i=null!=e?e:r)?i:null;const o=t(n);return JSON.stringify(e)===JSON.stringify(o)?e:o})}const s=function(n){let{callback:t,disabled:r}=n;const i=Ws(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)},[i,r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(e){if(n)for(const t of e){const{type:e,target:r}=t;if("childList"===e&&r instanceof HTMLElement&&r.contains(n)){a();break}}}}),u=rc({callback:a});return Vs(()=>{a(),n?(null==u||u.observe(n),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())},[n]),i}const ac=[];function sc(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==uu;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?zs(n,r.current):uu}function uc(n){return e.useMemo(()=>n?function(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}(n):null,[n])}const cc=[],lc=[{sensor:Ju,options:{}},{sensor:Xu,options:{}}],dc={current:{}},pc={draggable:{measure:hu},droppable:{measure:hu,strategy:Ku.WhileDragging,frequency:ec.Optimized},dragOverlay:{measure:bu}};class fc extends Map{get(e){var n;return null!=e&&null!=(n=super.get(e))?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,t;return null!=(n=null==(t=this.get(e))?void 0:t.node.current)?n:void 0}}const mc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new fc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:su},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pc,measureDroppableContainers:su,windowRect:null,measuringScheduled:!1},gc=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:su,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:su}),bc=/*#__PURE__*/e.createContext(mc);function hc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fc}}}function vc(e,n){switch(n.type){case au.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case au.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case au.DragEnd:case au.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case au.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new fc(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case au.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const a=new fc(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case au.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new fc(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Ic(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(gc),a=Ls(i),s=Ls(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!_s(a))return;if(document.activeElement===a.target)return;const e=o.get(s);if(!e)return;const{activatorNode:n,node:t}=e;if(!n.current&&!t.current)return;requestAnimationFrame(()=>{for(const e of[n.current,t.current]){if(!e)continue;const n=$s(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const yc=/*#__PURE__*/e.createContext({...uu,scaleX:1,scaleY:1});var Cc;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Cc||(Cc={}));const xc=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=lc,collisionDetection:d=du,measuring:p,modifiers:f,...m}=n;const g=e.useReducer(vc,void 0,hc),[b,h]=g,[v,y]=function(){const[n]=e.useState(()=>new Set),t=e.useCallback(e=>(n.add(e),()=>n.delete(e)),[n]),r=e.useCallback(e=>{let{type:t,event:r}=e;n.forEach(e=>{var n;return null==(n=e[t])?void 0:n.call(e,r)})},[n]);return[r,t]}(),[C,x]=e.useState(Cc.Uninitialized),A=C===Cc.Initialized,{draggable:{active:E,nodes:w,translate:R},droppable:{containers:T}}=b,N=null!=E?w.get(E):null,O=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==N?void 0:N.data)?e:dc,rect:O}:null},[E,N]),k=e.useRef(null),[G,B]=e.useState(null),[P,M]=e.useState(null),V=Fs(m,Object.values(m)),W=Ys("DndDescribedBy",a),F=e.useMemo(()=>T.getEnabled(),[T]),H=function(n){return e.useMemo(()=>({draggable:{...pc.draggable,...null==n?void 0:n.draggable},droppable:{...pc.droppable,...null==n?void 0:n.droppable},dragOverlay:{...pc.dragOverlay,...null==n?void 0:n.dragOverlay}}),[null==n?void 0:n.draggable,null==n?void 0:n.droppable,null==n?void 0:n.dragOverlay])}(p),{droppableRects:X,measureDroppableContainers:L,measuringScheduled:Z}=function(n,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=e.useState(null),{frequency:u,measure:c,strategy:l}=o,d=e.useRef(n),p=function(){switch(l){case Ku.Always:return!1;case Ku.BeforeDragging:return r;default:return!r}}(),f=Fs(p),m=e.useCallback(function(e){void 0===e&&(e=[]),f.current||s(n=>null===n?e:n.concat(e.filter(e=>!n.includes(e))))},[f]),g=e.useRef(null),b=Hs(e=>{if(p&&!r)return nc;if(!e||e===nc||d.current!==n||null!=a){const e=new Map;for(let t of n){if(!t)continue;if(a&&a.length>0&&!a.includes(t.id)&&t.rect.current){e.set(t.id,t.rect.current);continue}const n=t.node.current,r=n?new ku(c(n),n):null;t.rect.current=r,r&&e.set(t.id,r)}return e}return e},[n,a,r,p,c]);return e.useEffect(()=>{d.current=n},[n]),e.useEffect(()=>{p||m()},[r,p]),e.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),e.useEffect(()=>{p||"number"!=typeof u||null!==g.current||(g.current=setTimeout(()=>{m(),g.current=null},u))},[u,p,m,...i]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=a}}(F,{dragging:A,dependencies:[R.x,R.y],config:H.droppable}),Y=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return Hs(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(w,E),j=e.useMemo(()=>P?Us(P):null,[P]),J=function(){const e=A&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),z=function(e,n){return tc(e,n)}(Y,H.draggable.measure);!function(n){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=n;const a=e.useRef(!1),{x:s,y:u}="boolean"==typeof o?{x:o,y:o}:o;Vs(()=>{if(!s&&!u||!t)return void(a.current=!1);if(a.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=pu(r(e),i);if(s||(n.x=0),u||(n.y=0),a.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=Iu(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?w.get(E):null,config:J.layoutShiftCompensation,initialRect:z,measure:H.draggable.measure});const _=oc(Y,H.draggable.measure,z),U=oc(Y?Y.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Q=T.getNodeFor(null==(t=q.current.over)?void 0:t.id),$=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(Bs(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=rc({callback:o}),s=e.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Bs(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=Xs(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:H.dragOverlay.measure}),K=null!=(r=$.nodeRef.current)?r:Y,ee=A?null!=(i=$.rect)?i:_:null,ne=Boolean($.nodeRef.current&&$.rect),te=pu(re=ne?null:_,tc(re));var re;const ie=uc(K?ks(K):null),oe=function(n){const t=e.useRef(n),r=Hs(e=>n?e&&e!==ac&&n&&t.current&&n.parentNode===t.current.parentNode?e:vu(n):ac,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(A?null!=Q?Q:Y:null),ae=function(n,t){void 0===t&&(t=bu);const[r]=n,i=uc(r?ks(r):null),[o,a]=e.useState(cc);function s(){a(()=>n.length?n.map(e=>wu(e)?i:new ku(t(e),e)):cc)}const u=rc({callback:s});return Vs(()=>{null==u||u.disconnect(),s(),n.forEach(e=>null==u?void 0:u.observe(e))},[n]),o}(oe),se=function(e,n){let{transform:t,...r}=n;return null!=e&&e.length?e.reduce((e,n)=>n({transform:e,...r}),t):t}(f,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:P,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:$.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?Js(j,R):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=yu(e.target);n&&r(e=>e?(e.set(n,Au(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=yu(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,Au(n)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),i.current=n}return()=>{t(n),t(e)};function t(e){e.forEach(e=>{const n=yu(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>Js(e,n),uu):Ou(n):uu,[n,t])}(oe),le=sc(ce),de=sc(ce,[_]),pe=Js(se,le),fe=ee?mu(ee,se):null,me=D&&fe?d({active:D,collisionRect:fe,droppableRects:X,droppableContainers:F,pointerCoordinates:ue}):null,ge=function(e){if(!e||0===e.length)return null;const[n]=e;return n.id}(me),[be,he]=e.useState(null),ve=function(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}(ne?se:Js(se,de),null!=(o=null==be?void 0:be.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==k.current)return;const i=w.get(k.current);if(!i)return;const o=e.nativeEvent,a=new t({active:k.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!w.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),v({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!w.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),v({type:"onDragPending",event:o})},onStart(e){const n=k.current;if(null==n)return;const t=w.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:O}};I.unstable_batchedUpdates(()=>{null==r||r(i),x(Cc.Initializing),h({type:au.DragStart,initialCoordinates:e,active:n}),v({type:"onDragStart",event:i}),B(Ie.current),M(o)})},onMove(e){h({type:au.DragMove,coordinates:e})},onEnd:s(au.DragEnd),onCancel:s(au.DragCancel)});function s(e){return async function(){const{active:n,collisions:t,over:r,scrollAdjustedTranslate:i}=q.current;let a=null;if(n&&i){const{cancelDrop:s}=V.current;a={activatorEvent:o,active:n,collisions:t,delta:i,over:r},e===au.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=au.DragCancel)}k.current=null,I.unstable_batchedUpdates(()=>{h({type:e}),x(Cc.Uninitialized),he(null),B(null),M(null),Ie.current=null;const n=e===au.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),v({type:n,event:a})}})}}Ie.current=a},[w]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=w.get(r);null!==k.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},k.current=r,ye(t,n))},[w,ye]),xe=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[n,t])}(l,Ce);!function(n){e.useEffect(()=>{if(!Ns)return;const e=n.map(e=>{let{sensor:n}=e;return null==n.setup?void 0:n.setup()});return()=>{for(const n of e)null==n||n()}},n.map(e=>{let{sensor:n}=e;return n}))}(l),Vs(()=>{_&&C===Cc.Initializing&&x(Cc.Initialized)},[_,C]),e.useEffect(()=>{const{onDragMove:e}=V.current,{active:n,activatorEvent:t,collisions:r,over:i}=q.current;if(!n||!t)return;const o={active:n,activatorEvent:t,collisions:r,delta:{x:pe.x,y:pe.y},over:i};I.unstable_batchedUpdates(()=>{null==e||e(o),v({type:"onDragMove",event:o})})},[pe.x,pe.y]),e.useEffect(()=>{const{active:e,activatorEvent:n,collisions:t,droppableContainers:r,scrollAdjustedTranslate:i}=q.current;if(!e||null==k.current||!n||!i)return;const{onDragOver:o}=V.current,a=r.get(ge),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,u={active:e,activatorEvent:n,collisions:t,delta:{x:i.x,y:i.y},over:s};I.unstable_batchedUpdates(()=>{he(s),null==o||o(u),v({type:"onDragOver",event:u})})},[ge]),Vs(()=>{q.current={activatorEvent:P,active:D,activeNode:Y,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:w,draggingNode:K,draggingNodeRect:ee,droppableContainers:T,over:be,scrollableAncestors:oe,scrollAdjustedTranslate:pe},O.current={initial:ee,translated:fe}},[D,Y,me,fe,w,K,ee,X,T,be,oe,pe]),function(n){let{acceleration:t,activator:r=qu.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=Qu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=Ls(n);return Hs(e=>{if(t||!r||!e)return $u;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[Eu.Backward]:e.x[Eu.Backward]||-1===i,[Eu.Forward]:e.x[Eu.Forward]||1===i},y:{[Eu.Backward]:e.y[Eu.Backward]||-1===o,[Eu.Forward]:e.y[Eu.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,b]=function(){const n=e.useRef(null);return[e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]),e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),h=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case qu.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qu.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(h.current.x*v.current.x,h.current.y*v.current.y)},[]),x=e.useMemo(()=>u===Qu.TreeOrder?[...l].reverse():l,[u,l]);e.useEffect(()=>{if(a&&l.length&&I){for(const e of x){if(!1===(null==i?void 0:i(e)))continue;const n=l.indexOf(e),r=d[n];if(!r)continue;const{direction:o,speed:a}=Su(e,r,I,t,f);for(const e of["x","y"])m[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return b(),y.current=e,g(C,s),h.current=a,void(v.current=o)}h.current={x:0,y:0},v.current={x:0,y:0},b()}else b()},[t,C,i,b,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...J,delta:R,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Y,activeNodeRect:_,activatorEvent:P,collisions:me,containerNodeRect:U,dragOverlay:$,draggableNodes:w,droppableContainers:T,droppableRects:X,over:be,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:H,measuringScheduled:Z,windowRect:ie}),[D,Y,_,P,me,U,$,w,T,X,be,L,oe,ae,H,Z,ie]),Ee=e.useMemo(()=>({activatorEvent:P,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:w,over:be,measureDroppableContainers:L}),[P,xe,D,_,h,W,w,be,L]);return S.default.createElement(tu.Provider,{value:y},S.default.createElement(gc.Provider,{value:Ee},S.default.createElement(bc.Provider,{value:Ae},S.default.createElement(yc.Provider,{value:ve},c)),S.default.createElement(Ic,{disabled:!1===(null==s?void 0:s.restoreFocus)})),S.default.createElement(ou,{...s,hiddenTextDescribedById:W}))}),Ac=/*#__PURE__*/e.createContext(null),Ec="button",wc={timeout:25};function Rc(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Tc(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function Sc(e){return null!==e&&e>=0}const Nc=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=Rc(n,r,t),a=n[i],s=o[i];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},Oc="Sortable",Dc=/*#__PURE__*/S.default.createContext({activeIndex:-1,containerId:Oc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Nc,disabled:{draggable:!1,droppable:!1}});function kc(n){let{children:t,id:r,items:i,strategy:o=Nc,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(bc),p=Ys(Oc,r),f=Boolean(null!==u.rect),m=e.useMemo(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),g=null!=s,b=s?m.indexOf(s.id):-1,h=l?m.indexOf(l.id):-1,v=e.useRef(m),I=!function(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}(m,v.current),y=-1!==h&&-1===b||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);Vs(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const x=e.useMemo(()=>({activeIndex:b,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:h,useDragOverlay:f,sortedRects:Tc(m,c),strategy:o}),[b,p,C.draggable,C.droppable,y,m,h,c,f,o]);return S.default.createElement(Dc.Provider,{value:x},t)}const Gc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return Rc(t,r,i).indexOf(n)},Bc=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:c}=e;return!(!c||!r||s!==o&&i===a||!t&&(a===i||n!==u))},Pc={duration:200,easing:"ease"},Mc="transform",Vc=/*#__PURE__*/qs.Transition.toString({property:Mc,duration:0,easing:"linear"}),Wc={roleDescription:"sortable"};var Fc=function(n){var t=function(n){let{animateLayoutChanges:t=Bc,attributes:r,disabled:i,data:o,getNewIndex:a=Gc,id:s,strategy:u,resizeObserverConfig:c,transition:l=Pc}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:b,overIndex:h,useDragOverlay:v,strategy:I}=e.useContext(Dc),y=function(e,n){var t,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(t=null==e?void 0:e.draggable)?t:n.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:n.droppable}}(i,m),C=d.indexOf(s),x=e.useMemo(()=>({sortable:{containerId:p,index:C,items:d},...o}),[p,o,C,d]),A=e.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:E,node:w,isOver:R,setNodeRef:T}=function(n){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=n;const a=Ys("Droppable"),{active:s,dispatch:u,over:c,measureDroppableContainers:l}=e.useContext(gc),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:h}={...wc,...o},v=Fs(null!=b?b:i),I=rc({callback:e.useCallback(()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},h)):p.current=!0},[h]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=Xs(y),A=Fs(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:au.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:au.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:au.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,u]),{active:s,rect:f,isOver:(null==c?void 0:c.id)===i,node:C,over:c,setNodeRef:x}}({id:s,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:S,activatorEvent:N,activeNodeRect:O,attributes:D,setNodeRef:k,listeners:G,isDragging:B,over:P,setActivatorNodeRef:M,transform:V}=function(n){let{id:t,data:r,disabled:i=!1,attributes:o}=n;const a=Ys("Draggable"),{activators:s,activatorEvent:u,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:p,over:f}=e.useContext(gc),{role:m=Ec,roleDescription:g="draggable",tabIndex:b=0}=null!=o?o:{},h=(null==c?void 0:c.id)===t,v=e.useContext(h?yc:Ac),[I,y]=Xs(),[C,x]=Xs(),A=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[n,t])}(s,t),E=Fs(r);return Vs(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:E}),()=>{const e=p.get(t);e&&e.key===a&&p.delete(t)}),[p,t]),{active:c,activatorEvent:u,activeNodeRect:l,attributes:e.useMemo(()=>({role:m,tabIndex:b,"aria-disabled":i,"aria-pressed":!(!h||m!==Ec)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,b,h,g,d.draggable]),isDragging:h,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...Wc,...r},disabled:y.draggable}),W=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return e.useMemo(()=>e=>{t.forEach(n=>n(e))},t)}(T,k),F=Boolean(S),H=F&&!g&&Sc(f)&&Sc(h),X=!v&&B,L=X&&H?V:null,Z=H?null!=L?L:(null!=u?u:I)({rects:b,activeNodeRect:O,activeIndex:f,overIndex:h,index:C}):null,Y=Sc(f)&&Sc(h)?a({id:s,items:d,activeIndex:f,overIndex:h}):C,j=null==S?void 0:S.id,J=e.useRef({activeId:j,items:d,newIndex:Y,containerId:p}),z=d!==J.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:F,id:s,index:C,items:d,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:l,wasDragging:null!=J.current.activeId}),U=function(n){let{disabled:t,index:r,node:i,rect:o}=n;const[a,s]=e.useState(null),u=e.useRef(r);return Vs(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=bu(i.current,{ignoreTransform:!0}),t={x:e.left-n.left,y:e.top-n.top,scaleX:e.width/n.width,scaleY:e.height/n.height};(t.x||t.y)&&s(t)}}r!==u.current&&(u.current=r)},[t,r,i,o]),e.useEffect(()=>{a&&s(null)},[a]),a}({disabled:!_,index:C,node:w,rect:E});return e.useEffect(()=>{F&&J.current.newIndex!==Y&&(J.current.newIndex=Y),p!==J.current.containerId&&(J.current.containerId=p),d!==J.current.items&&(J.current.items=d)},[F,Y,p,d]),e.useEffect(()=>{if(j===J.current.activeId)return;if(null!=j&&null==J.current.activeId)return void(J.current.activeId=j);const e=setTimeout(()=>{J.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:E,index:C,newIndex:Y,items:d,isOver:R,isSorting:F,isDragging:B,listeners:G,node:w,overIndex:h,over:P,setNodeRef:W,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:k,transform:null!=U?U:Z,transition:U||z&&J.current.newIndex===C?Vc:X&&!_s(N)||!l?void 0:F||_?qs.Transition.toString({...l,property:Mc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:qs.Transform.toString(t.transform),transition:a};/*#__PURE__*/return S.default.createElement("div",L({ref:o,style:s},r,i,{onPointerDown:function(e){e.target instanceof HTMLElement&&(["svg","path"].includes(e.target.nodeName)&&(e.preventDefault(),e.stopPropagation()),null==i||i.onPointerDown(e))}}),/*#__PURE__*/S.default.createElement(Sa.MultiValueContainer,n))},Hc=function(e){var n=L({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});/*#__PURE__*/return S.default.createElement(Sa.MultiValueLabel,L({},e,{innerProps:n}))},Xc=Zi(function(e,n){var t,r,i,o="[object Map]",a="[object Promise]",s="[object Set]",u="[object WeakMap]",c="[object DataView]",l=/^\[object .+?Constructor\]$/,d="object"==typeof self&&self&&self.Object===Object&&self,p="object"==typeof Xi&&Xi&&Xi.Object===Object&&Xi||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,b=Function.prototype,h=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=b.toString,C=h.hasOwnProperty,x=h.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=g?p.Buffer:void 0,w=h.propertyIsEnumerable,R=E?E.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=F(p,"DataView"),N=F(p,"Map"),O=F(p,"Promise"),D=F(p,"Set"),k=F(p,"WeakMap"),G=!w.call({valueOf:1},"valueOf"),B=X(S),P=X(N),M=X(O),V=X(D),W=X(k);function F(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return function(e){if(!J(e)||function(e){return!!I&&I in e}(e))return!1;var n=j(e)||function(e){var n=!1;if(null!=e&&"function"!=typeof e.toString)try{n=!!(e+"")}catch(e){}return n}(e)?A:l;return n.test(X(e))}(t)?t:void 0}var H=function(e){return x.call(e)};function X(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&H(new S(new ArrayBuffer(1)))!=c||N&&H(new N)!=o||O&&H(O.resolve())!=a||D&&H(new D)!=s||k&&H(new k)!=u)&&(H=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?X(t):void 0;if(r)switch(r){case B:return c;case P:return o;case M:return a;case V:return s;case W:return u}return n});var L=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!j(e)}var Y=R||function(){return!1};function j(e){var n=J(e)?x.call(e):"";return"[object Function]"==n||"[object GeneratorFunction]"==n}function J(e){var n=typeof e;return!!e&&("object"==n||"function"==n)}e.exports=function(e){if(Z(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||Y(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!w.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=H(e);if(n==o||n==s)return!e.size;if(G||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||h)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),Lc=function(e,n){return Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},Lc(e,n)};function Zc(e,n){function t(){this.constructor=e}Lc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function Yc(e){return"function"==typeof e}var jc=!1,Jc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){jc=e},get useDeprecatedSynchronousErrorHandling(){return jc}};function zc(e){setTimeout(function(){throw e},0)}var _c={closed:!0,next:function(e){},error:function(e){if(Jc.useDeprecatedSynchronousErrorHandling)throw e;zc(e)},complete:function(){}},Uc=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function qc(e){return null!==e&&"object"==typeof e}var Qc=/*@__PURE__*/function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,n){return n+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=/*@__PURE__*/Object.create(Error.prototype),e}(),$c=Qc,Kc=/*@__PURE__*/function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var n;if(!this.closed){var t=this,r=t._parentOrParents,i=t._ctorUnsubscribe,o=t._unsubscribe,a=t._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s)r[s].remove(this);if(Yc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof $c?el(e.errors):[e]}}if(Uc(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(qc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof $c?n=n.concat(el(e.errors)):n.push(e)}}}if(n)throw new $c(n)}},e.prototype.add=function(n){var t=n;if(!n)return e.EMPTY;switch(typeof n){case"function":t=new e(n);case"object":if(t===this||t.closed||"function"!=typeof t.unsubscribe)return t;if(this.closed)return t.unsubscribe(),t;if(!(t instanceof e)){var r=t;(t=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+n+" added to Subscription.")}var i=t._parentOrParents;if(null===i)t._parentOrParents=this;else if(i instanceof e){if(i===this)return t;t._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return t;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[t]:o.push(t),t},e.prototype.remove=function(e){var n=this._subscriptions;if(n){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function el(e){return e.reduce(function(e,n){return e.concat(n instanceof $c?n.errors:n)},[])}var nl=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),tl=/*@__PURE__*/function(e){function n(t,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=_c;break;case 1:if(!t){o.destination=_c;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new rl(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new rl(o,t,r,i)}return o}return Zc(n,e),n.prototype[nl]=function(){return this},n.create=function(e,t,r){var i=new n(e,t,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(Kc),rl=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return Yc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==_c&&(Yc((s=Object.create(t)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=o,a._error=r,a._complete=i,a}return Zc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;Jc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var n=this._parentSubscriber,t=Jc.useDeprecatedSynchronousErrorHandling;if(this._error)t&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(n.syncErrorThrowable)t?(n.syncErrorValue=e,n.syncErrorThrown=!0):zc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;zc(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var t=function(){return e._complete.call(e._context)};Jc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,n){try{e.call(this._context,n)}catch(e){if(this.unsubscribe(),Jc.useDeprecatedSynchronousErrorHandling)throw e;zc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!Jc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return Jc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(zc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(tl),il=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function ol(e){return e}var al=/*@__PURE__*/function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(e,n,t){var r=this.operator,i=function(e,n,t){if(e){if(e instanceof tl)return e;if(e[nl])return e[nl]()}return e||n||t?new tl(e,n,t):new tl(_c)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||Jc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Jc.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){Jc.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),function(e){for(;e;){var n=e.destination;if(e.closed||e.isStopped)return!1;e=n&&n instanceof tl?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=sl(n))(function(n,r){var i;i=t.subscribe(function(n){try{e(n)}catch(e){r(e),i&&i.unsubscribe()}},r,n)})},e.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},e.prototype[il]=function(){return this},e.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 0===n.length?this:(0===(e=n).length?ol:1===e.length?e[0]:function(n){return e.reduce(function(e,n){return n(e)},n)})(this)},e.prototype.toPromise=function(e){var n=this;return new(e=sl(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},e.create=function(n){return new e(n)},e}();function sl(e){if(e||(e=Jc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var ul=/*#__PURE__*/function(){function e(e,n){var t=this;this.wsURL=void 0,this.cable=null,this.subscriptions=new Map,this.onDisconnect=void 0,this.addSubscription=function(e,n){t.subscriptions.set(e,n)},this.wsURL=e,this.onDisconnect=n}var n=e.prototype;return n.connect=function(e,n){this.cable=H.default.createConsumer(this.wsURL+"?token="+e+"&lang="+n)},n.disconnect=function(){this.cable&&(this.subscriptions.forEach(function(e){e.unsubscribe()}),this.subscriptions.clear(),this.cable.disconnect(),this.cable=null)},n.request=function(e){var n=this.cable,t=this.subscriptions,r=this.addSubscription,i=this.onDisconnect;return new al(function(o){if(n){var a,s=(null==(a=e.variables)?void 0:a.id)||"company";if(!t.has(s)){var u=n.subscriptions.create({channel:"GraphqlChannel",channelId:Math.round(Date.now()+1e5*Math.random()).toString(16)},{connected:function(){this.perform("execute",e)},disconnected:function(){i&&i()},received:function(e){e.more?e.result.errors?o.error&&o.error(e.result.errors[0]):e.result.data&&o.next&&(Xc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}});r(s,u)}}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),cl=0,ll=/*#__PURE__*/function(){function e(e,n,t,r){this.actionCableClient=null,this.registry=new Map,this.activeRxSubscriptions=new Map,this.actionCableClient=new ul(e,r),this.actionCableClient.connect(n,t)}var n=e.prototype;return n.subscribe=function(e,n,t,r){var i=this;void 0===r&&(r=function(e){throw e});var o=String(++cl);this.registry.set(o,{query:e,variables:n,onData:t,onError:r});var a=this.subscribeToActionCable(e,n,t,r);return this.activeRxSubscriptions.set(o,a),function(){a.unsubscribe(),i.activeRxSubscriptions.delete(o),i.registry.delete(o)}},n.disconnect=function(){var e;this.activeRxSubscriptions.forEach(function(e){return e.unsubscribe()}),this.activeRxSubscriptions.clear(),this.registry.clear(),null==(e=this.actionCableClient)||e.disconnect(),this.actionCableClient=null},n.getActiveSubscriptions=function(){return new Map(this.registry)},n.resubscribe=function(){var e=this;this.activeRxSubscriptions.forEach(function(e){return e.unsubscribe()}),this.activeRxSubscriptions.clear(),this.registry.forEach(function(n,t){var r=e.subscribeToActionCable(n.query,n.variables,n.onData,n.onError);e.activeRxSubscriptions.set(t,r)})},n.subscribeToActionCable=function(e,n,t,r){if(void 0===r&&(r=function(e){throw e}),!this.actionCableClient)throw new Error("No WS client available");var i=this.actionCableClient.request({query:e,variables:n}).subscribe({next:function(e){var n=e.data,i=e.errors;if(i)return r(new Error(JSON.stringify(i)));n&&t&&t(function(e){var n=Object.keys(e);if(1!==n.length)throw new Error("Expected exactly one response key, got: "+n.join(", "));return e[n[0]]}(n))}});return i},e}(),dl=function(e,n,t,r){return new ll(e,n,t,r)},pl=function(e,n){return ci(new E.GraphQLClient(e,{fetch:n}))},fl=function(n){var t,r=n.url,o=n.wsUrl,a=n.lang,s=i.useStore().sessionStore,u=e.useState(),c=u[0],l=u[1],d=e.useState(),p=d[0],f=d[1],m=e.useRef(void 0),g=e.useRef(""),b=o||r.replace("graphql","cable"),h=(null==(t=s.loginStatus.authResponse)?void 0:t.accessToken)||"";return e.useEffect(function(){r&&l(pl(r,i.fetch))},[r]),e.useEffect(function(){if(r&&h&&h!==g.current){g.current=h;var e=m.current,n=null==e?void 0:e.getActiveSubscriptions(),t=dl(b,h,a,function(){"connected"===s.loginStatus.status&&console.warn("[dashboard-toolkit] WebSocket disconnected unexpectedly — waiting for token refresh")});return m.current=t,n&&n.size>0&&n.forEach(function(e){t.subscribe(e.query,e.variables,e.onData,e.onError)}),f(t),e&&e.disconnect(),function(){t.disconnect(),m.current=void 0}}},[r,b,h,a]),{graphqlSdk:c,gqlWsClient:p}};const ml=e.createContext(null),gl={didCatch:!1,error:null};class bl extends e.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gl}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){const{error:n}=this.state;null!==n&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(gl))}componentDidCatch(e,n){this.props.onError?.(e,n)}componentDidUpdate(e,n){const{didCatch:t}=this.state,{resetKeys:r}=this.props;t&&null!==n.error&&function(e=[],n=[]){return e.length!==n.length||e.some((e,t)=>!Object.is(e,n[t]))}(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:"keys"}),this.setState(gl))}render(){const{children:n,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=n;if(o){const n={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(n);else if(r)s=e.createElement(r,n);else{if(void 0===i)throw a;s=i}}return e.createElement(ml.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}var hl={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:function(e){return e.spacing(2)},padding:function(e){return e.spacing(2)}},vl=function(e){var r=e.resetErrorBoundary,i=t.useTranslation().t;/*#__PURE__*/return S.default.createElement(n.Box,{sx:hl},/*#__PURE__*/S.default.createElement(n.Typography,{variant:"body2",color:"text.secondary"},i("widgetCard.error")),/*#__PURE__*/S.default.createElement(n.Button,{variant:"outlined",size:"small",onClick:r,"data-testid":"widget-card.error-retry"},i("widgetCard.retry")))},Il=function(e,n){console.error("[dashboard-toolkit] Widget error:",e,n)},yl=function(e){/*#__PURE__*/return S.default.createElement(bl,{FallbackComponent:vl,onError:Il},e.children)},Cl={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+X.default+")"},backgroundRepeat:"no-repeat",backgroundSize:"50%",backgroundPosition:"50%","&:hover":{backgroundColor:function(e){return e.palette.primary.dark}}},"& .react-resizable-handle:after":{display:"none"}},header:{height:"40px"},dragIcon:{width:"30px",height:"30px",marginLeft:function(e){return"-"+e.spacing(1)},padding:"8px",borderRadius:"4px",background:function(e){return e.palette.primary.main},"&:hover":{cursor:"move",background:function(e){return e.palette.primary.dark}}},actionButtons:{height:"30px",marginTop:"-7px"},settingsButton:{color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopRightRadius:0,borderBottomRightRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},infoButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},deleteButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},content:{height:"calc(100% - 40px)",padding:0,background:"transparent",border:"1px solid rgba(255, 255, 255, 0.2)",borderTop:"none",borderRadius:"4px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.25)","&:last-child":{paddingBottom:0}}},xl=["children","title","Widget","id","url","wsUrl","lang","data","filters","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function Al(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var El=S.default.forwardRef(function(r,o){var a=r.children,s=r.title,u=r.Widget,c=r.id,l=r.url,d=r.wsUrl,p=r.lang,f=r.data,m=r.filters,g=r.settings,b=r.openSettingsModal,h=r.onSettingsModalOpened,v=r.onSettingsModalClosed,I=r.sidePanelOpened,A=r.updateSidePanelProps,E=r.onDelete,w=r.editMode,R=r.version,T=r.requiredFeatures,N=r.extraPermissions,O=Z(r,xl),D=fl({url:l,wsUrl:d,lang:p}).graphqlSdk,k=i.useAccess(T,{extraPermissions:N}).hasAccess,G=e.useState(!1),B=G[0],P=G[1],M=e.useState(!1),V=M[0],W=M[1],F=t.useTranslation().t;return i.registerTranslations(_),/*#__PURE__*/S.default.createElement(n.Card,L({ref:o,sx:Cl.root},O),/*#__PURE__*/S.default.createElement(n.CardHeader,{avatar:w&&/*#__PURE__*/S.default.createElement(n.SvgIcon,{component:x.ReactComponent,className:"draggable-handle",sx:Cl.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:w&&/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",sx:Cl.actionButtons},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:Cl.settingsButton,onClick:function(){h&&h()},disabled:!k,"data-testid":"widget-card.settings-button"},/*#__PURE__*/S.default.createElement(y.Settings,null)),R&&/*#__PURE__*/S.default.createElement(S.default.Fragment,null,/*#__PURE__*/S.default.createElement(n.Tooltip,{title:R},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:Cl.infoButton,"data-testid":"widget-card.info-button"},/*#__PURE__*/S.default.createElement(y.Info,null)))),/*#__PURE__*/S.default.createElement(z,{open:V,confirmMessage:F("Are you sure you want to delete this widget?"),confirmButtonText:F("Delete"),cancelButtonText:F("Cancel"),onCancel:function(){return W(!1)},onConfirm:function(){try{var e=function(){P(!1)};P(!0),W(!1);var n=function(){if(E)return Promise.resolve(E()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}},confirmButtonTestId:"widget-card.delete-confirm",cancelButtonTestId:"widget-card.delete-cancel"},/*#__PURE__*/S.default.createElement(C.LoadingButton,{color:"secondary",sx:Cl.deleteButton,onClick:function(e){e.stopPropagation(),W(!0)},loading:B,"data-testid":"widget-card.delete-button"},/*#__PURE__*/S.default.createElement(y.Delete,null)))),sx:Cl.header}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:Cl.content},/*#__PURE__*/S.default.createElement(i.AccessGuard,{features:T,extraPermissions:N,onTrialRequest:function(e){try{return Promise.resolve(Al(function(){return Promise.resolve(null==D?void 0:D.startTrial({input:{featureKey:e}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to start trial:",e),!1}))}catch(e){return Promise.reject(e)}},onFeatureRequest:function(e){var n=e.featureKey,t=e.requestType,r=e.workplaceId;try{return Promise.resolve(Al(function(){return Promise.resolve(null==D?void 0:D.requestFeatureAccess({input:{featureKey:n,requestType:t.toUpperCase(),workplaceId:r}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to request feature access:",e),!1}))}catch(e){return Promise.reject(e)}}},/*#__PURE__*/S.default.createElement(yl,null,/*#__PURE__*/S.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,filters:m,settings:g,openSettingsModal:b,onSettingsModalOpened:h,onSettingsModalClosed:v,sidePanelOpened:I,updateSidePanelProps:A,editMode:w})))),w&&a)}),wl=function(e){var n=D.default(e.dateFrom),t=D.default(e.dateTo),r=t.diff(n,"day"),i=t.diff(n,"month"),o=[];return r<=1&&o.push(exports.InsightsAggregation.Hourly),r<=31&&o.push(exports.InsightsAggregation.Daily),i<=6&&o.push(exports.InsightsAggregation.Weekly),i<=12&&o.push(exports.InsightsAggregation.Monthly),o};exports.ActualStaffingCountsDocument=vr,exports.ApplicationInfoDocument=Ir,exports.AssignOperatorDocument=$r,exports.AssignOperatorToWorkplaceDocument=Zt,exports.AvailabilityInsightsDocument=yr,exports.BulkUpsertStaffingPlansDocument=Yt,exports.CompanyConfigDocument=Cr,exports.ConfirmTooltip=z,exports.CounterDirectoriesDocument=xr,exports.CountersDocument=Ar,exports.CreateDashboardDocument=jt,exports.CreateOrderDocument=Jt,exports.CreateProductDocument=zt,exports.CreateStaffingPlanDocument=_t,exports.CreateStatusChangeDocument=Ut,exports.CreateUserPresenceDocument=qt,exports.CreateWidgetDocument=Qt,exports.CurrentUserDocument=Er,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=void 0===s?[]:s,c=r.onFeatureRequest,l=i.useAccess([Hi]),d=l.hasAccess,p=l.accessState,f=l.buttons,m=l.cooldownInfo,g=l.features,b=e.useState(!1),h=b[0],v=b[1],I=e.useState(!1),y=I[0],C=I[1],x=e.useRef(null),A=function(n,t,r){var i=e.useState(function(){return Vi(n,t)}),o=i[0],a=i[1],s=e.useState(0),u=s[0],c=s[1],l=e.useRef(r);l.current=r,e.useEffect(function(){n&&a(function(e){var r=Vi(n,t);return JSON.stringify(r)===JSON.stringify(e)?e:r})},[n,t]);var d=e.useMemo(function(){return Wi(o,t)},[o,t,u]),p=e.useMemo(function(){return{dayType:o.dayType,selectedPeriodId:o.selectedPeriodId,dateRange:d,shiftIds:o.shiftIds}},[o.dayType,o.selectedPeriodId,d,o.shiftIds]);e.useEffect(function(){if(o.selectedPeriodId){var e=Si(o.selectedPeriodId,{dayType:o.dayType,shifts:t,selectedShiftIds:o.shiftIds});if(e){var n=e.getTime()-Date.now(),r=function(){var e=Ei.find(function(e){return e.id===o.selectedPeriodId});if(e){var n=Ai(o.selectedPeriodId,t),r=n?[n]:o.shiftIds;a(function(e){return L({},e,{shiftIds:r})}),c(function(e){return e+1});var i=e.calculate({dayType:o.dayType,shifts:t,selectedShiftIds:r});l.current({dayType:o.dayType,selectedPeriodId:o.selectedPeriodId,dateRange:i,shiftIds:r})}};if(!(n<=0)){var i=setTimeout(r,n);return function(){return clearTimeout(i)}}r()}}},[o.selectedPeriodId,o.dayType,o.shiftIds,t]);var f=e.useMemo(function(){var e=function(e){var n=Wi(e,t);l.current({dayType:e.dayType,selectedPeriodId:e.selectedPeriodId,dateRange:n,shiftIds:e.shiftIds})};return{handleDayTypeChange:function(n){a(function(t){var r=L({},t,{dayType:n});return e(r),r})},handleShiftChange:function(n){a(function(t){var r=L({},t,{shiftIds:n});return e(r),r})},handleDateRangeChange:function(n){a(function(t){var r=L({},t,{selectedPeriodId:void 0,shiftIds:[],customDateRange:n});return e(r),r})},handlePeriodSelect:function(n,r){a(function(i){var o=Ai(n.id,t),a=L({},i,{selectedPeriodId:n.id,shiftIds:o?[o]:[],customDateRange:r});return e(a),a})}}},[t]);return{filterValues:p,selectedPeriodId:o.selectedPeriodId,handlers:f}}(o,u,a),E=A.filterValues,w=A.selectedPeriodId,R=A.handlers,T=t.useTranslation().t;i.registerTranslations(_);var N,k,G,B=e.useMemo(function(){var e,n=g.find(function(e){return e.featureKey===Hi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[g]),P=e.useMemo(function(){return f.filter(function(e){return"start_trial"!==e.action})},[f]),M=e.useCallback(function(e,n){!e.needAccess||d?R.handlePeriodSelect(e,n):v(!0)},[d,R]),V=e.useCallback(function(){return C(!0)},[]),W=e.useCallback(function(){return C(!1)},[]),F=e.useCallback(function(){return v(!1)},[]),H=e.useCallback(function(){return v(!0)},[]);/*#__PURE__*/return S.default.createElement(n.Box,{sx:Fi.container},/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},/*#__PURE__*/S.default.createElement(n.TextField,{ref:x,label:T("dashboardFilters.dateRange.label"),value:(N=E.dateRange,k=D.default(N.from).format("YYYY-MM-DD"),G=D.default(N.to).format("YYYY-MM-DD"),k===G?k:k+" - "+G),onClick:V,size:"small",InputProps:{readOnly:!0,startAdornment:/*#__PURE__*/S.default.createElement(n.InputAdornment,{position:"start"},/*#__PURE__*/S.default.createElement(O.default,{sx:{fontSize:16}}))},sx:Fi.dateField,"data-testid":"dashboard-filters.date-range-input"}),/*#__PURE__*/S.default.createElement(Mi,{shifts:u,selectedShiftIds:E.shiftIds,onChange:R.handleShiftChange})),/*#__PURE__*/S.default.createElement(n.Popover,{open:y,anchorEl:x.current,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:Fi.popover,"data-testid":"dashboard-filters.date-popover"},/*#__PURE__*/S.default.createElement(n.Box,{sx:Fi.popoverContent},/*#__PURE__*/S.default.createElement(Bi,{dateRange:E.dateRange,dayType:E.dayType,shifts:u,selectedShiftIds:E.shiftIds,hasAccess:d,selectedPeriodId:w,onDayTypeChange:R.handleDayTypeChange,onDateRangeChange:R.handleDateRangeChange,onPeriodSelect:M,onAccessDenied:H}))),/*#__PURE__*/S.default.createElement(q,{open:h,onClose:F,accessState:p,buttons:P,daysSinceExpiry:B,cooldownInfo:m,onFeatureRequest:c}))},exports.DashboardsDocument=wr,exports.DepartmentsDocument=Rr,exports.FloorPlansDocument=Tr,exports.GetWorkplacePerformanceInsightsDocument=ei,exports.GraphqlWsClient=ll,exports.ListActualStaffingCountsDocument=ni,exports.ListStaffingPlansDocument=ti,exports.ListStatusChangesDocument=ri,exports.ListWorkOrdersDocument=ii,exports.ListWorkplaceAssignmentsDocument=oi,exports.ListWorkplacesDocument=ai,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=Z(e,Ui),l=t.useTranslation().t,d=function(e){return{card:L({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+F.default+"), linear-gradient(329.66deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%)",backgroundSize:"cover"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0}),cardOverlay:L({position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1},e.showBgPattern&&{mixBlendMode:"hard-light"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0},e.cardOverlay,{animation:e.animateBackgroundColor?(t=e.backgroundColor,v.keyframes(Yi||(Yi=Y(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),_i(t,.5),_i(t,1),_i(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:zi,borderBottom:"1px solid rgba(0, 0, 0, 0.1)",background:"rgba(0, 0, 0, 0.05)","& span":{lineHeight:"3em",fontSize:"1em",fontWeight:500}},cardContent:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"80%",minWidth:"auto",minHeight:"auto",maxWidth:"none",background:"transparent","& > img":{flexBasis:"25%",minWidth:"125px",maxWidth:"25%"}},cardLabel:{width:"100%",lineHeight:"2.5em",fontSize:"1.8em",fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textAlign:"center",textOverflow:"ellipsis",color:zi},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten(zi,.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:zi}};var t}({card:{rounded:u},cardOverlay:{background:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"linear-gradient(180deg, #31BF59 0%, #32D74B 100%)";case exports.AndonLightColor.Yellow:return"linear-gradient(360deg, #FFD60A 0%, #FFC12F 100%)";case exports.AndonLightColor.Red:return"linear-gradient(0deg, #F05C53 0%, #FF3B2F 100%)";default:return"rgba(187, 187, 187, 0.75)"}return"rgba(255, 255, 255, 0.75)"}()},showBgPattern:!0,backgroundColor:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"#32D74B";case exports.AndonLightColor.Yellow:return"#FFC12F";case exports.AndonLightColor.Red:return"#FF3B2F";default:return"#BBBBBBBF"}return"#FFFFFFBF"}(),animateBackgroundColor:s});/*#__PURE__*/return S.default.createElement(n.Card,L({sx:d.card},c),/*#__PURE__*/S.default.createElement(n.Box,{sx:d.cardOverlay}),/*#__PURE__*/S.default.createElement(n.CardHeader,{title:/*#__PURE__*/S.default.createElement(Ji,{line:1,text:r}),sx:d.cardHeader}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:d.cardContent},/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardLabel},i),/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=D.default.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):/*#__PURE__*/S.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=Sr,exports.MetricsDocument=Nr,exports.NotificationsDocument=Or,exports.OrdersDocument=Dr,exports.OrdersExecutionsDocument=kr,exports.PauseOrderExecutionDocument=$t,exports.ProductionInsightsDocument=Gr,exports.ProductsDocument=Br,exports.ReasonsDocument=Pr,exports.ReasonsRecommendationDocument=Mr,exports.RemoveDashboardDocument=Kt,exports.RemoveStaffingPlanDocument=er,exports.RemoveUserPresenceDocument=nr,exports.RemoveWidgetDocument=tr,exports.RemoveWorkplaceUsersPresencesDocument=rr,exports.RequestFeatureAccessDocument=ir,exports.SetCounterDocument=or,exports.ShiftsDocument=Vr,exports.SortableSelect=function(e){var n=e.options,t=e.selected,r=e.onChange,i=function(e){var n,i,o,a=e.active,s=e.over;if(a.id!==(null==s?void 0:s.id)){var u=t.findIndex(function(e){return e===a.id}),c=t.findIndex(function(e){return e===(null==s?void 0:s.id)});r((n=t,i=u,o=c,function(e,n,t){const r=n<0?e.length+n:n;if(r>=0&&r<e.length){const r=t<0?e.length+t:t,[i]=e.splice(n,1);e.splice(r,0,i)}}(n=[...n],i,o),n))}};/*#__PURE__*/return S.default.createElement(Ss,{placeholder:e.placeholder,isMulti:!0,options:n,value:t.map(function(e){return n.find(function(n){return n.value===e})}),onChange:function(e){return r([].concat(e||[]).map(function(e){return e.value}))},closeMenuOnSelect:!1,components:{MultiValueContainer:Fc,MultiValueLabel:Hc,ValueContainer:function(e){/*#__PURE__*/return S.default.createElement(xc,{onDragEnd:i},/*#__PURE__*/S.default.createElement(kc,{items:t},e.children))}},styles:{control:function(e,n){return L({},e,{padding:"6px 0 6px 8px",borderColor:"rgba(255, 255, 255, 0.15)",background:"#1C1F25"},n.isFocused&&{borderColor:"#4E5A67",boxShadow:"none"},{"&:hover":{borderColor:"#4E5A67",boxShadow:"none"}})},menu:function(e){return L({},e,{background:"#1C1F25"})},option:function(e,n){return L({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=Wr,exports.StandardRatesDocument=Fr,exports.StartOrderExecutionDocument=ar,exports.StartTrialDocument=sr,exports.StatusChangeTransitionPermissionsDocument=Hr,exports.StatusChangesDocument=Xr,exports.StatusInsightsDocument=Lr,exports.StopOrderExecutionDocument=ur,exports.UnassignOperatorDocument=Kr,exports.UnassignOperatorFromWorkplaceDocument=cr,exports.UpdateDashboardDocument=lr,exports.UpdateNotificationDocument=dr,exports.UpdateOrderDocument=pr,exports.UpdateOrderExecutionDocument=fr,exports.UpdateStaffingPlanDocument=mr,exports.UpdateStatusChangeDocument=gr,exports.UpdateWidgetDocument=br,exports.UpdateWorkOrderDocument=hr,exports.UsersDocument=Zr,exports.UsersPresencesDocument=Yr,exports.WidgetCard=El,exports.WidgetDocument=jr,exports.WidgetErrorBoundary=yl,exports.WidgetsDocument=Jr,exports.WorkOrdersDocument=zr,exports.WorkOrdersInsightsDocument=_r,exports.WorkplaceAssignmentsDocument=Ur,exports.WorkplaceEventDocument=si,exports.WorkplacePerformanceInsightsDocument=qr,exports.WorkplacesDocument=Qr,exports.findPeriodById=function(e){return Ei.find(function(n){return n.id===e})},exports.generateTimeRange=function(e,n,t,r){for(var i=[],o=e,a=e.isAfter(n);a?o.isAfter(n)||o.isSame(n):o.isBefore(n)||o.isSame(n);)i.push(o),o=a?o.subtract(r,t):o.add(r,t);return i},exports.getCurrentShift=mi,exports.getGqlWsClient=dl,exports.getGraphqlSdk=pl,exports.getNextBoundary=Si,exports.getRecentShift=gi,exports.getSdk=ci,exports.getShiftTimeRange=Ri,exports.getTimeRangeLabel=wi,exports.getValidAggregations=wl,exports.normalizeShifts=fi,exports.periods=Ei,exports.resolveAggregation=function(e,n){return n&&wl(e).includes(n)?n:function(e){var n=D.default(e.dateFrom),t=D.default(e.dateTo),r=t.diff(n,"day"),i=t.diff(n,"month");return r<=1?exports.InsightsAggregation.Hourly:r<=13?exports.InsightsAggregation.Daily:i<3?exports.InsightsAggregation.Weekly:exports.InsightsAggregation.Monthly}(e)},exports.resolveShiftIdForPeriod=Ai,exports.useGqlClients=fl,exports.version="1.5.39";
15
+ return N.createElement(Rs,ao({ref:t},r))}),Ss=Ts;const Ns="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Os(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function Ds(e){return"nodeType"in e}function ks(e){var n,t;return e?Os(e)?e:Ds(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function Gs(e){const{Document:n}=ks(e);return e instanceof n}function Bs(e){return!Os(e)&&e instanceof ks(e).HTMLElement}function Ps(e){return e instanceof ks(e).SVGElement}function Ms(e){return e?Os(e)?e.document:Ds(e)?Gs(e)?e:Bs(e)||Ps(e)?e.ownerDocument:document:document:document}const Vs=Ns?e.useLayoutEffect:e.useEffect;function Ws(n){const t=e.useRef(n);return Vs(()=>{t.current=n}),e.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Fs(n,t){void 0===t&&(t=[n]);const r=e.useRef(n);return Vs(()=>{r.current!==n&&(r.current=n)},t),r}function Hs(n,t){const r=e.useRef();return e.useMemo(()=>{const e=n(r.current);return r.current=e,e},[...t])}function Xs(n){const t=Ws(n),r=e.useRef(null),i=e.useCallback(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,i]}function Ls(n){const t=e.useRef();return e.useEffect(()=>{t.current=n},[n]),t.current}let Zs={};function Ys(n,t){return e.useMemo(()=>{if(t)return t;const e=null==Zs[n]?0:Zs[n]+1;return Zs[n]=e,n+"-"+e},[n,t])}function js(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>{const r=Object.entries(t);for(const[t,i]of r){const r=n[t];null!=r&&(n[t]=r+e*i)}return n},{...n})}}const Js=/*#__PURE__*/js(1),zs=/*#__PURE__*/js(-1);function _s(e){if(!e)return!1;const{KeyboardEvent:n}=ks(e.target);return n&&e instanceof n}function Us(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=ks(e.target);return n&&e instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const qs=/*#__PURE__*/Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[qs.Translate.toString(e),qs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),Qs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $s(e){return e.matches(Qs)?e:e.querySelector(Qs)}const Ks={display:"none"};function eu(e){let{id:n,value:t}=e;return S.default.createElement("div",{id:n,style:Ks},t)}function nu(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;return S.default.createElement("div",{id:n,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},t)}const tu=/*#__PURE__*/e.createContext(null),ru={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},iu={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function ou(n){let{announcements:t=iu,container:r,hiddenTextDescribedById:i,screenReaderInstructions:o=ru}=n;const{announce:a,announcement:s}=function(){const[n,t]=e.useState("");return{announce:e.useCallback(e=>{null!=e&&t(e)},[]),announcement:n}}(),u=Ys("DndLiveRegion"),[c,l]=e.useState(!1);if(e.useEffect(()=>{l(!0)},[]),function(n){const t=e.useContext(tu);e.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(n)},[n,t])}(e.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;const d=S.default.createElement(S.default.Fragment,null,S.default.createElement(eu,{id:i,value:o.draggable}),S.default.createElement(nu,{id:u,announcement:s}));return r?I.createPortal(d,r):d}var au;function su(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(au||(au={}));const uu=/*#__PURE__*/Object.freeze({x:0,y:0});function cu(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function lu(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),i=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height);if(r<i&&t<o){const a=(i-r)*(o-t);return Number((a/(n.width*n.height+e.width*e.height-a)).toFixed(4))}return 0}const du=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,o=t.get(r);if(o){const t=lu(o,n);t>0&&i.push({id:r,data:{droppableContainer:e,value:t}})}}return i.sort(cu)};function pu(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:uu}function fu(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return r.reduce((n,t)=>({...n,top:n.top+e*t.y,bottom:n.bottom+e*t.y,left:n.left+e*t.x,right:n.right+e*t.x}),{...n})}}const mu=/*#__PURE__*/fu(1),gu={ignoreTransform:!1};function bu(e,n){void 0===n&&(n=gu);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=ks(e).getComputedStyle(e);n&&(t=function(e,n,t){const r=function(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}(n);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,u=e.left-a-(1-i)*parseFloat(t),c=e.top-s-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),l=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:l,height:d,top:c,right:u+l,bottom:c+d,left:u}}(t,n,r))}const{top:r,left:i,width:o,height:a,bottom:s,right:u}=t;return{top:r,left:i,width:o,height:a,bottom:s,right:u}}function hu(e){return bu(e,{ignoreTransform:!0})}function vu(e,n){const t=[];return e?function r(i){if(null!=n&&t.length>=n)return t;if(!i)return t;if(Gs(i)&&null!=i.scrollingElement&&!t.includes(i.scrollingElement))return t.push(i.scrollingElement),t;if(!Bs(i)||Ps(i))return t;if(t.includes(i))return t;const o=ks(e).getComputedStyle(i);return i!==e&&function(e,n){void 0===n&&(n=ks(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=n[e];return"string"==typeof r&&t.test(r)})}(i,o)&&t.push(i),function(e,n){return void 0===n&&(n=ks(e).getComputedStyle(e)),"fixed"===n.position}(i,o)?t:r(i.parentNode)}(e):t}function Iu(e){const[n]=vu(e,1);return null!=n?n:null}function yu(e){return Ns&&e?Os(e)?e:Ds(e)?Gs(e)||e===Ms(e).scrollingElement?window:Bs(e)?e:null:null:null}function Cu(e){return Os(e)?e.scrollX:e.scrollLeft}function xu(e){return Os(e)?e.scrollY:e.scrollTop}function Au(e){return{x:Cu(e),y:xu(e)}}var Eu;function wu(e){return!(!Ns||!e)&&e===document.scrollingElement}function Ru(e){const n={x:0,y:0},t=wu(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height};return{isTop:e.scrollTop<=n.y,isLeft:e.scrollLeft<=n.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:n}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Eu||(Eu={}));const Tu={x:.2,y:.2};function Su(e,n,t,r,i){let{top:o,left:a,right:s,bottom:u}=t;void 0===r&&(r=10),void 0===i&&(i=Tu);const{isTop:c,isBottom:l,isLeft:d,isRight:p}=Ru(e),f={x:0,y:0},m={x:0,y:0},g=n.height*i.y,b=n.width*i.x;return!c&&o<=n.top+g?(f.y=Eu.Backward,m.y=r*Math.abs((n.top+g-o)/g)):!l&&u>=n.bottom-g&&(f.y=Eu.Forward,m.y=r*Math.abs((n.bottom-g-u)/g)),!p&&s>=n.right-b?(f.x=Eu.Forward,m.x=r*Math.abs((n.right-b-s)/b)):!d&&a<=n.left+b&&(f.x=Eu.Backward,m.x=r*Math.abs((n.left+b-a)/b)),{direction:f,speed:m}}function Nu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:n}=window;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}const{top:n,left:t,right:r,bottom:i}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ou(e){return e.reduce((e,n)=>Js(e,Au(n)),uu)}const Du=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+Cu(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+xu(n),0)}]];class ku{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const t=vu(n),r=Ou(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,i]of Du)for(const o of n)Object.defineProperty(this,o,{get:()=>{const n=i(t);return this.rect[o]+(r[e]-n)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Gu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var n;return null==(n=this.target)?void 0:n.removeEventListener(...e)})},this.target=e}add(e,n,t){var r;null==(r=this.target)||r.addEventListener(e,n,t),this.listeners.push([e,n,t])}}function Bu(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof n?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n&&r>n.y}var Pu,Mu;function Vu(e){e.preventDefault()}function Wu(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Pu||(Pu={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Mu||(Mu={}));const Fu={start:[Mu.Space,Mu.Enter],cancel:[Mu.Esc],end:[Mu.Space,Mu.Enter,Mu.Tab]},Hu=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case Mu.Right:return{...t,x:t.x+25};case Mu.Left:return{...t,x:t.x-25};case Mu.Down:return{...t,y:t.y+25};case Mu.Up:return{...t,y:t.y-25}}};class Xu{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Gu(Ms(n)),this.windowListeners=new Gu(ks(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pu.Resize,this.handleCancel),this.windowListeners.add(Pu.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Pu.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=bu),!e)return;const{top:t,left:r,bottom:i,right:o}=n(e);Iu(e)&&(i<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(uu)}handleKeyDown(e){if(_s(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:i=Fu,coordinateGetter:o=Hu,scrollBehavior:a="smooth"}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:u}=t.current,c=u?{x:u.left,y:u.top}:uu;this.referenceCoordinates||(this.referenceCoordinates=c);const l=o(e,{active:n,context:t.current,currentCoordinates:c});if(l){const n=zs(l,c),r={x:0,y:0},{scrollableAncestors:i}=t.current;for(const t of i){const i=e.code,{isTop:o,isRight:s,isLeft:u,isBottom:c,maxScroll:d,minScroll:p}=Ru(t),f=Nu(t),m={x:Math.min(i===Mu.Right?f.right-f.width/2:f.right,Math.max(i===Mu.Right?f.left:f.left+f.width/2,l.x)),y:Math.min(i===Mu.Down?f.bottom-f.height/2:f.bottom,Math.max(i===Mu.Down?f.top:f.top+f.height/2,l.y))},g=i===Mu.Down&&!c||i===Mu.Up&&!o;if((i===Mu.Right&&!s||i===Mu.Left&&!u)&&m.x!==l.x){const e=t.scrollLeft+n.x,o=i===Mu.Right&&e<=d.x||i===Mu.Left&&e>=p.x;if(o&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=o?t.scrollLeft-e:i===Mu.Right?t.scrollLeft-d.x:t.scrollLeft-p.x,r.x&&t.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==l.y){const e=t.scrollTop+n.y,o=i===Mu.Down&&e<=d.y||i===Mu.Up&&e>=p.y;if(o&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=o?t.scrollTop-e:i===Mu.Down?t.scrollTop-d.y:t.scrollTop-p.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Js(zs(l,this.referenceCoordinates),r))}}}handleMove(e,n){const{onMove:t}=this.props;e.preventDefault(),t(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Lu(e){return Boolean(e&&"distance"in e)}function Zu(e){return Boolean(e&&"delay"in e)}Xu.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=Fu,onActivation:i}=n,{active:o}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const n=o.activatorNode.current;return!(n&&e.target!==n||(e.preventDefault(),null==i||i({event:e.nativeEvent}),0))}return!1}}];class Yu{constructor(e,n,t){var r;void 0===t&&(t=function(e){const{EventTarget:n}=ks(e);return e instanceof n?e:Ms(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Ms(o),this.documentListeners=new Gu(this.document),this.listeners=new Gu(t),this.windowListeners=new Gu(ks(o)),this.initialCoordinates=null!=(r=Us(i))?r:uu,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Pu.Resize,this.handleCancel),this.windowListeners.add(Pu.DragStart,Vu),this.windowListeners.add(Pu.VisibilityChange,this.handleCancel),this.windowListeners.add(Pu.ContextMenu,Vu),this.documentListeners.add(Pu.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zu(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Lu(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:t,onPending:r}=this.props;r(t,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Pu.Click,Wu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pu.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:t,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!r)return;const s=null!=(n=Us(e))?n:uu,u=zs(r,s);if(!t&&a){if(Lu(a)){if(null!=a.tolerance&&Bu(u,a.tolerance))return this.handleCancel();if(Bu(u,a.distance))return this.handleStart()}return Zu(a)&&Bu(u,a.tolerance)?this.handleCancel():void this.handlePending(a,u)}e.cancelable&&e.preventDefault(),o(s)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Mu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ju={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ju extends Yu{constructor(e){const{event:n}=e,t=Ms(n.target);super(e,ju,t)}}Ju.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!(!t.isPrimary||0!==t.button||(null==r||r({event:t}),0))}}];const zu={move:{name:"mousemove"},end:{name:"mouseup"}};var _u;!function(e){e[e.RightClick=2]="RightClick"}(_u||(_u={})),class extends Yu{constructor(e){super(e,zu,Ms(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==_u.RightClick&&(null==r||r({event:t}),!0)}}];const Uu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var qu,Qu;(class extends Yu{constructor(e){super(e,Uu)}static setup(){return window.addEventListener(Uu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Uu.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:i}=t;return!(i.length>1||(null==r||r({event:t}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(qu||(qu={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Qu||(Qu={}));const $u={x:{[Eu.Backward]:!1,[Eu.Forward]:!1},y:{[Eu.Backward]:!1,[Eu.Forward]:!1}};var Ku,ec;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ku||(Ku={})),function(e){e.Optimized="optimized"}(ec||(ec={}));const nc=/*#__PURE__*/new Map;function tc(e,n){return Hs(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function rc(n){let{callback:t,disabled:r}=n;const i=Ws(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)},[r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function ic(e){return new ku(bu(e),e)}function oc(n,t,r){void 0===t&&(t=ic);const[i,o]=e.useState(null);function a(){o(e=>{if(!n)return null;var i;if(!1===n.isConnected)return null!=(i=null!=e?e:r)?i:null;const o=t(n);return JSON.stringify(e)===JSON.stringify(o)?e:o})}const s=function(n){let{callback:t,disabled:r}=n;const i=Ws(t),o=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)},[i,r]);return e.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(e){if(n)for(const t of e){const{type:e,target:r}=t;if("childList"===e&&r instanceof HTMLElement&&r.contains(n)){a();break}}}}),u=rc({callback:a});return Vs(()=>{a(),n?(null==u||u.observe(n),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())},[n]),i}const ac=[];function sc(n,t){void 0===t&&(t=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},t),e.useEffect(()=>{const e=n!==uu;e&&!r.current&&(r.current=n),!e&&r.current&&(r.current=null)},[n]),r.current?zs(n,r.current):uu}function uc(n){return e.useMemo(()=>n?function(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}(n):null,[n])}const cc=[],lc=[{sensor:Ju,options:{}},{sensor:Xu,options:{}}],dc={current:{}},pc={draggable:{measure:hu},droppable:{measure:hu,strategy:Ku.WhileDragging,frequency:ec.Optimized},dragOverlay:{measure:bu}};class fc extends Map{get(e){var n;return null!=e&&null!=(n=super.get(e))?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,t;return null!=(n=null==(t=this.get(e))?void 0:t.node.current)?n:void 0}}const mc={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:/*#__PURE__*/new Map,droppableRects:/*#__PURE__*/new Map,droppableContainers:/*#__PURE__*/new fc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:su},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pc,measureDroppableContainers:su,windowRect:null,measuringScheduled:!1},gc=/*#__PURE__*/e.createContext({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:su,draggableNodes:/*#__PURE__*/new Map,over:null,measureDroppableContainers:su}),bc=/*#__PURE__*/e.createContext(mc);function hc(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fc}}}function vc(e,n){switch(n.type){case au.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case au.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case au.DragEnd:case au.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case au.RegisterDroppable:{const{element:t}=n,{id:r}=t,i=new fc(e.droppable.containers);return i.set(r,t),{...e,droppable:{...e.droppable,containers:i}}}case au.SetDroppableDisabled:{const{id:t,key:r,disabled:i}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const a=new fc(e.droppable.containers);return a.set(t,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case au.UnregisterDroppable:{const{id:t,key:r}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const o=new fc(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Ic(n){let{disabled:t}=n;const{active:r,activatorEvent:i,draggableNodes:o}=e.useContext(gc),a=Ls(i),s=Ls(null==r?void 0:r.id);return e.useEffect(()=>{if(!t&&!i&&a&&null!=s){if(!_s(a))return;if(document.activeElement===a.target)return;const e=o.get(s);if(!e)return;const{activatorNode:n,node:t}=e;if(!n.current&&!t.current)return;requestAnimationFrame(()=>{for(const e of[n.current,t.current]){if(!e)continue;const n=$s(e);if(n){n.focus();break}}})}},[i,t,o,s,a]),null}const yc=/*#__PURE__*/e.createContext({...uu,scaleX:1,scaleY:1});var Cc;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Cc||(Cc={}));const xc=/*#__PURE__*/e.memo(function(n){var t,r,i,o;let{id:a,accessibility:s,autoScroll:u=!0,children:c,sensors:l=lc,collisionDetection:d=du,measuring:p,modifiers:f,...m}=n;const g=e.useReducer(vc,void 0,hc),[b,h]=g,[v,y]=function(){const[n]=e.useState(()=>new Set),t=e.useCallback(e=>(n.add(e),()=>n.delete(e)),[n]),r=e.useCallback(e=>{let{type:t,event:r}=e;n.forEach(e=>{var n;return null==(n=e[t])?void 0:n.call(e,r)})},[n]);return[r,t]}(),[C,x]=e.useState(Cc.Uninitialized),A=C===Cc.Initialized,{draggable:{active:E,nodes:w,translate:R},droppable:{containers:T}}=b,N=null!=E?w.get(E):null,O=e.useRef({initial:null,translated:null}),D=e.useMemo(()=>{var e;return null!=E?{id:E,data:null!=(e=null==N?void 0:N.data)?e:dc,rect:O}:null},[E,N]),k=e.useRef(null),[G,B]=e.useState(null),[P,M]=e.useState(null),V=Fs(m,Object.values(m)),W=Ys("DndDescribedBy",a),F=e.useMemo(()=>T.getEnabled(),[T]),H=function(n){return e.useMemo(()=>({draggable:{...pc.draggable,...null==n?void 0:n.draggable},droppable:{...pc.droppable,...null==n?void 0:n.droppable},dragOverlay:{...pc.dragOverlay,...null==n?void 0:n.dragOverlay}}),[null==n?void 0:n.draggable,null==n?void 0:n.droppable,null==n?void 0:n.dragOverlay])}(p),{droppableRects:X,measureDroppableContainers:L,measuringScheduled:Z}=function(n,t){let{dragging:r,dependencies:i,config:o}=t;const[a,s]=e.useState(null),{frequency:u,measure:c,strategy:l}=o,d=e.useRef(n),p=function(){switch(l){case Ku.Always:return!1;case Ku.BeforeDragging:return r;default:return!r}}(),f=Fs(p),m=e.useCallback(function(e){void 0===e&&(e=[]),f.current||s(n=>null===n?e:n.concat(e.filter(e=>!n.includes(e))))},[f]),g=e.useRef(null),b=Hs(e=>{if(p&&!r)return nc;if(!e||e===nc||d.current!==n||null!=a){const e=new Map;for(let t of n){if(!t)continue;if(a&&a.length>0&&!a.includes(t.id)&&t.rect.current){e.set(t.id,t.rect.current);continue}const n=t.node.current,r=n?new ku(c(n),n):null;t.rect.current=r,r&&e.set(t.id,r)}return e}return e},[n,a,r,p,c]);return e.useEffect(()=>{d.current=n},[n]),e.useEffect(()=>{p||m()},[r,p]),e.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),e.useEffect(()=>{p||"number"!=typeof u||null!==g.current||(g.current=setTimeout(()=>{m(),g.current=null},u))},[u,p,m,...i]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=a}}(F,{dragging:A,dependencies:[R.x,R.y],config:H.droppable}),Y=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return Hs(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(w,E),j=e.useMemo(()=>P?Us(P):null,[P]),J=function(){const e=A&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof u?!1===u.enabled:!1===u);return"object"==typeof u?{...u,enabled:e}:{enabled:e}}(),z=function(e,n){return tc(e,n)}(Y,H.draggable.measure);!function(n){let{activeNode:t,measure:r,initialRect:i,config:o=!0}=n;const a=e.useRef(!1),{x:s,y:u}="boolean"==typeof o?{x:o,y:o}:o;Vs(()=>{if(!s&&!u||!t)return void(a.current=!1);if(a.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const n=pu(r(e),i);if(s||(n.x=0),u||(n.y=0),a.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){const t=Iu(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,u,i,r])}({activeNode:null!=E?w.get(E):null,config:J.layoutShiftCompensation,initialRect:z,measure:H.draggable.measure});const _=oc(Y,H.draggable.measure,z),U=oc(Y?Y.parentElement:null),q=e.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Q=T.getNodeFor(null==(t=q.current.over)?void 0:t.id),$=function(n){let{measure:t}=n;const[r,i]=e.useState(null),o=e.useCallback(e=>{for(const{target:n}of e)if(Bs(n)){i(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),a=rc({callback:o}),s=e.useCallback(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Bs(n)?n:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),i(n?t(n):null)},[t,a]),[u,c]=Xs(s);return e.useMemo(()=>({nodeRef:u,rect:r,setRef:c}),[r,u,c])}({measure:H.dragOverlay.measure}),K=null!=(r=$.nodeRef.current)?r:Y,ee=A?null!=(i=$.rect)?i:_:null,ne=Boolean($.nodeRef.current&&$.rect),te=pu(re=ne?null:_,tc(re));var re;const ie=uc(K?ks(K):null),oe=function(n){const t=e.useRef(n),r=Hs(e=>n?e&&e!==ac&&n&&t.current&&n.parentNode===t.current.parentNode?e:vu(n):ac,[n]);return e.useEffect(()=>{t.current=n},[n]),r}(A?null!=Q?Q:Y:null),ae=function(n,t){void 0===t&&(t=bu);const[r]=n,i=uc(r?ks(r):null),[o,a]=e.useState(cc);function s(){a(()=>n.length?n.map(e=>wu(e)?i:new ku(t(e),e)):cc)}const u=rc({callback:s});return Vs(()=>{null==u||u.disconnect(),s(),n.forEach(e=>null==u?void 0:u.observe(e))},[n]),o}(oe),se=function(e,n){let{transform:t,...r}=n;return null!=e&&e.length?e.reduce((e,n)=>n({transform:e,...r}),t):t}(f,{transform:{x:R.x-te.x,y:R.y-te.y,scaleX:1,scaleY:1},activatorEvent:P,active:D,activeNodeRect:_,containerNodeRect:U,draggingNodeRect:ee,over:q.current.over,overlayNodeRect:$.rect,scrollableAncestors:oe,scrollableAncestorRects:ae,windowRect:ie}),ue=j?Js(j,R):null,ce=function(n){const[t,r]=e.useState(null),i=e.useRef(n),o=e.useCallback(e=>{const n=yu(e.target);n&&r(e=>e?(e.set(n,Au(n)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=i.current;if(n!==e){t(e);const a=n.map(e=>{const n=yu(e);return n?(n.addEventListener("scroll",o,{passive:!0}),[n,Au(n)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),i.current=n}return()=>{t(n),t(e)};function t(e){e.forEach(e=>{const n=yu(e);null==n||n.removeEventListener("scroll",o)})}},[o,n]),e.useMemo(()=>n.length?t?Array.from(t.values()).reduce((e,n)=>Js(e,n),uu):Ou(n):uu,[n,t])}(oe),le=sc(ce),de=sc(ce,[_]),pe=Js(se,le),fe=ee?mu(ee,se):null,me=D&&fe?d({active:D,collisionRect:fe,droppableRects:X,droppableContainers:F,pointerCoordinates:ue}):null,ge=function(e){if(!e||0===e.length)return null;const[n]=e;return n.id}(me),[be,he]=e.useState(null),ve=function(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}(ne?se:Js(se,de),null!=(o=null==be?void 0:be.rect)?o:null,_),Ie=e.useRef(null),ye=e.useCallback((e,n)=>{let{sensor:t,options:r}=n;if(null==k.current)return;const i=w.get(k.current);if(!i)return;const o=e.nativeEvent,a=new t({active:k.current,activeNode:i,event:o,options:r,context:q,onAbort(e){if(!w.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),v({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!w.get(e))return;const{onDragPending:i}=V.current,o={id:e,constraint:n,initialCoordinates:t,offset:r};null==i||i(o),v({type:"onDragPending",event:o})},onStart(e){const n=k.current;if(null==n)return;const t=w.get(n);if(!t)return;const{onDragStart:r}=V.current,i={activatorEvent:o,active:{id:n,data:t.data,rect:O}};I.unstable_batchedUpdates(()=>{null==r||r(i),x(Cc.Initializing),h({type:au.DragStart,initialCoordinates:e,active:n}),v({type:"onDragStart",event:i}),B(Ie.current),M(o)})},onMove(e){h({type:au.DragMove,coordinates:e})},onEnd:s(au.DragEnd),onCancel:s(au.DragCancel)});function s(e){return async function(){const{active:n,collisions:t,over:r,scrollAdjustedTranslate:i}=q.current;let a=null;if(n&&i){const{cancelDrop:s}=V.current;a={activatorEvent:o,active:n,collisions:t,delta:i,over:r},e===au.DragEnd&&"function"==typeof s&&await Promise.resolve(s(a))&&(e=au.DragCancel)}k.current=null,I.unstable_batchedUpdates(()=>{h({type:e}),x(Cc.Uninitialized),he(null),B(null),M(null),Ie.current=null;const n=e===au.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),v({type:n,event:a})}})}}Ie.current=a},[w]),Ce=e.useCallback((e,n)=>(t,r)=>{const i=t.nativeEvent,o=w.get(r);null!==k.current||!o||i.dndKit||i.defaultPrevented||!0===e(t,n.options,{active:o})&&(i.dndKit={capturedBy:n.sensor},k.current=r,ye(t,n))},[w,ye]),xe=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[n,t])}(l,Ce);!function(n){e.useEffect(()=>{if(!Ns)return;const e=n.map(e=>{let{sensor:n}=e;return null==n.setup?void 0:n.setup()});return()=>{for(const n of e)null==n||n()}},n.map(e=>{let{sensor:n}=e;return n}))}(l),Vs(()=>{_&&C===Cc.Initializing&&x(Cc.Initialized)},[_,C]),e.useEffect(()=>{const{onDragMove:e}=V.current,{active:n,activatorEvent:t,collisions:r,over:i}=q.current;if(!n||!t)return;const o={active:n,activatorEvent:t,collisions:r,delta:{x:pe.x,y:pe.y},over:i};I.unstable_batchedUpdates(()=>{null==e||e(o),v({type:"onDragMove",event:o})})},[pe.x,pe.y]),e.useEffect(()=>{const{active:e,activatorEvent:n,collisions:t,droppableContainers:r,scrollAdjustedTranslate:i}=q.current;if(!e||null==k.current||!n||!i)return;const{onDragOver:o}=V.current,a=r.get(ge),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,u={active:e,activatorEvent:n,collisions:t,delta:{x:i.x,y:i.y},over:s};I.unstable_batchedUpdates(()=>{he(s),null==o||o(u),v({type:"onDragOver",event:u})})},[ge]),Vs(()=>{q.current={activatorEvent:P,active:D,activeNode:Y,collisionRect:fe,collisions:me,droppableRects:X,draggableNodes:w,draggingNode:K,draggingNodeRect:ee,droppableContainers:T,over:be,scrollableAncestors:oe,scrollAdjustedTranslate:pe},O.current={initial:ee,translated:fe}},[D,Y,me,fe,w,K,ee,X,T,be,oe,pe]),function(n){let{acceleration:t,activator:r=qu.Pointer,canScroll:i,draggingRect:o,enabled:a,interval:s=5,order:u=Qu.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:p,threshold:f}=n;const m=function(e){let{delta:n,disabled:t}=e;const r=Ls(n);return Hs(e=>{if(t||!r||!e)return $u;const i=Math.sign(n.x-r.x),o=Math.sign(n.y-r.y);return{x:{[Eu.Backward]:e.x[Eu.Backward]||-1===i,[Eu.Forward]:e.x[Eu.Forward]||1===i},y:{[Eu.Backward]:e.y[Eu.Backward]||-1===o,[Eu.Forward]:e.y[Eu.Forward]||1===o}}},[t,n,r])}({delta:p,disabled:!a}),[g,b]=function(){const n=e.useRef(null);return[e.useCallback((e,t)=>{n.current=setInterval(e,t)},[]),e.useCallback(()=>{null!==n.current&&(clearInterval(n.current),n.current=null)},[])]}(),h=e.useRef({x:0,y:0}),v=e.useRef({x:0,y:0}),I=e.useMemo(()=>{switch(r){case qu.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qu.DraggableRect:return o}},[r,o,c]),y=e.useRef(null),C=e.useCallback(()=>{const e=y.current;e&&e.scrollBy(h.current.x*v.current.x,h.current.y*v.current.y)},[]),x=e.useMemo(()=>u===Qu.TreeOrder?[...l].reverse():l,[u,l]);e.useEffect(()=>{if(a&&l.length&&I){for(const e of x){if(!1===(null==i?void 0:i(e)))continue;const n=l.indexOf(e),r=d[n];if(!r)continue;const{direction:o,speed:a}=Su(e,r,I,t,f);for(const e of["x","y"])m[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return b(),y.current=e,g(C,s),h.current=a,void(v.current=o)}h.current={x:0,y:0},v.current={x:0,y:0},b()}else b()},[t,C,i,b,a,s,JSON.stringify(I),JSON.stringify(m),g,l,x,d,JSON.stringify(f)])}({...J,delta:R,draggingRect:fe,pointerCoordinates:ue,scrollableAncestors:oe,scrollableAncestorRects:ae});const Ae=e.useMemo(()=>({active:D,activeNode:Y,activeNodeRect:_,activatorEvent:P,collisions:me,containerNodeRect:U,dragOverlay:$,draggableNodes:w,droppableContainers:T,droppableRects:X,over:be,measureDroppableContainers:L,scrollableAncestors:oe,scrollableAncestorRects:ae,measuringConfiguration:H,measuringScheduled:Z,windowRect:ie}),[D,Y,_,P,me,U,$,w,T,X,be,L,oe,ae,H,Z,ie]),Ee=e.useMemo(()=>({activatorEvent:P,activators:xe,active:D,activeNodeRect:_,ariaDescribedById:{draggable:W},dispatch:h,draggableNodes:w,over:be,measureDroppableContainers:L}),[P,xe,D,_,h,W,w,be,L]);return S.default.createElement(tu.Provider,{value:y},S.default.createElement(gc.Provider,{value:Ee},S.default.createElement(bc.Provider,{value:Ae},S.default.createElement(yc.Provider,{value:ve},c)),S.default.createElement(Ic,{disabled:!1===(null==s?void 0:s.restoreFocus)})),S.default.createElement(ou,{...s,hiddenTextDescribedById:W}))}),Ac=/*#__PURE__*/e.createContext(null),Ec="button",wc={timeout:25};function Rc(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Tc(e,n){return e.reduce((e,t,r)=>{const i=n.get(t);return i&&(e[r]=i),e},Array(e.length))}function Sc(e){return null!==e&&e>=0}const Nc=e=>{let{rects:n,activeIndex:t,overIndex:r,index:i}=e;const o=Rc(n,r,t),a=n[i],s=o[i];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},Oc="Sortable",Dc=/*#__PURE__*/S.default.createContext({activeIndex:-1,containerId:Oc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Nc,disabled:{draggable:!1,droppable:!1}});function kc(n){let{children:t,id:r,items:i,strategy:o=Nc,disabled:a=!1}=n;const{active:s,dragOverlay:u,droppableRects:c,over:l,measureDroppableContainers:d}=e.useContext(bc),p=Ys(Oc,r),f=Boolean(null!==u.rect),m=e.useMemo(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),g=null!=s,b=s?m.indexOf(s.id):-1,h=l?m.indexOf(l.id):-1,v=e.useRef(m),I=!function(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}(m,v.current),y=-1!==h&&-1===b||I,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);Vs(()=>{I&&g&&d(m)},[I,m,g,d]),e.useEffect(()=>{v.current=m},[m]);const x=e.useMemo(()=>({activeIndex:b,containerId:p,disabled:C,disableTransforms:y,items:m,overIndex:h,useDragOverlay:f,sortedRects:Tc(m,c),strategy:o}),[b,p,C.draggable,C.droppable,y,m,h,c,f,o]);return S.default.createElement(Dc.Provider,{value:x},t)}const Gc=e=>{let{id:n,items:t,activeIndex:r,overIndex:i}=e;return Rc(t,r,i).indexOf(n)},Bc=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:u,transition:c}=e;return!(!c||!r||s!==o&&i===a||!t&&(a===i||n!==u))},Pc={duration:200,easing:"ease"},Mc="transform",Vc=/*#__PURE__*/qs.Transition.toString({property:Mc,duration:0,easing:"linear"}),Wc={roleDescription:"sortable"};var Fc=function(n){var t=function(n){let{animateLayoutChanges:t=Bc,attributes:r,disabled:i,data:o,getNewIndex:a=Gc,id:s,strategy:u,resizeObserverConfig:c,transition:l=Pc}=n;const{items:d,containerId:p,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:b,overIndex:h,useDragOverlay:v,strategy:I}=e.useContext(Dc),y=function(e,n){var t,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(t=null==e?void 0:e.draggable)?t:n.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:n.droppable}}(i,m),C=d.indexOf(s),x=e.useMemo(()=>({sortable:{containerId:p,index:C,items:d},...o}),[p,o,C,d]),A=e.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:E,node:w,isOver:R,setNodeRef:T}=function(n){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:o}=n;const a=Ys("Droppable"),{active:s,dispatch:u,over:c,measureDroppableContainers:l}=e.useContext(gc),d=e.useRef({disabled:r}),p=e.useRef(!1),f=e.useRef(null),m=e.useRef(null),{disabled:g,updateMeasurementsFor:b,timeout:h}={...wc,...o},v=Fs(null!=b?b:i),I=rc({callback:e.useCallback(()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},h)):p.current=!0},[h]),disabled:g||!s}),y=e.useCallback((e,n)=>{I&&(n&&(I.unobserve(n),p.current=!1),e&&I.observe(e))},[I]),[C,x]=Xs(y),A=Fs(t);return e.useEffect(()=>{I&&C.current&&(I.disconnect(),p.current=!1,I.observe(C.current))},[C,I]),e.useEffect(()=>(u({type:au.RegisterDroppable,element:{id:i,key:a,disabled:r,node:C,rect:f,data:A}}),()=>u({type:au.UnregisterDroppable,key:a,id:i})),[i]),e.useEffect(()=>{r!==d.current.disabled&&(u({type:au.SetDroppableDisabled,id:i,key:a,disabled:r}),d.current.disabled=r)},[i,a,r,u]),{active:s,rect:f,isOver:(null==c?void 0:c.id)===i,node:C,over:c,setNodeRef:x}}({id:s,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:S,activatorEvent:N,activeNodeRect:O,attributes:D,setNodeRef:k,listeners:G,isDragging:B,over:P,setActivatorNodeRef:M,transform:V}=function(n){let{id:t,data:r,disabled:i=!1,attributes:o}=n;const a=Ys("Draggable"),{activators:s,activatorEvent:u,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:p,over:f}=e.useContext(gc),{role:m=Ec,roleDescription:g="draggable",tabIndex:b=0}=null!=o?o:{},h=(null==c?void 0:c.id)===t,v=e.useContext(h?yc:Ac),[I,y]=Xs(),[C,x]=Xs(),A=function(n,t){return e.useMemo(()=>n.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[n,t])}(s,t),E=Fs(r);return Vs(()=>(p.set(t,{id:t,key:a,node:I,activatorNode:C,data:E}),()=>{const e=p.get(t);e&&e.key===a&&p.delete(t)}),[p,t]),{active:c,activatorEvent:u,activeNodeRect:l,attributes:e.useMemo(()=>({role:m,tabIndex:b,"aria-disabled":i,"aria-pressed":!(!h||m!==Ec)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[i,m,b,h,g,d.draggable]),isDragging:h,listeners:i?void 0:A,node:I,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:v}}({id:s,data:x,attributes:{...Wc,...r},disabled:y.draggable}),W=function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return e.useMemo(()=>e=>{t.forEach(n=>n(e))},t)}(T,k),F=Boolean(S),H=F&&!g&&Sc(f)&&Sc(h),X=!v&&B,L=X&&H?V:null,Z=H?null!=L?L:(null!=u?u:I)({rects:b,activeNodeRect:O,activeIndex:f,overIndex:h,index:C}):null,Y=Sc(f)&&Sc(h)?a({id:s,items:d,activeIndex:f,overIndex:h}):C,j=null==S?void 0:S.id,J=e.useRef({activeId:j,items:d,newIndex:Y,containerId:p}),z=d!==J.current.items,_=t({active:S,containerId:p,isDragging:B,isSorting:F,id:s,index:C,items:d,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:l,wasDragging:null!=J.current.activeId}),U=function(n){let{disabled:t,index:r,node:i,rect:o}=n;const[a,s]=e.useState(null),u=e.useRef(r);return Vs(()=>{if(!t&&r!==u.current&&i.current){const e=o.current;if(e){const n=bu(i.current,{ignoreTransform:!0}),t={x:e.left-n.left,y:e.top-n.top,scaleX:e.width/n.width,scaleY:e.height/n.height};(t.x||t.y)&&s(t)}}r!==u.current&&(u.current=r)},[t,r,i,o]),e.useEffect(()=>{a&&s(null)},[a]),a}({disabled:!_,index:C,node:w,rect:E});return e.useEffect(()=>{F&&J.current.newIndex!==Y&&(J.current.newIndex=Y),p!==J.current.containerId&&(J.current.containerId=p),d!==J.current.items&&(J.current.items=d)},[F,Y,p,d]),e.useEffect(()=>{if(j===J.current.activeId)return;if(null!=j&&null==J.current.activeId)return void(J.current.activeId=j);const e=setTimeout(()=>{J.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:S,activeIndex:f,attributes:D,data:x,rect:E,index:C,newIndex:Y,items:d,isOver:R,isSorting:F,isDragging:B,listeners:G,node:w,overIndex:h,over:P,setNodeRef:W,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:k,transform:null!=U?U:Z,transition:U||z&&J.current.newIndex===C?Vc:X&&!_s(N)||!l?void 0:F||_?qs.Transition.toString({...l,property:Mc}):void 0}}({id:n.data.value}),r=t.attributes,i=t.listeners,o=t.setNodeRef,a=t.transition,s={display:"flex",transform:qs.Transform.toString(t.transform),transition:a};/*#__PURE__*/return S.default.createElement("div",L({ref:o,style:s},r,i,{onPointerDown:function(e){e.target instanceof HTMLElement&&(["svg","path"].includes(e.target.nodeName)&&(e.preventDefault(),e.stopPropagation()),null==i||i.onPointerDown(e))}}),/*#__PURE__*/S.default.createElement(Sa.MultiValueContainer,n))},Hc=function(e){var n=L({},e.innerProps,{style:{cursor:"grab"},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}});/*#__PURE__*/return S.default.createElement(Sa.MultiValueLabel,L({},e,{innerProps:n}))},Xc=Zi(function(e,n){var t,r,i,o="[object Map]",a="[object Promise]",s="[object Set]",u="[object WeakMap]",c="[object DataView]",l=/^\[object .+?Constructor\]$/,d="object"==typeof self&&self&&self.Object===Object&&self,p="object"==typeof Xi&&Xi&&Xi.Object===Object&&Xi||d||Function("return this")(),f=n&&!n.nodeType&&n,m=f&&e&&!e.nodeType&&e,g=m&&m.exports===f,b=Function.prototype,h=Object.prototype,v=p["__core-js_shared__"],I=(t=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",y=b.toString,C=h.hasOwnProperty,x=h.toString,A=RegExp("^"+y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=g?p.Buffer:void 0,w=h.propertyIsEnumerable,R=E?E.isBuffer:void 0,T=(r=Object.keys,i=Object,function(e){return r(i(e))}),S=F(p,"DataView"),N=F(p,"Map"),O=F(p,"Promise"),D=F(p,"Set"),k=F(p,"WeakMap"),G=!w.call({valueOf:1},"valueOf"),B=X(S),P=X(N),M=X(O),V=X(D),W=X(k);function F(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return function(e){if(!J(e)||function(e){return!!I&&I in e}(e))return!1;var n=j(e)||function(e){var n=!1;if(null!=e&&"function"!=typeof e.toString)try{n=!!(e+"")}catch(e){}return n}(e)?A:l;return n.test(X(e))}(t)?t:void 0}var H=function(e){return x.call(e)};function X(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(S&&H(new S(new ArrayBuffer(1)))!=c||N&&H(new N)!=o||O&&H(O.resolve())!=a||D&&H(new D)!=s||k&&H(new k)!=u)&&(H=function(e){var n=x.call(e),t="[object Object]"==n?e.constructor:void 0,r=t?X(t):void 0;if(r)switch(r){case B:return c;case P:return o;case M:return a;case V:return s;case W:return u}return n});var L=Array.isArray;function Z(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!j(e)}var Y=R||function(){return!1};function j(e){var n=J(e)?x.call(e):"";return"[object Function]"==n||"[object GeneratorFunction]"==n}function J(e){var n=typeof e;return!!e&&("object"==n||"function"==n)}e.exports=function(e){if(Z(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||Y(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Z(e)}(e)&&C.call(e,"callee")&&(!w.call(e,"callee")||"[object Arguments]"==x.call(e))}(e)))return!e.length;var n=H(e);if(n==o||n==s)return!e.size;if(G||function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||h)}(e))return!T(e).length;for(var t in e)if(C.call(e,t))return!1;return!0}}),Lc=function(e,n){return Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},Lc(e,n)};function Zc(e,n){function t(){this.constructor=e}Lc(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}function Yc(e){return"function"==typeof e}var jc=!1,Jc={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){jc=e},get useDeprecatedSynchronousErrorHandling(){return jc}};function zc(e){setTimeout(function(){throw e},0)}var _c={closed:!0,next:function(e){},error:function(e){if(Jc.useDeprecatedSynchronousErrorHandling)throw e;zc(e)},complete:function(){}},Uc=/*@__PURE__*/function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function qc(e){return null!==e&&"object"==typeof e}var Qc=/*@__PURE__*/function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,n){return n+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=/*@__PURE__*/Object.create(Error.prototype),e}(),$c=Qc,Kc=/*@__PURE__*/function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var n;if(!this.closed){var t=this,r=t._parentOrParents,i=t._ctorUnsubscribe,o=t._unsubscribe,a=t._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s)r[s].remove(this);if(Yc(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){n=e instanceof $c?el(e.errors):[e]}}if(Uc(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(qc(c))try{c.unsubscribe()}catch(e){n=n||[],e instanceof $c?n=n.concat(el(e.errors)):n.push(e)}}}if(n)throw new $c(n)}},e.prototype.add=function(n){var t=n;if(!n)return e.EMPTY;switch(typeof n){case"function":t=new e(n);case"object":if(t===this||t.closed||"function"!=typeof t.unsubscribe)return t;if(this.closed)return t.unsubscribe(),t;if(!(t instanceof e)){var r=t;(t=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+n+" added to Subscription.")}var i=t._parentOrParents;if(null===i)t._parentOrParents=this;else if(i instanceof e){if(i===this)return t;t._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return t;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[t]:o.push(t),t},e.prototype.remove=function(e){var n=this._subscriptions;if(n){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function el(e){return e.reduce(function(e,n){return e.concat(n instanceof $c?n.errors:n)},[])}var nl=/*@__PURE__*/function(){return"function"==typeof Symbol?/*@__PURE__*/Symbol("rxSubscriber"):"@@rxSubscriber_"+/*@__PURE__*/Math.random()}(),tl=/*@__PURE__*/function(e){function n(t,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=_c;break;case 1:if(!t){o.destination=_c;break}if("object"==typeof t){t instanceof n?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new rl(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new rl(o,t,r,i)}return o}return Zc(n,e),n.prototype[nl]=function(){return this},n.create=function(e,t,r){var i=new n(e,t,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(Kc),rl=/*@__PURE__*/function(e){function n(n,t,r,i){var o,a=e.call(this)||this;a._parentSubscriber=n;var s=a;return Yc(t)?o=t:t&&(o=t.next,r=t.error,i=t.complete,t!==_c&&(Yc((s=Object.create(t)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=o,a._error=r,a._complete=i,a}return Zc(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;Jc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var n=this._parentSubscriber,t=Jc.useDeprecatedSynchronousErrorHandling;if(this._error)t&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(n.syncErrorThrowable)t?(n.syncErrorValue=e,n.syncErrorThrown=!0):zc(e),this.unsubscribe();else{if(this.unsubscribe(),t)throw e;zc(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var t=function(){return e._complete.call(e._context)};Jc.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,n){try{e.call(this._context,n)}catch(e){if(this.unsubscribe(),Jc.useDeprecatedSynchronousErrorHandling)throw e;zc(e)}},n.prototype.__tryOrSetError=function(e,n,t){if(!Jc.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,t)}catch(n){return Jc.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=n,e.syncErrorThrown=!0,!0):(zc(n),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(tl),il=/*@__PURE__*/function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function ol(e){return e}var al=/*@__PURE__*/function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(e,n,t){var r=this.operator,i=function(e,n,t){if(e){if(e instanceof tl)return e;if(e[nl])return e[nl]()}return e||n||t?new tl(e,n,t):new tl(_c)}(e,n,t);if(i.add(r?r.call(i,this.source):this.source||Jc.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Jc.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){Jc.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),function(e){for(;e;){var n=e.destination;if(e.closed||e.isStopped)return!1;e=n&&n instanceof tl?n:null}return!0}(e)?e.error(n):console.warn(n)}},e.prototype.forEach=function(e,n){var t=this;return new(n=sl(n))(function(n,r){var i;i=t.subscribe(function(n){try{e(n)}catch(e){r(e),i&&i.unsubscribe()}},r,n)})},e.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},e.prototype[il]=function(){return this},e.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 0===n.length?this:(0===(e=n).length?ol:1===e.length?e[0]:function(n){return e.reduce(function(e,n){return n(e)},n)})(this)},e.prototype.toPromise=function(e){var n=this;return new(e=sl(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},e.create=function(n){return new e(n)},e}();function sl(e){if(e||(e=Jc.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var ul=/*#__PURE__*/function(){function e(e,n){var t=this;this.wsURL=void 0,this.cable=null,this.subscriptions=new Map,this.onDisconnect=void 0,this.addSubscription=function(e,n){t.subscriptions.set(e,n)},this.wsURL=e,this.onDisconnect=n}var n=e.prototype;return n.connect=function(e,n){this.cable=H.default.createConsumer(this.wsURL+"?token="+e+"&lang="+n)},n.disconnect=function(){this.cable&&(this.subscriptions.forEach(function(e){e.unsubscribe()}),this.subscriptions.clear(),this.cable.disconnect(),this.cable=null)},n.request=function(e){var n=this.cable,t=this.subscriptions,r=this.addSubscription,i=this.onDisconnect;return new al(function(o){if(n){var a,s=(null==(a=e.variables)?void 0:a.id)||"company";if(!t.has(s)){var u=n.subscriptions.create({channel:"GraphqlChannel",channelId:Math.round(Date.now()+1e5*Math.random()).toString(16)},{connected:function(){this.perform("execute",e)},disconnected:function(){i&&i()},received:function(e){e.more?e.result.errors?o.error&&o.error(e.result.errors[0]):e.result.data&&o.next&&(Xc(e.result.data)||o.next(e.result)):o.complete&&o.complete()}});r(s,u)}}})},n.hasSubscription=function(e){return this.subscriptions.has(e)},e}(),cl=0,ll=/*#__PURE__*/function(){function e(e,n,t,r){this.actionCableClient=null,this.registry=new Map,this.activeRxSubscriptions=new Map,this.actionCableClient=new ul(e,r),this.actionCableClient.connect(n,t)}var n=e.prototype;return n.subscribe=function(e,n,t,r){var i=this;void 0===r&&(r=function(e){throw e});var o=String(++cl);this.registry.set(o,{query:e,variables:n,onData:t,onError:r});var a=this.subscribeToActionCable(e,n,t,r);return this.activeRxSubscriptions.set(o,a),function(){a.unsubscribe(),i.activeRxSubscriptions.delete(o),i.registry.delete(o)}},n.disconnect=function(){var e;this.activeRxSubscriptions.forEach(function(e){return e.unsubscribe()}),this.activeRxSubscriptions.clear(),this.registry.clear(),null==(e=this.actionCableClient)||e.disconnect(),this.actionCableClient=null},n.getActiveSubscriptions=function(){return new Map(this.registry)},n.resubscribe=function(){var e=this;this.activeRxSubscriptions.forEach(function(e){return e.unsubscribe()}),this.activeRxSubscriptions.clear(),this.registry.forEach(function(n,t){var r=e.subscribeToActionCable(n.query,n.variables,n.onData,n.onError);e.activeRxSubscriptions.set(t,r)})},n.subscribeToActionCable=function(e,n,t,r){if(void 0===r&&(r=function(e){throw e}),!this.actionCableClient)throw new Error("No WS client available");var i=this.actionCableClient.request({query:e,variables:n}).subscribe({next:function(e){var n=e.data,i=e.errors;if(i)return r(new Error(JSON.stringify(i)));n&&t&&t(function(e){var n=Object.keys(e);if(1!==n.length)throw new Error("Expected exactly one response key, got: "+n.join(", "));return e[n[0]]}(n))}});return i},e}(),dl=function(e,n,t,r){return new ll(e,n,t,r)},pl=function(e,n){return ci(new E.GraphQLClient(e,{fetch:n}))},fl=function(n){var t,r=n.url,o=n.wsUrl,a=n.lang,s=i.useStore().sessionStore,u=e.useState(),c=u[0],l=u[1],d=e.useState(),p=d[0],f=d[1],m=e.useRef(void 0),g=e.useRef(""),b=o||r.replace("graphql","cable"),h=(null==(t=s.loginStatus.authResponse)?void 0:t.accessToken)||"";return e.useEffect(function(){r&&l(pl(r,i.fetch))},[r]),e.useEffect(function(){if(r&&h&&h!==g.current){g.current=h;var e=m.current,n=null==e?void 0:e.getActiveSubscriptions(),t=dl(b,h,a,function(){"connected"===s.loginStatus.status&&console.warn("[dashboard-toolkit] WebSocket disconnected unexpectedly — waiting for token refresh")});return m.current=t,n&&n.size>0&&n.forEach(function(e){t.subscribe(e.query,e.variables,e.onData,e.onError)}),f(t),e&&e.disconnect(),function(){t.disconnect(),m.current=void 0}}},[r,b,h,a]),{graphqlSdk:c,gqlWsClient:p}};const ml=e.createContext(null),gl={didCatch:!1,error:null};class bl extends e.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=gl}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){const{error:n}=this.state;null!==n&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(gl))}componentDidCatch(e,n){this.props.onError?.(e,n)}componentDidUpdate(e,n){const{didCatch:t}=this.state,{resetKeys:r}=this.props;t&&null!==n.error&&function(e=[],n=[]){return e.length!==n.length||e.some((e,t)=>!Object.is(e,n[t]))}(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:"keys"}),this.setState(gl))}render(){const{children:n,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=n;if(o){const n={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(n);else if(r)s=e.createElement(r,n);else{if(void 0===i)throw a;s=i}}return e.createElement(ml.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}var hl={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:function(e){return e.spacing(2)},padding:function(e){return e.spacing(2)}},vl=function(e){var r=e.resetErrorBoundary,i=t.useTranslation().t;/*#__PURE__*/return S.default.createElement(n.Box,{sx:hl},/*#__PURE__*/S.default.createElement(n.Typography,{variant:"body2",color:"text.secondary"},i("widgetCard.error")),/*#__PURE__*/S.default.createElement(n.Button,{variant:"outlined",size:"small",onClick:r,"data-testid":"widget-card.error-retry"},i("widgetCard.retry")))},Il=function(e,n){console.error("[dashboard-toolkit] Widget error:",e,n)},yl=function(e){/*#__PURE__*/return S.default.createElement(bl,{FallbackComponent:vl,onError:Il},e.children)},Cl={root:{boxShadow:"none","& .react-resizable-handle":{width:"24px",height:"24px",borderRadius:"4px",background:function(e){return e.palette.primary.main+" url("+X.default+")"},backgroundRepeat:"no-repeat",backgroundSize:"50%",backgroundPosition:"50%","&:hover":{backgroundColor:function(e){return e.palette.primary.dark}}},"& .react-resizable-handle:after":{display:"none"}},header:{height:"40px"},dragIcon:{width:"30px",height:"30px",marginLeft:function(e){return"-"+e.spacing(1)},padding:"8px",borderRadius:"4px",background:function(e){return e.palette.primary.main},"&:hover":{cursor:"move",background:function(e){return e.palette.primary.dark}}},actionButtons:{height:"30px",marginTop:"-7px"},settingsButton:{color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopRightRadius:0,borderBottomRightRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},infoButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},deleteButton:{marginLeft:"1px",color:"rgba(255, 255, 255, 0.45)",borderRadius:"4px",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderColor:"rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.1)","&:focus":{boxShadow:"0 0 0 1px rgba(255, 255, 255, 0.1)"},"&:hover":{opacity:.8}},content:{height:"calc(100% - 40px)",padding:0,background:"transparent",border:"1px solid rgba(255, 255, 255, 0.2)",borderTop:"none",borderRadius:"4px",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.25)","&:last-child":{paddingBottom:0}}},xl=["children","title","Widget","id","url","wsUrl","lang","data","filters","settings","openSettingsModal","onSettingsModalOpened","onSettingsModalClosed","sidePanelOpened","updateSidePanelProps","onDelete","editMode","version","requiredFeatures","extraPermissions"];function Al(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}var El=S.default.forwardRef(function(r,o){var a=r.children,s=r.title,u=r.Widget,c=r.id,l=r.url,d=r.wsUrl,p=r.lang,f=r.data,m=r.filters,g=r.settings,b=r.openSettingsModal,h=r.onSettingsModalOpened,v=r.onSettingsModalClosed,I=r.sidePanelOpened,A=r.updateSidePanelProps,E=r.onDelete,w=r.editMode,R=r.version,T=r.requiredFeatures,N=r.extraPermissions,O=Z(r,xl),D=fl({url:l,wsUrl:d,lang:p}).graphqlSdk,k=i.useAccess(T,{extraPermissions:N}).hasAccess,G=e.useState(!1),B=G[0],P=G[1],M=e.useState(!1),V=M[0],W=M[1],F=t.useTranslation().t;return i.registerTranslations(_),/*#__PURE__*/S.default.createElement(n.Card,L({ref:o,sx:Cl.root},O),/*#__PURE__*/S.default.createElement(n.CardHeader,{avatar:w&&/*#__PURE__*/S.default.createElement(n.SvgIcon,{component:x.ReactComponent,className:"draggable-handle",sx:Cl.dragIcon,inheritViewBox:!0}),title:s,titleTypographyProps:{variant:"subtitle1"},action:w&&/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",sx:Cl.actionButtons},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:Cl.settingsButton,onClick:function(){h&&h()},disabled:!k,"data-testid":"widget-card.settings-button"},/*#__PURE__*/S.default.createElement(y.Settings,null)),R&&/*#__PURE__*/S.default.createElement(S.default.Fragment,null,/*#__PURE__*/S.default.createElement(n.Tooltip,{title:R},/*#__PURE__*/S.default.createElement(n.Button,{color:"secondary",sx:Cl.infoButton,"data-testid":"widget-card.info-button"},/*#__PURE__*/S.default.createElement(y.Info,null)))),/*#__PURE__*/S.default.createElement(z,{open:V,confirmMessage:F("Are you sure you want to delete this widget?"),confirmButtonText:F("Delete"),cancelButtonText:F("Cancel"),onCancel:function(){return W(!1)},onConfirm:function(){try{var e=function(){P(!1)};P(!0),W(!1);var n=function(){if(E)return Promise.resolve(E()).then(function(){})}();return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}},confirmButtonTestId:"widget-card.delete-confirm",cancelButtonTestId:"widget-card.delete-cancel"},/*#__PURE__*/S.default.createElement(C.LoadingButton,{color:"secondary",sx:Cl.deleteButton,onClick:function(e){e.stopPropagation(),W(!0)},loading:B,"data-testid":"widget-card.delete-button"},/*#__PURE__*/S.default.createElement(y.Delete,null)))),sx:Cl.header}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:Cl.content},/*#__PURE__*/S.default.createElement(i.AccessGuard,{features:T,extraPermissions:N,onTrialRequest:function(e){try{return Promise.resolve(Al(function(){return Promise.resolve(null==D?void 0:D.startTrial({input:{featureKey:e}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to start trial:",e),!1}))}catch(e){return Promise.reject(e)}},onFeatureRequest:function(e){var n=e.featureKey,t=e.requestType,r=e.workplaceId;try{return Promise.resolve(Al(function(){return Promise.resolve(null==D?void 0:D.requestFeatureAccess({input:{featureKey:n,requestType:t.toUpperCase(),workplaceId:r}})).then(function(){return Promise.resolve(i.refreshUserData()).then(function(){return!0})})},function(e){return console.error("Failed to request feature access:",e),!1}))}catch(e){return Promise.reject(e)}}},/*#__PURE__*/S.default.createElement(yl,null,/*#__PURE__*/S.default.createElement(u,{id:c,url:l,wsUrl:d,lang:p,data:f,filters:m,settings:g,openSettingsModal:b,onSettingsModalOpened:h,onSettingsModalClosed:v,sidePanelOpened:I,updateSidePanelProps:A,editMode:w})))),w&&a)}),wl=function(e){var n=D.default(e.dateFrom),t=D.default(e.dateTo),r=t.diff(n,"day"),i=t.diff(n,"month"),o=[];return r<=1&&o.push(exports.InsightsAggregation.Hourly),r>=2&&r<=31&&o.push(exports.InsightsAggregation.Daily),r>=14&&i<=6&&o.push(exports.InsightsAggregation.Weekly),i>=3&&i<=12&&o.push(exports.InsightsAggregation.Monthly),o};exports.ActualStaffingCountsDocument=vr,exports.ApplicationInfoDocument=Ir,exports.AssignOperatorDocument=$r,exports.AssignOperatorToWorkplaceDocument=Zt,exports.AvailabilityInsightsDocument=yr,exports.BulkUpsertStaffingPlansDocument=Yt,exports.CompanyConfigDocument=Cr,exports.ConfirmTooltip=z,exports.CounterDirectoriesDocument=xr,exports.CountersDocument=Ar,exports.CreateDashboardDocument=jt,exports.CreateOrderDocument=Jt,exports.CreateProductDocument=zt,exports.CreateStaffingPlanDocument=_t,exports.CreateStatusChangeDocument=Ut,exports.CreateUserPresenceDocument=qt,exports.CreateWidgetDocument=Qt,exports.CurrentUserDocument=Er,exports.DashboardFilters=function(r){var o=r.initialValues,a=r.onChange,s=r.shifts,u=void 0===s?[]:s,c=r.onFeatureRequest,l=i.useAccess([Hi]),d=l.hasAccess,p=l.accessState,f=l.buttons,m=l.cooldownInfo,g=l.features,b=e.useState(!1),h=b[0],v=b[1],I=e.useState(!1),y=I[0],C=I[1],x=e.useRef(null),A=function(n,t,r){var i=e.useState(function(){return Vi(n,t)}),o=i[0],a=i[1],s=e.useState(0),u=s[0],c=s[1],l=e.useRef(r);l.current=r,e.useEffect(function(){n&&a(function(e){var r=Vi(n,t);return JSON.stringify(r)===JSON.stringify(e)?e:r})},[n,t]);var d=e.useMemo(function(){return Wi(o,t)},[o,t,u]),p=e.useMemo(function(){return{dayType:o.dayType,selectedPeriodId:o.selectedPeriodId,dateRange:d,shiftIds:o.shiftIds}},[o.dayType,o.selectedPeriodId,d,o.shiftIds]);e.useEffect(function(){if(o.selectedPeriodId){var e=Si(o.selectedPeriodId,{dayType:o.dayType,shifts:t,selectedShiftIds:o.shiftIds});if(e){var n=e.getTime()-Date.now(),r=function(){var e=Ei.find(function(e){return e.id===o.selectedPeriodId});if(e){var n=Ai(o.selectedPeriodId,t),r=n?[n]:o.shiftIds;a(function(e){return L({},e,{shiftIds:r})}),c(function(e){return e+1});var i=e.calculate({dayType:o.dayType,shifts:t,selectedShiftIds:r});l.current({dayType:o.dayType,selectedPeriodId:o.selectedPeriodId,dateRange:i,shiftIds:r})}};if(!(n<=0)){var i=setTimeout(r,n);return function(){return clearTimeout(i)}}r()}}},[o.selectedPeriodId,o.dayType,o.shiftIds,t]);var f=e.useMemo(function(){var e=function(e){var n=Wi(e,t);l.current({dayType:e.dayType,selectedPeriodId:e.selectedPeriodId,dateRange:n,shiftIds:e.shiftIds})};return{handleDayTypeChange:function(n){a(function(t){var r=L({},t,{dayType:n});return e(r),r})},handleShiftChange:function(n){a(function(t){var r=L({},t,{shiftIds:n});return e(r),r})},handleDateRangeChange:function(n){a(function(t){var r=L({},t,{selectedPeriodId:void 0,shiftIds:[],customDateRange:n});return e(r),r})},handlePeriodSelect:function(n,r){a(function(i){var o=Ai(n.id,t),a=L({},i,{selectedPeriodId:n.id,shiftIds:o?[o]:[],customDateRange:r});return e(a),a})}}},[t]);return{filterValues:p,selectedPeriodId:o.selectedPeriodId,handlers:f}}(o,u,a),E=A.filterValues,w=A.selectedPeriodId,R=A.handlers,T=t.useTranslation().t;i.registerTranslations(_);var N,k,G,B=e.useMemo(function(){var e,n=g.find(function(e){return e.featureKey===Hi});return null!=(e=null==n?void 0:n.daysSinceExpiry)?e:null},[g]),P=e.useMemo(function(){return f.filter(function(e){return"start_trial"!==e.action})},[f]),M=e.useCallback(function(e,n){!e.needAccess||d?R.handlePeriodSelect(e,n):v(!0)},[d,R]),V=e.useCallback(function(){return C(!0)},[]),W=e.useCallback(function(){return C(!1)},[]),F=e.useCallback(function(){return v(!1)},[]),H=e.useCallback(function(){return v(!0)},[]);/*#__PURE__*/return S.default.createElement(n.Box,{sx:Fi.container},/*#__PURE__*/S.default.createElement(n.Stack,{direction:"row",spacing:2,alignItems:"center"},/*#__PURE__*/S.default.createElement(n.TextField,{ref:x,label:T("dashboardFilters.dateRange.label"),value:(N=E.dateRange,k=D.default(N.from).format("YYYY-MM-DD"),G=D.default(N.to).format("YYYY-MM-DD"),k===G?k:k+" - "+G),onClick:V,size:"small",InputProps:{readOnly:!0,startAdornment:/*#__PURE__*/S.default.createElement(n.InputAdornment,{position:"start"},/*#__PURE__*/S.default.createElement(O.default,{sx:{fontSize:16}}))},sx:Fi.dateField,"data-testid":"dashboard-filters.date-range-input"}),/*#__PURE__*/S.default.createElement(Mi,{shifts:u,selectedShiftIds:E.shiftIds,onChange:R.handleShiftChange})),/*#__PURE__*/S.default.createElement(n.Popover,{open:y,anchorEl:x.current,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:Fi.popover,"data-testid":"dashboard-filters.date-popover"},/*#__PURE__*/S.default.createElement(n.Box,{sx:Fi.popoverContent},/*#__PURE__*/S.default.createElement(Bi,{dateRange:E.dateRange,dayType:E.dayType,shifts:u,selectedShiftIds:E.shiftIds,hasAccess:d,selectedPeriodId:w,onDayTypeChange:R.handleDayTypeChange,onDateRangeChange:R.handleDateRangeChange,onPeriodSelect:M,onAccessDenied:H}))),/*#__PURE__*/S.default.createElement(q,{open:h,onClose:F,accessState:p,buttons:P,daysSinceExpiry:B,cooldownInfo:m,onFeatureRequest:c}))},exports.DashboardsDocument=wr,exports.DepartmentsDocument=Rr,exports.FloorPlansDocument=Tr,exports.GetWorkplacePerformanceInsightsDocument=ei,exports.GraphqlWsClient=ll,exports.ListActualStaffingCountsDocument=ni,exports.ListStaffingPlansDocument=ti,exports.ListStatusChangesDocument=ri,exports.ListWorkOrdersDocument=ii,exports.ListWorkplaceAssignmentsDocument=oi,exports.ListWorkplacesDocument=ai,exports.MetricCard=function(e){var r=e.title,i=e.metricLabel,o=e.metricValue,a=e.extraValue,s=e.animateBackgroundColor,u=e.rounded,c=Z(e,Ui),l=t.useTranslation().t,d=function(e){return{card:L({position:"relative",width:"100%",height:"100%"},e.showBgPattern&&{mixBlendMode:"hard-light",background:"url("+F.default+"), linear-gradient(329.66deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%)",backgroundSize:"cover"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0}),cardOverlay:L({position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1},e.showBgPattern&&{mixBlendMode:"hard-light"},e.card.rounded?{borderRadius:"4px"}:{borderTopLeftRadius:0,borderTopRightRadius:0},e.cardOverlay,{animation:e.animateBackgroundColor?(t=e.backgroundColor,v.keyframes(Yi||(Yi=Y(["\n 0% {\n background: ",";\n }\n\n 50% {\n background: ",";\n }\n\n 100% {\n background: ",";\n }\n"])),_i(t,.5),_i(t,1),_i(t,.5))+" 3s infinite"):"none"}),cardHeader:{height:"3em",color:zi,borderBottom:"1px solid rgba(0, 0, 0, 0.1)",background:"rgba(0, 0, 0, 0.05)","& span":{lineHeight:"3em",fontSize:"1em",fontWeight:500}},cardContent:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"80%",minWidth:"auto",minHeight:"auto",maxWidth:"none",background:"transparent","& > img":{flexBasis:"25%",minWidth:"125px",maxWidth:"25%"}},cardLabel:{width:"100%",lineHeight:"2.5em",fontSize:"1.8em",fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textAlign:"center",textOverflow:"ellipsis",color:zi},cardValue:{lineHeight:"1.2em",textAlign:"center",fontSize:"1.6em",fontWeight:700,color:n.lighten(zi,.15)},cardExtra:{lineHeight:"4em",textAlign:"center",fontSize:"1em",fontWeight:600,color:zi}};var t}({card:{rounded:u},cardOverlay:{background:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"linear-gradient(180deg, #31BF59 0%, #32D74B 100%)";case exports.AndonLightColor.Yellow:return"linear-gradient(360deg, #FFD60A 0%, #FFC12F 100%)";case exports.AndonLightColor.Red:return"linear-gradient(0deg, #F05C53 0%, #FF3B2F 100%)";default:return"rgba(187, 187, 187, 0.75)"}return"rgba(255, 255, 255, 0.75)"}()},showBgPattern:!0,backgroundColor:function(){var e=null==o?void 0:o.statusColor;if(e)switch(e){case exports.AndonLightColor.Green:return"#32D74B";case exports.AndonLightColor.Yellow:return"#FFC12F";case exports.AndonLightColor.Red:return"#FF3B2F";default:return"#BBBBBBBF"}return"#FFFFFFBF"}(),animateBackgroundColor:s});/*#__PURE__*/return S.default.createElement(n.Card,L({sx:d.card},c),/*#__PURE__*/S.default.createElement(n.Box,{sx:d.cardOverlay}),/*#__PURE__*/S.default.createElement(n.CardHeader,{title:/*#__PURE__*/S.default.createElement(Ji,{line:1,text:r}),sx:d.cardHeader}),/*#__PURE__*/S.default.createElement(n.CardContent,{sx:d.cardContent},/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardLabel},i),/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardValue},o?function(e){var n=e.textValue;if(n){var t=D.default.duration(Number(n),"seconds");return Math.floor(t.asMinutes())+"m "+t.seconds()+"s"}return""}(o):/*#__PURE__*/S.default.createElement(t.Trans,{t:l},"No value for the selected metric")),a&&/*#__PURE__*/S.default.createElement(n.Typography,{sx:d.cardExtra},a)))},exports.MetricValuesDocument=Sr,exports.MetricsDocument=Nr,exports.NotificationsDocument=Or,exports.OrdersDocument=Dr,exports.OrdersExecutionsDocument=kr,exports.PauseOrderExecutionDocument=$t,exports.ProductionInsightsDocument=Gr,exports.ProductsDocument=Br,exports.ReasonsDocument=Pr,exports.ReasonsRecommendationDocument=Mr,exports.RemoveDashboardDocument=Kt,exports.RemoveStaffingPlanDocument=er,exports.RemoveUserPresenceDocument=nr,exports.RemoveWidgetDocument=tr,exports.RemoveWorkplaceUsersPresencesDocument=rr,exports.RequestFeatureAccessDocument=ir,exports.SetCounterDocument=or,exports.ShiftsDocument=Vr,exports.SortableSelect=function(e){var n=e.options,t=e.selected,r=e.onChange,i=function(e){var n,i,o,a=e.active,s=e.over;if(a.id!==(null==s?void 0:s.id)){var u=t.findIndex(function(e){return e===a.id}),c=t.findIndex(function(e){return e===(null==s?void 0:s.id)});r((n=t,i=u,o=c,function(e,n,t){const r=n<0?e.length+n:n;if(r>=0&&r<e.length){const r=t<0?e.length+t:t,[i]=e.splice(n,1);e.splice(r,0,i)}}(n=[...n],i,o),n))}};/*#__PURE__*/return S.default.createElement(Ss,{placeholder:e.placeholder,isMulti:!0,options:n,value:t.map(function(e){return n.find(function(n){return n.value===e})}),onChange:function(e){return r([].concat(e||[]).map(function(e){return e.value}))},closeMenuOnSelect:!1,components:{MultiValueContainer:Fc,MultiValueLabel:Hc,ValueContainer:function(e){/*#__PURE__*/return S.default.createElement(xc,{onDragEnd:i},/*#__PURE__*/S.default.createElement(kc,{items:t},e.children))}},styles:{control:function(e,n){return L({},e,{padding:"6px 0 6px 8px",borderColor:"rgba(255, 255, 255, 0.15)",background:"#1C1F25"},n.isFocused&&{borderColor:"#4E5A67",boxShadow:"none"},{"&:hover":{borderColor:"#4E5A67",boxShadow:"none"}})},menu:function(e){return L({},e,{background:"#1C1F25"})},option:function(e,n){return L({},e,{background:n.isFocused?"#2A2E34":"#1C1F25"})}}})},exports.StaffingPlansDocument=Wr,exports.StandardRatesDocument=Fr,exports.StartOrderExecutionDocument=ar,exports.StartTrialDocument=sr,exports.StatusChangeTransitionPermissionsDocument=Hr,exports.StatusChangesDocument=Xr,exports.StatusInsightsDocument=Lr,exports.StopOrderExecutionDocument=ur,exports.UnassignOperatorDocument=Kr,exports.UnassignOperatorFromWorkplaceDocument=cr,exports.UpdateDashboardDocument=lr,exports.UpdateNotificationDocument=dr,exports.UpdateOrderDocument=pr,exports.UpdateOrderExecutionDocument=fr,exports.UpdateStaffingPlanDocument=mr,exports.UpdateStatusChangeDocument=gr,exports.UpdateWidgetDocument=br,exports.UpdateWorkOrderDocument=hr,exports.UsersDocument=Zr,exports.UsersPresencesDocument=Yr,exports.WidgetCard=El,exports.WidgetDocument=jr,exports.WidgetErrorBoundary=yl,exports.WidgetsDocument=Jr,exports.WorkOrdersDocument=zr,exports.WorkOrdersInsightsDocument=_r,exports.WorkplaceAssignmentsDocument=Ur,exports.WorkplaceEventDocument=si,exports.WorkplacePerformanceInsightsDocument=qr,exports.WorkplacesDocument=Qr,exports.findPeriodById=function(e){return Ei.find(function(n){return n.id===e})},exports.generateTimeRange=function(e,n,t,r){for(var i=[],o=e,a=e.isAfter(n);a?o.isAfter(n)||o.isSame(n):o.isBefore(n)||o.isSame(n);)i.push(o),o=a?o.subtract(r,t):o.add(r,t);return i},exports.getCurrentShift=mi,exports.getGqlWsClient=dl,exports.getGraphqlSdk=pl,exports.getNextBoundary=Si,exports.getRecentShift=gi,exports.getSdk=ci,exports.getShiftTimeRange=Ri,exports.getTimeRangeLabel=wi,exports.getValidAggregations=wl,exports.normalizeShifts=fi,exports.periods=Ei,exports.resolveAggregation=function(e,n){return n&&wl(e).includes(n)?n:function(e){var n=D.default(e.dateFrom),t=D.default(e.dateTo),r=t.diff(n,"day"),i=t.diff(n,"month");return r<=1?exports.InsightsAggregation.Hourly:r<=13?exports.InsightsAggregation.Daily:i<3?exports.InsightsAggregation.Weekly:exports.InsightsAggregation.Monthly}(e)},exports.resolveShiftIdForPeriod=Ai,exports.useGqlClients=fl,exports.version="1.5.41";
16
16
  //# sourceMappingURL=index.js.map