From 77b1d23da04f96b8007d2538f0dff5ca5fb13c07 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Tue, 1 Oct 2024 19:30:55 +0200 Subject: [PATCH] . --- client/package.json | 2 +- dist/client/assets/{index-DGKfFlr2.js => index-CPprBq9G.js} | 2 +- dist/client/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename dist/client/assets/{index-DGKfFlr2.js => index-CPprBq9G.js} (98%) diff --git a/client/package.json b/client/package.json index a90aad6..7d46852 100644 --- a/client/package.json +++ b/client/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "dev": "vite --host", - "build": "tsc && vite build", + "build": "rm -rf ../dist/client && tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview --host --port 8080", "test": "jest" diff --git a/dist/client/assets/index-DGKfFlr2.js b/dist/client/assets/index-CPprBq9G.js similarity index 98% rename from dist/client/assets/index-DGKfFlr2.js rename to dist/client/assets/index-CPprBq9G.js index ce0b1cb..415f601 100644 --- a/dist/client/assets/index-DGKfFlr2.js +++ b/dist/client/assets/index-CPprBq9G.js @@ -419,7 +419,7 @@ function print() { __p += __j.call(arguments, '') } To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},UIe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function HIe(t){let{announcements:e=UIe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=BIe}=t;const{announce:i,announcement:o}=$Ie(),a=V_("DndLiveRegion"),[c,u]=S.useState(!1);if(S.useEffect(()=>{u(!0)},[]),FIe(S.useMemo(()=>({onDragStart(l){let{active:d}=l;i(e.onDragStart({active:d}))},onDragMove(l){let{active:d,over:p}=l;e.onDragMove&&i(e.onDragMove({active:d,over:p}))},onDragOver(l){let{active:d,over:p}=l;i(e.onDragOver({active:d,over:p}))},onDragEnd(l){let{active:d,over:p}=l;i(e.onDragEnd({active:d,over:p}))},onDragCancel(l){let{active:d,over:p}=l;i(e.onDragCancel({active:d,over:p}))}}),[i,e])),!c)return null;const f=oe.createElement(oe.Fragment,null,oe.createElement(jIe,{id:r,value:s.draggable}),oe.createElement(LIe,{id:a,announcement:o}));return n?rs.createPortal(f,n):f}var Vr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Vr||(Vr={}));function YE(){}function M1(t,e){return S.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function VIe(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Xa=Object.freeze({x:0,y:0});function qIe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function WIe(t,e){const n=KE(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function GIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function KIe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function YIe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function gU(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const XIe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=gU(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const u=qIe(gU(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(GIe)};function QIe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,a=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=QIe(a,e);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(KIe)};function JIe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function RJ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Xa}function eje(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const tje=eje(1);function AJ(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function nje(t,e,n){const r=AJ(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=t.left-o-(1-s)*parseFloat(n),u=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,l=i?t.height/i:t.height;return{width:f,height:l,top:u,right:c+f,bottom:u+l,left:c}}const rje={ignoreTransform:!1};function jy(t,e){e===void 0&&(e=rje);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=ui(t).getComputedStyle(t);u&&(n=nje(n,u,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:c}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:c}}function vU(t){return jy(t,{ignoreTransform:!0})}function sje(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function ije(t,e){return e===void 0&&(e=ui(t).getComputedStyle(t)),e.position==="fixed"}function oje(t,e){e===void 0&&(e=ui(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function A$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(R$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!U_(s)||SJ(s)||n.includes(s))return n;const i=ui(t).getComputedStyle(s);return s!==t&&oje(s,i)&&n.push(s),ije(s,i)?n:r(s.parentNode)}return t?r(t):n}function PJ(t){const[e]=A$(t,1);return e??null}function Fk(t){return!fP||!t?null:Oy(t)?t:E$(t)?R$(t)||t===Iy(t).scrollingElement?window:U_(t)?t:null:null}function NJ(t){return Oy(t)?t.scrollX:t.scrollLeft}function TJ(t){return Oy(t)?t.scrollY:t.scrollTop}function bO(t){return{x:NJ(t),y:TJ(t)}}var ts;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ts||(ts={}));function kJ(t){return!fP||!t?!1:t===document.scrollingElement}function DJ(t){const e={x:0,y:0},n=kJ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const aje={x:.2,y:.2};function lje(t,e,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=aje);const{isTop:u,isBottom:f,isLeft:l,isRight:d}=DJ(t),p={x:0,y:0},h={x:0,y:0},m={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+m.height?(p.y=ts.Backward,h.y=r*Math.abs((e.top+m.height-i)/m.height)):!f&&c>=e.bottom-m.height&&(p.y=ts.Forward,h.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!d&&a>=e.right-m.width?(p.x=ts.Forward,h.x=r*Math.abs((e.right-m.width-a)/m.width)):!l&&o<=e.left+m.width&&(p.x=ts.Backward,h.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:p,speed:h}}function cje(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function MJ(t){return t.reduce((e,n)=>xg(e,bO(n)),Xa)}function uje(t){return t.reduce((e,n)=>e+NJ(n),0)}function dje(t){return t.reduce((e,n)=>e+TJ(n),0)}function OJ(t,e){if(e===void 0&&(e=jy),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);PJ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const fje=[["x",["left","right"],uje],["y",["top","bottom"],dje]];class P${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 r=A$(n),s=MJ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of fje)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=s[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class A0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function hje(t){const{EventTarget:e}=ui(t);return t instanceof e?t:Iy(t)}function zk(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var qo;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(qo||(qo={}));function yU(t){t.preventDefault()}function pje(t){t.stopPropagation()}var un;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(un||(un={}));const IJ={start:[un.Space,un.Enter],cancel:[un.Esc],end:[un.Space,un.Enter]},mje=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case un.Right:return{...n,x:n.x+25};case un.Left:return{...n,x:n.x-25};case un.Down:return{...n,y:n.y+25};case un.Up:return{...n,y:n.y-25}}};class N${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 A0(Iy(n)),this.windowListeners=new A0(ui(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qo.Resize,this.handleCancel),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&OJ(r),n(Xa)}handleKeyDown(e){if(pP(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=IJ,coordinateGetter:o=mje,scrollBehavior:a="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:Xa;this.referenceCoordinates||(this.referenceCoordinates=f);const l=o(e,{active:n,context:r.current,currentCoordinates:f});if(l){const d=GE(l,f),p={x:0,y:0},{scrollableAncestors:h}=r.current;for(const m of h){const y=e.code,{isTop:g,isRight:v,isLeft:b,isBottom:_,maxScroll:R,minScroll:P}=DJ(m),T=cje(m),E={x:Math.min(y===un.Right?T.right-T.width/2:T.right,Math.max(y===un.Right?T.left:T.left+T.width/2,l.x)),y:Math.min(y===un.Down?T.bottom-T.height/2:T.bottom,Math.max(y===un.Down?T.top:T.top+T.height/2,l.y))},N=y===un.Right&&!v||y===un.Left&&!b,k=y===un.Down&&!_||y===un.Up&&!g;if(N&&E.x!==l.x){const M=m.scrollLeft+d.x,I=y===un.Right&&M<=R.x||y===un.Left&&M>=P.x;if(I&&!d.y){m.scrollTo({left:M,behavior:a});return}I?p.x=m.scrollLeft-M:p.x=y===un.Right?m.scrollLeft-R.x:m.scrollLeft-P.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(k&&E.y!==l.y){const M=m.scrollTop+d.y,I=y===un.Down&&M<=R.y||y===un.Up&&M>=P.y;if(I&&!d.x){m.scrollTo({top:M,behavior:a});return}I?p.y=m.scrollTop-M:p.y=y===un.Down?m.scrollTop-R.y:m.scrollTop-P.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,xg(GE(l,this.referenceCoordinates),p))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(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()}}N$.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=IJ,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function bU(t){return!!(t&&"distance"in t)}function xU(t){return!!(t&&"delay"in t)}class T${constructor(e,n,r){var s;r===void 0&&(r=hje(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=Iy(o),this.documentListeners=new A0(this.document),this.listeners=new A0(r),this.windowListeners=new A0(ui(o)),this.initialCoordinates=(s=KE(i))!=null?s:Xa,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:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(qo.Resize,this.handleCancel),this.windowListeners.add(qo.DragStart,yU),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),this.windowListeners.add(qo.ContextMenu,yU),this.documentListeners.add(qo.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xU(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(bU(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(qo.Click,pje,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qo.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=KE(e))!=null?n:Xa,u=GE(s,c);if(!r&&a){if(bU(a)){if(a.tolerance!=null&&zk(u,a.tolerance))return this.handleCancel();if(zk(u,a.distance))return this.handleStart()}return xU(a)&&zk(u,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===un.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const gje={move:{name:"pointermove"},end:{name:"pointerup"}};class k$ extends T${constructor(e){const{event:n}=e,r=Iy(n.target);super(e,gje,r)}}k$.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const vje={move:{name:"mousemove"},end:{name:"mouseup"}};var xO;(function(t){t[t.RightClick=2]="RightClick"})(xO||(xO={}));class jJ extends T${constructor(e){super(e,vje,Iy(e.event.target))}}jJ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===xO.RightClick?!1:(r==null||r({event:n}),!0)}}];const Bk={move:{name:"touchmove"},end:{name:"touchend"}};class LJ extends T${constructor(e){super(e,Bk)}static setup(){return window.addEventListener(Bk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Bk.move.name,e)};function e(){}}}LJ.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var P0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(P0||(P0={}));var XE;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(XE||(XE={}));function yje(t){let{acceleration:e,activator:n=P0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=XE.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:l,threshold:d}=t;const p=xje({delta:l,disabled:!i}),[h,m]=kIe(),y=S.useRef({x:0,y:0}),g=S.useRef({x:0,y:0}),v=S.useMemo(()=>{switch(n){case P0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case P0.DraggableRect:return s}},[n,s,c]),b=S.useRef(null),_=S.useCallback(()=>{const P=b.current;if(!P)return;const T=y.current.x*g.current.x,E=y.current.y*g.current.y;P.scrollBy(T,E)},[]),R=S.useMemo(()=>a===XE.TreeOrder?[...u].reverse():u,[a,u]);S.useEffect(()=>{if(!i||!u.length||!v){m();return}for(const P of R){if((r==null?void 0:r(P))===!1)continue;const T=u.indexOf(P),E=f[T];if(!E)continue;const{direction:N,speed:k}=lje(P,E,v,e,d);for(const M of["x","y"])p[M][N[M]]||(k[M]=0,N[M]=0);if(k.x>0||k.y>0){m(),b.current=P,h(_,o),y.current=k,g.current=N;return}}y.current={x:0,y:0},g.current={x:0,y:0},m()},[e,_,r,m,i,o,JSON.stringify(v),JSON.stringify(p),h,u,R,f,JSON.stringify(d)])}const bje={x:{[ts.Backward]:!1,[ts.Forward]:!1},y:{[ts.Backward]:!1,[ts.Forward]:!1}};function xje(t){let{delta:e,disabled:n}=t;const r=WE(e);return H_(s=>{if(n||!r||!s)return bje;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[ts.Backward]:s.x[ts.Backward]||i.x===-1,[ts.Forward]:s.x[ts.Forward]||i.x===1},y:{[ts.Backward]:s.y[ts.Backward]||i.y===-1,[ts.Forward]:s.y[ts.Forward]||i.y===1}}},[n,e,r])}function wje(t,e){const n=e!==null?t.get(e):void 0,r=n?n.node.current:null;return H_(s=>{var i;return e===null?null:(i=r??s)!=null?i:null},[r,e])}function _je(t,e){return S.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var Jv;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Jv||(Jv={}));var wO;(function(t){t.Optimized="optimized"})(wO||(wO={}));const wU=new Map;function Sje(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=S.useState(null),{frequency:a,measure:c,strategy:u}=s,f=S.useRef(t),l=y(),d=yx(l),p=S.useCallback(function(g){g===void 0&&(g=[]),!d.current&&o(v=>v===null?g:v.concat(g.filter(b=>!v.includes(b))))},[d]),h=S.useRef(null),m=H_(g=>{if(l&&!n)return wU;if(!g||g===wU||f.current!==t||i!=null){const v=new Map;for(let b of t){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){v.set(b.id,b.rect.current);continue}const _=b.node.current,R=_?new P$(c(_),_):null;b.rect.current=R,R&&v.set(b.id,R)}return v}return g},[t,i,n,l,c]);return S.useEffect(()=>{f.current=t},[t]),S.useEffect(()=>{l||p()},[n,l]),S.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),S.useEffect(()=>{l||typeof a!="number"||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,l,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(u){case Jv.Always:return!1;case Jv.BeforeDragging:return n;default:return!n}}}function D$(t,e){return H_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Cje(t,e){return D$(t,e)}function Eje(t){let{callback:e,disabled:n}=t;const r=hP(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function mP(t){let{callback:e,disabled:n}=t;const r=hP(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Rje(t){return new P$(jy(t),t)}function _U(t,e,n){e===void 0&&(e=Rje);const[r,s]=S.useReducer(a,null),i=Eje({callback(c){if(t)for(const u of c){const{type:f,target:l}=u;if(f==="childList"&&l instanceof HTMLElement&&l.contains(t)){s();break}}}}),o=mP({callback:s});return oa(()=>{s(),t?(o==null||o.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),i==null||i.disconnect())},[t]),r;function a(c){if(!t)return null;if(t.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f}}function Aje(t){const e=D$(t);return RJ(t,e)}const SU=[];function Pje(t){const e=S.useRef(t),n=H_(r=>t?r&&r!==SU&&t&&e.current&&t.parentNode===e.current.parentNode?r:A$(t):SU,[t]);return S.useEffect(()=>{e.current=t},[t]),n}function Nje(t){const[e,n]=S.useState(null),r=S.useRef(t),s=S.useCallback(i=>{const o=Fk(i.target);o&&n(a=>a?(a.set(o,bO(o)),new Map(a)):null)},[]);return S.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(c=>{const u=Fk(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,bO(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(c=>{const u=Fk(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),S.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>xg(i,o),Xa):MJ(t):Xa,[t,e])}function CU(t,e){e===void 0&&(e=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},e),S.useEffect(()=>{const r=t!==Xa;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?GE(t,n.current):Xa}function Tje(t){S.useEffect(()=>{if(!fP)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function kje(t,e){return S.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function $J(t){return S.useMemo(()=>t?sje(t):null,[t])}const Uk=[];function Dje(t,e){e===void 0&&(e=jy);const[n]=t,r=$J(n?ui(n):null),[s,i]=S.useReducer(a,Uk),o=mP({callback:i});return t.length>0&&s===Uk&&i(),oa(()=>{t.length?t.forEach(c=>o==null?void 0:o.observe(c)):(o==null||o.disconnect(),i())},[t]),s;function a(){return t.length?t.map(c=>kJ(c)?r:new P$(e(c),c)):Uk}}function FJ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return U_(e)?e:t}function Mje(t){let{measure:e}=t;const[n,r]=S.useState(null),s=S.useCallback(u=>{for(const{target:f}of u)if(U_(f)){r(l=>{const d=e(f);return l?{...l,width:d.width,height:d.height}:d});break}},[e]),i=mP({callback:s}),o=S.useCallback(u=>{const f=FJ(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[a,c]=qE(o);return S.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Oje=[{sensor:k$,options:{}},{sensor:N$,options:{}}],Ije={current:{}},cC={draggable:{measure:vU},droppable:{measure:vU,strategy:Jv.WhileDragging,frequency:wO.Optimized},dragOverlay:{measure:jy}};class N0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?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,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const jje={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new N0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:YE},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:cC,measureDroppableContainers:YE,windowRect:null,measuringScheduled:!1},zJ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:YE,draggableNodes:new Map,over:null,measureDroppableContainers:YE},q_=S.createContext(zJ),BJ=S.createContext(jje);function Lje(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new N0}}}function $je(t,e){switch(e.type){case Vr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Vr.DragMove:return t.draggable.active?{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}}:t;case Vr.DragEnd:case Vr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Vr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new N0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Vr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new N0(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case Vr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new N0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Fje(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=S.useContext(q_),i=WE(r),o=WE(n==null?void 0:n.id);return S.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!pP(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const l=OIe(f);if(l){l.focus();break}}})}},[r,e,s,o,i]),null}function UJ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function zje(t){return S.useMemo(()=>({draggable:{...cC.draggable,...t==null?void 0:t.draggable},droppable:{...cC.droppable,...t==null?void 0:t.droppable},dragOverlay:{...cC.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function Bje(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=S.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;oa(()=>{if(!o&&!a||!e){i.current=!1;return}if(i.current||!r)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const f=n(u),l=RJ(f,r);if(o||(l.x=0),a||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const d=PJ(u);d&&d.scrollBy({top:l.y,left:l.x})}},[e,o,a,r,n])}const gP=S.createContext({...Xa,scaleX:1,scaleY:1});var ed;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(ed||(ed={}));const Uje=S.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:f=Oje,collisionDetection:l=ZIe,measuring:d,modifiers:p,...h}=e;const m=S.useReducer($je,void 0,Lje),[y,g]=m,[v,b]=zIe(),[_,R]=S.useState(ed.Uninitialized),P=_===ed.Initialized,{draggable:{active:T,nodes:E,translate:N},droppable:{containers:k}}=y,M=T?E.get(T):null,I=S.useRef({initial:null,translated:null}),j=S.useMemo(()=>{var _t;return T!=null?{id:T,data:(_t=M==null?void 0:M.data)!=null?_t:Ije,rect:I}:null},[T,M]),L=S.useRef(null),[U,K]=S.useState(null),[H,q]=S.useState(null),ee=yx(h,Object.values(h)),se=V_("DndDescribedBy",o),X=S.useMemo(()=>k.getEnabled(),[k]),G=zje(d),{droppableRects:Y,measureDroppableContainers:Q,measuringScheduled:he}=Sje(X,{dragging:P,dependencies:[N.x,N.y],config:G.droppable}),fe=wje(E,T),ce=S.useMemo(()=>H?KE(H):null,[H]),xe=Nt(),Pe=Cje(fe,G.draggable.measure);Bje({activeNode:T?E.get(T):null,config:xe.layoutShiftCompensation,initialRect:Pe,measure:G.draggable.measure});const pe=_U(fe,G.draggable.measure,Pe),Le=_U(fe?fe.parentElement:null),Me=S.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=k.getNodeFor((n=Me.current.over)==null?void 0:n.id),Fe=Mje({measure:G.dragOverlay.measure}),ot=(r=Fe.nodeRef.current)!=null?r:fe,tt=P?(s=Fe.rect)!=null?s:pe:null,Et=!!(Fe.nodeRef.current&&Fe.rect),J=Aje(Et?null:pe),de=$J(ot?ui(ot):null),me=Pje(P?Oe??fe:null),Ae=Dje(me),Ne=UJ(p,{transform:{x:N.x-J.x,y:N.y-J.y,scaleX:1,scaleY:1},activatorEvent:H,active:j,activeNodeRect:pe,containerNodeRect:Le,draggingNodeRect:tt,over:Me.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:me,scrollableAncestorRects:Ae,windowRect:de}),Ee=ce?xg(ce,N):null,Ve=Nje(me),et=CU(Ve),qt=CU(Ve,[pe]),gt=xg(Ne,et),kt=tt?tje(tt,Ne):null,an=j&&kt?l({active:j,collisionRect:kt,droppableRects:Y,droppableContainers:X,pointerCoordinates:Ee}):null,gr=YIe(an,"id"),[_n,di]=S.useState(null),or=Et?Ne:xg(Ne,qt),fi=JIe(or,(i=_n==null?void 0:_n.rect)!=null?i:null,pe),$e=S.useCallback((_t,Wt)=>{let{sensor:Zt,options:ar}=Wt;if(L.current==null)return;const Nn=E.get(L.current);if(!Nn)return;const Cr=_t.nativeEvent,Dr=new Zt({active:L.current,activeNode:Nn,event:Cr,options:ar,context:Me,onStart(Yr){const Jl=L.current;if(Jl==null)return;const ua=E.get(Jl);if(!ua)return;const{onDragStart:te}=ee.current,ae={active:{id:Jl,data:ua.data,rect:I}};rs.unstable_batchedUpdates(()=>{te==null||te(ae),R(ed.Initializing),g({type:Vr.DragStart,initialCoordinates:Yr,active:Jl}),v({type:"onDragStart",event:ae})})},onMove(Yr){g({type:Vr.DragMove,coordinates:Yr})},onEnd:Hi(Vr.DragEnd),onCancel:Hi(Vr.DragCancel)});rs.unstable_batchedUpdates(()=>{K(Dr),q(_t.nativeEvent)});function Hi(Yr){return async function(){const{active:ua,collisions:te,over:ae,scrollAdjustedTranslate:ge}=Me.current;let _e=null;if(ua&&ge){const{cancelDrop:ze}=ee.current;_e={activatorEvent:Cr,active:ua,collisions:te,delta:ge,over:ae},Yr===Vr.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(_e))&&(Yr=Vr.DragCancel)}L.current=null,rs.unstable_batchedUpdates(()=>{g({type:Yr}),R(ed.Uninitialized),di(null),K(null),q(null);const ze=Yr===Vr.DragEnd?"onDragEnd":"onDragCancel";if(_e){const Ge=ee.current[ze];Ge==null||Ge(_e),v({type:ze,event:_e})}})}}},[E]),Ye=S.useCallback((_t,Wt)=>(Zt,ar)=>{const Nn=Zt.nativeEvent,Cr=E.get(ar);if(L.current!==null||!Cr||Nn.dndKit||Nn.defaultPrevented)return;const Dr={active:Cr};_t(Zt,Wt.options,Dr)===!0&&(Nn.dndKit={capturedBy:Wt.sensor},L.current=ar,$e(Zt,Wt))},[E,$e]),ht=_je(f,Ye);Tje(f),oa(()=>{pe&&_===ed.Initializing&&R(ed.Initialized)},[pe,_]),S.useEffect(()=>{const{onDragMove:_t}=ee.current,{active:Wt,activatorEvent:Zt,collisions:ar,over:Nn}=Me.current;if(!Wt||!Zt)return;const Cr={active:Wt,activatorEvent:Zt,collisions:ar,delta:{x:gt.x,y:gt.y},over:Nn};rs.unstable_batchedUpdates(()=>{_t==null||_t(Cr),v({type:"onDragMove",event:Cr})})},[gt.x,gt.y]),S.useEffect(()=>{const{active:_t,activatorEvent:Wt,collisions:Zt,droppableContainers:ar,scrollAdjustedTranslate:Nn}=Me.current;if(!_t||L.current==null||!Wt||!Nn)return;const{onDragOver:Cr}=ee.current,Dr=ar.get(gr),Hi=Dr&&Dr.rect.current?{id:Dr.id,rect:Dr.rect.current,data:Dr.data,disabled:Dr.disabled}:null,Yr={active:_t,activatorEvent:Wt,collisions:Zt,delta:{x:Nn.x,y:Nn.y},over:Hi};rs.unstable_batchedUpdates(()=>{di(Hi),Cr==null||Cr(Yr),v({type:"onDragOver",event:Yr})})},[gr]),oa(()=>{Me.current={activatorEvent:H,active:j,activeNode:fe,collisionRect:kt,collisions:an,droppableRects:Y,draggableNodes:E,draggingNode:ot,draggingNodeRect:tt,droppableContainers:k,over:_n,scrollableAncestors:me,scrollAdjustedTranslate:gt},I.current={initial:tt,translated:kt}},[j,fe,an,kt,E,ot,tt,Y,k,_n,me,gt]),yje({...xe,delta:N,draggingRect:kt,pointerCoordinates:Ee,scrollableAncestors:me,scrollableAncestorRects:Ae});const Qe=S.useMemo(()=>({active:j,activeNode:fe,activeNodeRect:pe,activatorEvent:H,collisions:an,containerNodeRect:Le,dragOverlay:Fe,draggableNodes:E,droppableContainers:k,droppableRects:Y,over:_n,measureDroppableContainers:Q,scrollableAncestors:me,scrollableAncestorRects:Ae,measuringConfiguration:G,measuringScheduled:he,windowRect:de}),[j,fe,pe,H,an,Le,Fe,E,k,Y,_n,Q,me,Ae,G,he,de]),yt=S.useMemo(()=>({activatorEvent:H,activators:ht,active:j,activeNodeRect:pe,ariaDescribedById:{draggable:se},dispatch:g,draggableNodes:E,over:_n,measureDroppableContainers:Q}),[H,ht,j,pe,g,se,E,_n,Q]);return oe.createElement(EJ.Provider,{value:b},oe.createElement(q_.Provider,{value:yt},oe.createElement(BJ.Provider,{value:Qe},oe.createElement(gP.Provider,{value:fi},u)),oe.createElement(Fje,{disabled:(a==null?void 0:a.restoreFocus)===!1})),oe.createElement(HIe,{...a,hiddenTextDescribedById:se}));function Nt(){const _t=(U==null?void 0:U.autoScrollEnabled)===!1,Wt=typeof c=="object"?c.enabled===!1:c===!1,Zt=P&&!_t&&!Wt;return typeof c=="object"?{...c,enabled:Zt}:{enabled:Zt}}}),Hje=S.createContext(null),EU="button",Vje="Droppable";function qje(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=V_(Vje),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:l,over:d}=S.useContext(q_),{role:p=EU,roleDescription:h="draggable",tabIndex:m=0}=s??{},y=(c==null?void 0:c.id)===e,g=S.useContext(y?gP:Hje),[v,b]=qE(),[_,R]=qE(),P=kje(o,e),T=yx(n);oa(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:_,data:T}),()=>{const N=l.get(e);N&&N.key===i&&l.delete(e)}),[l,e]);const E=S.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":y&&p===EU?!0:void 0,"aria-roledescription":h,"aria-describedby":f.draggable}),[r,p,m,y,h,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:E,isDragging:y,listeners:r?void 0:P,node:v,over:d,setNodeRef:b,setActivatorNodeRef:R,transform:g}}function HJ(){return S.useContext(BJ)}const Wje="Droppable",Gje={timeout:25};function Kje(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=V_(Wje),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=S.useContext(q_),f=S.useRef({disabled:n}),l=S.useRef(!1),d=S.useRef(null),p=S.useRef(null),{disabled:h,updateMeasurementsFor:m,timeout:y}={...Gje,...s},g=yx(m??r),v=S.useCallback(()=>{if(!l.current){l.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),p.current=null},y)},[y]),b=mP({callback:v,disabled:h||!o}),_=S.useCallback((E,N)=>{b&&(N&&(b.unobserve(N),l.current=!1),E&&b.observe(E))},[b]),[R,P]=qE(_),T=yx(e);return S.useEffect(()=>{!b||!R.current||(b.disconnect(),l.current=!1,b.observe(R.current))},[R,b]),oa(()=>(a({type:Vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:d,data:T}}),()=>a({type:Vr.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==f.current.disabled&&(a({type:Vr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:d,isOver:(c==null?void 0:c.id)===r,node:R,over:c,setNodeRef:P}}function Yje(t){let{animation:e,children:n}=t;const[r,s]=S.useState(null),[i,o]=S.useState(null),a=WE(n);return!n&&!r&&a&&s(a),oa(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){s(null);return}Promise.resolve(e(u,i)).then(()=>{s(null)})},[e,r,i]),oe.createElement(oe.Fragment,null,n,r?S.cloneElement(r,{ref:o}):null)}const Xje={x:0,y:0,scaleX:1,scaleY:1};function Qje(t){let{children:e}=t;return oe.createElement(q_.Provider,{value:zJ},oe.createElement(gP.Provider,{value:Xje},e))}const Zje={position:"fixed",touchAction:"none"},Jje=t=>pP(t)?"transform 250ms ease":void 0,eLe=S.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:c,transform:u,transition:f=Jje}=t;if(!a)return null;const l=s?u:{...u,scaleX:1,scaleY:1},d={...Zje,width:a.width,height:a.height,top:a.top,left:a.left,transform:Hl.Transform.toString(l),transformOrigin:s&&r?WIe(r,a):void 0,transition:typeof f=="function"?f(r):f,...c};return oe.createElement(n,{className:o,style:d,ref:e},i)}),tLe=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(s))n.node.style.setProperty(c,u);o!=null&&o.active&&n.node.classList.remove(o.active)}},nLe=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Hl.Transform.toString(e)},{transform:Hl.Transform.toString(n)}]},_O={duration:250,easing:"ease",keyframes:nLe,sideEffects:tLe({styles:{active:{opacity:"0"}}})};function rLe(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return hP((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=FJ(o);if(!u)return;const{transform:f}=ui(o).getComputedStyle(o),l=AJ(f);if(!l)return;const d=typeof e=="function"?e:sLe(e);return OJ(c,s.draggable.measure),d({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:l})})}function sLe(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={..._O,...t};return i=>{let{active:o,dragOverlay:a,transform:c,...u}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},l={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},d={x:c.x-f.x,y:c.y-f.y,...l},p=s({...u,active:o,dragOverlay:a,transform:{initial:c,final:d}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const y=r==null?void 0:r({active:o,dragOverlay:a,...u}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{y==null||y(),v()}})}}let RU=0;function iLe(t){return S.useMemo(()=>{if(t!=null)return RU++,RU},[t])}const oLe=oe.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:u=999}=t;const{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:p,draggableNodes:h,droppableContainers:m,dragOverlay:y,over:g,measuringConfiguration:v,scrollableAncestors:b,scrollableAncestorRects:_,windowRect:R}=HJ(),P=S.useContext(gP),T=iLe(l==null?void 0:l.id),E=UJ(o,{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:p,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:b,scrollableAncestorRects:_,transform:P,windowRect:R}),N=D$(d),k=rLe({config:r,draggableNodes:h,droppableContainers:m,measuringConfiguration:v}),M=N?y.setRef:void 0;return oe.createElement(Qje,null,oe.createElement(Yje,{animation:k},l&&T?oe.createElement(eLe,{key:T,id:l.id,ref:M,as:a,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:N,style:{zIndex:u,...s},transform:E},n):null))});function VJ(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function aLe(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function O1(t){return t!==null&&t>=0}function lLe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=VJ(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},I1={scaleX:1,scaleY:1},uLe=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const u=i[o];return u?{x:0,y:nn&&s<=o?{x:0,y:-a.height-c,...I1}:s=o?{x:0,y:a.height+c,...I1}:{x:0,y:0,...I1}};function dLe(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?nr.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),h=o!=null,m=o?p.indexOf(o.id):-1,y=u?p.indexOf(u.id):-1,g=S.useRef(p),v=!lLe(p,g.current),b=y!==-1&&m===-1||v,_=cLe(i);oa(()=>{v&&h&&f(p)},[v,p,h,f]),S.useEffect(()=>{g.current=p},[p]);const R=S.useMemo(()=>({activeIndex:m,containerId:l,disabled:_,disableTransforms:b,items:p,overIndex:y,useDragOverlay:d,sortedRects:aLe(p,c),strategy:s}),[m,l,_.draggable,_.droppable,b,p,y,c,d,s]);return oe.createElement(GJ.Provider,{value:R},e)}const hLe=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return VJ(n,r,s).indexOf(e)},KJ=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=t;return!u||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===c},pLe={duration:200,easing:"ease"},YJ="transform",mLe=Hl.Transition.toString({property:YJ,duration:0,easing:"linear"}),gLe={roleDescription:"sortable"};function vLe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=S.useState(null),a=S.useRef(n);return oa(()=>{if(!e&&n!==a.current&&r.current){const c=s.current;if(c){const u=jy(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),S.useEffect(()=>{i&&o(null)},[i]),i}function XJ(t){let{animateLayoutChanges:e=KJ,attributes:n,disabled:r,data:s,getNewIndex:i=hLe,id:o,strategy:a,resizeObserverConfig:c,transition:u=pLe}=t;const{items:f,containerId:l,activeIndex:d,disabled:p,disableTransforms:h,sortedRects:m,overIndex:y,useDragOverlay:g,strategy:v}=S.useContext(GJ),b=yLe(r,p),_=f.indexOf(o),R=S.useMemo(()=>({sortable:{containerId:l,index:_,items:f},...s}),[l,s,_,f]),P=S.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:T,node:E,isOver:N,setNodeRef:k}=Kje({id:o,data:R,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...c}}),{active:M,activatorEvent:I,activeNodeRect:j,attributes:L,setNodeRef:U,listeners:K,isDragging:H,over:q,setActivatorNodeRef:ee,transform:se}=qje({id:o,data:R,attributes:{...gLe,...n},disabled:b.draggable}),X=TIe(k,U),G=!!M,Y=G&&!h&&O1(d)&&O1(y),Q=!g&&H,he=Q&&Y?se:null,ce=Y?he??(a??v)({rects:m,activeNodeRect:j,activeIndex:d,overIndex:y,index:_}):null,xe=O1(d)&&O1(y)?i({id:o,items:f,activeIndex:d,overIndex:y}):_,Pe=M==null?void 0:M.id,pe=S.useRef({activeId:Pe,items:f,newIndex:xe,containerId:l}),Le=f!==pe.current.items,Me=e({active:M,containerId:l,isDragging:H,isSorting:G,id:o,index:_,items:f,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:u,wasDragging:pe.current.activeId!=null}),Oe=vLe({disabled:!Me,index:_,node:E,rect:T});return S.useEffect(()=>{G&&pe.current.newIndex!==xe&&(pe.current.newIndex=xe),l!==pe.current.containerId&&(pe.current.containerId=l),f!==pe.current.items&&(pe.current.items=f)},[G,xe,l,f]),S.useEffect(()=>{if(Pe===pe.current.activeId)return;if(Pe&&!pe.current.activeId){pe.current.activeId=Pe;return}const ot=setTimeout(()=>{pe.current.activeId=Pe},50);return()=>clearTimeout(ot)},[Pe]),{active:M,activeIndex:d,attributes:L,data:R,rect:T,index:_,newIndex:xe,items:f,isOver:N,isSorting:G,isDragging:H,listeners:K,node:E,overIndex:y,over:q,setNodeRef:X,setActivatorNodeRef:ee,setDroppableNodeRef:k,setDraggableNodeRef:U,transform:Oe??ce,transition:Fe()};function Fe(){if(Oe||Le&&pe.current.newIndex===_)return mLe;if(!(Q&&!pP(I)||!u)&&(G||Me))return Hl.Transition.toString({...u,property:YJ})}}function yLe(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}un.Down,un.Right,un.Up,un.Left;const bLe=({rowId:t,className:e})=>{const{attributes:n,listeners:r,isDragging:s}=XJ({id:t});return w.jsxs(it,{onClick:i=>{i.preventDefault()},size:"icon",variant:"link",className:ie(s?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",e),...n,...r,children:[w.jsx(yq,{className:"w-4 h-4"}),w.jsx("span",{className:"sr-only",children:"Mover fila"})]})};function xLe(){return{id:"select",header:({table:t})=>w.jsx(ix,{id:"select-all",checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>t.toggleAllPageRowsSelected(!!e),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:t})=>w.jsx(ix,{id:`select-row-${t.id}`,checked:t.getIsSelected(),onCheckedChange:e=>{t.toggleSelected(!!e)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function vP({columnCount:t,rowCount:e=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:s=!0,cellWidths:i=["auto"],withPagination:o=!0,shrinkZero:a=!1,className:c,...u}){return w.jsxs("div",{className:ie("w-full space-y-2.5 overflow-auto",c),...u,children:[w.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[w.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[n>0?Array.from({length:n}).map((f,l)=>w.jsx(bi,{className:"w-40 h-7 lg:w-60"},l)):null,r>0?Array.from({length:r}).map((f,l)=>w.jsx(bi,{className:"h-7 w-[4.5rem] border-dashed"},l)):null]}),s?w.jsx(bi,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),w.jsx("div",{className:"border rounded-md",children:w.jsxs(od,{children:[w.jsx(ZA,{children:Array.from({length:1}).map((f,l)=>w.jsx(Yo,{className:"hover:bg-transparent",children:Array.from({length:t}).map((d,p)=>w.jsx(JA,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:w.jsx(bi,{className:"w-full h-6"})},p))},l))}),w.jsx(ad,{children:Array.from({length:e}).map((f,l)=>w.jsx(Yo,{className:"hover:bg-transparent",children:Array.from({length:t}).map((d,p)=>w.jsx(Qc,{style:{width:i[p],minWidth:a?i[p]:"auto"},children:w.jsx(bi,{className:"w-full h-6"})},p))},l))})]})}),o?w.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[w.jsx(bi,{className:"w-40 h-7 shrink-0"}),w.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[w.jsxs("div",{className:"flex items-center space-x-2",children:[w.jsx(bi,{className:"w-24 h-7"}),w.jsx(bi,{className:"h-7 w-[4.5rem]"})]}),w.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:w.jsx(bi,{className:"w-20 h-7"})}),w.jsxs("div",{className:"flex items-center space-x-2",children:[w.jsx(bi,{className:"hidden size-7 lg:block"}),w.jsx(bi,{className:"size-7"}),w.jsx(bi,{className:"size-7"}),w.jsx(bi,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const yP=({title:t="Esto está muy vacío",subtitle:e="Empieza dando de alta un item",buttonText:n="Nuevo item",onButtonClick:r=()=>{},actions:s=void 0})=>w.jsxs("div",{className:"text-center",children:[w.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:w.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),w.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:t}),w.jsx("p",{className:"mt-1 text-base text-slate-500",children:e}),w.jsxs("div",{className:"items-center mt-6",children:[s&&w.jsx(w.Fragment,{children:s}),!s&&w.jsxs(it,{className:"my-4",onClick:r,children:[w.jsx(xq,{}),n]})]})]}),Xp=({title:t="Se ha producido un error",subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=$s();return w.jsx("div",{className:"grid h-screen place-items-center ",children:w.jsxs("div",{className:"text-center",children:[w.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:t}),w.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[e||r,w.jsx("br",{}),n]}),w.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[w.jsx(C$,{}),w.jsxs(it,{onClick:()=>s("/"),children:[w.jsx(pge,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};Xp.displayName="ErrorOverlay";var En=function(){return En=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1){if(n===0)return t.replace(e,"");if(t.includes(e)){var r=t.split(e),s=r[0],i=r[1];if(i.length===n)return t;if(i.length>n)return"".concat(s).concat(e).concat(i.slice(0,n))}var o=t.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=t.match(o);if(a){var s=a[1],i=a[2];return"".concat(s).concat(e).concat(i)}}return t},QJ=function(t,e){var n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,o=new RegExp("\\d([^".concat(Vl(r)).concat(Vl(i),"0-9]+)")),a=t.match(o);return a?a[1]:void 0},Pb=function(t){var e=t.value,n=t.decimalSeparator,r=t.intlConfig,s=t.decimalScale,i=t.prefix,o=i===void 0?"":i,a=t.suffix,c=a===void 0?"":a;if(e===""||e===void 0)return"";if(e==="-")return"-";var u=new RegExp("^\\d?-".concat(o?"".concat(Vl(o),"?"):"","\\d")).test(e),f=n!=="."?ALe(e,n,u):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l={minimumFractionDigits:s||0,maximumFractionDigits:20},d=r?new Intl.NumberFormat(r.locale,r.currency?En(En({},l),{style:"currency",currency:r.currency}):l):new Intl.NumberFormat(void 0,l),p=d.formatToParts(Number(f)),h=PLe(p,t),m=QJ(h,En({},t)),y=e.slice(-1)===n?n:"",g=f.match(RegExp("\\d+\\.(\\d+)"))||[],v=g[1];return s===void 0&&v&&n&&(h.includes(n)?h=h.replace(RegExp("(\\d+)(".concat(Vl(n),")(\\d+)"),"g"),"$1$2".concat(v)):m&&!c?h=h.replace(m,"".concat(n).concat(v).concat(m)):h="".concat(h).concat(n).concat(v)),c&&y?"".concat(h).concat(y).concat(c):m&&y?h.replace(m,"".concat(y).concat(m)):m&&c?h.replace(m,"".concat(y).concat(c)):[h,y,c].join("")},ALe=function(t,e,n){var r=t;return e&&e!=="."&&(r=r.replace(RegExp(Vl(e),"g"),"."),n&&e==="-"&&(r="-".concat(r.slice(1)))),r},PLe=function(t,e){var n=e.prefix,r=e.groupSeparator,s=e.decimalSeparator,i=e.decimalScale,o=e.disableGroupSeparators,a=o===void 0?!1:o;return t.reduce(function(c,u,f){var l=u.type,d=u.value;return f===0&&n?l==="minusSign"?[d,n]:l==="currency"?Zi(Zi([],c,!0),[n],!1):[n,d]:l==="currency"?n?c:Zi(Zi([],c,!0),[d],!1):l==="group"?a?c:Zi(Zi([],c,!0),[r!==void 0?r:d],!1):l==="decimal"?i!==void 0&&i===0?c:Zi(Zi([],c,!0),[s!==void 0?s:d],!1):l==="fraction"?Zi(Zi([],c,!0),[i!==void 0?d.slice(0,i):d],!1):Zi(Zi([],c,!0),[d],!1)},[""]).join("")},NLe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},TLe=function(t){var e=t||{},n=e.locale,r=e.currency,s=n?new Intl.NumberFormat(n,r?{currency:r,style:"currency"}:void 0):new Intl.NumberFormat;return s.formatToParts(1000.1).reduce(function(i,o,a){return o.type==="currency"?a===0?En(En({},i),{currencySymbol:o.value,prefix:o.value}):En(En({},i),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?En(En({},i),{groupSeparator:o.value}):o.type==="decimal"?En(En({},i),{decimalSeparator:o.value}):i},NLe)},AU=function(t){return RegExp(/\d/,"gi").test(t)},kLe=function(t,e,n){if(e===void 0&&(e="."),n===void 0||t===""||t===void 0)return t;if(!t.match(/\d/g))return"";var r=t.split(e),s=r[0],i=r[1];if(n===0)return s;var o=i||"";if(o.lengthh)){if(Nt===""||Nt==="-"||Nt===fe){y&&y(void 0,a,{float:null,formatted:"",value:""}),Me(Nt),J(1);return}var _t=fe?Nt.replace(fe,"."):Nt,Wt=parseFloat(_t),Zt=Pb(En({value:Nt},xe));if(yt!=null){var ar=yt+(Zt.length-$e.length);ar=ar<=0?_?_.length:0:ar,J(ar),Ae(me+1)}if(Me(Zt),y){var Nn={float:Wt,formatted:Zt,value:Nt};y(Nt,a,Nn)}}},gt=function($e){var Ye=$e.target,ht=Ye.value,Qe=Ye.selectionStart;qt(ht,Qe),K&&K($e)},kt=function($e){return H&&H($e),Le?Le.length:0},an=function($e){var Ye=$e.target.value,ht=Hk(En({value:Ye},Pe));if(ht==="-"||ht===fe||!ht){Me(""),q&&q($e);return}var Qe=RLe(ht,fe,g),yt=kLe(Qe,fe,b!==void 0?b:g),Nt=parseFloat(yt.replace(fe,".")),_t=Pb(En(En({},xe),{value:yt}));y&&Y&&y(yt,a,{float:Nt,formatted:_t,value:yt}),Me(_t),q&&q($e)},gr=function($e){var Ye=$e.key;if(Ve(Ye),T&&(Ye==="ArrowUp"||Ye==="ArrowDown")){$e.preventDefault(),J(Le.length);var ht=parseFloat(m!=null?String(m).replace(fe,"."):Hk(En({value:Le},Pe)))||0,Qe=Ye==="ArrowUp"?ht+T:ht-T;if(E!==void 0&&QeNumber(N))return;var yt=String(T).includes(".")?Number(String(T).split(".")[1].length):void 0;qt(String(yt?Qe.toFixed(yt):Qe).replace(".",fe))}ee&&ee($e)},_n=function($e){var Ye=$e.key,ht=$e.currentTarget.selectionStart;if(Ye!=="ArrowUp"&&Ye!=="ArrowDown"&&Le!=="-"){var Qe=QJ(Le,{groupSeparator:ce,decimalSeparator:fe});if(Qe&&ht&&ht>Le.length-Qe.length&&et.current){var yt=Le.length-Qe.length;et.current.setSelectionRange(yt,yt)}}se&&se($e)};S.useEffect(function(){m==null&&l==null&&Me("")},[l,m]),S.useEffect(function(){Fe&&Le!=="-"&&et.current&&document.activeElement===et.current&&et.current.setSelectionRange(Et,Et)},[Le,Et,et,Fe,me]);var di=function(){return m!=null&&Le!=="-"&&(!fe||Le!==fe)?Pb(En(En({},xe),{decimalScale:Fe?void 0:b,value:String(m)})):Le},or=En({type:"text",inputMode:"decimal",id:o,name:a,className:c,onChange:gt,onBlur:an,onFocus:kt,onKeyDown:gr,onKeyUp:_n,placeholder:v,disabled:p,value:di(),ref:et},Q);if(u){var fi=u;return oe.createElement(fi,En({},or))}return oe.createElement("input",En({},or))});bP.displayName="CurrencyInput";const Qp=S.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=Ny();let s=t;return r&&(r.message?s=String((r==null?void 0:r.message)||((i=r.root)==null?void 0:i.message)):r.type==="required"&&(s=re("common.required_field"))),w.jsx(m9,{ref:n,...e,children:s})});Qp.displayName="FormErrorMessage";const Zp=oe.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=Ny(),o=e||(n?re("common.required"):void 0),a=i?"text-destructive font-semibold":"";return w.jsxs(p9,{ref:s,className:"flex justify-between text-sm",...r,children:[w.jsx("span",{className:`block font-semibold ${a}`,children:t}),o&&w.jsx("span",{className:`text-sm font-medium ${a} `,children:o})]})});Zp.displayName="FormLabel";const MLe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),uC=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,currency:p,language:h,variant:m}=t,{control:y}=Bi(),[g,v]=S.useState(""),b={input:_=>{if(typeof _!="object")return _;const R=Jo.create(_);if(R.isFailure)throw R.error;const P=R.object.toString();return g.endsWith(",")?P.replace(/.0$/,","):P},output:(_,R,P)=>{const{value:T}=P??{value:null};v(T??"");const E=Jo.createFromFormattedValue(T,p.code);if(E.isFailure)throw E.error;return E.object.toObject()}};return w.jsx(Py,{defaultValue:u,control:y,name:n,disabled:c,rules:f,render:({field:_})=>w.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&w.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),w.jsx(Kp,{children:w.jsx(bP,{intlConfig:{locale:h.code},name:_.name,onBlur:_.onBlur,disabled:_.disabled,readOnly:l,className:ie(MLe({variant:m,className:a})),suffix:` ${p==null?void 0:p.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:o,decimalsLimit:d,decimalScale:d,step:1,value:b.input(_.value),onValueChange:(R,P,T)=>_.onChange(b.output(R,P,T))})}),i&&w.jsx(Yp,{children:i}),w.jsx(Qp,{})]})})});uC.displayName="FormCurrencyField";const ZJ=S.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:o,className:a,name:c}=t,{control:u}=Bi(),[f,l]=S.useState(!1);return w.jsx(Py,{control:u,name:c,rules:{required:o},render:({field:d})=>w.jsxs(Gp,{ref:e,className:ie(a,"flex flex-col"),children:[n&&w.jsx(Zp,{label:n,hint:s,required:o}),w.jsxs(hTe,{open:f,onOpenChange:l,children:[w.jsx(pTe,{asChild:!0,children:w.jsx(Kp,{children:w.jsxs(it,{variant:"secondary",className:ie("pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),children:[d.value?new Date(d.value).toLocaleDateString():r||w.jsx("span",{children:re("common.pick_date")}),w.jsx(rge,{className:"w-4 h-4 ml-auto text-"})]})})}),w.jsx(MY,{className:"w-auto p-0",align:"start",children:w.jsx(rG,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:d.value,selected:new Date(d.value),onSelect:p=>{d.onChange(p),l(!1)},disabled:p=>p{const a=oe.useId(),c=S.useMemo(()=>e||n||r,[e,n,r]);return w.jsxs(xr,{id:a,className:ie(c?"":"pt-6",t),ref:o,children:[c&&w.jsxs(Ei,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[w.jsxs("div",{children:[e&&w.jsx(ns,{className:"text-lg leading-normal",children:e}),n&&w.jsx(vs,{className:"leading-loose",children:n})]}),r&&w.jsx("div",{className:"flex-shrink-0",children:r})]}),w.jsx(wr,{className:"grid items-start gap-6",children:i}),s&&w.jsx(Vo,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});QE.displayName="FormGroup";const OLe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),ZE=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,variant:p}=t,{control:h}=Bi(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const b=lf.create(v);if(b.isFailure)throw b.error;const _=b.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,b,_)=>{const{value:R}=_??{value:null};y(R??"");const P=lf.createFromFormattedValue(R);if(P.isFailure)throw P.error;return P.object.toObject()}};return w.jsx(Py,{defaultValue:u,control:h,name:n,disabled:c,rules:{max:100,min:0,...f},render:({field:v})=>w.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&w.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),w.jsx(Kp,{children:w.jsx(bP,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(OLe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:d!==0,decimalsLimit:d,decimalScale:d,step:1,value:g.input(v.value),onValueChange:(b,_,R)=>v.onChange(g.output(b,_,R))})}),i&&w.jsx(Yp,{children:i}),w.jsx(Qp,{})]})})}),ILe=li("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),jLe=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,readOnly:l,scale:d,variant:p}=t,{control:h}=Bi(),[m,y]=S.useState(""),g={input:v=>{if(typeof v!="object")return v;const b=kp.create(v);if(b.isFailure)throw b.error;const _=b.object.toString();return m.endsWith(",")?_.replace(/.0$/,","):_},output:(v,b,_)=>{const{value:R}=_??{value:null};y(R??"");const P=kp.createFromFormattedValue(R);if(P.isFailure)throw P.error;return P.object.toObject()}};return w.jsx(Py,{defaultValue:u,control:h,name:n,disabled:c,rules:f,render:({field:v})=>w.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&w.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??!1)}),w.jsx(Kp,{children:w.jsx(bP,{name:v.name,onBlur:v.onBlur,disabled:v.disabled,readOnly:l,className:ie(ILe({variant:p,className:a})),groupSeparator:".",decimalSeparator:",",placeholder:o,allowDecimals:d!==0,decimalsLimit:d,decimalScale:d,step:1,value:g.input(v.value),onValueChange:(b,_,R)=>v.onChange(g.output(b,_,R))})}),i&&w.jsx(Yp,{children:i}),w.jsx(Qp,{})]})})}),PU=li("",{variants:{variant:{default:"",outline:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),$a=S.forwardRef(({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:o,autoSize:a,variant:c,...u},f)=>{const{control:l}=Bi();return w.jsx(Py,{control:l,name:t,rules:{required:i},render:({field:d,fieldState:p})=>w.jsxs(Gp,{ref:f,className:ie(o,"flex flex-col space-y-3"),children:[e&&w.jsx(Zp,{label:e,hint:n,required:i}),w.jsx(Kp,{className:"grow",children:a?w.jsx(AW,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",PU({variant:c,className:o})),...u,...d}):w.jsx(eZ,{placeholder:r,className:ie(p.error?"border-destructive focus-visible:ring-destructive":"","resize-y",PU({variant:c,className:o})),...u,...d})}),s&&w.jsx(Yp,{children:s}),w.jsx(Qp,{})]})})}),LLe=li("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),ih=S.forwardRef((t,e)=>{const{name:n,label:r,hint:s,description:i,placeholder:o,className:a,disabled:c,defaultValue:u,rules:f,type:l,variant:d,required:p,button:h,leadIcon:m,trailIcon:y}=t,{control:g}=Bi();return w.jsx(Py,{defaultValue:u,control:g,name:n,disabled:c,rules:{required:p,...f},render:({field:v,fieldState:b})=>w.jsxs(Gp,{ref:e,className:ie(a,"space-y-3"),children:[r&&w.jsx(Zp,{label:r,hint:s,required:!!((f==null?void 0:f.required)??p)}),w.jsxs("div",{className:ie(h?"flex":null),children:[w.jsxs("div",{className:ie(m?"relative flex items-stretch flex-grow focus-within:z-10":""),children:[m&&w.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:S.createElement(m,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)}),w.jsx(Kp,{className:ie("block",m?"pl-10":"",y?"pr-10":""),children:w.jsx($A,{type:l,placeholder:o,className:ie(b.error?"border-destructive focus-visible:ring-destructive":"",LLe({variant:d,className:a})),...v})}),y&&w.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pl-3 pointer-events-none",children:S.createElement(y,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0},null)})]}),h&&w.jsx(w.Fragment,{children:S.createElement(h)})]}),i&&w.jsx(Yp,{children:i}),w.jsx(Qp,{})]})})}),Ly=({className:t,children:e})=>w.jsx(kne,{children:w.jsx("div",{className:ie("flex flex-col w-full min-h-screen",t),children:e})});Ly.displayName="Layout";const $y=({className:t,children:e})=>w.jsxs(w.Fragment,{children:[w.jsx("main",{className:ie("flex min-h-[calc(100vh_-_theme(spacing.36))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:gap-8 md:p-10",t),children:e}),w.jsx(EZ,{})]});$y.displayName="LayoutContent";const NU=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Ie(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},JJ=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?NU(r.ref,n,t):r.refs&&r.refs.forEach(s=>NU(s,n,t))}},$Le=(t,e)=>{e.shouldUseNativeValidation&&JJ(t,e);const n={};for(const r in t){const s=Ie(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(FLe(e.names||Object.keys(t),r)){const o=Object.assign({},Ie(n,r));sn(o,"root",i),sn(n,r,o)}else sn(n,r,i)}return n},FLe=(t,e)=>t.some(n=>n.startsWith(e+"."));var M$=function(t,e,n){return e===void 0&&(e={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var o=function(){return c.error?{values:{},errors:$Le((f=c.error,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",f.details.length?f.details.reduce(function(d,p){var h=p.path.join(".");if(d[h]||(d[h]={message:p.message,type:p.type}),l){var m=d[h].types,y=m&&m[p.type];d[h]=n9(h,l,d,p.type,y?[].concat(y,p.message):p.message)}return d},{}):{}),i)}:(i.shouldUseNativeValidation&&JJ({},i),{errors:{},values:c.value});var f,l},a=Object.assign({},e,{context:s}),c={},u=function(){if(n.mode==="sync")c=t.validate(r,a);else{var f=function(l,d){try{var p=l()}catch(h){return d(h)}return p&&p.then?p.then(void 0,d):p}(function(){return Promise.resolve(t.validateAsync(r,a)).then(function(l){c.value=l})},function(l){c.error=l});if(f&&f.then)return f.then(function(){})}}();return Promise.resolve(u&&u.then?u.then(o):o())}catch(f){return Promise.reject(f)}}},eee={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),u=o(9474),f=o(1687),l=o(8652),d=o(8160),p=o(3292),h=o(6354),m=o(8901),y=o(9708),g=o(6914),v=o(2294),b=o(6133),_=o(1152),R=o(8863),P=o(2036),T={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new b.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){a(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const N=this.clone();N.$_terms.alterations=N.$_terms.alterations||[];for(const k in E){const M=E[k];a(typeof M=="function","Alteration adjuster for",k,"must be a function"),N.$_terms.alterations.push({target:k,adjuster:M})}return N.$_temp.ruleset=!1,N}artifact(E){return a(E!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return a(E===!1||typeof E=="string","Invalid to value"),a(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,N){return this._default("default",E,N)}description(E){return a(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const N=this.clone();return E!==void 0&&(E=N.$_compile(E,{override:!1})),N.$_setFlag("empty",E,{clone:!1})}error(E){return a(E,"Missing error"),a(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,N={}){return a(E!==void 0,"Missing example"),d.assertOptions(N,["override"]),this._inner("examples",E,{single:!0,override:N.override})}external(E,N){return typeof E=="object"&&(a(!N,"Cannot combine options with description"),N=E.description,E=E.method),a(typeof E=="function","Method must be a function"),a(N===void 0||N&&typeof N=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:N},{single:!0})}failover(E,N){return this._default("failover",E,N)}forbidden(){return this.presence("forbidden")}id(E){return E?(a(typeof E=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return a(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return a(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){a(E.length,"Missing notes");for(const N of E)a(N&&typeof N=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return a(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){a(E,"Missing preferences"),a(E.context===void 0,"Cannot override context"),a(E.externals===void 0,"Cannot override externals"),a(E.warnings===void 0,"Cannot override warnings"),a(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const N=this.clone();return N._preferences=d.preferences(N._preferences,E),N}presence(E){return a(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return a(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const N=this.clone(),k=E!==void 0&&!E;return N._preferences=d.preferences(N._preferences,{convert:k}),N}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){a(E.length,"Missing tags");for(const N of E)a(N&&typeof N=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return a(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const N=this.allow(...E);return N.$_setFlag("only",!!N._valids,{clone:!1}),N}when(E,N){const k=this.clone();k.$_terms.whens||(k.$_terms.whens=[]);const M=p.when(k,E,N);if(!["any","link"].includes(k.type)){const I=M.is?[M]:M.switch;for(const j of I)a(!j.then||j.then.type==="any"||j.then.type===k.type,"Cannot combine",k.type,"with",j.then&&j.then.type),a(!j.otherwise||j.otherwise.type==="any"||j.otherwise.type===k.type,"Cannot combine",k.type,"with",j.otherwise&&j.otherwise.type)}return k.$_terms.whens.push(M),k.$_mutateRebuild()}cache(E){a(!this._inRuleset(),"Cannot set caching inside a ruleset"),a(!this._cache,"Cannot override schema cache"),a(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const N=this.clone();return N._cache=E||l.provider.provision(),N.$_temp.ruleset=!1,N}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){a(d.isSchema(E),"Invalid schema object"),a(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let N=this.clone();if(this.type==="any"&&E.type!=="any"){const k=E.clone();for(const M of Object.keys(N))M!=="type"&&(k[M]=N[M]);N=k}N._ids.concat(E._ids),N._refs.register(E,b.toSibling),N._preferences=N._preferences?d.preferences(N._preferences,E._preferences):E._preferences,N._valids=P.merge(N._valids,E._valids,E._invalids),N._invalids=P.merge(N._invalids,E._invalids,E._valids);for(const k of E._singleRules.keys())N._singleRules.has(k)&&(N._rules=N._rules.filter(M=>M.keep||M.name!==k),N._singleRules.delete(k));for(const k of E._rules)E._definition.rules[k.method].multi||N._singleRules.set(k.name,k),N._rules.push(k);if(N._flags.empty&&E._flags.empty){N._flags.empty=N._flags.empty.concat(E._flags.empty);const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else if(E._flags.empty){N._flags.empty=E._flags.empty;const k=Object.assign({},E._flags);delete k.empty,f(N._flags,k)}else f(N._flags,E._flags);for(const k in E.$_terms){const M=E.$_terms[k];M?N.$_terms[k]?N.$_terms[k]=N.$_terms[k].concat(M):N.$_terms[k]=M.slice():N.$_terms[k]||(N.$_terms[k]=M)}return this.$_root._tracer&&this.$_root._tracer._combine(N,[this,E]),N.$_mutateRebuild()}extend(E){return a(!E.base,"Cannot extend type with another base"),m.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,N){a(!this._inRuleset(),"Cannot fork inside a ruleset");let k=this;for(let M of[].concat(E))M=Array.isArray(M)?M:M.split("."),k=k._ids.fork(M,N,k);return k.$_temp.ruleset=!1,k}rule(E){const N=this._definition;d.assertOptions(E,Object.keys(N.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const k=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(k>=0&&kk.tailor(E),ref:!1}),N.$_temp.ruleset=!1,N.$_mutateRebuild()}tracer(){return _.location?_.location(this):this}validate(E,N){return R.entry(E,this,N)}validateAsync(E,N){return R.entryAsync(E,this,N)}$_addRule(E){typeof E=="string"&&(E={name:E}),a(E&&typeof E=="object","Invalid options"),a(E.name&&typeof E.name=="string","Invalid rule name");for(const j in E)a(j[0]!=="_","Cannot set private rule properties");const N=Object.assign({},E);N._resolve=[],N.method=N.method||N.name;const k=this._definition.rules[N.method],M=N.args;a(k,"Unknown rule",N.method);const I=this.clone();if(M){a(Object.keys(M).length===1||Object.keys(M).length===this._definition.rules[N.name].args.length,"Invalid rule definition for",this.type,N.name);for(const j in M){let L=M[j];if(k.argsByName){const U=k.argsByName.get(j);if(U.ref&&d.isResolvable(L))N._resolve.push(j),I.$_mutateRegister(L);else if(U.normalize&&(L=U.normalize(L),M[j]=L),U.assert){const K=d.validateArg(L,j,U);a(!K,K,"or reference")}}L!==void 0?M[j]=L:delete M[j]}}return k.multi||(I._ruleRemove(N.name,{clone:!1}),I._singleRules.set(N.name,N)),I.$_temp.ruleset===!1&&(I.$_temp.ruleset=null),k.priority?I._rules.unshift(N):I._rules.push(N),I}$_compile(E,N){return p.schema(this.$_root,E,N)}$_createError(E,N,k,M,I,j={}){const L=j.flags!==!1?this._flags:{},U=j.messages?g.merge(this._definition.messages,j.messages):this._definition.messages;return new h.Report(E,N,k,L,U,M,I)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,N,k,M){(k=Object.assign({},k)).abortEarly=!0,k._externals=!1,N.snapshot();const I=!R.validate(E,this,N,k,M).errors;return N.restore(),I}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:N,name:k,path:M,key:I})=>{const j=this._definition[N][k]&&this._definition[N][k].register;j!==!1&&this.$_mutateRegister(E,{family:j,key:I})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:N,key:k}={}){this._refs.register(E,N),this._ids.register(E,{key:k})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,N,k={}){a(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const M=this._definition.flags[E]||{};if(u(N,M.default)&&(N=void 0),u(N,this._flags[E]))return this;const I=k.clone!==!1?this.clone():this;return N!==void 0?(I._flags[E]=N,I.$_mutateRegister(N)):delete I._flags[E],E[0]!=="_"&&(I.$_temp.ruleset=!1),I}$_parent(E,...N){return this[E][d.symbols.parent].call(this,...N)}$_validate(E,N,k){return R.validate(E,this,N,k)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const N in this.$_terms)E.$_terms[N]=this.$_terms[N]?this.$_terms[N].slice():null;E.$_super={};for(const N in this.$_super)E.$_super[N]=this._super[N].bind(E);return E}_bare(){const E=this.clone();E._reset();const N=E._definition.terms;for(const k in N){const M=N[k];E.$_terms[k]=M.init}return E.$_mutateRebuild()}_default(E,N,k={}){return d.assertOptions(k,"literal"),a(N!==void 0,"Missing",E,"value"),a(typeof N=="function"||!k.literal,"Only function value supports literal option"),typeof N=="function"&&k.literal&&(N={[d.symbols.literal]:!0,literal:N}),this.$_setFlag(E,N)}_generate(E,N,k){if(!this.$_terms.whens)return{schema:this};const M=[],I=[];for(let U=0;Uee)break}const j=I.join(", ");if(N.mainstay.tracer.debug(N,"rule","when",j),!j)return{schema:this};if(!N.mainstay.tracer.active&&this.$_temp.whens[j])return{schema:this.$_temp.whens[j],id:j};let L=this;this._definition.generate&&(L=this._definition.generate(this,E,N,k));for(const U of M)L=L.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(L,[this,...M]),this.$_temp.whens[j]=L,{schema:L,id:j}}_inner(E,N,k={}){a(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const M=this.clone();return M.$_terms[E]&&!k.override||(M.$_terms[E]=[]),k.single?M.$_terms[E].push(N):M.$_terms[E].push(...N),M.$_temp.ruleset=!1,M}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,N={}){if(!this._singleRules.has(E))return this;const k=N.clone!==!1?this.clone():this;k._singleRules.delete(E);const M=[];for(let I=0;I{const a=o(375),c=o(8571),u=o(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),a(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let p=this._map.get(l);if(p)return p.value=d,void this._list.first(p);p=this._list.unshift({key:l,value:d}),this._map.set(l,p),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:d,prev:p}=l;return d.prev=p,p&&(p.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),u=o(5934);let f,l;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=u.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(p,h,m="Options"){a(p&&typeof p=="object"&&!Array.isArray(p),"Options must be of type object");const y=Object.keys(p).filter(g=>!h.includes(g));a(y.length===0,`${m} contain unknown keys: ${y}`)},i.checkPreferences=function(p){l=l||o(3378);const h=l.preferences.validate(p);if(h.error)throw new c([h.error.details[0].message])},i.compare=function(p,h,m){switch(m){case"=":return p===h;case">":return p>h;case"<":return p=":return p>=h;case"<=":return p<=h}},i.default=function(p,h){return p===void 0?h:p},i.isIsoDate=function(p){return d.isoDate.test(p)},i.isNumber=function(p){return typeof p=="number"&&!isNaN(p)},i.isResolvable=function(p){return!!p&&(p[i.symbols.ref]||p[i.symbols.template])},i.isSchema=function(p,h={}){const m=p&&p[i.symbols.any];return!!m&&(a(h.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(p){return p[i.symbols.values]},i.limit=function(p){return Number.isSafeInteger(p)&&p>=0},i.preferences=function(p,h){f=f||o(6914),p=p||{},h=h||{};const m=Object.assign({},p,h);return h.errors&&p.errors&&(m.errors=Object.assign({},p.errors,h.errors),m.errors.wrap=Object.assign({},p.errors.wrap,h.errors.wrap)),h.messages&&(m.messages=f.compile(h.messages,p.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(p,h,m={}){try{return p()}catch(y){throw y.path!==void 0?y.path=h+"."+y.path:y.path=h,m.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(p,h,{assert:m,message:y}){if(i.isSchema(m)){const g=m.validate(p);return g.error?g.error.message:void 0}if(!m(p))return h?`${h} ${y}`:y},i.verifyFlat=function(p,h){for(const m of p)a(!Array.isArray(m),"Method no longer accepts array arguments:",h)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.schema=function(l,d,p={}){c.assertOptions(p,["appendPath","override"]);try{return f.schema(l,d,p)}catch(h){throw p.appendPath&&h.path!==void 0&&(h.message=`${h.message} (${h.path})`),h}},f.schema=function(l,d,p){a(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(a(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const h=(m,...y)=>p.override!==!1?m.valid(l.override,...y):m.valid(...y);if(f.simple(d))return h(l,d);if(typeof d=="function")return l.custom(d);if(a(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return h(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const m of d)if(!f.simple(m))return l.alternatives().try(...d);return h(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?h(l.date(),d):(a(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,p={}){c.assertOptions(p,["legacy"]);const h=d&&d[c.symbols.any];if(h)return a(p.legacy||h.version===c.version,"Cannot mix different versions of joi schemas:",h.version,c.version),d;if(typeof d!="object"||!p.legacy)return i.schema(l,d,{appendPath:!0});const m=f.walk(d);return m?m.compile(m.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const p of l){const h=f.walk(p);if(h)return h}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};a(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const p in l){const h=f.walk(l[p]);if(h)return h}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,p){if(p===void 0&&(a(d&&typeof d=="object","Missing options"),p=d,d=u.create(".")),Array.isArray(p)&&(p={switch:p}),c.assertOptions(p,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return a(p.is===void 0,'"is" can not be used with a schema condition'),a(p.not===void 0,'"not" can not be used with a schema condition'),a(p.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:p.then,otherwise:p.otherwise,break:p.break});if(a(u.isRef(d)||typeof d=="string","Invalid condition:",d),a(p.not===void 0||p.is===void 0,'Cannot combine "is" with "not"'),p.switch===void 0){let m=p;p.not!==void 0&&(m={is:p.not,then:p.otherwise,otherwise:p.then,break:p.break});let y=m.is!==void 0?l.$_compile(m.is):l.$_root.invalid(null,!1,0,"").required();return a(m.then!==void 0||m.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),a(m.break===void 0||m.then===void 0||m.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),p.is===void 0||u.isRef(p.is)||c.isSchema(p.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(p.switch),'"switch" must be an array'),a(p.is===void 0,'Cannot combine "switch" with "is"'),a(p.not===void 0,'Cannot combine "switch" with "not"'),a(p.then===void 0,'Cannot combine "switch" with "then"');const h={ref:i.ref(d),switch:[],break:p.break};for(let m=0;m{const a=o(5688),c=o(8160),u=o(3328);i.Report=class{constructor(f,l,d,p,h,m,y){if(this.code=f,this.flags=p,this.messages=h,this.path=m.path,this.prefs=y,this.state=m,this.value=l,this.message=null,this.template=null,this.local=d||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,p,h){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let m=h.errors.language;if(c.isResolvable(m)&&(m=m.resolve(f,p,h)),m&&l[m]){if(l[m][d]!==void 0)return l[m][d];if(l[m]["*"]!==void 0)return l[m]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,p){if(!d.errors.label)return"";if(f.label)return f.label;let h=l.path;return d.errors.label==="key"&&l.path.length>1&&(h=l.path.slice(-1)),i.path(h)||i.template(null,d.messages,"root",l,d)||p&&i.template(null,p,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:p,message:h,details:m}=i.details(f);if(p)return p;if(d.errors.stack)return new i.ValidationError(h,m,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(h,m,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const p=[];for(const h of f){if(h instanceof Error){if(l.override!==!1)return{override:h};const y=h.toString();d.push(y),p.push({message:y,type:"override",context:{error:h}});continue}const m=h.toString();d.push(m),p.push({message:m,path:h.path.filter(y=>typeof y!="object"),type:h.code,context:h.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:p}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8160),f=o(6914),l={};i.type=function(d,p){const h=Object.getPrototypeOf(d),m=c(h),y=d._assign(Object.create(m)),g=Object.assign({},p);delete g.base,m._definition=g;const v=h._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const b=Object.assign({},v.terms);if(g.terms)for(const T in g.terms){const E=g.terms[T];a(y.$_terms[T]===void 0,"Invalid term override for",g.type,T),y.$_terms[T]=E.init,b[T]=E}g.terms=b,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const _=Object.assign({},v.rules);if(g.rules)for(const T in g.rules){const E=g.rules[T];a(typeof E=="object","Invalid rule definition for",g.type,T);let N=E.method;if(N===void 0&&(N=function(){return this.$_addRule(T)}),N&&(a(!m[T],"Rule conflict in",g.type,T),m[T]=N),a(!_[T],"Rule conflict in",g.type,T),_[T]=E,E.alias){const k=[].concat(E.alias);for(const M of k)m[M]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(k=>(typeof k=="string"&&(k={name:k}),a(!E.argsByName.has(k.name),"Duplicated argument name",k.name),u.isSchema(k.assert)&&(k.assert=k.assert.strict().label(k.name)),E.argsByName.set(k.name,k),k)))}g.rules=_;const R=Object.assign({},v.modifiers);if(g.modifiers)for(const T in g.modifiers){a(!m[T],"Rule conflict in",g.type,T);const E=g.modifiers[T];a(typeof E=="function","Invalid modifier definition for",g.type,T);const N=function(k){return this.rule({[T]:k})};m[T]=N,R[T]=E}if(g.modifiers=R,g.overrides){m._super=h,y.$_super={};for(const T in g.overrides)a(h[T],"Cannot override missing",T),g.overrides[T][u.symbols.parent]=h[T],y.$_super[T]=h[T].bind(y);Object.assign(m,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const P=Object.assign({},v.manifest,g.manifest);return P.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=P,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,p){return d&&p?function(h,m){return p(d(h,m),m)}:d||p},l.coerce=function(d,p){return d&&p?{from:d.from&&p.from?[...new Set([...d.from,...p.from])]:null,method(h,m){let y;if((!p.from||p.from.includes(typeof h))&&(y=p.method(h,m),y)){if(y.errors||y.value===void 0)return y;h=y.value}if(!d.from||d.from.includes(typeof h)){const g=d.method(h,m);if(g)return g}return y}}:d||p},l.prepare=function(d,p){return d&&p?function(h,m){const y=d(h,m);if(y){if(y.errors||y.value===void 0)return y;h=y.value}return p(h,m)||y}:d||p},l.rebuild=function(d,p){return d&&p?function(h){p(h),d(h)}:d||p},l.validate=function(d,p){return d&&p?function(h,m){const y=p(h,m);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;h=y.value}return d(h,m)||y}:d||p}},5107:(s,i,o)=>{const a=o(375),c=o(8571),u=o(8652),f=o(8160),l=o(3292),d=o(6354),p=o(8901),h=o(9708),m=o(6133),y=o(3328),g=o(1152);let v;const b={types:{alternatives:o(4946),any:o(8068),array:o(546),boolean:o(4937),date:o(7500),function:o(390),link:o(8785),number:o(3832),object:o(8966),string:o(7417),symbol:o(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const _={_types:new Set(Object.keys(b.types))};for(const R of _._types)_[R]=function(...P){return a(!P.length||["alternatives","link","object"].includes(R),"The",R,"type does not allow arguments"),b.generate(this,b.types[R],P)};for(const R of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])_[R]=function(...P){return this.any()[R](...P)};Object.assign(_,b.methods);for(const R in b.aliases){const P=b.aliases[R];_[R]=_[P]}return _.x=_.expression,g.setup&&g.setup(_),_}};b.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(_,R,...P){b.assert(_,R,!0,P)},attempt:(_,R,...P)=>b.assert(_,R,!1,P),build(_){return a(typeof h.build=="function","Manifest functionality disabled"),h.build(this,_)},checkPreferences(_){f.checkPreferences(_)},compile(_,R){return l.compile(this,_,R)},defaults(_){a(typeof _=="function","modifier must be a function");const R=Object.assign({},this);for(const P of R._types){const T=_(R[P]());a(f.isSchema(T),"modifier must return a valid schema object"),R[P]=function(...E){return b.generate(this,T,E)}}return R},expression:(..._)=>new y(..._),extend(..._){f.verifyFlat(_,"extend"),v=v||o(3378),a(_.length,"You need to provide at least one extension"),this.assert(_,v.extensions);const R=Object.assign({},this);R._types=new Set(R._types);for(let P of _){typeof P=="function"&&(P=P(R)),this.assert(P,v.extension);const T=b.expandExtension(P,R);for(const E of T){a(R[E.type]===void 0||R._types.has(E.type),"Cannot override name",E.type);const N=E.base||this.any(),k=p.type(N,E);R._types.add(E.type),R[E.type]=function(...M){return b.generate(this,k,M)}}}return R},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:m.isRef,isSchema:f.isSchema,in:(..._)=>m.in(..._),override:f.symbols.override,ref:(..._)=>m.create(..._),types(){const _={};for(const R of this._types)_[R]=this[R]();for(const R in b.aliases)_[R]=this[R]();return _}},b.assert=function(_,R,P,T){const E=T[0]instanceof Error||typeof T[0]=="string"?T[0]:null,N=E!==null?T[1]:T[0],k=R.validate(_,f.preferences({errors:{stack:!0}},N||{}));let M=k.error;if(!M)return k.value;if(E instanceof Error)throw E;const I=P&&typeof M.annotate=="function"?M.annotate():M.message;throw M instanceof d.ValidationError==0&&(M=c(M)),M.message=E?`${E} ${I}`:I,M},b.generate=function(_,R,P){return a(_,"Must be invoked on a Joi instance."),R.$_root=_,R._definition.args&&P.length?R._definition.args(R,...P):R},b.expandExtension=function(_,R){if(typeof _.type=="string")return[_];const P=[];for(const T of R._types)if(_.type.test(T)){const E=Object.assign({},_);E.type=T,E.base=R[T](),P.push(E)}return P},s.exports=b.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),u=o(3328);i.compile=function(f,l){if(typeof f=="string")return a(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return a(!l,"Cannot set single message template"),f;a(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const p=f[d];if(d==="root"||u.isTemplate(p)){l[d]=p;continue}if(typeof p=="string"){l[d]=new u(p);continue}a(typeof p=="object"&&!Array.isArray(p),"Invalid message for",d);const h=d;for(d in l[h]=l[h]||{},p){const m=p[d];d==="root"||u.isTemplate(m)?l[h][d]=m:(a(typeof m=="string","Invalid message for",d,"in",h),l[h][d]=new u(m))}}return l},i.decompile=function(f){const l={};for(let d in f){const p=f[d];if(d==="root"){l.root=p;continue}if(u.isTemplate(p)){l[d]=p.describe({compact:!0});continue}const h=d;for(d in l[h]={},p){const m=p[d];d!=="root"?l[h][d]=m.describe({compact:!0}):l[h].root=m}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let p in l){const h=l[p];if(p==="root"||u.isTemplate(h)){d[p]=h;continue}if(typeof h=="string"){d[p]=new u(h);continue}a(typeof h=="object"&&!Array.isArray(h),"Invalid message for",p);const m=p;for(p in d[m]=d[m]||{},h){const y=h[p];p==="root"||u.isTemplate(y)?d[m][p]=y:(a(typeof y=="string","Invalid message for",p,"in",m),d[m][p]=new u(y))}}return d}},2294:(s,i,o)=>{const a=o(375),c=o(8160),u=o(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,p]of l._byId.entries())a(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,p);for(const[d,p]of l._byKey.entries())a(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,p)}fork(l,d,p){const h=this._collect(l);h.push({schema:p});const m=h.shift();let y={id:m.id,schema:d(m.schema)};a(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of h)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const p=l[0],h=this._get(p);if(!h)return[...d,...l].join(".");const m=l.slice(1);return d=[...d,h.schema._flags.label||p],m.length?h.schema._ids.labels(m,d):d.join(".")}reach(l,d=[]){const p=l[0],h=this._get(p);a(h,"Schema does not contain path",[...d,...l].join("."));const m=l.slice(1);return m.length?h.schema._ids.reach(m,[...d,p]):h.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const p=l._flags.id;if(p){const h=this._byId.get(p);a(!h||h.schema===l,"Cannot add different schemas with the same id:",p),a(!this._byKey.has(p),"Schema id conflicts with existing key:",p),this._byId.set(p,{schema:l,id:p})}d&&(a(!this._byKey.has(d),"Schema already contains key:",d),a(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],p=[]){const h=l[0],m=this._get(h);a(m,"Schema does not contain path",[...d,...l].join(".")),p=[m,...p];const y=l.slice(1);return y.length?m.schema._ids._collect(y,[...d,h],p):p}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,p){const h=i.schema(l,{each:(m,{key:y})=>{if(d===(m._flags.id||y))return p},ref:!1});return h?h.$_mutateRebuild():l},i.schema=function(l,d){let p;for(const h in l._flags){if(h[0]==="_")continue;const m=f.scan(l._flags[h],{source:"flags",name:h},d);m!==void 0&&(p=p||l.clone(),p._flags[h]=m)}for(let h=0;h{const a=o(375),c=o(8571),u=o(9621),f=o(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(p,h={}){a(typeof p=="string","Invalid reference key:",p),f.assertOptions(h,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!h.prefix||typeof h.prefix=="object","options.prefix must be of type object");const m=Object.assign({},d.defaults,h);delete m.prefix;const y=m.separator,g=d.context(p,y,h.prefix);if(m.type=g.type,p=g.key,m.type==="value")if(g.root&&(a(!y||p[0]!==y,"Cannot specify relative path with root prefix"),m.ancestor="root",p||(p=null)),y&&y===p)p=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!y||!p||p[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,b]=d.ancestor(p,y);b&&(p=p.slice(b))===""&&(p=null),m.ancestor=v}return m.path=y?p===null?[]:p.split(y):[p],new d.Ref(m)},i.in=function(p,h={}){return i.create(p,{...h,in:!0})},i.isRef=function(p){return!!p&&!!p[f.symbols.ref]},d.Ref=class{constructor(p){a(typeof p=="object","Invalid reference construction"),f.assertOptions(p,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(p.separator)||typeof p.separator=="string"&&p.separator.length===1,"Invalid separator"),a(!p.adjust||typeof p.adjust=="function","options.adjust must be a function"),a(!p.map||Array.isArray(p.map),"options.map must be an array"),a(!p.map||!p.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,p),a(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(p,h,m,y,g={}){return a(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,h,g):this.type==="local"?this._resolve(y,h,g):this.ancestor?this.ancestor==="root"?this._resolve(h.ancestors[h.ancestors.length-1],h,g):(a(this.ancestor<=h.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(h.ancestors[this.ancestor-1],h,g)):this._resolve(p,h,g)}_resolve(p,h,m){let y;if(this.type==="value"&&h.mainstay.shadow&&m.shadow!==!1&&(y=h.mainstay.shadow.get(this.absolute(h))),y===void 0&&(y=u(p,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return h.mainstay&&h.mainstay.tracer.resolve(h,this,y),y}toString(){return this.display}absolute(p){return[...p.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const p={path:this.path};this.type!=="value"&&(p.type=this.type),this.separator!=="."&&(p.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(p.ancestor=this.ancestor),this.map&&(p.map=[...this.map]);for(const h of["adjust","iterables","render"])this[h]!==null&&this[h]!==void 0&&(p[h]=this[h]);return this.in!==!1&&(p.in=!0),{ref:p}}updateDisplay(){const p=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${p}`);if(!this.separator)return void(this.display=`ref:${p}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${p}`);if(this.ancestor==="root")return void(this.display=`ref:root:${p}`);if(this.ancestor===1)return void(this.display=`ref:${p||".."}`);const h=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${h}${p||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(p){return(p=Object.assign({},d.defaults,p)).type==="value"&&p.ancestor===void 0&&(p.ancestor=1),new d.Ref(p)},d.context=function(p,h,m={}){if(p=p.trim(),m){const y=m.global===void 0?"$":m.global;if(y!==h&&p.startsWith(y))return{key:p.slice(y.length),type:"global"};const g=m.local===void 0?"#":m.local;if(g!==h&&p.startsWith(g))return{key:p.slice(g.length),type:"local"};const v=m.root===void 0?"/":m.root;if(v!==h&&p.startsWith(v))return{key:p.slice(v.length),type:"value",root:!0}}return{key:p,type:"value"}},d.ancestor=function(p,h){if(!h)return[1,0];if(p[0]!==h)return[1,0];if(p[1]!==h)return[0,1];let m=2;for(;p[m]===h;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(p,h){if(p)if(h=h===void 0?i.toParent:h,Array.isArray(p))for(const m of p)this.register(m,h);else if(f.isSchema(p))for(const m of p._refs.refs)m.ancestor-h>=0&&this.refs.push({ancestor:m.ancestor-h,root:m.root});else i.isRef(p)&&p.type==="value"&&p.ancestor-h>=0&&this.refs.push({ancestor:p.ancestor-h,root:p.root}),l=l||o(3328),l.isTemplate(p)&&this.register(p.refs(),h)}get length(){return this.refs.length}clone(){const p=new i.Manager;return p.refs=c(this.refs),p}reset(){this.refs=[]}roots(){return this.refs.filter(p=>!p.ancestor).map(p=>p.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),u=o(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,p){this.path=l,this.ancestors=d,this.mainstay=p.mainstay,this.schemas=p.schemas,this.debug=null}localize(l,d=null,p=null){const h=new f.State(l,d,this);return p&&h.schemas&&(h.schemas=[f.schemas(p),...h.schemas]),h}nest(l,d){const p=new f.State(this.path,this.ancestors,this);return p.schemas=p.schemas&&[f.schemas(l),...p.schemas],p.debug=d,p}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=a(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,p){if(!l.length||p==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let h=this._values;for(let m=0;m{const a=o(375),c=o(8571),u=o(5277),f=o(1447),l=o(8160),d=o(6354),p=o(6133),h={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=h.Template=class{constructor(m,y){if(a(typeof m=="string","Template source must be a string"),a(!m.includes("\0")&&!m.includes(""),"Template source cannot contain reserved control characters"),this.source=m,this.rendered=m,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(a(Object.keys(this._functions).every(b=>typeof b=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(b=>typeof b=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=h.encode(this.source),y=h.split(m);let g=!1;const v=[],b=y.shift();b&&v.push(b);for(const _ of y){const R=_[0]!=="{",P=R?"}":"}}",T=_.indexOf(P);if(T===-1||_[1]==="{"){v.push(`{${h.decode(_)}`);continue}let E=_.slice(R?0:1,T);const N=E[0]===":";N&&(E=E.slice(1));const k=this._ref(h.decode(E),{raw:R,wrapped:N});v.push(k),typeof k!="string"&&(g=!0);const M=_.slice(T+P.length);M&&v.push(h.decode(M))}g?this._template=v:this.rendered=v.join("")}static date(m,y){return h.dateFormat[y.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(m){return new h.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[l.symbols.template]}refs(){if(!this._template)return;const m=[];for(const y of this._template)typeof y!="string"&&m.push(...y.refs);return m}resolve(m,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],m,y,g,v,{}):this.render(m,y,g,v)}_part(m,...y){return m.ref?m.ref.resolve(...y):m.formula.evaluate(y)}render(m,y,g,v,b={}){if(!this.isDynamic())return this.rendered;const _=[];for(const R of this._template)if(typeof R=="string")_.push(R);else{const P=this._part(R,m,y,g,v,b),T=h.stringify(P,m,y,g,v,b);if(T!==void 0){const E=R.raw||(b.errors&&b.errors.escapeHtml)===!1?T:u(T);_.push(h.wrap(E,R.wrapped&&g.errors.wrap.label))}}return _.join("")}_ref(m,{raw:y,wrapped:g}){const v=[],b=R=>{const P=p.create(R,this._settings);return v.push(P),T=>{const E=P.resolve(...T);return E!==void 0?E:null}};try{const R=this._functions?{...h.functions,...this._functions}:h.functions;var _=new f.Parser(m,{reference:b,functions:R,constants:h.constants})}catch(R){throw R.message=`Invalid template variable "${m}" fails due to: ${R.message}`,R}if(_.single){if(_.single.type==="reference"){const R=v[0];return{ref:R,raw:y,refs:v,wrapped:g||R.type==="local"&&R.key==="label"}}return h.stringify(_.single.value)}return{formula:_,raw:y,refs:v}}toString(){return this.source}},h.Template.prototype[l.symbols.template]=!0,h.Template.prototype.isImmutable=!0,h.encode=function(m){return m.replace(/\\(\{+)/g,(y,g)=>h.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>h.closes.slice(0,g.length))},h.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},h.split=function(m){const y=[];let g="";for(let v=0;v ${M.toString()}`);m=N}if(!Array.isArray(m))return m.toString();const E=[];for(const N of m)E.push(h.stringify(N,y,g,v,b,{arrayItems:!0,..._}));return h.wrap(E.join(", "),!T&&P.array)},h.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},h.functions={if:(m,y,g)=>m?y:g,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[y,g,v,b,_]=this,R=_.messages;if(!R)return"";const P=d.template(y,R[0],m,g,v)||d.template(y,R[1],m,g,v);return P?P.render(y,g,v,b,_):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),u=o(8068),f=o(8160),l=o(3292),d=o(6354),p=o(6133),h={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:p.toSibling}},args:(m,...y)=>y.length===1&&Array.isArray(y[0])?m.try(...y[0]):m.try(...y),validate(m,y){const{schema:g,error:v,state:b,prefs:_}=y;if(g._flags.match){const P=[],T=[];for(let N=0;Nd.details(N,{override:!1}))})};if(g._flags.match==="one")return P.length===1?{value:P[0]}:{errors:v("alternatives.one")};if(P.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:T.map(N=>d.details(N,{override:!1}))})};const E=N=>N.$_terms.matches.some(k=>k.schema.type==="object"||k.schema.type==="alternatives"&&E(k.schema));return E(g)?{value:P.reduce((N,k)=>c(N,k,{mergeArrays:!1}))}:{value:P[P.length-1]}}const R=[];for(let P=0;Pg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:b,is:_,not:R,then:P,otherwise:T}=g;m=v?m.try(v):b?m.conditional(b,{is:_,then:P,not:R,otherwise:T,switch:g.switch}):m.conditional(_,{then:P,otherwise:T})}return m}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),h.errors=function(m,{error:y,state:g}){if(!m.length)return{errors:y("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const v=new Set,b=[];for(const{reports:_,schema:R}of m){if(_.length>1)return h.unmatched(m,y);const P=_[0];if(P instanceof d.Report==0)return h.unmatched(m,y);if(P.state.path.length!==g.path.length){b.push({type:R.type,report:P});continue}if(P.code==="any.only"){for(const N of P.local.valids)v.add(N);continue}const[T,E]=P.code.split(".");E!=="base"?b.push({type:R.type,report:P}):P.code==="object.base"?v.add(P.local.type):v.add(T)}return b.length?b.length===1?{errors:b[0].report}:h.unmatched(m,y):{errors:y("alternatives.types",{types:[...v]})}},h.unmatched=function(m,y){const g=[];for(const v of m)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),u=o(8160),f=o(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return a(typeof l=="function","Method must be a function"),a(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:p}){try{return p(l,d)}catch(h){return d.error("any.custom",{error:h})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){a(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return a(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:p,local:h})=>d.error(p,h),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const p in d){const h=d[p];if(["examples","externals","metas","notes","tags"].includes(p))for(const m of h)l=l[p.slice(0,-1)](m);else if(p!=="alterations")if(p!=="whens"){if(p==="shared")for(const m of h)l=l.shared(m)}else for(const m of h){const{ref:y,is:g,not:v,then:b,otherwise:_,concat:R}=m;l=R?l.concat(R):y?l.when(y,{is:g,not:v,then:b,otherwise:_,switch:m.switch,break:m.break}):l.when(g,{then:b,otherwise:_,break:m.break})}else{const m={};for(const{target:y,adjuster:g}of h)m[y]=g;l=l.alter(m)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),u=o(9621),f=o(8068),l=o(8160),d=o(3292),p={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(h,{schema:m,state:y,prefs:g}){if(!Array.isArray(h))return;const v=m.$_getRule("sort");return v?p.sort(m,h,v.args.options,y,g):void 0}},validate(h,{schema:m,error:y}){if(!Array.isArray(h)){if(m._flags.single){const g=[h];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:h.slice()}},rules:{has:{method(h){h=this.$_compile(h,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:h}});return m.$_mutateRegister(h),m},validate(h,{state:m,prefs:y,error:g},{schema:v}){const b=[h,...m.ancestors];for(let R=0;Rthis.$_compile(h[y]),y,{append:!0});m.$_terms.items.push(g)}return m.$_mutateRebuild()},validate(h,{schema:m,error:y,state:g,prefs:v,errorsArray:b}){const _=m.$_terms._requireds.slice(),R=m.$_terms.ordered.slice(),P=[...m.$_terms._inclusions,..._],T=!h[l.symbols.arraySingle];delete h[l.symbols.arraySingle];const E=b();let N=h.length;for(let k=0;k="})}},ordered:{method(...h){l.verifyFlat(h,"ordered");const m=this.$_addRule("items");for(let y=0;ythis.$_compile(h[y]),y,{append:!0});p.validateSingle(g,m),m.$_mutateRegister(g),m.$_terms.ordered.push(g)}return m.$_mutateRebuild()}},single:{method(h){const m=h===void 0||!!h;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(h={}){l.assertOptions(h,["by","order"]);const m={order:h.order||"ascending"};return h.by&&(m.by=d.ref(h.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(h,{error:m,state:y,prefs:g,schema:v},{options:b}){const{value:_,errors:R}=p.sort(v,h,b,y,g);if(R)return R;for(let P=0;Pnew Set(h)}},rebuild(h){h.$_terms._inclusions=[],h.$_terms._exclusions=[],h.$_terms._requireds=[];for(const m of h.$_terms.items)p.validateSingle(m,h),m._flags.presence==="required"?h.$_terms._requireds.push(m):m._flags.presence==="forbidden"?h.$_terms._exclusions.push(m):h.$_terms._inclusions.push(m);for(const m of h.$_terms.ordered)p.validateSingle(m,h)},manifest:{build:(h,m)=>(m.items&&(h=h.items(...m.items)),m.ordered&&(h=h.ordered(...m.ordered)),h)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),p.fillMissedErrors=function(h,m,y,g,v,b){const _=[];let R=0;for(const P of y){const T=P._flags.label;T?_.push(T):++R}_.length?R?m.push(h.$_createError("array.includesRequiredBoth",g,{knownMisses:_,unknownMisses:R},v,b)):m.push(h.$_createError("array.includesRequiredKnowns",g,{knownMisses:_},v,b)):m.push(h.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:R},v,b))},p.fillOrderedErrors=function(h,m,y,g,v,b){const _=[];for(const R of y)R._flags.presence==="required"&&_.push(R);_.length&&p.fillMissedErrors(h,m,_,g,v,b)},p.fillDefault=function(h,m,y,g){const v=[];let b=!0;for(let _=h.length-1;_>=0;--_){const R=h[_],P=[m,...y.ancestors],T=R.$_validate(void 0,y.localize(y.path,P,R),g).value;if(b){if(T===void 0)continue;b=!1}v.unshift(T)}v.length&&m.push(...v)},p.fastSplice=function(h,m){let y=m;for(;y{let N=p.compare(T,E,_,R);if(N!==null||(y.by&&(T=y.by.resolve(T,g,v),E=y.by.resolve(E,g,v)),N=p.compare(T,E,_,R),N!==null))return N;const k=typeof T;if(k!==typeof E)throw h.$_createError("array.sort.mismatching",m,null,g,v);if(k!=="number"&&k!=="string")throw h.$_createError("array.sort.unsupported",m,{type:k},g,v);return k==="number"?(T-E)*b:T{const a=o(375),c=o(8068),u=o(8160),f=o(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:p}){if(typeof d!="boolean"){if(typeof d=="string"){const h=p._flags.sensitive?d:d.toLowerCase();d=h==="true"||h!=="false"&&d}return typeof d!="boolean"&&(d=p.$_terms.truthy&&p.$_terms.truthy.has(d,null,null,!p._flags.sensitive)||(!p.$_terms.falsy||!p.$_terms.falsy.has(d,null,null,!p._flags.sensitive))&&d),{value:d}}},validate(d,{error:p}){if(typeof d!="boolean")return{value:d,errors:p("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const p=this.clone();p.$_terms.truthy=p.$_terms.truthy||new f;for(let h=0;hd?1:0},string:{from:l.isBool,to:(d,p)=>d?"true":"false"}},manifest:{build:(d,p)=>(p.truthy&&(d=d.truthy(...p.truthy)),p.falsy&&(d=d.falsy(...p.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f=o(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:p})=>({value:l.parse(d,p._flags.format)||d})},validate(d,{schema:p,error:h,prefs:m}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=p._flags.format;return m.convert&&y&&typeof d=="string"?{value:d,errors:h("date.format",{format:y})}:{value:d,errors:h("date.base")}},rules:{compare:{method:!1,validate(d,p,{date:h},{name:m,operator:y,args:g}){const v=h==="now"?Date.now():h.getTime();return u.compare(d.getTime(),v,y)?d:p.error("date."+m,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return a(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return a(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,p)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:p})=>f.date(d,p)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,p){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(p==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const h=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),p){if(p==="javascript")return l.date(1*d);if(p==="unix")return l.date(1e3*d);if(typeof h=="string")return null}return l.date(d)},l.date=function(d){const p=new Date(d);return isNaN(p.getTime())?null:p}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return a(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return a(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return a(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),u=o(8571),f=o(3652),l=o(8068),d=o(8160),p=o(3292),h=o(6354),m=o(6133),y=o(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,b)=>v.keys(b),validate(v,{schema:b,error:_,state:R,prefs:P}){if(!v||typeof v!==b.$_property("typeof")||Array.isArray(v))return{value:v,errors:_("object.base",{type:b.$_property("typeof")})};if(!(b.$_terms.renames||b.$_terms.dependencies||b.$_terms.keys||b.$_terms.patterns||b.$_terms.externals))return;v=g.clone(v,P);const T=[];if(b.$_terms.renames&&!g.rename(b,v,R,P,T))return{value:v,errors:T};if(!b.$_terms.keys&&!b.$_terms.patterns&&!b.$_terms.dependencies)return{value:v,errors:T};const E=new Set(Object.keys(v));if(b.$_terms.keys){const N=[v,...R.ancestors];for(const k of b.$_terms.keys){const M=k.key,I=v[M];E.delete(M);const j=R.localize([...R.path,M],N,k),L=k.schema.$_validate(I,j,P);if(L.errors){if(P.abortEarly)return{value:v,errors:L.errors};L.value!==void 0&&(v[M]=L.value),T.push(...L.errors)}else k.schema._flags.result==="strip"||L.value===void 0&&I!==void 0?delete v[M]:L.value!==void 0&&(v[M]=L.value)}}if(E.size||b._flags._hasPatternMatch){const N=g.unknown(b,v,E,T,R,P);if(N)return N}if(b.$_terms.dependencies)for(const N of b.$_terms.dependencies){if(N.key!==null&&g.isPresent(N.options)(N.key.resolve(v,R,P,null,{shadow:!1}))===!1)continue;const k=g.dependencies[N.rel](b,N,v,R,P);if(k){const M=b.$_createError(k.code,v,k.context,R,P);if(P.abortEarly)return{value:v,errors:M};T.push(M)}}return{value:v,errors:T}},rules:{and:{method(...v){return d.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,b,_){y.isTemplate(v)||(v=p.ref(v)),c(_===void 0||typeof _=="string","Message must be a string"),b=this.$_compile(b,{appendPath:!0});const R=this.$_addRule({name:"assert",args:{subject:v,schema:b,message:_}});return R.$_mutateRegister(v),R.$_mutateRegister(b),R},validate(v,{error:b,prefs:_,state:R},{subject:P,schema:T,message:E}){const N=P.resolve(v,R,_),k=m.isRef(P)?P.absolute(R):[];return T.$_match(N,R.localize(k,[v,...R.ancestors],T),_)?v:b("object.assert",{subject:P,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,b){return c(typeof v=="function","constructor must be a function"),b=b||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:b}})},validate:(v,b,{constructor:_,name:R})=>v instanceof _?v:b.error("object.instance",{type:R,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!d.isSchema(v),"Object schema cannot be a joi schema");const b=this.clone();if(v)if(Object.keys(v).length){b.$_terms.keys=b.$_terms.keys?b.$_terms.keys.filter(_=>!v.hasOwnProperty(_.key)):new g.Keys;for(const _ in v)d.tryWithPath(()=>b.$_terms.keys.push({key:_,schema:this.$_compile(v[_])}),_)}else b.$_terms.keys=new g.Keys;else b.$_terms.keys=null;return b.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,b,{limit:_},{name:R,operator:P,args:T})=>d.compare(Object.keys(v).length,_,P)?v:b.error("object."+R,{limit:T.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,b,_={}){const R=v instanceof RegExp;R||(v=this.$_compile(v,{appendPath:!0})),c(b!==void 0,"Invalid rule"),d.assertOptions(_,["fallthrough","matches"]),R&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),b=this.$_compile(b,{appendPath:!0});const P=this.clone();P.$_terms.patterns=P.$_terms.patterns||[];const T={[R?"regex":"schema"]:v,rule:b};return _.matches&&(T.matches=this.$_compile(_.matches),T.matches.type!=="array"&&(T.matches=T.matches.$_root.array().items(T.matches)),P.$_mutateRegister(T.matches),P.$_setFlag("_hasPatternMatch",!0,{clone:!1})),_.fallthrough&&(T.fallthrough=!0),P.$_terms.patterns.push(T),P.$_mutateRegister(b),P}},ref:{method(){return this.$_addRule("ref")},validate:(v,b)=>m.isRef(v)?v:b.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,b)=>v instanceof RegExp?v:b.error("object.regex",{value:v})},rename:{method(v,b,_={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof b=="string"||b instanceof y,"Invalid rename to argument"),c(b!==v,"Cannot rename key to same name:",v),d.assertOptions(_,["alias","ignoreUndefined","override","multiple"]);const R=this.clone();R.$_terms.renames=R.$_terms.renames||[];for(const P of R.$_terms.renames)c(P.from!==v,"Cannot rename the same key multiple times");return b instanceof y&&R.$_mutateRegister(b),R.$_terms.renames.push({from:v,to:b,options:a(g.renameDefaults,_)}),R}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,b,{type:_})=>!d.isSchema(v)||_!=="any"&&v.type!==_?b.error("object.schema",{type:_}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,b,_={}){return g.dependency(this,"with",v,b,_)}},without:{method(v,b,_={}){return g.dependency(this,"without",v,b,_)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,b){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,b)}},rebuild(v){if(v.$_terms.keys){const b=new f.Sorter;for(const _ of v.$_terms.keys)d.tryWithPath(()=>b.add(_,{after:_.schema.$_rootReferences(),group:_.key}),_.key);v.$_terms.keys=new g.Keys(...b.nodes)}},manifest:{build(v,b){if(b.keys&&(v=v.keys(b.keys)),b.dependencies)for(const{rel:_,key:R=null,peers:P,options:T}of b.dependencies)v=g.dependency(v,_,R,P,T);if(b.patterns)for(const{regex:_,schema:R,rule:P,fallthrough:T,matches:E}of b.patterns)v=v.pattern(_||R,P,{fallthrough:T,matches:E});if(b.renames)for(const{from:_,to:R,options:P}of b.renames)v=v.rename(_,R,P);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,b){if(typeof v=="object"){if(b.nonEnumerables)return u(v,{shallow:!0});const R=Object.create(Object.getPrototypeOf(v));return Object.assign(R,v),R}const _=function(...R){return v.apply(this,R)};return _.prototype=u(v.prototype),Object.defineProperty(_,"name",{value:v.name,writable:!1}),Object.defineProperty(_,"length",{value:v.length,writable:!1}),Object.assign(_,v),_},g.dependency=function(v,b,_,R,P){c(_===null||typeof _=="string",b,"key must be a strings"),P||(P=R.length>1&&typeof R[R.length-1]=="object"?R.pop():{}),d.assertOptions(P,["separator","isPresent"]),R=[].concat(R);const T=d.default(P.separator,"."),E=[];for(const k of R)c(typeof k=="string",b,"peers must be strings"),E.push(p.ref(k,{separator:T,ancestor:0,prefix:!1}));_!==null&&(_=p.ref(_,{separator:T,ancestor:0,prefix:!1}));const N=v.clone();return N.$_terms.dependencies=N.$_terms.dependencies||[],N.$_terms.dependencies.push(new g.Dependency(b,_,E,R,P)),N},g.dependencies={and(v,b,_,R,P){const T=[],E=[],N=b.peers.length,k=g.isPresent(b.options);for(const M of b.peers)k(M.resolve(_,R,P,null,{shadow:!1}))===!1?T.push(M.key):E.push(M.key);if(T.length!==N&&E.length!==N)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:T,missingWithLabels:g.keysToLabels(v,T)}}},nand(v,b,_,R,P){const T=[],E=g.isPresent(b.options);for(const M of b.peers)E(M.resolve(_,R,P,null,{shadow:!1}))&&T.push(M.key);if(T.length!==b.peers.length)return;const N=b.paths[0],k=b.paths.slice(1);return{code:"object.nand",context:{main:N,mainWithLabel:g.keysToLabels(v,N),peers:k,peersWithLabels:g.keysToLabels(v,k)}}},or(v,b,_,R,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,R,P,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)}}},oxor(v,b,_,R,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,R,P,null,{shadow:!1}))&&T.push(k.key);if(!T.length||T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.oxor",context:N}},with(v,b,_,R,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,R,P,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,b,_,R,P){const T=g.isPresent(b.options);for(const E of b.peers)if(T(E.resolve(_,R,P,null,{shadow:!1})))return{code:"object.without",context:{main:b.key.key,mainWithLabel:g.keysToLabels(v,b.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,b,_,R,P){const T=[],E=g.isPresent(b.options);for(const k of b.peers)E(k.resolve(_,R,P,null,{shadow:!1}))&&T.push(k.key);if(T.length===1)return;const N={peers:b.paths,peersWithLabels:g.keysToLabels(v,b.paths)};return T.length===0?{code:"object.missing",context:N}:(N.present=T,N.presentWithLabels=g.keysToLabels(v,T),{code:"object.xor",context:N})}},g.keysToLabels=function(v,b){return Array.isArray(b)?b.map(_=>v.$_mapLabels(_)):v.$_mapLabels(b)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:b=>b!==void 0},g.rename=function(v,b,_,R,P){const T={};for(const E of v.$_terms.renames){const N=[],k=typeof E.from!="string";if(k)for(const M in b){if(b[M]===void 0&&E.options.ignoreUndefined||M===E.to)continue;const I=E.from.exec(M);I&&N.push({from:M,to:E.to,match:I})}else!Object.prototype.hasOwnProperty.call(b,E.from)||b[E.from]===void 0&&E.options.ignoreUndefined||N.push(E);for(const M of N){const I=M.from;let j=M.to;if(j instanceof y&&(j=j.render(b,_,R,M.match)),I!==j){if(!E.options.multiple&&T[j]&&(P.push(v.$_createError("object.rename.multiple",b,{from:I,to:j,pattern:k},_,R)),R.abortEarly)||Object.prototype.hasOwnProperty.call(b,j)&&!E.options.override&&!T[j]&&(P.push(v.$_createError("object.rename.override",b,{from:I,to:j,pattern:k},_,R)),R.abortEarly))return!1;b[I]===void 0?delete b[j]:b[j]=b[I],T[j]=!0,E.options.alias||delete b[I]}}}return!0},g.unknown=function(v,b,_,R,P,T){if(v.$_terms.patterns){let E=!1;const N=v.$_terms.patterns.map(M=>{if(M.matches)return E=!0,[]}),k=[b,...P.ancestors];for(const M of _){const I=b[M],j=[...P.path,M];for(let L=0;L{const a=o(375),c=o(8068),u=o(8160),f=o(3292),l=o(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(p,h)=>p.ref(h),validate(p,{schema:h,state:m,prefs:y}){a(h.$_terms.link,"Uninitialized link schema");const g=d.generate(h,p,m,y),v=h.$_terms.link[0].ref;return g.$_validate(p,m.nest(g,`link:${v.display}:${g.type}`),y)},generate:(p,h,m,y)=>d.generate(p,h,m,y),rules:{ref:{method(p){a(!this.$_terms.link,"Cannot reinitialize schema"),p=f.ref(p),a(p.type==="value"||p.type==="local","Invalid reference type:",p.type),a(p.type==="local"||p.ancestor==="root"||p.ancestor>0,"Link cannot reference itself");const h=this.clone();return h.$_terms.link=[{ref:p}],h}},relative:{method(p=!0){return this.$_setFlag("relative",p)}}},overrides:{concat(p){a(this.$_terms.link,"Uninitialized link schema"),a(u.isSchema(p),"Invalid schema object"),a(p.type!=="link","Cannot merge type link with another link");const h=this.clone();return h.$_terms.whens||(h.$_terms.whens=[]),h.$_terms.whens.push({concat:p}),h.$_mutateRebuild()}},manifest:{build:(p,h)=>(a(h.link,"Invalid link description missing link"),p.ref(h.link))}}),d.generate=function(p,h,m,y){let g=m.mainstay.links.get(p);if(g)return g._generate(h,m,y).schema;const v=p.$_terms.link[0].ref,{perspective:b,path:_}=d.perspective(v,m);d.assert(b,"which is outside of schema boundaries",v,p,m,y);try{g=_.length?b.$_reach(_):b}catch{d.assert(!1,"to non-existing schema",v,p,m,y)}return d.assert(g.type!=="link","which is another link",v,p,m,y),p._flags.relative||m.mainstay.links.set(p,g),g._generate(h,m,y).schema},d.perspective=function(p,h){if(p.type==="local"){for(const{schema:m,key:y}of h.schemas){if((m._flags.id||y)===p.path[0])return{perspective:m,path:p.path.slice(1)};if(m.$_terms.shared){for(const g of m.$_terms.shared)if(g._flags.id===p.path[0])return{perspective:g,path:p.path.slice(1)}}}return{perspective:null,path:null}}return p.ancestor==="root"?{perspective:h.schemas[h.schemas.length-1].schema,path:p.path}:{perspective:h.schemas[p.ancestor]&&h.schemas[p.ancestor].schema,path:p.path}},d.assert=function(p,h,m,y,g,v){p||a(!1,`"${l.label(y._flags,g,v)}" contains link reference "${m.display}" ${h}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),u=o(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),p=d.indexOf("."),h=d.indexOf("e");return(p<0?0:(h<0?d.length:h)-p-1)+(h<0?0:Math.max(0,-parseInt(d.slice(h+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:p}){if(!l.match(f.numberRx))return;l=l.trim();const h={value:parseFloat(l)};if(h.value===0&&(h.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(h.value)))return h.errors=p("number.unsafe"),h}else{const m=h.value.toString();if(m.match(/e/i))return h;if(m!==f.normalizeDecimal(l))return h.errors=p("number.unsafe"),h}return h}},validate(l,{schema:d,error:p,prefs:h}){if(l===1/0||l===-1/0)return{value:l,errors:p("number.infinity")};if(!u.isNumber(l))return{value:l,errors:p("number.base")};const m={value:l};if(h.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);m.value=Math.round(m.value*g)/g}}return m.value===0&&(m.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,p,m)?l:d.error("number."+h,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,d)=>Math.trunc(l)-l==0?l:d.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const d=typeof l=="number"?f.decimalPlaces(l):null,p=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:p}})},validate:(l,d,{base:p,baseDecimalPlace:h,pfactor:m},y)=>f.decimalPlaces(l)>h?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(m*l)%Math.round(m*p)==0?l:d.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return a(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:p}){const h=l.toString().match(f.precisionRx);return Math.max((h[1]?h[1].length:0)-(h[2]?parseInt(h[2],10):0),0)<=p?l:d.error("number.precision",{limit:p,value:l})},convert:!0},sign:{method(l){return a(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:p})=>p==="negative"&&l<0||p==="positive"&&l>0?l:d.error(`number.${p}`)},unsafe:{method(l=!0){return a(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),u=o(1745),f=o(9959),l=o(6064),d=o(9926),p=o(5752),h=o(8068),m=o(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=h.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:b,prefs:_}){const R=v.$_getRule("normalize");R&&(g=g.normalize(R.args.form));const P=v.$_getRule("case");P&&(g=P.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const T=v.$_getRule("trim");if(T&&T.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const N of v.$_terms.replacements)g=g.replace(N.pattern,N.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const N=y.isoDate(g);N&&(g=N)}if(v._flags.truncate){const N=v.$_getRule("max");if(N){let k=N.args.limit;if(m.isResolvable(k)&&(k=k.resolve(g,b,_),!m.limit(k)))return{value:g,errors:v.$_createError("any.ref",k,{ref:N.args.limit,arg:"limit",reason:"must be a positive integer"},b,_)};g=g.slice(0,k)}}return{value:g}}},validate(g,{schema:v,error:b}){if(typeof g!="string")return{value:g,errors:b("string.base")};if(g===""){const _=v.$_getRule("min");return _&&_.args.limit===0?void 0:{value:g,errors:b("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return m.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:b})=>y.base64Regex[b.paddingRequired][b.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return a(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:b})=>b==="lower"&&g===g.toLocaleLowerCase()||b==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${b}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let b=g.length,_=0,R=1;for(;b--;){const P=g.charAt(b)*R;_+=P-9*(P>9),R^=3}return _>0&&_%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return m.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},a(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:b}){const _=g.match(y.dataUriRegex);return _&&(!_[2]||_[2]!=="base64"||y.base64Regex[b.paddingRequired].false.test(_[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&m.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,b,{address:_})=>c.isValid(g,_)?g:v.error("string.domain")},email:{method(g={}){m.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),b=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:b,address:v})},validate(g,v,{options:b},{regex:_,address:R}){const P=b.multiple?g.split(_):[g],T=[];for(const E of P)u.isValid(E,R)||T.push(E);return T.length?v.error("string.email",{value:g,invalids:T}):g}},guid:{alias:"uuid",method(g={}){m.assertOptions(g,["version","separator"]);let v="";if(g.version){const R=[].concat(g.version);a(R.length>=1,"version must have at least 1 valid version specified");const P=new Set;for(let T=0;T(b.prefix==="optional"?y.hexRegex.withOptionalPrefix:b.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?b.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){m.assertOptions(g,["cidr","version"]);const{cidr:v,versions:b,regex:_}=f.regex(g),R=g.version?b:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:R}},regex:_})},validate:(g,v,{options:b},{regex:_})=>_.test(g)?g:b.version?v.error("string.ipVersion",{value:g,cidr:b.cidr,version:b.version}):v.error("string.ip",{value:g,cidr:b.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:b,encoding:_},{name:R,operator:P,args:T}){const E=!_&&g.length;return m.compare(E,b,P)?g:v.error("string."+R,{limit:T.limit,value:g,encoding:_})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return a(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:b})=>g===g.normalize(b)?g:v("string.normalize",{value:g,form:b}),convert:!0},pattern:{alias:"regex",method(g,v={}){a(g instanceof RegExp,"regex must be a RegExp"),a(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),m.assertOptions(v,["invert","name"]);const b=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:b})},validate:(g,v,{regex:b,options:_},{errorCode:R})=>b.test(g)^_.invert?g:v.error(R,{name:_.name,regex:b,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),a(g instanceof RegExp,"pattern must be a RegExp"),a(typeof v=="string","replacement must be a String");const b=this.clone();return b.$_terms.replacements||(b.$_terms.replacements=[]),b.$_terms.replacements.push({pattern:g,replacement:v}),b}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:b})=>b&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return a(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){m.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&m.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:b}=p.regex(g),_=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:_,scheme:b})},validate(g,v,{options:b},{regex:_,domain:R,scheme:P}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let T=_.exec(g);if(!T&&v.prefs.convert&&b.encodeUri){const E=encodeURI(g);T=_.exec(E),T&&(g=E)}if(T){const E=T[1]||T[2];return!R||b.allowRelative&&!E||c.isValid(E,R)?g:v.error("string.domain",{value:E})}return b.relativeOnly?v.error("string.uriRelativeOnly"):b.scheme?v.error("string.uriCustomScheme",{scheme:P,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:b,replacement:_}of v.replacements)g=g.replace(b,_);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(a(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);a(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),a(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const b=g.tlds.allow;return b?b===!0?(a(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(b)&&(g=Object.assign({},g,{tlds:{allow:new Set(b)}})),a(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const b of g)a(c.isValid(b,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!m.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,b,_,R){return a(!R||!1,"Invalid encoding:",R),g.$_addRule({name:v,method:"length",args:{limit:b,encoding:R},operator:_})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const p=l.$_terms.map.get(f);return p&&(f=p),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),a(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const p of f){a(p&&p[Symbol.iterator],"Entry must be an iterable");const[h,m]=p;a(typeof h!="object"&&typeof h!="function"&&typeof h!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),l.$_terms.map.set(h,m),d.push(m)}return l.valid(...d)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),u=o(738),f=o(9621),l=o(8160),d=o(6354),p=o(493),h={result:Symbol("result")};i.entry=function(m,y,g){let v=l.defaults;g&&(a(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const b=h.entry(m,y,v);a(!b.mainstay.externals.length,"Schema with external rules must use validateAsync()");const _={value:b.value};return b.error&&(_.error=b.error),b.mainstay.warnings.length&&(_.warning=d.details(b.mainstay.warnings)),b.mainstay.debug&&(_.debug=b.mainstay.debug),b.mainstay.artifacts&&(_.artifacts=b.mainstay.artifacts),_},i.entryAsync=async function(m,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const b=h.entry(m,y,v),_=b.mainstay;if(b.error)throw _.debug&&(b.error.debug=_.debug),b.error;if(_.externals.length){let P=b.value;const T=[];for(const E of _.externals){const N=E.state.path,k=E.schema.type==="link"?_.links.get(E.schema):null;let M,I,j=P;const L=N.length?[P]:[],U=N.length?f(m,N):m;if(N.length){M=N[N.length-1];let K=P;for(const H of N.slice(0,-1))K=K[H],L.unshift(K);I=L[0],j=I[M]}try{const K=(q,ee)=>(k||E.schema).$_createError(q,j,ee,E.state,v),H=await E.method(j,{schema:E.schema,linked:k,state:E.state,prefs:g,original:U,error:K,errorsArray:h.errorsArray,warn:(q,ee)=>_.warnings.push((k||E.schema).$_createError(q,j,ee,E.state,v)),message:(q,ee)=>(k||E.schema).$_createError("external",j,ee,E.state,v,{messages:q})});if(H===void 0||H===j)continue;if(H instanceof d.Report){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(H),v.abortEarly)break;continue}if(Array.isArray(H)&&H[l.symbols.errors]){if(_.tracer.log(E.schema,E.state,"rule","external","error"),T.push(...H),v.abortEarly)break;continue}I?(_.tracer.value(E.state,"rule",j,H,"external"),I[M]=H):(_.tracer.value(E.state,"rule",P,H,"external"),P=H)}catch(K){throw v.errors.label&&(K.message+=` (${E.label})`),K}}if(b.value=P,T.length)throw b.error=d.process(T,m,v),_.debug&&(b.error.debug=_.debug),b.error}if(!v.warnings&&!v.debug&&!v.artifacts)return b.value;const R={value:b.value};return _.warnings.length&&(R.warning=d.details(_.warnings)),_.debug&&(R.debug=_.debug),_.artifacts&&(R.artifacts=_.artifacts),R},h.Mainstay=class{constructor(m,y,g){this.externals=[],this.warnings=[],this.tracer=m,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const m=this._snapshots.pop();this.externals=m.externals,this.warnings=m.warnings}commit(){this._snapshots.pop()}},h.entry=function(m,y,g){const{tracer:v,cleanup:b}=h.tracer(y,g),_=g.debug?[]:null,R=y._ids._schemaChain?new Map:null,P=new h.Mainstay(v,_,R),T=y._ids._schemaChain?[{schema:y}]:null,E=new p([],[],{mainstay:P,schemas:T}),N=i.validate(m,y,E,g);b&&y.$_root.untrace();const k=d.process(N.errors,m,g);return{value:N.value,error:k,mainstay:P}},h.tracer=function(m,y){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:y.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:h.ignore}},i.validate=function(m,y,g,v,b={}){if(y.$_terms.whens&&(y=y._generate(m,g,v).schema),y._preferences&&(v=h.prefs(y,v)),y._cache&&v.cache){const k=y._cache.get(m);if(g.mainstay.tracer.debug(g,"validate","cached",!!k),k)return k}const _=(k,M,I)=>y.$_createError(k,m,M,I||g,v),R={original:m,prefs:v,schema:y,state:g,error:_,errorsArray:h.errorsArray,warn:(k,M,I)=>g.mainstay.warnings.push(_(k,M,I)),message:(k,M)=>y.$_createError("custom",m,M,g,v,{messages:k})};g.mainstay.tracer.entry(y,g);const P=y._definition;if(P.prepare&&m!==void 0&&v.convert){const k=P.prepare(m,R);if(k){if(g.mainstay.tracer.value(g,"prepare",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),R);m=k.value}}if(P.coerce&&m!==void 0&&v.convert&&(!P.coerce.from||P.coerce.from.includes(typeof m))){const k=P.coerce.method(m,R);if(k){if(g.mainstay.tracer.value(g,"coerced",m,k.value),k.errors)return h.finalize(k.value,[].concat(k.errors),R);m=k.value}}const T=y._flags.empty;T&&T.$_match(h.trim(m,y),g.nest(T),l.defaults)&&(g.mainstay.tracer.value(g,"empty",m,void 0),m=void 0);const E=b.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(m===void 0){if(E==="forbidden")return h.finalize(m,null,R);if(E==="required")return h.finalize(m,[y.$_createError("any.required",m,null,g,v)],R);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return h.finalize(m,null,R);g.mainstay.tracer.value(g,"default",m,{}),m={}}}else if(E==="forbidden")return h.finalize(m,[y.$_createError("any.unknown",m,null,g,v)],R);const N=[];if(y._valids){const k=y._valids.get(m,g,v,y._flags.insensitive);if(k)return v.convert&&(g.mainstay.tracer.value(g,"valids",m,k.value),m=k.value),g.mainstay.tracer.filter(y,g,"valid",k),h.finalize(m,null,R);if(y._flags.only){const M=y.$_createError("any.only",m,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],R);N.push(M)}}if(y._invalids){const k=y._invalids.get(m,g,v,y._flags.insensitive);if(k){g.mainstay.tracer.filter(y,g,"invalid",k);const M=y.$_createError("any.invalid",m,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return h.finalize(m,[M],R);N.push(M)}}if(P.validate){const k=P.validate(m,R);if(k&&(g.mainstay.tracer.value(g,"base",m,k.value),m=k.value,k.errors)){if(!Array.isArray(k.errors))return N.push(k.errors),h.finalize(m,N,R);if(k.errors.length)return N.push(...k.errors),h.finalize(m,N,R)}}return y._rules.length?h.rules(m,N,R):h.finalize(m,N,R)},h.rules=function(m,y,g){const{schema:v,state:b,prefs:_}=g;for(const R of v._rules){const P=v._definition.rules[R.method];if(P.convert&&_.convert){b.mainstay.tracer.log(v,b,"rule",R.name,"full");continue}let T,E=R.args;if(R._resolve.length){E=Object.assign({},E);for(const k of R._resolve){const M=P.argsByName.get(k),I=E[k].resolve(m,b,_),j=M.normalize?M.normalize(I):I,L=l.validateArg(j,null,M);if(L){T=v.$_createError("any.ref",I,{arg:k,ref:E[k],reason:L},b,_);break}E[k]=j}}T=T||P.validate(m,g,E,R);const N=h.rule(T,R);if(N.errors){if(b.mainstay.tracer.log(v,b,"rule",R.name,"error"),R.warn){b.mainstay.warnings.push(...N.errors);continue}if(_.abortEarly)return h.finalize(m,N.errors,g);y.push(...N.errors)}else b.mainstay.tracer.log(v,b,"rule",R.name,"pass"),b.mainstay.tracer.value(b,"rule",m,N.value,R.name),m=N.value}return h.finalize(m,y,g)},h.rule=function(m,y){return m instanceof d.Report?(h.error(m,y),{errors:[m],value:null}):Array.isArray(m)&&m[l.symbols.errors]?(m.forEach(g=>h.error(g,y)),{errors:m,value:null}):{errors:null,value:m}},h.error=function(m,y){return y.message&&m._setTemplate(y.message),m},h.finalize=function(m,y,g){y=y||[];const{schema:v,state:b,prefs:_}=g;if(y.length){const P=h.default("failover",void 0,y,g);P!==void 0&&(b.mainstay.tracer.value(b,"failover",m,P),m=P,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const P of y)a(P instanceof Error||P instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(m===void 0){const P=h.default("default",m,y,g);b.mainstay.tracer.value(b,"default",m,P),m=P}if(v._flags.cast&&m!==void 0){const P=v._definition.cast[v._flags.cast];if(P.from(m)){const T=P.to(m,g);b.mainstay.tracer.value(b,"cast",m,T,v._flags.cast),m=T}}if(v.$_terms.externals&&_.externals&&_._externals!==!1)for(const{method:P}of v.$_terms.externals)b.mainstay.externals.push({method:P,schema:v,state:b,label:d.label(v._flags,b,_)});const R={value:m,errors:y.length?y:null};return v._flags.result&&(R.value=v._flags.result==="strip"?void 0:g.original,b.mainstay.tracer.value(b,v._flags.result,m,R.value),b.shadow(m,v._flags.result)),v._cache&&_.cache!==!1&&!v._refs.length&&v._cache.set(g.original,R),m===void 0||R.errors||v._flags.artifact===void 0||(b.mainstay.artifacts=b.mainstay.artifacts||new Map,b.mainstay.artifacts.has(v._flags.artifact)||b.mainstay.artifacts.set(v._flags.artifact,[]),b.mainstay.artifacts.get(v._flags.artifact).push(b.path)),R},h.prefs=function(m,y){const g=y===l.defaults;return g&&m._preferences[l.symbols.prefs]?m._preferences[l.symbols.prefs]:(y=l.preferences(y,m._preferences),g&&(m._preferences[l.symbols.prefs]=y),y)},h.default=function(m,y,g,v){const{schema:b,state:_,prefs:R}=v,P=b._flags[m];if(R.noDefaults||P===void 0)return y;if(_.mainstay.tracer.log(b,_,"rule",m,"full"),!P)return P;if(typeof P=="function"){const T=P.length?[c(_.ancestors[0]),v]:[];try{return P(...T)}catch(E){return void g.push(b.$_createError(`any.${m}`,null,{error:E},_,R))}}return typeof P!="object"?P:P[l.symbols.literal]?P.literal:l.isResolvable(P)?P.resolve(y,_,R):c(P)},h.trim=function(m,y){if(typeof m!="string")return m;const g=y.$_getRule("trim");return g&&g.args.enabled?m.trim():m},h.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},h.errorsArray=function(){const m=[];return m[l.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),u=o(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,p){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const h of[...d._values,...d._refs])l.add(h)}if(p)for(const h of[...p._values,...p._refs])l.remove(h);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,p,h){return!!this.get(l,d,p,h)}get(l,d,p,h){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&h){const m=this._lowercase.get(l.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const m of this._values)if(c(m,l))return{value:m}}if(d)for(const m of this._refs){const y=m.resolve(l,d,p,null,{in:!0});if(y===void 0)continue;const g=m.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(h&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:m}}else if(c(v,l))return{value:v,ref:m}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const p of[...this._values,...this._refs])p!==void 0&&d.push(p);return d}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){a(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const p of l)typeof p=="string"&&d.set(p.toLowerCase(),p);return d}},978:(s,i,o)=>{const a=o(375),c=o(8571),u=o(1687),f=o(9621),l={};s.exports=function(d,p,h={}){if(a(d&&typeof d=="object","Invalid defaults value: must be an object"),a(!p||p===!0||typeof p=="object","Invalid source value: must be true, falsy or an object"),a(typeof h=="object","Invalid options: must be an object"),!p)return null;if(h.shallow)return l.applyToDefaultsWithShallow(d,p,h);const m=c(d);if(p===!0)return m;const y=h.nullOverride!==void 0&&h.nullOverride;return u(m,p,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,p,h){const m=h.shallow;a(Array.isArray(m),"Invalid keys");const y=new Map,g=p===!0?null:new Set;for(let _ of m){_=Array.isArray(_)?_:_.split(".");const R=f(d,_);R&&typeof R=="object"?y.set(R,g&&f(p,_)||R):g&&g.add(_)}const v=c(d,{},y);if(!g)return v;for(const _ of g)l.reachCopy(v,p,_);const b=h.nullOverride!==void 0&&h.nullOverride;return u(v,p,{nullOverride:b,mergeArrays:!1})},l.reachCopy=function(d,p,h){for(const g of h){if(!(g in p))return;const v=p[g];if(typeof v!="object"||v===null)return;p=v}const m=p;let y=d;for(let g=0;g{const a=o(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new a(u)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),u=o(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},p=null){if(typeof l!="object"||l===null)return l;let h=f.clone,m=p;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);h=b=>b}else if(m){const b=m.get(l);if(b)return b}else m=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(m&&m.set(l,g),y===c.set)for(const b of l)g.add(h(b,d,m));else if(y===c.map)for(const[b,_]of l)g.set(b,h(_,d,m));const v=u.keys(l,d);for(const b of v){if(b==="__proto__")continue;if(y===c.array&&b==="length"){g.length=l.length;continue}const _=Object.getOwnPropertyDescriptor(l,b);_?_.get||_.set?Object.defineProperty(g,b,_):_.enumerable?g[b]=h(l[b],d,m):Object.defineProperty(g,b,{enumerable:!1,writable:!0,configurable:!0,value:h(l[b],d,m)}):Object.defineProperty(g,b,{enumerable:!0,writable:!0,configurable:!0,value:h(l[b],d,m)})}return g},f.cloneWithShallow=function(l,d){const p=d.shallow;(d=Object.assign({},d)).shallow=!1;const h=new Map;for(const m of p){const y=a(l,m);typeof y!="object"&&typeof y!="function"||h.set(y,y)}return f.clone(l,d,h)},f.base=function(l,d,p){if(p.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const h=Object.getPrototypeOf(l);if(h&&h.isImmutable)return l;if(d===c.array){const m=[];return h!==d&&Object.setPrototypeOf(m,h),m}if(f.needsProtoHack.has(d)){const m=new h.constructor;return h!==d&&Object.setPrototypeOf(m,h),m}return Object.create(h)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const p=typeof u;if(p!==typeof f||u===null||f===null)return!1;if(p==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(p!=="object")return u!=u&&f!=f;const h=c.getSharedType(u,f,!!l.prototype);switch(h){case a.buffer:return!1;case a.promise:return u===f;case a.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let m=d.length-1;m>=0;--m)if(d[m].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(h,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:a.getInternalProto(u);const d=a.getInternalProto(u);return d!==a.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,p){const{isDeepEqual:h,valueOf:m,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===a.array){if(!d.part){if(f.length!==l.length)return!1;for(let T=0;T{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:a(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c=256?"&#"+o+";":`&#x${o.toString(16).padStart(2,"0")};`)},i.isSafe=function(o){return i.safeCharCodes.has(o)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const o=new Set;for(let a=32;a<123;++a)(a>=97||a>=65&&a<=90||a>=48&&a<=57||a===32||a===46||a===44||a===45||a===58||a===95)&&o.add(a);return o}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,o)=>{const a=o(375),c=o(8571),u=o(7043),f={};s.exports=f.merge=function(l,d,p){if(a(l&&typeof l=="object","Invalid target value: must be an object"),a(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(p=Object.assign({nullOverride:!0,mergeArrays:!0},p),Array.isArray(d)){a(Array.isArray(l),"Cannot merge array onto an object"),p.mergeArrays||(l.length=0);for(let m=0;m{const a=o(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);a(!d||!l.separator,"Separator option is not valid for array-based chain");const p=d?f:f.split(l.separator||".");let h=u;for(let m=0;m{s.exports=function(...i){try{return JSON.stringify(...i)}catch(o){return"[Cannot display object: "+o.message+"]"}}},4277:(s,i)=>{const o={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},o.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(a){if(Array.isArray(a))return i.array;if(a instanceof Date)return i.date;if(a instanceof RegExp)return i.regex;if(a instanceof Error)return i.error;const c=Object.prototype.toString.call(a);return o.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(o,a={}){return a.symbols!==!1?Reflect.ownKeys(o):Object.getOwnPropertyNames(o)}},3652:(s,i,o)=>{const a=o(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),p=f.group||"?",h=f.sort||0;a(!l.includes(p),`Item cannot come before itself: ${p}`),a(!l.includes("?"),"Item cannot come before unassociated items"),a(!d.includes(p),`Item cannot come after itself: ${p}`),a(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const m of u){const y={seq:this._items.length,sort:h,before:l,after:d,group:p,node:m};this._items.push(y)}if(!f.manual){const m=this._sort();a(m,"item",p!=="?"?`added into group ${p}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const a=o(443),c=o(2178),u={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,p=f.split(".");if(p.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const h=l.tlds;if(h){const m=p[p.length-1].toLowerCase();if(h.deny&&h.deny.has(m)||h.allow&&!h.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m63)return c.code("DOMAIN_LONG_SEGMENT");if(m{const a=o(9848),c=o(5380),u=o(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const p=!f.nonAsciiRx.test(l);if(!p){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const h=l.split("@");if(h.length!==2)return h.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[m,y]=h;if(!m)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(m).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(m,p)||c.analyze(y,d)},f.local=function(l,d){const p=l.split(".");for(const h of p){if(!h.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(h))return u.code("INVALID_LOCAL_CHARS")}else for(const m of h){if(f.atextRx.test(m))continue;const y=f.binary(m);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(u={}){a(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),a(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),a(l.length>=1,"options.version must have at least 1 version specified");for(let h=0;h{if(f==="forbidden")return c.ip[h];const m=`\\/${h==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[h]}${m}`:`${c.ip[h]}(?:${m})?`}).join("|")})`,p=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:p,raw:d}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",p="\\w-\\.~",h="!\\$&'\\(\\)\\*\\+,;=",m="%"+l,y=p+m+h+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const b=d+"{1,4}",_="(?:"+b+":"+b+"|"+f.ipv4address+")",R="(?:"+b+":){6}"+_,P="::(?:"+b+":){5}"+_,T="(?:"+b+")?::(?:"+b+":){4}"+_,E="(?:(?:"+b+":){0,1}"+b+")?::(?:"+b+":){3}"+_,N="(?:(?:"+b+":){0,2}"+b+")?::(?:"+b+":){2}"+_,k="(?:(?:"+b+":){0,3}"+b+")?::"+b+":"+_,M="(?:(?:"+b+":){0,4}"+b+")?::"+_,I="(?:(?:"+b+":){0,5}"+b+")?::"+b,j="(?:(?:"+b+":){0,6}"+b+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+R+"|"+P+"|"+T+"|"+E+"|"+N+"|"+k+"|"+M+"|"+I+"|"+j+")",f.ipvFuture="v"+d+"+\\.["+p+h+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const L="["+p+m+h+":]*",U="["+p+m+h+"]{1,255}",K="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",H="(?:"+L+"@)?"+K+"(?::\\d*)?",q="(?:"+L+"@)?("+K+")(?::\\d*)?",ee=g+"*",se=g+"+",X="(?:\\/"+ee+")*",G="\\/(?:"+se+X+")?",Y=se+X,Q="["+p+m+h+"@]+"+X,he="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+H+X+")|"+G+"|"+Y+"|"+he+")",f.hierPartCapture="(?:(?:\\/\\/"+q+X+")|"+G+"|"+Y+")",f.relativeRef="(?:(?:\\/\\/"+H+X+")|"+G+"|"+Q+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+q+X+")|"+G+"|"+Q+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",p=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(p+d);let h="";if(f.scheme){a(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);a(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let b=0;b{const o={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(a,c={}){if(!c[o.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],u="",f=0,l=!1;const d=h=>{if(f)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(l||u||h){if(m&&m.type==="reference"&&h===")")return m.type="function",m.value=this._subFormula(u,m.value),void(u="");if(h===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(o.operatorCharacters.includes(u))m&&m.type==="operator"&&o.operators.includes(m.value+u)?m.value+=u:c.push({type:"operator",value:u});else if(u.match(o.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const h of a)l?h===l?(d(),l=!1):u+=h:f?h==="("?(u+=h,++f):h===")"?(--f,f?u+=h:d(h)):u+=h:h in o.literals?l=o.literals[h]:h==="("?(d(),++f):o.operatorCharacters.includes(h)?(d(),u=h,d()):h!==" "?u+=h:d();d(),c=c.map((h,m)=>h.type!=="operator"||h.value!=="-"||m&&c[m-1].type!=="operator"?h:{type:"operator",value:"n"});let p=!1;for(const h of c){if(h.type==="operator"){if(o.operatorsPrefix.includes(h.value))continue;if(!p)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(h.value))throw new Error(`Formula contains an unknown operator ${h.value}`)}else if(p)throw new Error("Formula missing expected operator");p=!p}if(!p)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(h=>{if(h.type==="operator")return o.operatorsPrefix.includes(h.value)?h:h.value;if(h.type!=="reference")return h.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(h.value))throw new Error(`Formula contains invalid reference ${h.value}`);return this.settings.reference?this.settings.reference(h.value):o.reference(h.value)})}_subFormula(a,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(a){let l="",d=0,p=!1;const h=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);f.push(l),l=""};for(let m=0;mnew i.Parser(l,this.settings)),function(l){const d=[];for(const p of f)d.push(p.evaluate(l));return u.call(l,...d)}}evaluate(a){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=o.evaluate(l,a);c[u]=o.single(f.value,d)}}return o.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(eee);var zLe=eee.exports;const eu=xu(zLe),ey=()=>{const t=S.useContext(iJ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},BLe=()=>{const t=ey();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return tf({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},ULe=eu.object({incidence:eu.string().min(10).required().messages({"string.empty":"Debe escribir algo antes de enviar","string.min":"El texto es demasiado corto. Debe tener al menos 10 caracteres","string.max":"El texto es demasiado largo.","any.required":"La descripción es requerida"})});function HLe(){const[t,e]=S.useState(!1),[n,r]=S.useState(!1),{toast:s}=Kl(),{useSubmitIncidence:i}=BLe(),o=j_({mode:"onBlur",resolver:M$(ULe),defaultValues:{incidence:""}}),{handleSubmit:a,watch:c,reset:u}=o,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),e(!1),u()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),d=async m=>{l(m)},p=()=>{console.log("handleClose",f.trim()),f.trim()?r(!0):(e(!1),u())},h=()=>{r(!1),e(!1),u()};return w.jsxs(w.Fragment,{children:[w.jsxs(S_,{open:t,onOpenChange:e,children:[w.jsx(KL,{asChild:!0,children:w.jsxs(it,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[w.jsx(pq,{className:"w-5 h-5"}),w.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),w.jsxs(xy,{className:"sm:max-w-xl",children:[w.jsxs(wy,{className:"mb-2",children:[w.jsx(Sy,{children:re("support.modal.title")}),w.jsx(PA,{children:re("support.modal.subtitle")})]}),w.jsx(L_,{...o,children:w.jsxs("form",{onSubmit:a(d),className:"space-y-4",children:[w.jsx($a,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),w.jsxs(_y,{children:[w.jsx(it,{type:"button",variant:"outline",onClick:p,children:"Cancelar"}),w.jsx(it,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),w.jsx(EW,{open:n,onOpenChange:r,children:w.jsxs(yL,{children:[w.jsxs(bL,{children:[w.jsx(wL,{children:"¿Estás seguro de que quieres cancelar?"}),w.jsx(_L,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),w.jsxs(xL,{children:[w.jsx(CL,{onClick:()=>r(!1),children:"Volver al formulario"}),w.jsx(SL,{onClick:h,children:"Sí, cerrar"})]})]})})]})}var VLe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const qLe=xu(VLe);var WLe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function TU(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(qLe[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(WLe),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var GLe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,KLe=/^\s*$/,YLe=Object.create(null);function tee(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(tee,"")+"";case"comment":return t+""}}var XLe={parse:function(t,e){e||(e={}),e.components||(e.components=YLe);var n,r=[],s=[],i=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(GLe,function(c,u){if(o){if(c!=="")return;o=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(WLe),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var GLe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,KLe=/^\s*$/,YLe=Object.create(null);function tee(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(tee,"")+"";case"comment":return t+""}}var XLe={parse:function(t,e){e||(e={}),e.components||(e.components=YLe);var n,r=[],s=[],i=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(GLe,function(c,u){if(o){if(c!=="")return;o=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("