@cosmicstack/mercury-agent 1.1.13 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/index.js +27245 -21727
- package/dist/index.js.map +1 -1
- package/dist/web/ui/assets/Chat-CajL8sV3.js +27 -0
- package/dist/web/ui/assets/{Dashboard-1rlAqQ-Y.js → Dashboard-ClnaDoDG.js} +1 -2
- package/dist/web/ui/assets/{Goals-CgSUAXLH.js → Goals-Rm3s3OGd.js} +1 -2
- package/dist/web/ui/assets/{Graph-DnlOWkay.js → Graph-hYGmN5vp.js} +1 -2
- package/dist/web/ui/assets/{Kanban-DRlNiNRF.js → Kanban-BK_Oi6am.js} +1 -2
- package/dist/web/ui/assets/{Login-BP5524pC.js → Login-Bl8tq7KA.js} +1 -2
- package/dist/web/ui/assets/MarkdownRenderer-DKGKZih7.js +21 -0
- package/dist/web/ui/assets/{Memory-BOQEY0H8.js → Memory-kKRHTUyC.js} +1 -2
- package/dist/web/ui/assets/{Permissions-jbFH-toa.js → Permissions-CDRBOdMO.js} +1 -2
- package/dist/web/ui/assets/{PersonDetail-Ca8B9io8.js → PersonDetail-DLbZBUS0.js} +1 -2
- package/dist/web/ui/assets/{Persons-epdmUeBM.js → Persons-C-GjzdmT.js} +1 -2
- package/dist/web/ui/assets/{Providers-Bm8sZNZo.js → Providers-L32issLd.js} +1 -2
- package/dist/web/ui/assets/{Schedules-BZKhm9R7.js → Schedules-BvGLrPPD.js} +1 -2
- package/dist/web/ui/assets/{Settings-Hii-5oku.js → Settings-BP9_1JW3.js} +1 -2
- package/dist/web/ui/assets/{Skills-BHJp2CgD.js → Skills-CvXlgjZK.js} +1 -2
- package/dist/web/ui/assets/{Tasks-D36pqkro.js → Tasks-XcAVd2Ff.js} +1 -2
- package/dist/web/ui/assets/{Usage-CmjaYrsT.js → Usage--2hxK31f.js} +1 -2
- package/dist/web/ui/assets/{Workspace-BYLf-wTJ.js → Workspace-BPChIyBc.js} +11 -12
- package/dist/web/ui/assets/{activity-MOTqH8zM.js → activity-CDTOZzUZ.js} +1 -2
- package/dist/web/ui/assets/{alert-dialog-MbYSbZx5.js → alert-dialog-B3JUwsIN.js} +1 -2
- package/dist/web/ui/assets/{arrow-left-CtqQsBC6.js → arrow-left-CkDXNwR2.js} +1 -2
- package/dist/web/ui/assets/{avatar-BIYaY7pR.js → avatar-NU204zr9.js} +1 -2
- package/dist/web/ui/assets/{badge-CUJiWF1y.js → badge-DpVeNL8j.js} +1 -2
- package/dist/web/ui/assets/{button-CNasMlFE.js → button-V3Fu7_kO.js} +1 -2
- package/dist/web/ui/assets/{card-BdsEOP7t.js → card-CjAvp22k.js} +1 -2
- package/dist/web/ui/assets/{chevron-down-CB9J_vvZ.js → chevron-down-C66c9kfo.js} +1 -2
- package/dist/web/ui/assets/{circle-check-DvGSe1uZ.js → circle-check-Cch4Kwja.js} +1 -2
- package/dist/web/ui/assets/{circle-x-CyaGJ_BM.js → circle-x-DK0DQPGB.js} +1 -2
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js +0 -1
- package/dist/web/ui/assets/{dialog-Bd1rELXb.js → dialog-FHqlAspv.js} +1 -2
- package/dist/web/ui/assets/{download-C8RvlFqO.js → download-D73EX-Ki.js} +1 -2
- package/dist/web/ui/assets/{eye-BJ0NucMz.js → eye-CxEb5_L8.js} +1 -2
- package/dist/web/ui/assets/{file-text-BWWBuD_N.js → file-text-CDTjVG9h.js} +1 -2
- package/dist/web/ui/assets/{folder-open-BwjemFy7.js → folder-open-CF5wm-xS.js} +1 -2
- package/dist/web/ui/assets/{git-branch-D9JVASpC.js → git-branch-CYWJZoQx.js} +1 -2
- package/dist/web/ui/assets/{index-C3YiF4qv.js → index-B1xAjISP.js} +4 -5
- package/dist/web/ui/assets/{index-CaqLZNof.js → index-CufYpqmV.js} +1 -2
- package/dist/web/ui/assets/{input-CH3dmo9r.js → input-CF6e2HL4.js} +1 -2
- package/dist/web/ui/assets/{loader-circle-DbYKk0_Q.js → loader-circle-CJko6bz6.js} +1 -2
- package/dist/web/ui/assets/{pencil-gNDEMhav.js → pencil-DGvW-dl_.js} +1 -2
- package/dist/web/ui/assets/{plus-7rbHkByr.js → plus-DhHrgqcD.js} +1 -2
- package/dist/web/ui/assets/{power-BS7gCDWs.js → power-BFKfrVvI.js} +1 -2
- package/dist/web/ui/assets/{progress-ZzhsBV2v.js → progress-CsRtYJ3t.js} +1 -2
- package/dist/web/ui/assets/{search-BZsbhO0B.js → search-BwE8vRR_.js} +1 -2
- package/dist/web/ui/assets/{select-vRSgBrHz.js → select-Xy3UJnp-.js} +1 -2
- package/dist/web/ui/assets/{send-BkyTIUtJ.js → send-DHy23R-c.js} +1 -2
- package/dist/web/ui/assets/{sparkles-DcP24GEL.js → sparkles-wNQvP7So.js} +1 -2
- package/dist/web/ui/assets/{switch-LRN9wWy2.js → switch-CGgMESDf.js} +1 -2
- package/dist/web/ui/assets/{terminal-CWG62zdD.js → terminal-BvZc6N0C.js} +1 -2
- package/dist/web/ui/assets/{textarea-CXh3tmJ1.js → textarea-BTxEQ_C2.js} +1 -2
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js +0 -1
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js +0 -1
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js +0 -1
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js +0 -1
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js +0 -1
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js +0 -1
- package/dist/web/ui/assets/{zap-BEfqVtvZ.js → zap-CK8xUBKc.js} +1 -2
- package/dist/web/ui/index.html +1 -1
- package/dist/web/ui/workbox-0bb07689.js +1 -0
- package/package.json +3 -1
- package/dist/web/ui/assets/Chat-DXSn2dY8.js +0 -28
- package/dist/web/ui/assets/Chat-DXSn2dY8.js.map +0 -1
- package/dist/web/ui/assets/Dashboard-1rlAqQ-Y.js.map +0 -1
- package/dist/web/ui/assets/Goals-CgSUAXLH.js.map +0 -1
- package/dist/web/ui/assets/Graph-DnlOWkay.js.map +0 -1
- package/dist/web/ui/assets/Kanban-DRlNiNRF.js.map +0 -1
- package/dist/web/ui/assets/Login-BP5524pC.js.map +0 -1
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js +0 -22
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js.map +0 -1
- package/dist/web/ui/assets/Memory-BOQEY0H8.js.map +0 -1
- package/dist/web/ui/assets/Permissions-jbFH-toa.js.map +0 -1
- package/dist/web/ui/assets/PersonDetail-Ca8B9io8.js.map +0 -1
- package/dist/web/ui/assets/Persons-epdmUeBM.js.map +0 -1
- package/dist/web/ui/assets/Providers-Bm8sZNZo.js.map +0 -1
- package/dist/web/ui/assets/Schedules-BZKhm9R7.js.map +0 -1
- package/dist/web/ui/assets/Settings-Hii-5oku.js.map +0 -1
- package/dist/web/ui/assets/Skills-BHJp2CgD.js.map +0 -1
- package/dist/web/ui/assets/Tasks-D36pqkro.js.map +0 -1
- package/dist/web/ui/assets/Usage-CmjaYrsT.js.map +0 -1
- package/dist/web/ui/assets/Workspace-BYLf-wTJ.js.map +0 -1
- package/dist/web/ui/assets/activity-MOTqH8zM.js.map +0 -1
- package/dist/web/ui/assets/alert-dialog-MbYSbZx5.js.map +0 -1
- package/dist/web/ui/assets/arrow-left-CtqQsBC6.js.map +0 -1
- package/dist/web/ui/assets/avatar-BIYaY7pR.js.map +0 -1
- package/dist/web/ui/assets/badge-CUJiWF1y.js.map +0 -1
- package/dist/web/ui/assets/button-CNasMlFE.js.map +0 -1
- package/dist/web/ui/assets/card-BdsEOP7t.js.map +0 -1
- package/dist/web/ui/assets/chevron-down-CB9J_vvZ.js.map +0 -1
- package/dist/web/ui/assets/circle-check-DvGSe1uZ.js.map +0 -1
- package/dist/web/ui/assets/circle-x-CyaGJ_BM.js.map +0 -1
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js.map +0 -1
- package/dist/web/ui/assets/dialog-Bd1rELXb.js.map +0 -1
- package/dist/web/ui/assets/download-C8RvlFqO.js.map +0 -1
- package/dist/web/ui/assets/eye-BJ0NucMz.js.map +0 -1
- package/dist/web/ui/assets/file-text-BWWBuD_N.js.map +0 -1
- package/dist/web/ui/assets/folder-open-BwjemFy7.js.map +0 -1
- package/dist/web/ui/assets/git-branch-D9JVASpC.js.map +0 -1
- package/dist/web/ui/assets/index-C3YiF4qv.js.map +0 -1
- package/dist/web/ui/assets/index-CaqLZNof.js.map +0 -1
- package/dist/web/ui/assets/input-CH3dmo9r.js.map +0 -1
- package/dist/web/ui/assets/loader-circle-DbYKk0_Q.js.map +0 -1
- package/dist/web/ui/assets/pencil-gNDEMhav.js.map +0 -1
- package/dist/web/ui/assets/plus-7rbHkByr.js.map +0 -1
- package/dist/web/ui/assets/power-BS7gCDWs.js.map +0 -1
- package/dist/web/ui/assets/progress-ZzhsBV2v.js.map +0 -1
- package/dist/web/ui/assets/search-BZsbhO0B.js.map +0 -1
- package/dist/web/ui/assets/select-vRSgBrHz.js.map +0 -1
- package/dist/web/ui/assets/send-BkyTIUtJ.js.map +0 -1
- package/dist/web/ui/assets/sparkles-DcP24GEL.js.map +0 -1
- package/dist/web/ui/assets/switch-LRN9wWy2.js.map +0 -1
- package/dist/web/ui/assets/terminal-CWG62zdD.js.map +0 -1
- package/dist/web/ui/assets/textarea-CXh3tmJ1.js.map +0 -1
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js.map +0 -1
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js.map +0 -1
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js.map +0 -1
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js.map +0 -1
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js.map +0 -1
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js.map +0 -1
- package/dist/web/ui/assets/zap-BEfqVtvZ.js.map +0 -1
|
@@ -3,4 +3,3 @@ import{r as l,c as I,a as Te}from"./vendor-react-C7pctHW3.js";function Rn(){for(
|
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
5
|
`},Bn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Fn(e){let{announcements:t=Bn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=zn}=e;const{announce:i,announcement:s}=Ln(),a=$e("DndLiveRegion"),[c,u]=l.useState(!1);if(l.useEffect(()=>{u(!0)},[]),kn(l.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;i(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;i(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const d=I.createElement(I.Fragment,null,I.createElement(Tn,{id:r,value:o.draggable}),I.createElement(Nn,{id:a,announcement:s}));return n?Te.createPortal(d,n):d}var N;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(N||(N={}));function et(){}function ho(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function vo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const q=Object.freeze({x:0,y:0});function $n(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Xn(e,t){const n=Ze(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Yn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Kn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Nt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const po=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Nt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=$n(Nt(c),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(jn)};function Un(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,d=s*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const Wn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const c=Un(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(Yn)};function Hn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Vt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:q}function Vn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const qn=Vn(1);function qt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Gn(e,t,n){const r=qt(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const Jn={ignoreTransform:!1};function De(e,t){t===void 0&&(t=Jn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=z(e).getComputedStyle(e);u&&(n=Gn(n,u,d))}const{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function Lt(e){return De(e,{ignoreTransform:!0})}function _n(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Qn(e,t){return t===void 0&&(t=z(e).getComputedStyle(e)),t.position==="fixed"}function Zn(e,t){t===void 0&&(t=z(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function yt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(mt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||Ut(o)||n.includes(o))return n;const i=z(e).getComputedStyle(o);return o!==e&&Zn(o,i)&&n.push(o),Qn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Gt(e){const[t]=yt(e,1);return t??null}function dt(e){return!nt||!e?null:we(e)?e:bt(e)?mt(e)||e===xe(e).scrollingElement?window:Be(e)?e:null:null}function Jt(e){return we(e)?e.scrollX:e.scrollLeft}function _t(e){return we(e)?e.scrollY:e.scrollTop}function ht(e){return{x:Jt(e),y:_t(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function Qt(e){return!nt||!e?!1:e===document.scrollingElement}function Zt(e){const t={x:0,y:0},n=Qt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const er={x:.2,y:.2};function tr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=er);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=Zt(e),g={x:0,y:0},D={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=L.Backward,D.y=r*Math.abs((t.top+v.height-i)/v.height)):!d&&c>=t.bottom-v.height&&(g.y=L.Forward,D.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!h&&a>=t.right-v.width?(g.x=L.Forward,D.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(g.x=L.Backward,D.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:D}}function nr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function en(e){return e.reduce((t,n)=>ye(t,ht(n)),q)}function rr(e){return e.reduce((t,n)=>t+Jt(n),0)}function or(e){return e.reduce((t,n)=>t+_t(n),0)}function tn(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Gt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ir=[["x",["left","right"],rr],["y",["top","bottom"],or]];class wt{constructor(t,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=yt(n),o=en(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of ir)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=a(r),d=o[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ne{constructor(t){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=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function sr(e){const{EventTarget:t}=z(e);return e instanceof t?e:xe(e)}function ft(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var U;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(U||(U={}));function kt(e){e.preventDefault()}function ar(e){e.stopPropagation()}var R;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(R||(R={}));const nn={start:[R.Space,R.Enter],cancel:[R.Esc],end:[R.Space,R.Enter,R.Tab]},lr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case R.Right:return{...n,x:n.x+25};case R.Left:return{...n,x:n.x-25};case R.Down:return{...n,y:n.y+25};case R.Up:return{...n,y:n.y-25}}};class rn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ne(xe(n)),this.windowListeners=new Ne(z(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(U.Resize,this.handleCancel),this.windowListeners.add(U.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(U.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&tn(r),n(q)}handleKeyDown(t){if(ot(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=nn,coordinateGetter:s=lr,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:q;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=Qe(f,d),g={x:0,y:0},{scrollableAncestors:D}=r.current;for(const v of D){const p=t.code,{isTop:b,isRight:y,isLeft:m,isBottom:C,maxScroll:S,minScroll:E}=Zt(v),w=nr(v),x={x:Math.min(p===R.Right?w.right-w.width/2:w.right,Math.max(p===R.Right?w.left:w.left+w.width/2,f.x)),y:Math.min(p===R.Down?w.bottom-w.height/2:w.bottom,Math.max(p===R.Down?w.top:w.top+w.height/2,f.y))},O=p===R.Right&&!y||p===R.Left&&!m,T=p===R.Down&&!C||p===R.Up&&!b;if(O&&x.x!==f.x){const M=v.scrollLeft+h.x,W=p===R.Right&&M<=S.x||p===R.Left&&M>=E.x;if(W&&!h.y){v.scrollTo({left:M,behavior:a});return}W?g.x=v.scrollLeft-M:g.x=p===R.Right?v.scrollLeft-S.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(T&&x.y!==f.y){const M=v.scrollTop+h.y,W=p===R.Down&&M<=S.y||p===R.Up&&M>=E.y;if(W&&!h.x){v.scrollTo({top:M,behavior:a});return}W?g.y=v.scrollTop-M:g.y=p===R.Down?v.scrollTop-S.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,ye(Qe(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}rn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Pt(e){return!!(e&&"distance"in e)}function zt(e){return!!(e&&"delay"in e)}class xt{constructor(t,n,r){var o;r===void 0&&(r=sr(t.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=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=xe(s),this.documentListeners=new Ne(this.document),this.listeners=new Ne(r),this.windowListeners=new Ne(z(s)),this.initialCoordinates=(o=Ze(i))!=null?o:q,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(U.Resize,this.handleCancel),this.windowListeners.add(U.DragStart,kt),this.windowListeners.add(U.VisibilityChange,this.handleCancel),this.windowListeners.add(U.ContextMenu,kt),this.documentListeners.add(U.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Pt(n)){this.handlePending(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)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(U.Click,ar,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(U.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=Ze(t))!=null?n:q,u=Qe(o,c);if(!r&&a){if(Pt(a)){if(a.tolerance!=null&&ft(u,a.tolerance))return this.handleCancel();if(ft(u,a.distance))return this.handleStart()}if(zt(a)&&ft(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===R.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class on extends xt{constructor(t){const{event:n}=t,r=xe(n.target);super(t,cr,r)}}on.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ur={move:{name:"mousemove"},end:{name:"mouseup"}};var vt;(function(e){e[e.RightClick=2]="RightClick"})(vt||(vt={}));class dr extends xt{constructor(t){super(t,ur,xe(t.event.target))}}dr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===vt.RightClick?!1:(r==null||r({event:n}),!0)}}];const gt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class fr extends xt{constructor(t){super(t,gt)}static setup(){return window.addEventListener(gt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(gt.move.name,t)};function t(){}}}fr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Le;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Le||(Le={}));var tt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(tt||(tt={}));function gr(e){let{acceleration:t,activator:n=Le.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=tt.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const g=vr({delta:f,disabled:!i}),[D,v]=En(),p=l.useRef({x:0,y:0}),b=l.useRef({x:0,y:0}),y=l.useMemo(()=>{switch(n){case Le.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Le.DraggableRect:return o}},[n,o,c]),m=l.useRef(null),C=l.useCallback(()=>{const E=m.current;if(!E)return;const w=p.current.x*b.current.x,x=p.current.y*b.current.y;E.scrollBy(w,x)},[]),S=l.useMemo(()=>a===tt.TreeOrder?[...u].reverse():u,[a,u]);l.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of S){if((r==null?void 0:r(E))===!1)continue;const w=u.indexOf(E),x=d[w];if(!x)continue;const{direction:O,speed:T}=tr(E,x,y,t,h);for(const M of["x","y"])g[M][O[M]]||(T[M]=0,O[M]=0);if(T.x>0||T.y>0){v(),m.current=E,D(C,s),p.current=T,b.current=O;return}}p.current={x:0,y:0},b.current={x:0,y:0},v()},[t,C,r,v,i,s,JSON.stringify(y),JSON.stringify(g),D,u,S,d,JSON.stringify(h)])}const hr={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function vr(e){let{delta:t,disabled:n}=e;const r=_e(t);return Fe(o=>{if(n||!r||!o)return hr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||i.x===-1,[L.Forward]:o.x[L.Forward]||i.x===1},y:{[L.Backward]:o.y[L.Backward]||i.y===-1,[L.Forward]:o.y[L.Forward]||i.y===1}}},[n,t,r])}function pr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function br(e,t){return l.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ze||(ze={}));var pt;(function(e){e.Optimized="optimized"})(pt||(pt={}));const Bt=new Map;function mr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=l.useState(null),{frequency:a,measure:c,strategy:u}=o,d=l.useRef(e),f=p(),h=Pe(f),g=l.useCallback(function(b){b===void 0&&(b=[]),!h.current&&s(y=>y===null?b:y.concat(b.filter(m=>!y.includes(m))))},[h]),D=l.useRef(null),v=Fe(b=>{if(f&&!n)return Bt;if(!b||b===Bt||d.current!==e||i!=null){const y=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){y.set(m.id,m.rect.current);continue}const C=m.node.current,S=C?new wt(c(C),C):null;m.rect.current=S,S&&y.set(m.id,S)}return y}return b},[e,i,n,f,c]);return l.useEffect(()=>{d.current=e},[e]),l.useEffect(()=>{f||g()},[n,f]),l.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),l.useEffect(()=>{f||typeof a!="number"||D.current!==null||(D.current=setTimeout(()=>{g(),D.current=null},a))},[a,f,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case ze.Always:return!1;case ze.BeforeDragging:return n;default:return!n}}}function Dt(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function yr(e,t){return Dt(e,t)}function wr(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function it(e){let{callback:t,disabled:n}=e;const r=rt(t),o=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return l.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function xr(e){return new wt(De(e),e)}function Ft(e,t,n){t===void 0&&(t=xr);const[r,o]=l.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const s=wr({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=it({callback:i});return V(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function Dr(e){const t=Dt(e);return Vt(e,t)}const $t=[];function Cr(e){const t=l.useRef(e),n=Fe(r=>e?r&&r!==$t&&e&&t.current&&e.parentNode===t.current.parentNode?r:yt(e):$t,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function Sr(e){const[t,n]=l.useState(null),r=l.useRef(e),o=l.useCallback(i=>{const s=dt(i.target);s&&n(a=>a?(a.set(s,ht(s)),new Map(a)):null)},[]);return l.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(c=>{const u=dt(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,ht(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{const u=dt(c);u==null||u.removeEventListener("scroll",o)})}},[o,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),q):en(e):q,[e,t])}function Xt(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const r=e!==q;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Qe(e,n.current):q}function Rr(e){l.useEffect(()=>{if(!nt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Er(e,t){return l.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function sn(e){return l.useMemo(()=>e?_n(e):null,[e])}const jt=[];function Ar(e,t){t===void 0&&(t=De);const[n]=e,r=sn(n?z(n):null),[o,i]=l.useState(jt);function s(){i(()=>e.length?e.map(c=>Qt(c)?r:new wt(t(c),c)):jt)}const a=it({callback:s});return V(()=>{a==null||a.disconnect(),s(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function an(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function Mr(e){let{measure:t}=e;const[n,r]=l.useState(null),o=l.useCallback(u=>{for(const{target:d}of u)if(Be(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=it({callback:o}),s=l.useCallback(u=>{const d=an(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[a,c]=Je(s);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Or=[{sensor:on,options:{}},{sensor:rn,options:{}}],Ir={current:{}},Ge={draggable:{measure:Lt},droppable:{measure:Lt,strategy:ze.WhileDragging,frequency:pt.Optimized},dragOverlay:{measure:De}};class ke extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Tr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ke,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:et},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:et,windowRect:null,measuringScheduled:!1},ln={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:et,draggableNodes:new Map,over:null,measureDroppableContainers:et},Xe=l.createContext(ln),cn=l.createContext(Tr);function Nr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ke}}}function Lr(e,t){switch(t.type){case N.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case N.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case N.DragEnd:case N.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case N.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ke(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case N.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new ke(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case N.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ke(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function kr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l.useContext(Xe),i=_e(r),s=_e(n==null?void 0:n.id);return l.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!ot(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=On(d);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function un(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Pr(e){return l.useMemo(()=>({draggable:{...Ge.draggable,...e==null?void 0:e.draggable},droppable:{...Ge.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ge.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function zr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;V(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=Vt(d,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Gt(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const st=l.createContext({...q,scaleX:1,scaleY:1});var ue;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ue||(ue={}));const bo=l.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Or,collisionDetection:f=Wn,measuring:h,modifiers:g,...D}=t;const v=l.useReducer(Lr,void 0,Nr),[p,b]=v,[y,m]=Pn(),[C,S]=l.useState(ue.Uninitialized),E=C===ue.Initialized,{draggable:{active:w,nodes:x,translate:O},droppable:{containers:T}}=p,M=w!=null?x.get(w):null,W=l.useRef({initial:null,translated:null}),H=l.useMemo(()=>{var P;return w!=null?{id:w,data:(P=M==null?void 0:M.data)!=null?P:Ir,rect:W}:null},[w,M]),G=l.useRef(null),[Ce,je]=l.useState(null),[F,Ye]=l.useState(null),Z=Pe(D,Object.values(D)),Se=$e("DndDescribedBy",s),Ke=l.useMemo(()=>T.getEnabled(),[T]),B=Pr(h),{droppableRects:ee,measureDroppableContainers:de,measuringScheduled:Re}=mr(Ke,{dragging:E,dependencies:[O.x,O.y],config:B.droppable}),Y=pr(x,w),Ue=l.useMemo(()=>F?Ze(F):null,[F]),oe=Sn(),te=yr(Y,B.draggable.measure);zr({activeNode:w!=null?x.get(w):null,config:oe.layoutShiftCompensation,initialRect:te,measure:B.draggable.measure});const A=Ft(Y,B.draggable.measure,te),Ee=Ft(Y?Y.parentElement:null),J=l.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=T.getNodeFor((n=J.current.over)==null?void 0:n.id),ne=Mr({measure:B.dragOverlay.measure}),he=(r=ne.nodeRef.current)!=null?r:Y,ve=E?(o=ne.rect)!=null?o:A:null,Ct=!!(ne.nodeRef.current&&ne.rect),St=Dr(Ct?null:A),at=sn(he?z(he):null),ie=Cr(E?ge??Y:null),We=Ar(ie),He=un(g,{transform:{x:O.x-St.x,y:O.y-St.y,scaleX:1,scaleY:1},activatorEvent:F,active:H,activeNodeRect:A,containerNodeRect:Ee,draggingNodeRect:ve,over:J.current.over,overlayNodeRect:ne.rect,scrollableAncestors:ie,scrollableAncestorRects:We,windowRect:at}),Rt=Ue?ye(Ue,O):null,Et=Sr(ie),bn=Xt(Et),mn=Xt(Et,[A]),pe=ye(He,bn),be=ve?qn(ve,He):null,Ae=H&&be?f({active:H,collisionRect:be,droppableRects:ee,droppableContainers:Ke,pointerCoordinates:Rt}):null,At=Kn(Ae,"id"),[se,Mt]=l.useState(null),yn=Ct?He:ye(He,mn),wn=Hn(yn,(i=se==null?void 0:se.rect)!=null?i:null,A),lt=l.useRef(null),Ot=l.useCallback((P,$)=>{let{sensor:X,options:ae}=$;if(G.current==null)return;const K=x.get(G.current);if(!K)return;const j=P.nativeEvent,_=new X({active:G.current,activeNode:K,event:j,options:ae,context:J,onAbort(k){if(!x.get(k))return;const{onDragAbort:Q}=Z.current,re={id:k};Q==null||Q(re),y({type:"onDragAbort",event:re})},onPending(k,le,Q,re){if(!x.get(k))return;const{onDragPending:Oe}=Z.current,ce={id:k,constraint:le,initialCoordinates:Q,offset:re};Oe==null||Oe(ce),y({type:"onDragPending",event:ce})},onStart(k){const le=G.current;if(le==null)return;const Q=x.get(le);if(!Q)return;const{onDragStart:re}=Z.current,Me={activatorEvent:j,active:{id:le,data:Q.data,rect:W}};Te.unstable_batchedUpdates(()=>{re==null||re(Me),S(ue.Initializing),b({type:N.DragStart,initialCoordinates:k,active:le}),y({type:"onDragStart",event:Me}),je(lt.current),Ye(j)})},onMove(k){b({type:N.DragMove,coordinates:k})},onEnd:me(N.DragEnd),onCancel:me(N.DragCancel)});lt.current=_;function me(k){return async function(){const{active:Q,collisions:re,over:Me,scrollAdjustedTranslate:Oe}=J.current;let ce=null;if(Q&&Oe){const{cancelDrop:Ie}=Z.current;ce={activatorEvent:j,active:Q,collisions:re,delta:Oe,over:Me},k===N.DragEnd&&typeof Ie=="function"&&await Promise.resolve(Ie(ce))&&(k=N.DragCancel)}G.current=null,Te.unstable_batchedUpdates(()=>{b({type:k}),S(ue.Uninitialized),Mt(null),je(null),Ye(null),lt.current=null;const Ie=k===N.DragEnd?"onDragEnd":"onDragCancel";if(ce){const ct=Z.current[Ie];ct==null||ct(ce),y({type:Ie,event:ce})}})}}},[x]),xn=l.useCallback((P,$)=>(X,ae)=>{const K=X.nativeEvent,j=x.get(ae);if(G.current!==null||!j||K.dndKit||K.defaultPrevented)return;const _={active:j};P(X,$.options,_)===!0&&(K.dndKit={capturedBy:$.sensor},G.current=ae,Ot(X,$))},[x,Ot]),It=br(d,xn);Rr(d),V(()=>{A&&C===ue.Initializing&&S(ue.Initialized)},[A,C]),l.useEffect(()=>{const{onDragMove:P}=Z.current,{active:$,activatorEvent:X,collisions:ae,over:K}=J.current;if(!$||!X)return;const j={active:$,activatorEvent:X,collisions:ae,delta:{x:pe.x,y:pe.y},over:K};Te.unstable_batchedUpdates(()=>{P==null||P(j),y({type:"onDragMove",event:j})})},[pe.x,pe.y]),l.useEffect(()=>{const{active:P,activatorEvent:$,collisions:X,droppableContainers:ae,scrollAdjustedTranslate:K}=J.current;if(!P||G.current==null||!$||!K)return;const{onDragOver:j}=Z.current,_=ae.get(At),me=_&&_.rect.current?{id:_.id,rect:_.rect.current,data:_.data,disabled:_.disabled}:null,k={active:P,activatorEvent:$,collisions:X,delta:{x:K.x,y:K.y},over:me};Te.unstable_batchedUpdates(()=>{Mt(me),j==null||j(k),y({type:"onDragOver",event:k})})},[At]),V(()=>{J.current={activatorEvent:F,active:H,activeNode:Y,collisionRect:be,collisions:Ae,droppableRects:ee,draggableNodes:x,draggingNode:he,draggingNodeRect:ve,droppableContainers:T,over:se,scrollableAncestors:ie,scrollAdjustedTranslate:pe},W.current={initial:ve,translated:be}},[H,Y,Ae,be,x,he,ve,ee,T,se,ie,pe]),gr({...oe,delta:O,draggingRect:be,pointerCoordinates:Rt,scrollableAncestors:ie,scrollableAncestorRects:We});const Dn=l.useMemo(()=>({active:H,activeNode:Y,activeNodeRect:A,activatorEvent:F,collisions:Ae,containerNodeRect:Ee,dragOverlay:ne,draggableNodes:x,droppableContainers:T,droppableRects:ee,over:se,measureDroppableContainers:de,scrollableAncestors:ie,scrollableAncestorRects:We,measuringConfiguration:B,measuringScheduled:Re,windowRect:at}),[H,Y,A,F,Ae,Ee,ne,x,T,ee,se,de,ie,We,B,Re,at]),Cn=l.useMemo(()=>({activatorEvent:F,activators:It,active:H,activeNodeRect:A,ariaDescribedById:{draggable:Se},dispatch:b,draggableNodes:x,over:se,measureDroppableContainers:de}),[F,It,H,A,b,Se,x,se,de]);return I.createElement(Ht.Provider,{value:m},I.createElement(Xe.Provider,{value:Cn},I.createElement(cn.Provider,{value:Dn},I.createElement(st.Provider,{value:wn},u)),I.createElement(kr,{disabled:(a==null?void 0:a.restoreFocus)===!1})),I.createElement(Fn,{...a,hiddenTextDescribedById:Se}));function Sn(){const P=(Ce==null?void 0:Ce.autoScrollEnabled)===!1,$=typeof c=="object"?c.enabled===!1:c===!1,X=E&&!P&&!$;return typeof c=="object"?{...c,enabled:X}:{enabled:X}}}),Br=l.createContext(null),Yt="button",Fr="Draggable";function $r(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e(Fr),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=l.useContext(Xe),{role:g=Yt,roleDescription:D="draggable",tabIndex:v=0}=o??{},p=(c==null?void 0:c.id)===t,b=l.useContext(p?st:Br),[y,m]=Je(),[C,S]=Je(),E=Er(s,t),w=Pe(n);V(()=>(f.set(t,{id:t,key:i,node:y,activatorNode:C,data:w}),()=>{const O=f.get(t);O&&O.key===i&&f.delete(t)}),[f,t]);const x=l.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===Yt?!0:void 0,"aria-roledescription":D,"aria-describedby":d.draggable}),[r,g,v,p,D,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:x,isDragging:p,listeners:r?void 0:E,node:y,over:h,setNodeRef:m,setActivatorNodeRef:S,transform:b}}function dn(){return l.useContext(cn)}const Xr="Droppable",jr={timeout:25};function Yr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(Xr),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=l.useContext(Xe),d=l.useRef({disabled:n}),f=l.useRef(!1),h=l.useRef(null),g=l.useRef(null),{disabled:D,updateMeasurementsFor:v,timeout:p}={...jr,...o},b=Pe(v??r),y=l.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),g.current=null},p)},[p]),m=it({callback:y,disabled:D||!s}),C=l.useCallback((x,O)=>{m&&(O&&(m.unobserve(O),f.current=!1),x&&m.observe(x))},[m]),[S,E]=Je(C),w=Pe(t);return l.useEffect(()=>{!m||!S.current||(m.disconnect(),f.current=!1,m.observe(S.current))},[S,m]),l.useEffect(()=>(a({type:N.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:h,data:w}}),()=>a({type:N.UnregisterDroppable,key:i,id:r})),[r]),l.useEffect(()=>{n!==d.current.disabled&&(a({type:N.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(c==null?void 0:c.id)===r,node:S,over:c,setNodeRef:E}}function Kr(e){let{animation:t,children:n}=e;const[r,o]=l.useState(null),[i,s]=l.useState(null),a=_e(n);return!n&&!r&&a&&o(a),V(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){o(null);return}Promise.resolve(t(u,i)).then(()=>{o(null)})},[t,r,i]),I.createElement(I.Fragment,null,n,r?l.cloneElement(r,{ref:s}):null)}const Ur={x:0,y:0,scaleX:1,scaleY:1};function Wr(e){let{children:t}=e;return I.createElement(Xe.Provider,{value:ln},I.createElement(st.Provider,{value:Ur},t))}const Hr={position:"fixed",touchAction:"none"},Vr=e=>ot(e)?"transform 250ms ease":void 0,qr=l.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:c,transform:u,transition:d=Vr}=e;if(!a)return null;const f=o?u:{...u,scaleX:1,scaleY:1},h={...Hr,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:o&&r?Xn(r,a):void 0,transition:typeof d=="function"?d(r):d,...c};return I.createElement(n,{className:s,style:h,ref:t},i)}),Gr=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(o[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 s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[c,u]of Object.entries(o))n.node.style.setProperty(c,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},Jr=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fe.Transform.toString(t)},{transform:fe.Transform.toString(n)}]},_r={duration:250,easing:"ease",keyframes:Jr,sideEffects:Gr({styles:{active:{opacity:"0"}}})};function Qr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return rt((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=an(s);if(!u)return;const{transform:d}=z(s).getComputedStyle(s),f=qt(d);if(!f)return;const h=typeof t=="function"?t:Zr(t);return tn(c,o.draggable.measure),h({active:{id:i,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function Zr(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={..._r,...e};return i=>{let{active:s,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:c.scaleX!==1?s.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?s.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-d.x,y:c.y-d.y,...f},g=o({...u,active:s,dragOverlay:a,transform:{initial:c,final:h}}),[D]=g,v=g[g.length-1];if(JSON.stringify(D)===JSON.stringify(v))return;const p=r==null?void 0:r({active:s,dragOverlay:a,...u}),b=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{p==null||p(),y()}})}}let Kt=0;function eo(e){return l.useMemo(()=>{if(e!=null)return Kt++,Kt},[e])}const mo=I.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:D,droppableContainers:v,dragOverlay:p,over:b,measuringConfiguration:y,scrollableAncestors:m,scrollableAncestorRects:C,windowRect:S}=dn(),E=l.useContext(st),w=eo(f==null?void 0:f.id),x=un(s,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:p.rect,over:b,overlayNodeRect:p.rect,scrollableAncestors:m,scrollableAncestorRects:C,transform:E,windowRect:S}),O=Dt(h),T=Qr({config:r,draggableNodes:D,droppableContainers:v,measuringConfiguration:y}),M=O?p.setRef:void 0;return I.createElement(Wr,null,I.createElement(Kr,{animation:T},f&&w?I.createElement(qr,{key:w,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:O,style:{zIndex:u,...o},transform:x},n):null))});function fn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function to(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ve(e){return e!==null&&e>=0}function no(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ro(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const gn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=fn(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},qe={scaleX:1,scaleY:1},yo=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...qe}:null}const c=oo(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-c,...qe}:o<n&&o>=s?{x:0,y:a.height+c,...qe}:{x:0,y:0,...qe}};function oo(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const hn="Sortable",vn=I.createContext({activeIndex:-1,containerId:hn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:gn,disabled:{draggable:!1,droppable:!1}});function wo(e){let{children:t,id:n,items:r,strategy:o=gn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=dn(),f=$e(hn,n),h=a.rect!==null,g=l.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),D=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,b=l.useRef(g),y=!no(g,b.current),m=p!==-1&&v===-1||y,C=ro(i);V(()=>{y&&D&&d(g)},[y,g,D,d]),l.useEffect(()=>{b.current=g},[g]);const S=l.useMemo(()=>({activeIndex:v,containerId:f,disabled:C,disableTransforms:m,items:g,overIndex:p,useDragOverlay:h,sortedRects:to(g,c),strategy:o}),[v,f,C.draggable,C.droppable,m,g,p,c,h,o]);return I.createElement(vn.Provider,{value:S},t)}const io=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return fn(n,r,o).indexOf(t)},so=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===c},ao={duration:200,easing:"ease"},pn="transform",lo=fe.Transition.toString({property:pn,duration:0,easing:"linear"}),co={roleDescription:"sortable"};function uo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=l.useState(null),a=l.useRef(n);return V(()=>{if(!t&&n!==a.current&&r.current){const c=o.current;if(c){const u=De(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&s(d)}}n!==a.current&&(a.current=n)},[t,n,r,o]),l.useEffect(()=>{i&&s(null)},[i]),i}function xo(e){let{animateLayoutChanges:t=so,attributes:n,disabled:r,data:o,getNewIndex:i=io,id:s,strategy:a,resizeObserverConfig:c,transition:u=ao}=e;const{items:d,containerId:f,activeIndex:h,disabled:g,disableTransforms:D,sortedRects:v,overIndex:p,useDragOverlay:b,strategy:y}=l.useContext(vn),m=fo(r,g),C=d.indexOf(s),S=l.useMemo(()=>({sortable:{containerId:f,index:C,items:d},...o}),[f,o,C,d]),E=l.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:w,node:x,isOver:O,setNodeRef:T}=Yr({id:s,data:S,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:M,activatorEvent:W,activeNodeRect:H,attributes:G,setNodeRef:Ce,listeners:je,isDragging:F,over:Ye,setActivatorNodeRef:Z,transform:Se}=$r({id:s,data:S,attributes:{...co,...n},disabled:m.draggable}),Ke=Rn(T,Ce),B=!!M,ee=B&&!D&&Ve(h)&&Ve(p),de=!b&&F,Re=de&&ee?Se:null,Ue=ee?Re??(a??y)({rects:v,activeNodeRect:H,activeIndex:h,overIndex:p,index:C}):null,oe=Ve(h)&&Ve(p)?i({id:s,items:d,activeIndex:h,overIndex:p}):C,te=M==null?void 0:M.id,A=l.useRef({activeId:te,items:d,newIndex:oe,containerId:f}),Ee=d!==A.current.items,J=t({active:M,containerId:f,isDragging:F,isSorting:B,id:s,index:C,items:d,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),ge=uo({disabled:!J,index:C,node:x,rect:w});return l.useEffect(()=>{B&&A.current.newIndex!==oe&&(A.current.newIndex=oe),f!==A.current.containerId&&(A.current.containerId=f),d!==A.current.items&&(A.current.items=d)},[B,oe,f,d]),l.useEffect(()=>{if(te===A.current.activeId)return;if(te!=null&&A.current.activeId==null){A.current.activeId=te;return}const he=setTimeout(()=>{A.current.activeId=te},50);return()=>clearTimeout(he)},[te]),{active:M,activeIndex:h,attributes:G,data:S,rect:w,index:C,newIndex:oe,items:d,isOver:O,isSorting:B,isDragging:F,listeners:je,node:x,overIndex:p,over:Ye,setNodeRef:Ke,setActivatorNodeRef:Z,setDroppableNodeRef:T,setDraggableNodeRef:Ce,transform:ge??Ue,transition:ne()};function ne(){if(ge||Ee&&A.current.newIndex===C)return lo;if(!(de&&!ot(W)||!u)&&(B||J))return fe.Transition.toString({...u,property:pn})}}function fo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}R.Down,R.Right,R.Up,R.Left;export{fe as C,bo as D,rn as K,on as P,wo as S,ho as a,mo as b,po as c,xo as d,vo as u,yo as v};
|
|
6
|
-
//# sourceMappingURL=vendor-dnd-DRBSMxXo.js.map
|
|
@@ -27,4 +27,3 @@ import{j as pn}from"./vendor-motion-Dwx3-JO5.js";import{d as nn,g as or}from"./v
|
|
|
27
27
|
`,...o.current()});return/^[\t ]/.test(s)&&(s=$e(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,n.options.closeAtx&&(s+=" "+l),u(),a(),s}Xr.peek=nc;function Xr(e){return e.value||""}function nc(){return"<"}Qr.peek=tc;function Qr(e,t,n,r){const i=rt(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let s=u.move("![");return s+=u.move(n.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(n.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=n.enter("destinationRaw"),s+=u.move(n.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),s+=u.move(" "+i),s+=u.move(n.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),s+=u.move(")"),l(),s}function tc(){return"!"}Gr.peek=rc;function Gr(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const s=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function rc(){return"!"}Kr.peek=ic;function Kr(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],a=n.compilePattern(l);let u;if(l.atBreak)for(;u=a.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return i+r+i}function ic(){return"`"}function Jr(e,t){const n=Xn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Zr.peek=lc;function Zr(e,t,n,r){const i=rt(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let a,u;if(Jr(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=l.move("<");return c+=l.move(n.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),n.stack=f,c}a=n.enter("link"),u=n.enter("label");let s=l.move("[");return s+=l.move(n.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(n.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(u=n.enter("destinationRaw"),s+=l.move(n.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=n.enter(`title${o}`),s+=l.move(" "+i),s+=l.move(n.safe(e.title,{before:s,after:i,...l.current()})),s+=l.move(i),u()),s+=l.move(")"),a(),s}function lc(e,t,n){return Jr(e,n)?"<":"["}ei.peek=oc;function ei(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const s=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function oc(){return"["}function it(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ac(e){const t=it(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function uc(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ni(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function sc(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?uc(n):it(n);const a=e.ordered?l==="."?")":".":ac(n);let u=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ni(n)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=a),n.bulletCurrent=l;const s=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),s}function cc(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function fc(e,t,n,r){const i=cc(n);let o=n.bulletCurrent||it(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const u=n.enter("listItem"),s=n.indentLines(n.containerFlow(e,a.current()),f);return u(),s;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function hc(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const pc=fn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mc(e,t,n,r){return(e.children.some(function(l){return pc(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function gc(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ti.peek=dc;function ti(e,t,n,r){const i=gc(n),o=n.enter("strong"),l=n.createTracker(r),a=l.move(i+i);let u=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=on(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=$e(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=on(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+$e(c));const h=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function dc(e,t,n){return n.options.strong||"*"}function yc(e,t,n,r){return n.safe(e.value,r)}function kc(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function xc(e,t,n){const r=(ni(n)+(n.options.ruleSpaces?" ":"")).repeat(kc(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ri={blockquote:Us,break:tr,code:Xs,definition:Gs,emphasis:Yr,hardBreak:tr,heading:ec,html:Xr,image:Qr,imageReference:Gr,inlineCode:Kr,link:Zr,linkReference:ei,list:sc,listItem:fc,paragraph:hc,root:mc,strong:ti,text:yc,thematicBreak:xc};function bc(){return{enter:{table:wc,tableData:rr,tableHeader:rr,tableRow:Cc},exit:{codeText:Ec,table:Sc,tableData:Pn,tableHeader:Pn,tableRow:Pn}}}function wc(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Sc(e){this.exit(e),this.data.inTable=void 0}function Cc(e){this.enter({type:"tableRow",children:[]},e)}function Pn(e){this.exit(e)}function rr(e){this.enter({type:"tableCell",children:[]},e)}function Ec(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ic));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ic(e,t){return t==="|"?t:e}function Ac(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
28
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:u,tableRow:a}};function l(h,d,x,C){return s(f(h,x,C),h.align)}function a(h,d,x,C){const y=c(h,x,C),A=s([y]);return A.slice(0,A.indexOf(`
|
|
29
29
|
`))}function u(h,d,x,C){const y=x.enter("tableCell"),A=x.enter("phrasing"),E=x.containerPhrasing(h,{...C,before:o,after:o});return A(),y(),E}function s(h,d){return js(h,{align:d,alignDelimiters:r,padding:n,stringLength:i})}function f(h,d,x){const C=h.children;let y=-1;const A=[],E=d.enter("table");for(;++y<C.length;)A[y]=c(C[y],d,x);return E(),A}function c(h,d,x){const C=h.children;let y=-1;const A=[],E=d.enter("tableRow");for(;++y<C.length;)A[y]=u(C[y],h,d,x);return E(),A}function p(h,d,x){let C=ri.inlineCode(h,d,x);return x.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Tc(){return{exit:{taskListCheckValueChecked:ir,taskListCheckValueUnchecked:ir,paragraph:vc}}}function Pc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zc}}}function ir(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vc(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function zc(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(l);let u=ri.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+l}}function Dc(){return[ss(),zs(),Rs(),bc(),Tc()]}function Lc(e){return{extensions:[cs(),Ds(e),_s(),Ac(e),Pc()]}}const Fc={tokenize:Bc,partial:!0},ii={tokenize:jc,partial:!0},li={tokenize:Hc,partial:!0},oi={tokenize:Uc,partial:!0},Rc={tokenize:Vc,partial:!0},ai={name:"wwwAutolink",tokenize:Mc,previous:si},ui={name:"protocolAutolink",tokenize:Nc,previous:ci},de={name:"emailAutolink",tokenize:Oc,previous:fi},fe={};function _c(){return{text:fe}}let Se=48;for(;Se<123;)fe[Se]=de,Se++,Se===58?Se=65:Se===91&&(Se=97);fe[43]=de;fe[45]=de;fe[46]=de;fe[95]=de;fe[72]=[de,ui];fe[104]=[de,ui];fe[87]=[de,ai];fe[119]=[de,ai];function Oc(e,t,n){const r=this;let i,o;return l;function l(c){return!jn(c)||!fi.call(r,r.previous)||lt(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return jn(c)?(e.consume(c),a):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(Rc,f,s)(c):c===45||c===95||G(c)?(o=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&J(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Mc(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!si.call(r,r.previous)||lt(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Fc,e.attempt(ii,e.attempt(li,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Nc(e,t,n){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&ci.call(r,r.previous)&&!lt(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(J(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),u}return n(c)}function u(c){return c===47?(e.consume(c),o?s:(o=!0,u)):n(c)}function s(c){return c===null||tn(c)||U(c)||Ee(c)||un(c)?n(c):e.attempt(ii,e.attempt(li,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Bc(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function jc(e,t,n){let r,i,o;return l;function l(s){return s===46||s===95?e.check(oi,u,a)(s):s===null||U(s)||Ee(s)||s!==45&&un(s)?u(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function u(s){return i||r||!o?n(s):t(s)}}function Hc(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(oi,t,o)(l):l===null||U(l)||Ee(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Uc(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||U(a)||Ee(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||U(a)||Ee(a)?t(a):r(a)}function o(a){return J(a)?l(a):n(a)}function l(a){return a===59?(e.consume(a),r):J(a)?(e.consume(a),l):n(a)}}function Vc(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return G(o)?n(o):t(o)}}function si(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||U(e)}function ci(e){return!J(e)}function fi(e){return!(e===47||jn(e))}function jn(e){return e===43||e===45||e===46||e===95||G(e)}function lt(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const $c={tokenize:Jc,partial:!0};function qc(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Qc,continuation:{tokenize:Gc},exit:Kc}},text:{91:{name:"gfmFootnoteCall",tokenize:Xc},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Wc,resolveTo:Yc}}}}function Wc(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!l||!l._balanced)return n(u);const s=se(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Yc(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function Xc(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(o>999||c===93&&!l||c===null||c===91||U(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(se(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return U(c)||(l=!0),o++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function Qc(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return u;function u(d){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(d){return d===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(d)}function f(d){if(l>999||d===93&&!a||d===null||d===91||U(d))return n(d);if(d===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=se(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return U(d)||(a=!0),l++,e.consume(d),d===92?c:f}function c(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}function p(d){return d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),i.includes(o)||i.push(o),O(e,h,"gfmFootnoteDefinitionWhitespace")):n(d)}function h(d){return t(d)}}function Gc(e,t,n){return e.check(We,t,e.attempt($c,t,n))}function Kc(e){e.exit("gfmFootnoteDefinition")}function Jc(e,t,n){const r=this;return O(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function Zc(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},c={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&re(p,p.length,0,sn(h,l.slice(s+1,u),a)),re(p,p.length,0,[["exit",c,a],["enter",l[u][1],a],["exit",l[u][1],a],["exit",f,a]]),re(l,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function o(l,a,u){const s=this.previous,f=this.events;let c=0;return p;function p(d){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(d):(l.enter("strikethroughSequenceTemporary"),h(d))}function h(d){const x=Le(s);if(d===126)return c>1?u(d):(l.consume(d),c++,h);if(c<2&&!n)return u(d);const C=l.exit("strikethroughSequenceTemporary"),y=Le(d);return C._open=!y||y===2&&!!x,C._close=!x||x===2&&!!y,a(d)}}}class ef{constructor(){this.map=[]}add(t,n,r){nf(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function nf(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function tf(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rf(){return{flow:{null:{name:"table",tokenize:lf,resolveAll:of}}}}function lf(e,t,n){const r=this;let i=0,o=0,l;return a;function a(k){let T=r.events.length-1;for(;T>-1;){const q=r.events[T][1].type;if(q==="lineEnding"||q==="linePrefix")T--;else break}const P=T>-1?r.events[T][1].type:null,j=P==="tableHead"||P==="tableRow"?w:u;return j===w&&r.parser.lazy[r.now().line]?n(k):j(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),s(k)}function s(k){return k===124||(l=!0,o+=1),f(k)}function f(k){return k===null?n(k):v(k)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):n(k):R(k)?O(e,f,"whitespace")(k):(o+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||U(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?p:c)}function p(k){return k===92||k===124?(e.consume(k),c):c(k)}function h(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),l=!1,R(k)?O(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):d(k))}function d(k){return k===45||k===58?C(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):F(k)}function x(k){return R(k)?O(e,C,"whitespace")(k):C(k)}function C(k){return k===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||v(k)?L(k):F(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),A(k)):F(k)}function A(k){return k===45?(e.consume(k),A):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(k))}function E(k){return R(k)?O(e,L,"whitespace")(k):L(k)}function L(k){return k===124?d(k):k===null||v(k)?!l||i!==o?F(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):F(k)}function F(k){return n(k)}function w(k){return e.enter("tableRow"),M(k)}function M(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),M):k===null||v(k)?(e.exit("tableRow"),t(k)):R(k)?O(e,M,"whitespace")(k):(e.enter("data"),$(k))}function $(k){return k===null||k===124||U(k)?(e.exit("data"),M(k)):(e.consume(k),k===92?B:$)}function B(k){return k===92||k===124?(e.consume(k),$):$(k)}}function of(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,u=0,s,f,c;const p=new ef;for(;++n<e.length;){const h=e[n],d=h[1];h[0]==="enter"?d.type==="tableHead"?(a=!1,u!==0&&(lr(p,t,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",s,t]])):d.type==="tableRow"||d.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",f,t]])),i=d.type==="tableDelimiterRow"?2:f?3:1):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=Je(p,t,o,i,void 0,c),o=[0,0,0,0]),l[2]=n)):d.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=Je(p,t,o,i,void 0,c)),o=l,l=[o[1],n,0,0])):d.type==="tableHead"?(a=!0,u=n):d.type==="tableRow"||d.type==="tableDelimiterRow"?(u=n,o[1]!==0?(l[0]=l[1],c=Je(p,t,o,i,n,c)):l[1]!==0&&(c=Je(p,t,l,i,n,c)),i=0):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&lr(p,t,u,s,f),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=tf(t.events,n))}return e}function Je(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},ze(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=ze(t.events,n[1]);if(o={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const s=ze(t.events,n[2]),f=ze(t.events,n[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const d=n[2]+1,x=n[3]-n[2]-1;e.add(d,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},ze(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function lr(e,t,n,r,i){const o=[],l=ze(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function ze(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const af={name:"tasklistCheck",tokenize:sf};function uf(){return{text:{91:af}}}function sf(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return U(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return v(u)?t(u):R(u)?e.check({tokenize:cf},t,n)(u):n(u)}}function cf(e,t,n){return O(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ff(e){return wr([_c(),qc(),Zc(e),rf(),uf()])}const hf={};function df(e){const t=this,n=e||hf,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ff(n)),o.push(Dc()),l.push(Lc(n))}export{gf as M,df as r};
|
|
30
|
-
//# sourceMappingURL=vendor-markdown-DwTbvico.js.map
|
|
@@ -15,4 +15,3 @@ import{r as T}from"./vendor-react-C7pctHW3.js";var Gs={exports:{}},le={};/**
|
|
|
15
15
|
${w}px !important;
|
|
16
16
|
}
|
|
17
17
|
`),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),C.contains(P)&&C.removeChild(P)}},[e]),nt.jsx(Du,{isPresent:e,childRef:a,sizeRef:l,pop:r,children:r===!1?t:T.cloneElement(t,{ref:h})})}const Ru=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=en(Lu),h=T.useId();let f=!0,d=T.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{u.set(p,!0);for(const g of u.values())if(!g)return;s&&s()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[n,u,s]);return r&&f&&(d={...d}),T.useMemo(()=>{u.forEach((p,g)=>u.set(g,!1))},[n]),T.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),t=nt.jsx(Eu,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:t}),nt.jsx(ue.Provider,{value:d,children:t})};function Lu(){return new Map}function So(t=!0){const e=T.useContext(ue);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=T.useId();T.useEffect(()=>{if(t)return i(r)},[t]);const o=T.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Kt=t=>t.key||"";function Ls(t){const e=[];return T.Children.forEach(t,n=>{T.isValidElement(n)&&e.push(n)}),e}const $c=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=So(o),f=T.useMemo(()=>Ls(t),[t]),d=o&&!u?[]:f.map(Kt),p=T.useRef(!0),g=T.useRef(f),m=en(()=>new Map),y=T.useRef(new Set),[x,v]=T.useState(f),[w,P]=T.useState(f);Xs(()=>{p.current=!1,g.current=f;for(let A=0;A<w.length;A++){const V=Kt(w[A]);d.includes(V)?(m.delete(V),y.current.delete(V)):m.get(V)!==!0&&m.set(V,!1)}},[w,d.length,d.join("-")]);const C=[];if(f!==x){let A=[...f];for(let V=0;V<w.length;V++){const b=w[V],E=Kt(b);d.includes(E)||(A.splice(V,0,b),C.push(b))}return r==="wait"&&C.length&&(A=C),P(Ls(A)),v(f),null}const{forceRender:R}=T.useContext(tn);return nt.jsx(nt.Fragment,{children:w.map(A=>{const V=Kt(A),b=o&&!u?!1:f===w||d.includes(V),E=()=>{if(y.current.has(V))return;if(m.has(V))y.current.add(V),m.set(V,!0);else return;let I=!0;m.forEach(tt=>{tt||(I=!1)}),I&&(R==null||R(),P(g.current),o&&(h==null||h()),s&&s())};return nt.jsx(Ru,{isPresent:b,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:b?void 0:E,anchorX:a,anchorY:l,children:A},V)})})},Po=T.createContext({strict:!1}),ks={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Fs=!1;function ku(){if(Fs)return;const t={};for(const e in ks)t[e]={isEnabled:n=>ks[e].some(s=>!!n[s])};Zi(t),Fs=!0}function bo(){return ku(),yl()}function Fu(t){const e=bo();for(const n in t)e[n]={...e[n],...t[n]};Zi(e)}const Iu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ae(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Iu.has(t)}let Ao=t=>!ae(t);function Bu(t){typeof t=="function"&&(Ao=e=>e.startsWith("on")?!ae(e):t(e))}try{Bu(require("@emotion/is-prop-valid").default)}catch{}function Ou(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||j(t[i])||(Ao(i)||n===!0&&ae(i)||!e&&!ae(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const de=T.createContext({});function ju(t,e){if(fe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ft(n)?n:void 0,animate:Ft(s)?s:void 0}}return t.inherit!==!1?e:{}}function Nu(t){const{initial:e,animate:n}=ju(t,T.useContext(de));return T.useMemo(()=>({initial:e,animate:n}),[Is(e),Is(n)])}function Is(t){return Array.isArray(t)?t.join(" "):t}const Mn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vo(t,e,n){for(const s in e)!j(e[s])&&!io(s,n)&&(t[s]=e[s])}function Uu({transformTemplate:t},e){return T.useMemo(()=>{const n=Mn();return An(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Wu(t,e){const n=t.style||{},s={};return Vo(s,n,t),Object.assign(s,Uu(t,e)),s}function Ku(t,e){const n={},s=Wu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Co=()=>({...Mn(),attrs:{}});function $u(t,e,n,s){const i=T.useMemo(()=>{const r=Co();return oo(r,e,ao(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Vo(r,t.style,t),i.style={...r,...i.style}}return i}const _u=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dn(t){return typeof t!="string"||t.includes("-")?!1:!!(_u.indexOf(t)>-1||/[A-Z]/u.test(t))}function zu(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Dn(t)?$u:Ku)(e,s,i,t),c=Ou(e,typeof t=="string",r),u=t!==T.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=T.useMemo(()=>j(h)?h.get():h,[h]);return T.createElement(t,{...u,children:f})}function Gu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Hu(n,s,i,t),renderState:e()}}function Hu(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Zt(r[f]);let{initial:o,animate:a}=t;const l=fe(t),c=Yi(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!he(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=yn(t,f[d]);if(p){const{transitionEnd:g,transition:m,...y}=p;for(const x in y){let v=y[x];if(Array.isArray(v)){const w=u?v.length-1:0;v=v[w]}v!==null&&(i[x]=v)}for(const x in g)i[x]=g[x]}}}return i}const Mo=t=>(e,n)=>{const s=T.useContext(de),i=T.useContext(ue),r=()=>Gu(t,e,s,i);return n?r():en(r)},Xu=Mo({scrapeMotionValuesFromProps:Vn,createRenderState:Mn}),Yu=Mo({scrapeMotionValuesFromProps:lo,createRenderState:Co}),qu=Symbol.for("motionComponentSymbol");function Zu(t,e,n){const s=T.useRef(n);T.useInsertionEffect(()=>{s.current=n});const i=T.useRef(null);return T.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Do=T.createContext({});function yt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ju(t,e,n,s,i,r){var v,w;const{visualElement:o}=T.useContext(de),a=T.useContext(Po),l=T.useContext(ue),c=T.useContext(Cn),u=c.reducedMotion,h=c.skipAnimations,f=T.useRef(null),d=T.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,g=T.useContext(Do);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Qu(f.current,n,i,g);const m=T.useRef(!1);T.useInsertionEffect(()=>{p&&m.current&&p.update(n,l)});const y=n[Bi],x=T.useRef(!!y&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,y)));return Xs(()=>{d.current=!0,p&&(m.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),T.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,y)}),x.current=!1),p.enteringChildren=void 0)}),p}function Qu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Eo(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&yt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function Eo(t){if(t)return t.options.allowProjection!==!1?t.projection:Eo(t.parent)}function Ae(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Fu(s);const r=n?n==="svg":Dn(t),o=r?Yu:Xu;function a(c,u){let h;const f={...T.useContext(Cn),...c,layoutId:tc(c)},{isStatic:d}=f,p=Nu(c),g=o(c,d);if(!d&&typeof window<"u"){ec();const m=nc(f);h=m.MeasureLayout,p.visualElement=Ju(t,g,f,i,m.ProjectionNode,r)}return nt.jsxs(de.Provider,{value:p,children:[h&&p.visualElement?nt.jsx(h,{visualElement:p.visualElement,...f}):null,zu(t,c,Zu(g,p.visualElement,u),g,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=T.forwardRef(a);return l[qu]=t,l}function tc({layoutId:t}){const e=T.useContext(tn).id;return e&&t!==void 0?e+"-"+t:t}function ec(t,e){T.useContext(Po).strict}function nc(t){const e=bo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function sc(t,e){if(typeof Proxy>"u")return Ae;const n=new Map,s=(r,o)=>Ae(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Ae(o,void 0,t,e)),n.get(o))})}const ic=(t,e)=>e.isSVG??Dn(t)?new Fl(e):new Ml(e,{allowProjection:t!==T.Fragment});class oc extends lt{constructor(e){super(e),e.animationState||(e.animationState=Nl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();he(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let rc=0;class ac extends lt{constructor(){super(...arguments),this.id=rc++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=mt(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const lc={animation:{Feature:oc},exit:{Feature:ac}};function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const uc=t=>e=>wn(e)&&t(e,Nt(e));function Rt(t,e,n,s){return It(t,e,uc(n),s)}const Ro=({current:t})=>t?t.ownerDocument.defaultView:null,Bs=(t,e)=>Math.abs(t-e);function cc(t,e){const n=Bs(t.x,e.x),s=Bs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Os=new Set(["auto","scroll"]);class Lo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=$t(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ve(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=cc(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=d,{timestamp:y}=O;this.history.push({...m,timestamp:y});const{onStart:x,onMove:v}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=$t(p,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ve(d.type==="pointercancel"?this.lastMoveEventInfo:$t(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),m&&m(d,x)},!wn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=Nt(e),c=$t(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=O;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ve(c,this.history)),this.removeListeners=Bt(Rt(this.contextWindow,"pointermove",this.handlePointerMove),Rt(this.contextWindow,"pointerup",this.handlePointerUp),Rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Os.has(s.overflowX)||Os.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function $t(t,e){return e?{point:e(t.point)}:t}function js(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ve({point:t},e){return{point:t,delta:js(t,ko(e)),offset:js(t,hc(e)),velocity:fc(e,.1)}}function hc(t){return t[0]}function ko(t){return t[t.length-1]}function fc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=ko(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Ns(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function pc(t,{top:e,left:n,bottom:s,right:i}){return{x:Ns(t.x,n,i),y:Ns(t.y,e,s)}}function Us(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function mc(t,e){return{x:Us(t.x,e.x),y:Us(t.y,e.y)}}function gc(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=Lt(e.min,e.max-s,t.min):s>i&&(n=Lt(t.min,t.max-i,e.min)),Q(0,1,n)}function yc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Je=.35;function vc(t=Je){return t===!1?t=0:t===!0&&(t=Je),{x:Ws(t,"left","right"),y:Ws(t,"top","bottom")}}function Ws(t,e,n){return{min:Ks(t,e),max:Ks(t,n)}}function Ks(t,e){return typeof t=="number"?t:t[e]||0}const xc=new WeakMap;class Tc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=F(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Nt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ha(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),q(y=>{let x=this.getAxisMotionValue(y).get()||0;if(J.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(x=U(w)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&M.update(()=>g(h,f),!1,!0),$e(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=Sc(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),m&&M.update(()=>m(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Lo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:Ro(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!_t(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=dc(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&yt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=pc(s.layoutBox,e):this.constraints=!1,this.elastic=vc(n),i!==this.constraints&&!yt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=yc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!yt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Sl(s,i.root,this.visualElement.getTransformPagePoint());let o=mc(i.layout.layoutBox,r);if(n){const a=n(xl(o));this.hasMutatedConstraints=!!a,a&&(o=Qi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=q(u=>{if(!_t(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $e(this.visualElement,e),s.start(gn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!_t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-D(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!yt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=gc({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(o=>{if(!_t(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(D(l,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xc.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&Qa(f);u&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();yt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=wc(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),M.read(i);const a=It(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Je,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function $s(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function wc(t,e,n){const s=qn(t,$s(n)),i=qn(e,$s(n));return()=>{s(),i()}}function _t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Sc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Pc extends lt{constructor(e){super(e),this.removeGroupControls=_,this.removeListeners=_,this.controls=new Tc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ce=t=>(e,n)=>{t&&M.update(()=>t(e,n),!1,!0)};class bc extends lt{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(e){this.session=new Lo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ro(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ce(e),onStart:Ce(n),onMove:Ce(s),onEnd:(r,o)=>{delete this.session,i&&M.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Me=!1;class Ac extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Me&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Me=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||M.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Tn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Me=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Fo(t){const[e,n]=So(),s=T.useContext(tn);return nt.jsx(Ac,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(Do),isPresent:e,safeToRemove:n})}const Vc={pan:{Feature:bc},drag:{Feature:Pc,ProjectionNode:wo,MeasureLayout:Fo}};function _s(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&M.postRender(()=>r(e,Nt(e)))}class Cc extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=Ya(e,(n,s)=>(_s(this.node,s,"Start"),i=>_s(this.node,i,"End"))))}unmount(){}}class Mc extends lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Bt(It(this.node.current,"focus",()=>this.onFocus()),It(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function zs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&M.postRender(()=>r(e,Nt(e)))}class Dc extends lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=el(e,(i,r)=>(zs(this.node,r,"Start"),(o,{success:a})=>zs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Qe=new WeakMap,De=new WeakMap,Ec=t=>{const e=Qe.get(t.target);e&&e(t)},Rc=t=>{t.forEach(Ec)};function Lc({root:t,...e}){const n=t||document;De.has(n)||De.set(n,{});const s=De.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Rc,{root:t,...e})),s[i]}function kc(t,e,n){const s=Lc(e);return Qe.set(t,n),s.observe(t),()=>{Qe.delete(t),s.unobserve(t)}}const Fc={some:0,all:1};class Ic extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Fc[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=kc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Bc(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Bc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Oc={inView:{Feature:Ic},tap:{Feature:Dc},focus:{Feature:Mc},hover:{Feature:Cc}},jc={layout:{ProjectionNode:wo,MeasureLayout:Fo}},Nc={...lc,...Oc,...Vc,...jc},_c=sc(Nc,ic);export{$c as A,nt as j,_c as m};
|
|
18
|
-
//# sourceMappingURL=vendor-motion-Dwx3-JO5.js.map
|
|
@@ -62,4 +62,3 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
62
62
|
* This source code is licensed under the MIT license found in the
|
|
63
63
|
* LICENSE file in the root directory of this source tree.
|
|
64
64
|
*/var ze=c;function Qd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jd=typeof Object.is=="function"?Object.is:Qd,ef=ze.useState,tf=ze.useEffect,nf=ze.useLayoutEffect,rf=ze.useDebugValue;function of(e,t){var n=t(),r=ef({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return nf(function(){o.value=n,o.getSnapshot=t,un(o)&&s({inst:o})},[e,n,t]),tf(function(){return un(o)&&s({inst:o}),e(function(){un(o)&&s({inst:o})})},[e]),rf(n),n}function un(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jd(e,n)}catch{return!0}}function sf(e,t){return t()}var af=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sf:of;ci.useSyncExternalStore=ze.useSyncExternalStore!==void 0?ze.useSyncExternalStore:af;ai.exports=ci;var cf=ai.exports;function lf(){return cf.useSyncExternalStore(uf,()=>!0,()=>!1)}function uf(){return()=>{}}var nr="Avatar",[df]=Xd(nr),[ff,li]=df(nr),ui=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=c.useState("idle");return v.jsx(ff,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:v.jsx(tr.span,{...r,ref:t})})});ui.displayName=nr;var di="AvatarImage",fi=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,i=li(di,n),a=pf(r,s),l=K(u=>{o(u),i.onImageLoadingStatusChange(u)});return G(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?v.jsx(tr.img,{...s,ref:t,src:r}):null});fi.displayName=di;var pi="AvatarFallback",vi=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=li(pi,n),[i,a]=c.useState(r===void 0);return c.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),i&&s.imageLoadingStatus!=="loaded"?v.jsx(tr.span,{...o,ref:t}):null});vi.displayName=pi;function Dr(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function pf(e,{referrerPolicy:t,crossOrigin:n}){const r=lf(),o=c.useRef(null),s=r?(o.current||(o.current=new window.Image),o.current):null,[i,a]=c.useState(()=>Dr(s,e));return G(()=>{a(Dr(s,e))},[s,e]),G(()=>{const l=f=>()=>{a(f)};if(!s)return;const u=l("loaded"),d=l("error");return s.addEventListener("load",u),s.addEventListener("error",d),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",d)}},[s,n,t]),i}var xp=ui,bp=fi,Sp=vi,dn="rovingFocusGroup.onEntryFocus",vf={bubbles:!1,cancelable:!0},lt="RovingFocusGroup",[Rn,hi,hf]=Os(lt),[mf,mi]=ee(lt,[hf]),[gf,yf]=mf(lt),gi=c.forwardRef((e,t)=>v.jsx(Rn.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Rn.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(wf,{...e,ref:t})})}));gi.displayName=lt;var wf=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=c.useRef(null),m=L(t,p),y=kt(s),[h,g]=me({prop:i,defaultProp:a??null,onChange:l,caller:lt}),[w,x]=c.useState(!1),b=K(u),S=hi(n),C=c.useRef(!1),[R,E]=c.useState(0);return c.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(dn,b),()=>P.removeEventListener(dn,b)},[b]),v.jsx(gf,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:h,onItemFocus:c.useCallback(P=>g(P),[g]),onItemShiftTab:c.useCallback(()=>x(!0),[]),onFocusableItemAdd:c.useCallback(()=>E(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>E(P=>P-1),[]),children:v.jsx(N.div,{tabIndex:w||R===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{C.current=!0}),onFocus:A(e.onFocus,P=>{const T=!C.current;if(P.target===P.currentTarget&&T&&!w){const _=new CustomEvent(dn,vf);if(P.currentTarget.dispatchEvent(_),!_.defaultPrevented){const M=S().filter(D=>D.focusable),$=M.find(D=>D.active),F=M.find(D=>D.id===h),H=[$,F,...M].filter(Boolean).map(D=>D.ref.current);xi(H,d)}}C.current=!1}),onBlur:A(e.onBlur,()=>x(!1))})})}),yi="RovingFocusGroupItem",wi=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=re(),u=s||l,d=yf(yi,n),f=d.currentTabStopId===u,p=hi(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:h}=d;return c.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),v.jsx(Rn.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:v.jsx(N.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:A(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:A(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:A(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=Sf(g,d.orientation,d.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=p().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=d.loop?Cf(b,S+1):b.slice(S+1)}setTimeout(()=>xi(b))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:h!=null}):i})})});wi.displayName=yi;var xf={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Sf(e,t,n){const r=bf(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xf[r]}function xi(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Cf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ef=gi,Rf=wi,Zt="Tabs",[Pf]=ee(Zt,[mi]),bi=mi(),[Af,rr]=Pf(Zt),Si=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=kt(a),[f,p]=me({prop:r,onChange:o,defaultProp:s??"",caller:Zt});return v.jsx(Af,{scope:n,baseId:re(),value:f,onValueChange:p,orientation:i,dir:d,activationMode:l,children:v.jsx(N.div,{dir:d,"data-orientation":i,...u,ref:t})})});Si.displayName=Zt;var Ci="TabsList",Ei=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=rr(Ci,n),i=bi(n);return v.jsx(Ef,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:v.jsx(N.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Ei.displayName=Ci;var Ri="TabsTrigger",Pi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=rr(Ri,n),a=bi(n),l=_i(i.baseId,r),u=Ni(i.baseId,r),d=r===i.value;return v.jsx(Rf,{asChild:!0,...a,focusable:!o,active:d,children:v.jsx(N.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...s,ref:t,onMouseDown:A(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:A(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:A(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});Pi.displayName=Ri;var Ai="TabsContent",Ti=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=rr(Ai,n),l=_i(a.baseId,r),u=Ni(a.baseId,r),d=r===a.value,f=c.useRef(d);return c.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(q,{present:o||d,children:({present:p})=>v.jsx(N.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});Ti.displayName=Ai;function _i(e,t){return`${e}-trigger-${t}`}function Ni(e,t){return`${e}-content-${t}`}var Cp=Si,Ep=Ei,Rp=Pi,Pp=Ti,Qt="Switch",[Tf]=ee(Qt),[_f,Nf]=Tf(Qt),Oi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l="on",onCheckedChange:u,form:d,...f}=e,[p,m]=c.useState(null),y=L(t,b=>m(b)),h=c.useRef(!1),g=p?d||!!p.closest("form"):!0,[w,x]=me({prop:o,defaultProp:s??!1,onChange:u,caller:Qt});return v.jsxs(_f,{scope:n,checked:w,disabled:a,children:[v.jsx(N.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Li(w),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:y,onClick:A(e.onClick,b=>{x(S=>!S),g&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})}),g&&v.jsx(Mi,{control:p,bubbles:!h.current,name:r,value:l,checked:w,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Oi.displayName=Qt;var Ii="SwitchThumb",Di=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Nf(Ii,n);return v.jsx(N.span,{"data-state":Li(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Di.displayName=Ii;var Of="SwitchBubbleInput",Mi=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=c.useRef(null),a=L(i,s),l=Is(n),u=Kr(t);return c.useEffect(()=>{const d=i.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[l,n,r]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Mi.displayName=Of;function Li(e){return e?"checked":"unchecked"}var Ap=Oi,Tp=Di;export{ep as $,gp as A,yp as B,Ff as C,Fu as D,wp as E,xp as F,Sp as G,bp as H,lp as I,Cp as J,Ep as K,pp as L,Rp as M,Pp as N,Lu as O,$f as P,Ap as Q,Lf as R,ol as S,jf as T,Tp as U,Vf as V,Gf as W,Yf as X,Kf as Y,qf as Z,Jf as _,Mf as a,Qf as a0,Zf as a1,Xf as a2,Uf as a3,zf as a4,kf as a5,Wf as b,Bf as c,Hf as d,ul as e,tp as f,np as g,rp as h,op as i,Iu as j,Mu as k,ju as l,ss as m,$u as n,sp as o,vd as p,hd as q,ip as r,cp as s,ap as t,up as u,dp as v,fp as w,vp as x,mp as y,hp as z};
|
|
65
|
-
//# sourceMappingURL=vendor-radix-3UdfCgs_.js.map
|
|
@@ -41,4 +41,3 @@ Error generating stack: `+o.message+`
|
|
|
41
41
|
*/var ka="popstate";function Ea(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Lp(e={}){function t(r,l){var s;let o=(s=l.state)==null?void 0:s.masked,{pathname:u,search:i,hash:a}=o||r.location;return su("",{pathname:u,search:i,hash:a},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,l){return typeof l=="string"?l:ur(l)}return Tp(t,n,null,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ue(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Np(){return Math.random().toString(36).substring(2,10)}function Ca(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function su(e,t,n=null,r,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?yn(t):t,state:n,key:t&&t.key||r||Np(),mask:l}}function ur({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function yn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Tp(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,u=l.history,i="POP",a=null,s=p();s==null&&(s=0,u.replaceState({...u.state,idx:s},""));function p(){return(u.state||{idx:null}).idx}function d(){i="POP";let C=p(),f=C==null?null:C-s;s=C,a&&a({action:i,location:y.location,delta:f})}function m(C,f){i="PUSH";let c=Ea(C)?C:su(y.location,C,f);s=p()+1;let h=Ca(c,s),S=y.createHref(c.mask||c);try{u.pushState(h,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;l.location.assign(S)}o&&a&&a({action:i,location:y.location,delta:1})}function g(C,f){i="REPLACE";let c=Ea(C)?C:su(y.location,C,f);s=p();let h=Ca(c,s),S=y.createHref(c.mask||c);u.replaceState(h,"",S),o&&a&&a({action:i,location:y.location,delta:0})}function w(C){return zp(C)}let y={get action(){return i},get location(){return e(l,u)},listen(C){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(ka,d),a=C,()=>{l.removeEventListener(ka,d),a=null}},createHref(C){return t(l,C)},createURL:w,encodeLocation(C){let f=w(C);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:m,replace:g,go(C){return u.go(C)}};return y}function zp(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),A(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ur(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jc(e,t,n="/"){return Dp(e,t,n,!1)}function Dp(e,t,n,r,l){let o=typeof t=="string"?yn(t):t,u=tt(o.pathname||"/",n);if(u==null)return null;let i=Op(e),a=null,s=Qp(u);for(let p=0;a==null&&p<i.length;++p)a=Wp(i[p],s,r);return a}function Op(e){let t=Ac(e);return Mp(t),t}function Ac(e,t=[],n=[],r="",l=!1){let o=(u,i,a=l,s)=>{let p={relativePath:s===void 0?u.path||"":s,caseSensitive:u.caseSensitive===!0,childrenIndex:i,route:u};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&a)return;A(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let d=Ie([r,p.relativePath]),m=n.concat(p);u.children&&u.children.length>0&&(A(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Ac(u.children,t,m,d,a)),!(u.path==null&&!u.index)&&t.push({path:d,score:Bp(d,u.index),routesMeta:m})};return e.forEach((u,i)=>{var a;if(u.path===""||!((a=u.path)!=null&&a.includes("?")))o(u,i);else for(let s of Bc(u.path))o(u,i,!0,s)}),t}function Bc(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let u=Bc(r.join("/")),i=[];return i.push(...u.map(a=>a===""?o:[o,a].join("/"))),l&&i.push(...u),i.map(a=>e.startsWith("/")&&a===""?"/":a)}function Mp(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Hp(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Fp=/^:[\w-]+$/,Ip=3,$p=2,Up=1,jp=10,Ap=-2,xa=e=>e==="*";function Bp(e,t){let n=e.split("/"),r=n.length;return n.some(xa)&&(r+=Ap),t&&(r+=$p),n.filter(l=>!xa(l)).reduce((l,o)=>l+(Fp.test(o)?Ip:o===""?Up:jp),r)}function Hp(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Wp(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",u=[];for(let i=0;i<r.length;++i){let a=r[i],s=i===r.length-1,p=o==="/"?t:t.slice(o.length)||"/",d=gl({path:a.relativePath,caseSensitive:a.caseSensitive,end:s},p),m=a.route;if(!d&&s&&n&&!r[r.length-1].route.index&&(d=gl({path:a.relativePath,caseSensitive:a.caseSensitive,end:!1},p)),!d)return null;Object.assign(l,d.params),u.push({params:l,pathname:Ie([o,d.pathname]),pathnameBase:Gp(Ie([o,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(o=Ie([o,d.pathnameBase]))}return u}function gl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Vp(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),i=l.slice(1);return{params:r.reduce((s,{paramName:p,isOptional:d},m)=>{if(p==="*"){let w=i[m]||"";u=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=i[m];return d&&!g?s[p]=void 0:s[p]=(g||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:u,pattern:e}}function Vp(e,t=!1,n=!0){Ue(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,i,a,s,p)=>{if(r.push({paramName:i,isOptional:a!=null}),a){let d=p.charAt(s+u.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Qp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ue(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function tt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Kp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Yp(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?yn(e):e,o;return n?(n=Hc(n),n.startsWith("/")?o=Ra(n.substring(1),"/"):o=Ra(n,t)):o=t,{pathname:o,search:Jp(r),hash:Zp(l)}}function Ra(e,t){let n=wl(t).split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function ho(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Xp(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oi(e){let t=Xp(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Fl(e,t,n,r=!1){let l;typeof e=="string"?l=yn(e):(l={...e},A(!l.pathname||!l.pathname.includes("?"),ho("?","pathname","search",l)),A(!l.pathname||!l.pathname.includes("#"),ho("#","pathname","hash",l)),A(!l.search||!l.search.includes("#"),ho("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,i;if(u==null)i=n;else{let d=t.length-1;if(!r&&u.startsWith("..")){let m=u.split("/");for(;m[0]==="..";)m.shift(),d-=1;l.pathname=m.join("/")}i=d>=0?t[d]:"/"}let a=Yp(l,i),s=u&&u!=="/"&&u.endsWith("/"),p=(o||u===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||p)&&(a.pathname+="/"),a}var Hc=e=>e.replace(/\/\/+/g,"/"),Ie=e=>Hc(e.join("/")),wl=e=>e.replace(/\/+$/,""),Gp=e=>wl(e).replace(/^\/*/,"/"),Jp=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zp=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qp=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function eh(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ie(t)||"/"}var Wc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vc(e,t){let n=e;if(typeof n!="string"||!Kp.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(Wc)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),i=tt(u.pathname,t);u.origin===o.origin&&i!=null?n=i+u.search+u.hash:l=!0}catch{Ue(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Qc=["POST","PUT","PATCH","DELETE"];new Set(Qc);var th=["GET",...Qc];new Set(th);var gn=v.createContext(null);gn.displayName="DataRouter";var Il=v.createContext(null);Il.displayName="DataRouterState";var Kc=v.createContext(!1);function nh(){return v.useContext(Kc)}var Yc=v.createContext({isTransitioning:!1});Yc.displayName="ViewTransition";var rh=v.createContext(new Map);rh.displayName="Fetchers";var lh=v.createContext(null);lh.displayName="Await";var Ee=v.createContext(null);Ee.displayName="Navigation";var dr=v.createContext(null);dr.displayName="Location";var Ne=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ne.displayName="Route";var ui=v.createContext(null);ui.displayName="RouteError";var Xc="REACT_ROUTER_ERROR",oh="REDIRECT",uh="ROUTE_ERROR_RESPONSE";function ih(e){if(e.startsWith(`${Xc}:${oh}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ah(e){if(e.startsWith(`${Xc}:${uh}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new qp(t.status,t.statusText,t.data)}catch{}}function sh(e,{relative:t}={}){A(wn(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ee),{hash:l,pathname:o,search:u}=pr(e,{relative:t}),i=o;return n!=="/"&&(i=o==="/"?n:Ie([n,o])),r.createHref({pathname:i,search:u,hash:l})}function wn(){return v.useContext(dr)!=null}function Qe(){return A(wn(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(dr).location}var Gc="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jc(e){v.useContext(Ee).static||v.useLayoutEffect(e)}function Zc(){let{isDataRoute:e}=v.useContext(Ne);return e?xh():ch()}function ch(){A(wn(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(gn),{basename:t,navigator:n}=v.useContext(Ee),{matches:r}=v.useContext(Ne),{pathname:l}=Qe(),o=JSON.stringify(oi(r)),u=v.useRef(!1);return Jc(()=>{u.current=!0}),v.useCallback((a,s={})=>{if(Ue(u.current,Gc),!u.current)return;if(typeof a=="number"){n.go(a);return}let p=Fl(a,JSON.parse(o),l,s.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ie([t,p.pathname])),(s.replace?n.replace:n.push)(p,s.state,s)},[t,n,o,l,e])}var fh=v.createContext(null);function dh(e){let t=v.useContext(Ne).outlet;return v.useMemo(()=>t&&v.createElement(fh.Provider,{value:e},t),[t,e])}function sm(){let{matches:e}=v.useContext(Ne),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function pr(e,{relative:t}={}){let{matches:n}=v.useContext(Ne),{pathname:r}=Qe(),l=JSON.stringify(oi(n));return v.useMemo(()=>Fl(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function ph(e,t){return qc(e,t)}function qc(e,t,n){var C;A(wn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=v.useContext(Ee),{matches:l}=v.useContext(Ne),o=l[l.length-1],u=o?o.params:{},i=o?o.pathname:"/",a=o?o.pathnameBase:"/",s=o&&o.route;{let f=s&&s.path||"";ef(i,!s||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${i}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
42
42
|
|
|
43
43
|
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let p=Qe(),d;if(t){let f=typeof t=="string"?yn(t):t;A(a==="/"||((C=f.pathname)==null?void 0:C.startsWith(a)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${a}" but pathname "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=p;let m=d.pathname||"/",g=m;if(a!=="/"){let f=a.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(f.length).join("/")}let w=n&&n.state.matches.length?n.state.matches.map(f=>Object.assign(f,{route:n.manifest[f.route.id]||f.route})):jc(e,{pathname:g});Ue(s||w!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ue(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=gh(w&&w.map(f=>Object.assign({},f,{params:Object.assign({},u,f.params),pathname:Ie([a,r.encodeLocation?r.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?a:Ie([a,r.encodeLocation?r.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),l,n);return t&&y?v.createElement(dr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},y):y}function hh(){let e=Ch(),t=bp(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,u)}var mh=v.createElement(hh,null),bc=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=ah(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Ne.Provider,{value:this.props.routeContext},v.createElement(ui.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(vh,{error:e},t):t}};bc.contextType=Kc;var mo=new WeakMap;function vh({children:e,error:t}){let{basename:n}=v.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=ih(t.digest);if(r){let l=mo.get(t);if(l)throw l;let o=Vc(r.location,n);if(Wc&&!mo.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw mo.set(t,u),u}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function yh({routeContext:e,match:t,children:n}){let r=v.useContext(gn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ne.Provider,{value:e},n)}function gh(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let l=e,o=r==null?void 0:r.errors;if(o!=null){let p=l.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);A(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,p+1))}let u=!1,i=-1;if(n&&r){u=r.renderFallback;for(let p=0;p<l.length;p++){let d=l[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(i=p),d.route.id){let{loaderData:m,errors:g}=r,w=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!g||g[d.route.id]===void 0);if(d.route.lazy||w){n.isStatic&&(u=!0),i>=0?l=l.slice(0,i+1):l=[l[0]];break}}}}let a=n==null?void 0:n.onError,s=r&&a?(p,d)=>{var m,g;a(p,{location:r.location,params:((g=(m=r.matches)==null?void 0:m[0])==null?void 0:g.params)??{},pattern:eh(r.matches),errorInfo:d})}:void 0;return l.reduceRight((p,d,m)=>{let g,w=!1,y=null,C=null;r&&(g=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||mh,u&&(i<0&&m===0?(ef("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):i===m&&(w=!0,C=d.route.hydrateFallbackElement||null)));let f=t.concat(l.slice(0,m+1)),c=()=>{let h;return g?h=y:w?h=C:d.route.Component?h=v.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=p,v.createElement(yh,{match:d,routeContext:{outlet:p,matches:f,isDataRoute:r!=null},children:h})};return r&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?v.createElement(bc,{location:r.location,revalidation:r.revalidation,component:y,error:g,children:c(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:s}):c()},null)}function ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wh(e){let t=v.useContext(gn);return A(t,ii(e)),t}function Sh(e){let t=v.useContext(Il);return A(t,ii(e)),t}function kh(e){let t=v.useContext(Ne);return A(t,ii(e)),t}function ai(e){let t=kh(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Eh(){return ai("useRouteId")}function Ch(){var r;let e=v.useContext(ui),t=Sh("useRouteError"),n=ai("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function xh(){let{router:e}=wh("useNavigate"),t=ai("useNavigate"),n=v.useRef(!1);return Jc(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{Ue(n.current,Gc),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var Pa={};function ef(e,t,n){!t&&!Pa[e]&&(Pa[e]=!0,Ue(!1,n))}v.memo(Rh);function Rh({routes:e,manifest:t,future:n,state:r,isStatic:l,onError:o}){return qc(e,void 0,{manifest:t,state:r,isStatic:l,onError:o})}function cm({to:e,replace:t,state:n,relative:r}){A(wn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=v.useContext(Ee);Ue(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=v.useContext(Ne),{pathname:u}=Qe(),i=Zc(),a=Fl(e,oi(o),u,r==="path"),s=JSON.stringify(a);return v.useEffect(()=>{i(JSON.parse(s),{replace:t,state:n,relative:r})},[i,s,r,t,n]),null}function fm(e){return dh(e.context)}function Ph(e){A(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _h({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1,useTransitions:u}){A(!wn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=v.useMemo(()=>({basename:i,navigator:l,static:o,useTransitions:u,future:{}}),[i,l,o,u]);typeof n=="string"&&(n=yn(n));let{pathname:s="/",search:p="",hash:d="",state:m=null,key:g="default",mask:w}=n,y=v.useMemo(()=>{let C=tt(s,i);return C==null?null:{location:{pathname:C,search:p,hash:d,state:m,key:g,mask:w},navigationType:r}},[i,s,p,d,m,g,r,w]);return Ue(y!=null,`<Router basename="${i}"> is not able to match the URL "${s}${p}${d}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:v.createElement(Ee.Provider,{value:a},v.createElement(dr.Provider,{children:t,value:y}))}function dm({children:e,location:t}){return ph(cu(e),t)}function cu(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,cu(r.props.children,o));return}A(r.type===Ph,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=cu(r.props.children,o)),n.push(u)}),n}var Kr="get",Yr="application/x-www-form-urlencoded";function $l(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Lh(e){return $l(e)&&e.tagName.toLowerCase()==="button"}function Nh(e){return $l(e)&&e.tagName.toLowerCase()==="form"}function Th(e){return $l(e)&&e.tagName.toLowerCase()==="input"}function zh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Dh(e,t){return e.button===0&&(!t||t==="_self")&&!zh(e)}var Or=null;function Oh(){if(Or===null)try{new FormData(document.createElement("form"),0),Or=!1}catch{Or=!0}return Or}var Mh=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vo(e){return e!=null&&!Mh.has(e)?(Ue(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yr}"`),null):e}function Fh(e,t){let n,r,l,o,u;if(Nh(e)){let i=e.getAttribute("action");r=i?tt(i,t):null,n=e.getAttribute("method")||Kr,l=vo(e.getAttribute("enctype"))||Yr,o=new FormData(e)}else if(Lh(e)||Th(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||i.getAttribute("action");if(r=a?tt(a,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Kr,l=vo(e.getAttribute("formenctype"))||vo(i.getAttribute("enctype"))||Yr,o=new FormData(i,e),!Oh()){let{name:s,type:p,value:d}=e;if(p==="image"){let m=s?`${s}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else s&&o.append(s,d)}}else{if($l(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Kr,r=null,l=Yr,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:r,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function si(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function tf(e,t,n,r){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${r}`:l.pathname=`${l.pathname}.${r}`:l.pathname==="/"?l.pathname=`_root.${r}`:t&&tt(l.pathname,t)==="/"?l.pathname=`${wl(t)}/_root.${r}`:l.pathname=`${wl(l.pathname)}.${r}`,l}async function Ih(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $h(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Uh(e,t,n){let r=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await Ih(o,n);return u.links?u.links():[]}return[]}));return Hh(r.flat(1).filter($h).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function _a(e,t,n,r,l,o){let u=(a,s)=>n[s]?a.route.id!==n[s].route.id:!0,i=(a,s)=>{var p;return n[s].pathname!==a.pathname||((p=n[s].route.path)==null?void 0:p.endsWith("*"))&&n[s].params["*"]!==a.params["*"]};return o==="assets"?t.filter((a,s)=>u(a,s)||i(a,s)):o==="data"?t.filter((a,s)=>{var d;let p=r.routes[a.route.id];if(!p||!p.hasLoader)return!1;if(u(a,s)||i(a,s))return!0;if(a.route.shouldRevalidate){let m=a.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function jh(e,t,{includeHydrateFallback:n}={}){return Ah(e.map(r=>{let l=t.routes[r.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function Ah(e){return[...new Set(e)]}function Bh(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Hh(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let o=JSON.stringify(Bh(l));return n.has(o)||(n.add(o),r.push({key:o,link:l})),r},[])}function ci(){let e=v.useContext(gn);return si(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Wh(){let e=v.useContext(Il);return si(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var fi=v.createContext(void 0);fi.displayName="FrameworkContext";function di(){let e=v.useContext(fi);return si(e,"You must render this element inside a <HydratedRouter> element"),e}function Vh(e,t){let n=v.useContext(fi),[r,l]=v.useState(!1),[o,u]=v.useState(!1),{onFocus:i,onBlur:a,onMouseEnter:s,onMouseLeave:p,onTouchStart:d}=t,m=v.useRef(null);v.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let y=f=>{f.forEach(c=>{u(c.isIntersecting)})},C=new IntersectionObserver(y,{threshold:.5});return m.current&&C.observe(m.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let y=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(y)}}},[r]);let g=()=>{l(!0)},w=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Nn(i,g),onBlur:Nn(a,w),onMouseEnter:Nn(s,g),onMouseLeave:Nn(p,w),onTouchStart:Nn(d,g)}]:[!1,m,{}]}function Nn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qh({page:e,...t}){let n=nh(),{router:r}=ci(),l=v.useMemo(()=>jc(r.routes,e,r.basename),[r.routes,e,r.basename]);return l?n?v.createElement(Yh,{page:e,matches:l,...t}):v.createElement(Xh,{page:e,matches:l,...t}):null}function Kh(e){let{manifest:t,routeModules:n}=di(),[r,l]=v.useState([]);return v.useEffect(()=>{let o=!1;return Uh(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),r}function Yh({page:e,matches:t,...n}){let r=Qe(),{future:l}=di(),{basename:o}=ci(),u=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let i=tf(e,o,l.unstable_trailingSlashAwareDataRequests,"rsc"),a=!1,s=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?a=!0:s.push(p.route.id);return a&&s.length>0&&i.searchParams.set("_routes",s.join(",")),[i.pathname+i.search]},[o,l.unstable_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,u.map(i=>v.createElement("link",{key:i,rel:"prefetch",as:"fetch",href:i,...n})))}function Xh({page:e,matches:t,...n}){let r=Qe(),{future:l,manifest:o,routeModules:u}=di(),{basename:i}=ci(),{loaderData:a,matches:s}=Wh(),p=v.useMemo(()=>_a(e,t,s,o,r,"data"),[e,t,s,o,r]),d=v.useMemo(()=>_a(e,t,s,o,r,"assets"),[e,t,s,o,r]),m=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,C=!1;if(t.forEach(c=>{var S;let h=o.routes[c.route.id];!h||!h.hasLoader||(!p.some(E=>E.route.id===c.route.id)&&c.route.id in a&&((S=u[c.route.id])!=null&&S.shouldRevalidate)||h.hasClientLoader?C=!0:y.add(c.route.id))}),y.size===0)return[];let f=tf(e,i,l.unstable_trailingSlashAwareDataRequests,"data");return C&&y.size>0&&f.searchParams.set("_routes",t.filter(c=>y.has(c.route.id)).map(c=>c.route.id).join(",")),[f.pathname+f.search]},[i,l.unstable_trailingSlashAwareDataRequests,a,r,o,p,t,e,u]),g=v.useMemo(()=>jh(d,o),[d,o]),w=Kh(d);return v.createElement(v.Fragment,null,m.map(y=>v.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),g.map(y=>v.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),w.map(({key:y,link:C})=>v.createElement("link",{key:y,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function Gh(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Jh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Jh&&(window.__reactRouterVersion="7.15.0")}catch{}function pm({basename:e,children:t,useTransitions:n,window:r}){let l=v.useRef();l.current==null&&(l.current=Lp({window:r,v5Compat:!0}));let o=l.current,[u,i]=v.useState({action:o.action,location:o.location}),a=v.useCallback(s=>{n===!1?i(s):v.startTransition(()=>i(s))},[n]);return v.useLayoutEffect(()=>o.listen(a),[o,a]),v.createElement(_h,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,useTransitions:n})}var nf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rf=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:o,replace:u,mask:i,state:a,target:s,to:p,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:g,...w},y){let{basename:C,navigator:f,useTransitions:c}=v.useContext(Ee),h=typeof p=="string"&&nf.test(p),S=Vc(p,C);p=S.to;let E=sh(p,{relative:l}),x=Qe(),R=null;if(i){let je=Fl(i,[],x.mask?x.mask.pathname:"/",!0);C!=="/"&&(je.pathname=je.pathname==="/"?C:Ie([C,je.pathname])),R=f.createHref(je)}let[L,F,T]=Vh(r,w),me=em(p,{replace:u,mask:i,state:a,target:s,preventScrollReset:d,relative:l,viewTransition:m,defaultShouldRevalidate:g,useTransitions:c});function xt(je){t&&t(je),je.defaultPrevented||me(je)}let rt=!(S.isExternal||o),Sn=v.createElement("a",{...w,...T,href:(rt?R:void 0)||S.absoluteURL||E,onClick:rt?xt:t,ref:Gh(y,F),target:s,"data-discover":!h&&n==="render"?"true":void 0});return L&&!h?v.createElement(v.Fragment,null,Sn,v.createElement(Qh,{page:E})):Sn});rf.displayName="Link";var Zh=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:o,to:u,viewTransition:i,children:a,...s},p){let d=pr(u,{relative:s.relative}),m=Qe(),g=v.useContext(Il),{navigator:w,basename:y}=v.useContext(Ee),C=g!=null&&om(d)&&i===!0,f=w.encodeLocation?w.encodeLocation(d).pathname:d.pathname,c=m.pathname,h=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(c=c.toLowerCase(),h=h?h.toLowerCase():null,f=f.toLowerCase()),h&&y&&(h=tt(h,y)||h);const S=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let E=c===f||!l&&c.startsWith(f)&&c.charAt(S)==="/",x=h!=null&&(h===f||!l&&h.startsWith(f)&&h.charAt(f.length)==="/"),R={isActive:E,isPending:x,isTransitioning:C},L=E?t:void 0,F;typeof r=="function"?F=r(R):F=[r,E?"active":null,x?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let T=typeof o=="function"?o(R):o;return v.createElement(rf,{...s,"aria-current":L,className:F,ref:p,style:T,to:u,viewTransition:i},typeof a=="function"?a(R):a)});Zh.displayName="NavLink";var qh=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:o,method:u=Kr,action:i,onSubmit:a,relative:s,preventScrollReset:p,viewTransition:d,defaultShouldRevalidate:m,...g},w)=>{let{useTransitions:y}=v.useContext(Ee),C=rm(),f=lm(i,{relative:s}),c=u.toLowerCase()==="get"?"get":"post",h=typeof i=="string"&&nf.test(i),S=E=>{if(a&&a(E),E.defaultPrevented)return;E.preventDefault();let x=E.nativeEvent.submitter,R=(x==null?void 0:x.getAttribute("formmethod"))||u,L=()=>C(x||E.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:l,state:o,relative:s,preventScrollReset:p,viewTransition:d,defaultShouldRevalidate:m});y&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:w,method:c,action:f,onSubmit:r?a:S,...g,"data-discover":!h&&e==="render"?"true":void 0})});qh.displayName="Form";function bh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lf(e){let t=v.useContext(gn);return A(t,bh(e)),t}function em(e,{target:t,replace:n,mask:r,state:l,preventScrollReset:o,relative:u,viewTransition:i,defaultShouldRevalidate:a,useTransitions:s}={}){let p=Zc(),d=Qe(),m=pr(e,{relative:u});return v.useCallback(g=>{if(Dh(g,t)){g.preventDefault();let w=n!==void 0?n:ur(d)===ur(m),y=()=>p(e,{replace:w,mask:r,state:l,preventScrollReset:o,relative:u,viewTransition:i,defaultShouldRevalidate:a});s?v.startTransition(()=>y()):y()}},[d,p,m,n,r,l,t,e,o,u,i,a,s])}var tm=0,nm=()=>`__${String(++tm)}__`;function rm(){let{router:e}=lf("useSubmit"),{basename:t}=v.useContext(Ee),n=Eh(),r=e.fetch,l=e.navigate;return v.useCallback(async(o,u={})=>{let{action:i,method:a,encType:s,formData:p,body:d}=Fh(o,t);if(u.navigate===!1){let m=u.fetcherKey||nm();await r(m,n,u.action||i,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:p,body:d,formMethod:u.method||a,formEncType:u.encType||s,flushSync:u.flushSync})}else await l(u.action||i,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:p,body:d,formMethod:u.method||a,formEncType:u.encType||s,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,l,t,n])}function lm(e,{relative:t}={}){let{basename:n}=v.useContext(Ee),r=v.useContext(Ne);A(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),o={...pr(e||".",{relative:t})},u=Qe();if(e==null){o.search=u.search;let i=new URLSearchParams(o.search),a=i.getAll("index");if(a.some(p=>p==="")){i.delete("index"),a.filter(d=>d).forEach(d=>i.append("index",d));let p=i.toString();o.search=p?`?${p}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ie([n,o.pathname])),ur(o)}function om(e,{relative:t}={}){let n=v.useContext(Yc);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=lf("useViewTransitionState"),l=pr(e,{relative:t});if(!n.isTransitioning)return!1;let o=tt(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=tt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return gl(l.pathname,u)!=null||gl(l.pathname,o)!=null}export{pm as B,rf as L,Zh as N,fm as O,im as R,_p as a,am as b,Ef as c,um as d,Zc as e,dm as f,La as g,Ph as h,cm as i,sm as j,v as r,Qe as u};
|
|
44
|
-
//# sourceMappingURL=vendor-react-C7pctHW3.js.map
|