@open-mercato/cezar 0.16.0 → 0.16.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/dist/contract/agent-profiles.d.ts +2 -2
- package/dist/contract/index.js +3 -0
- package/dist/contract/projects.d.ts +4 -0
- package/dist/core/backend-detect.js +10 -0
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +3 -0
- package/dist/core/codex-app-server-runner.js +46 -4
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/cursor-bin.d.ts +7 -0
- package/dist/core/cursor-bin.js +11 -0
- package/dist/core/cursor-bin.js.map +1 -1
- package/dist/core/provider-auth.d.ts +25 -7
- package/dist/core/provider-auth.js +141 -17
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/usage-limit.js +51 -6
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/runs/agent-error-telemetry.d.ts +3 -2
- package/dist/runs/agent-error-telemetry.js +24 -3
- package/dist/runs/agent-error-telemetry.js.map +1 -1
- package/dist/self-update/checkouts.js +8 -4
- package/dist/self-update/checkouts.js.map +1 -1
- package/dist/server/provider-auth-runtime.js +6 -3
- package/dist/server/provider-auth-runtime.js.map +1 -1
- package/dist/server/server.d.ts +10 -0
- package/dist/server/server.js +12 -3
- package/dist/server/server.js.map +1 -1
- package/dist/server/terminal/detected-urls.js +6 -1
- package/dist/server/terminal/detected-urls.js.map +1 -1
- package/dist/workspace/projects.d.ts +2 -0
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-task-pickers-DXaIqpJo.js → agent-task-pickers-B5I-IyLy.js} +1 -1
- package/web/dist/assets/{alert-dialog-BRafiUQO.js → alert-dialog-DvPnvVvK.js} +1 -1
- package/web/dist/assets/arrow-left-BELOeFyX.js +1 -0
- package/web/dist/assets/{automation-format-DeGsIrRc.js → automation-format-BL4n19a2.js} +1 -1
- package/web/dist/assets/{automations-route-CwLG2JNr.js → automations-route-BXxP0xWu.js} +1 -1
- package/web/dist/assets/{button-ZPJ84lSe.js → button-Clwd6u4_.js} +1 -1
- package/web/dist/assets/{centered-state-DPvWqO6I.js → centered-state-nM7v9xtl.js} +1 -1
- package/web/dist/assets/check-Dt8U0Zvm.js +1 -0
- package/web/dist/assets/chevron-left-Df5IsPem.js +1 -0
- package/web/dist/assets/chevron-right-VbYrJ_st.js +1 -0
- package/web/dist/assets/circle-check-DnEaQ9Rj.js +1 -0
- package/web/dist/assets/{collapsible-D5nsq_lY.js → collapsible-Bdyuw-he.js} +1 -1
- package/web/dist/assets/{commit-list-Cj_rtptn.js → commit-list-xMdmPYbz.js} +1 -1
- package/web/dist/assets/{compare-variants-DI8e5hXy.js → compare-variants-BWaSra3R.js} +1 -1
- package/web/dist/assets/{dashboard-Bq8Zgcct.js → dashboard-i4GP_SB1.js} +1 -1
- package/web/dist/assets/{diff-Dzk_1Vj_.js → diff-CJKocK17.js} +2 -2
- package/web/dist/assets/{diff-stat-CG6Qr4ac.js → diff-stat-CiWUpWY0.js} +1 -1
- package/web/dist/assets/{diff-view-CnRMn9fw.js → diff-view-DqWj0yYe.js} +1 -1
- package/web/dist/assets/{download-CAIBRPES.js → download-DOJ8Dqfh.js} +1 -1
- package/web/dist/assets/{file-BuJHbBa7.js → file-1a6_DhLG.js} +1 -1
- package/web/dist/assets/{file-preview-Dy3TYcU4.js → file-preview-iucr8WDo.js} +1 -1
- package/web/dist/assets/{file-text-DYR0Kxgo.js → file-text-DmMQx3hx.js} +1 -1
- package/web/dist/assets/{git-pull-request-draft-tzNd17hB.js → git-pull-request-draft-Cn24ayXz.js} +1 -1
- package/web/dist/assets/git-tab-loading-BfC2ir8N.js +1 -0
- package/web/dist/assets/{git-toolbar-Dc6kAzPv.js → git-toolbar-DU5Ca6RI.js} +1 -1
- package/web/dist/assets/{github-k0H4K2Xv.js → github-uQ7k7SEK.js} +1 -1
- package/web/dist/assets/{host-usage-BmL2kzAM.js → host-usage-DjDYDU0A.js} +1 -1
- package/web/dist/assets/{icon-tooltip-BEOrU9g6.js → icon-tooltip-YXzUubMO.js} +1 -1
- package/web/dist/assets/{index-B7LeGGi2.js → index-Cse8uyXO.js} +4 -4
- package/web/dist/assets/{input-NF_gJ6fV.js → input-DIWTlsx6.js} +1 -1
- package/web/dist/assets/{layout-cards-Cx4pRGy3.js → layout-cards-Sur4EWtx.js} +1 -1
- package/web/dist/assets/loader-circle-D-ter0qP.js +1 -0
- package/web/dist/assets/{markdown-D27e_KDW.js → markdown-BzqT8I8y.js} +1 -1
- package/web/dist/assets/{markdown-DUNEzJJg.js → markdown-Rbaca31B.js} +1 -1
- package/web/dist/assets/{message-square-DHEW7I0Y.js → message-square-EWpWB_Gr.js} +1 -1
- package/web/dist/assets/plus-CBVm02wz.js +1 -0
- package/web/dist/assets/{project-router-CIOAbq2D.js → project-router-DZsR9P9C.js} +1 -1
- package/web/dist/assets/{queries-B--Cyn_0.js → queries-CI0EmEcH.js} +1 -1
- package/web/dist/assets/{reference-chip-C0KB59wJ.js → reference-chip-DnemrSPW.js} +1 -1
- package/web/dist/assets/{repo-git-BlEiXMbR.js → repo-git-CxAx2JBB.js} +1 -1
- package/web/dist/assets/{run-diff-C_AD_Pms.js → run-diff-BPZ85gAE.js} +1 -1
- package/web/dist/assets/{save-Ct323V7q.js → save-B8DEQI2V.js} +1 -1
- package/web/dist/assets/{scroll-within-DVYNEANz.js → scroll-within-Cm6fjjNd.js} +1 -1
- package/web/dist/assets/{search-x-7tkSEIRx.js → search-x-CuinYQnl.js} +1 -1
- package/web/dist/assets/{settings-2-CmkgM6rX.js → settings-2-COky68xN.js} +1 -1
- package/web/dist/assets/{skills-DKqFJCnx.js → skills-B1z9gRg4.js} +1 -1
- package/web/dist/assets/{square-Du4NO0cr.js → square-8OFxLPoA.js} +1 -1
- package/web/dist/assets/{tabs-BhcbXPq1.js → tabs-BUk8rSoE.js} +1 -1
- package/web/dist/assets/{tag-DczwHOyX.js → tag-yruQH0i-.js} +1 -1
- package/web/dist/assets/{task-commits-DtSkB1UU.js → task-commits-W1ZZiEt4.js} +1 -1
- package/web/dist/assets/{task-graph-DalcExDj.js → task-graph-fkOtF8MX.js} +1 -1
- package/web/dist/assets/{task-notes-BHYduZ1z.js → task-notes-lmvd1UM7.js} +1 -1
- package/web/dist/assets/{task-workspace-LhAGqT6q.js → task-workspace-DA3mFwL9.js} +3 -3
- package/web/dist/assets/{terminal-tordSBUt.js → terminal-F3ZJ5fI8.js} +1 -1
- package/web/dist/assets/{terminal-drawer-Cvbqz2QG.js → terminal-drawer-DAkquqSe.js} +2 -2
- package/web/dist/assets/{textarea-Dy9f469S.js → textarea-ewNKsXDa.js} +1 -1
- package/web/dist/assets/{token-metrics-edH1Iifj.js → token-metrics-Dk2ZNHb_.js} +1 -1
- package/web/dist/assets/{tooltip-tycRJnh-.js → tooltip-B628Gs7C.js} +1 -1
- package/web/dist/assets/{tracker-BNqQ5hFE.js → tracker-wxG0l2wk.js} +1 -1
- package/web/dist/assets/{triangle-alert-BDB8QKSV.js → triangle-alert-BqI_9MkV.js} +1 -1
- package/web/dist/assets/{upload-H7_s70Ro.js → upload-J0hBTVF7.js} +1 -1
- package/web/dist/assets/{use-automations-7Eect_3d.js → use-automations-v77gHYDG.js} +1 -1
- package/web/dist/assets/{use-now-DUGH_55J.js → use-now-pBdvhv13.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-D4G7Y1CV.js → use-submit-shortcut-hAaAH4HY.js} +1 -1
- package/web/dist/assets/{workflow-graph-4GB6HfLn.js → workflow-graph-Bo72pTbt.js} +1 -1
- package/web/dist/assets/worktree-lifecycle-operation-DOTiqQFx.js +18 -0
- package/web/dist/assets/x-DMIsmLBt.js +1 -0
- package/web/dist/index.html +37 -37
- package/web/dist/assets/arrow-left-BfLRAgF_.js +0 -1
- package/web/dist/assets/check-Blje0ysd.js +0 -1
- package/web/dist/assets/chevron-left-CwNUPSrV.js +0 -1
- package/web/dist/assets/chevron-right-dAzuginM.js +0 -1
- package/web/dist/assets/circle-check-B_-oU6Lf.js +0 -1
- package/web/dist/assets/git-tab-loading-BL6wGQi_.js +0 -1
- package/web/dist/assets/loader-circle-i7B5PoZa.js +0 -1
- package/web/dist/assets/plus-CUeDPNAL.js +0 -1
- package/web/dist/assets/worktree-lifecycle-operation-C6S6Hgiq.js +0 -18
- package/web/dist/assets/x-PavsP4k3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{r as n}from"./button-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{r as n}from"./button-Clwd6u4_.js";e();var r=t();function i({className:e,type:t,...i}){return(0,r.jsx)(`input`,{type:t,"data-slot":`input`,className:n(`h-9 w-full min-w-0 rounded-md border border-input bg-card px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-soft-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...i})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./button-ZPJ84lSe.js";import{t as a}from"./project-router-CIOAbq2D.js";import{_ as o,f as s,g as c,h as l,m as u,p as d}from"./reference-chip-C0KB59wJ.js";import{$ as f,B as p,Dn as m,Et as h,Sn as g,W as _,Y as v,dt as y,mt as b}from"./git-tab-loading-BL6wGQi_.js";import{t as x}from"./check-Blje0ysd.js";import{f as S}from"./tooltip-tycRJnh-.js";import{a as C,c as w,i as T,l as E,n as D,r as O,u as k}from"./icon-tooltip-BEOrU9g6.js";import{t as A}from"./save-Ct323V7q.js";import{t as j}from"./x-PavsP4k3.js";import{t as M}from"./input-NF_gJ6fV.js";var N=e(t(),1),P=n(),F=2,ee=new Map,te=[],ne=[],re=30,I=`text/cez-view`,L=`text/cez-column`;function R({layouts:e,active:t,onSelect:n,onClose:o,saved:s=ne,onApplySaved:c,onSaveCurrent:l,onDeleteSaved:u,fixedViews:d=[],fixedActive:f=null,onViews:v=te,onSelectFixed:y,notesHref:b,notesActive:x=!1,showLayouts:S=!0,onViewDragStart:C,onViewDragEnd:w,onOpenBeside:A,onColumnDropClose:j,keyHints:M=ee,showKeyHints:R=!1}){let B=b?_(d):[...d],U=e=>e===`notes`?x:f===e,W=(0,N.useRef)(null),[ie,ae]=(0,N.useState)(0),[G,K]=(0,N.useState)(null),oe=`${B.join(`|`)}#${S&&f===null?t:``}`;(0,N.useEffect)(()=>{let e=W.current;if(!e)return;let t=()=>ae(e.clientWidth),n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[]);let[se,ce]=(0,N.useState)(0);(0,N.useEffect)(()=>{let e=typeof document>`u`?void 0:document.fonts;if(!e)return;let t=()=>ce(e=>e+1);return e.ready.then(t),e.addEventListener?.(`loadingdone`,t),()=>e.removeEventListener?.(`loadingdone`,t)},[]),(0,N.useLayoutEffect)(()=>K(null),[oe,ie,se]),(0,N.useLayoutEffect)(()=>{let e=W.current;G===null||G===0||!e||e.scrollWidth>e.clientWidth+1&&K(G-1)}),(0,N.useLayoutEffect)(()=>{let e=W.current;if(G!==null||!e)return;let t=[...e.querySelectorAll(`[data-strip-item]`)].map(e=>e.offsetWidth+F),n=[...e.querySelectorAll(`[data-strip-chrome]`)].reduce((e,t)=>e+t.offsetWidth+F,0),r=e.clientWidth-n;if(t.reduce((e,t)=>e+t,0)<=r){K(B.length);return}let i=B.findIndex(U),a=re,o=0;for(let[e,n]of t.entries()){let s=i>e?t[i]??0:0;if(a+n+s>r)break;a+=n,o+=1}K(o)});let q=G??B.length,J=B.slice(0,q),Y=B.findIndex(U);Y>=q&&(J=[...J,B[Y]]);let X=B.filter(e=>!J.includes(e)),[Z,Q]=(0,N.useState)(!1),$=e=>j!==void 0&&e.dataTransfer.types.includes(L);return(0,P.jsxs)(`div`,{ref:W,"data-slot":`layout-cards`,"data-drop-close":Z?``:void 0,className:r(`relative flex min-w-0 flex-1 items-end gap-0.5 overflow-x-clip rounded-md`,Z&&`bg-muted outline-1 outline-dashed outline-border`),onDragOver:e=>{$(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Q(!0))},onDragLeave:e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||Q(!1)},onDrop:e=>{if(Q(!1),!$(e))return;let t=e.dataTransfer.getData(L),n=Number(t);t===``||!Number.isInteger(n)||(e.preventDefault(),j?.(n))},children:[J.map(e=>{if(e===`notes`)return(0,P.jsxs)(a,{to:b,"data-strip-item":``,"aria-current":x?`page`:void 0,className:r(`relative -mb-px flex h-9 shrink-0 items-center gap-1.5 border-b-2 px-2.5 text-[13px] font-medium`,x?`border-foreground text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(z,{hint:R?M.get(`view:notes`):void 0,children:(0,P.jsx)(g,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})}),`Notes`]},`notes`);let t=B.indexOf(e)+1,n=p[e],o=U(e),s=v.includes(e),c=h(e),l=M.get(`view:${e}`);return(0,P.jsxs)(i,{type:`button`,variant:`ghost`,"data-slot":`layout-card`,"data-strip-item":``,"data-fixed":e,"data-active":o?`true`:void 0,"data-on":s?``:void 0,"aria-pressed":o||s,draggable:C!==void 0,title:C?`${c}${t<=9?` (${t})`:``} — drag onto the workspace to split, ⌥-click to open beside`:c,onClick:t=>{t.altKey&&A?A(e):y?.(e)},onDragStart:t=>{t.dataTransfer.setData(I,e),t.dataTransfer.effectAllowed=`copyMove`,C?.(e)},onDragEnd:()=>w?.(),className:r(`relative -mb-px h-9 shrink-0 gap-1.5 rounded-none border-b-2 border-transparent px-2.5 text-[13px] font-medium text-muted-foreground hover:bg-transparent hover:text-foreground active:translate-y-0`,(o||s)&&`text-foreground`,o&&`border-foreground`),children:[(0,P.jsx)(z,{hint:R?l:void 0,children:(0,P.jsx)(n,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})}),c,s&&!o?(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-2 right-1 size-1.5 rounded-full bg-primary`}):null]},e)}),X.length>0?(0,P.jsxs)(D,{children:[(0,P.jsx)(k,{asChild:!0,children:(0,P.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-action":`more-views`,"aria-label":`${X.length} more views`,title:`More views`,className:`mb-1 size-7 shrink-0 text-muted-foreground`,children:(0,P.jsx)(m,{"aria-hidden":`true`})})}),(0,P.jsx)(O,{align:`start`,className:`max-h-72 w-56 overflow-y-auto`,children:X.map(e=>{if(e===`notes`)return(0,P.jsx)(T,{asChild:!0,children:(0,P.jsxs)(a,{to:b,children:[(0,P.jsx)(g,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`truncate`,children:`Notes`}),M.get(`view:notes`)?(0,P.jsx)(E,{children:M.get(`view:notes`)}):null]})},`notes`);let t=p[e],n=M.get(`view:${e}`);return(0,P.jsxs)(T,{"data-view":e,onSelect:()=>y?.(e),children:[(0,P.jsx)(t,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`truncate`,children:h(e)}),n?(0,P.jsx)(E,{children:n}):null]},e)})})]}):null,Z?(0,P.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 rounded bg-background px-2 py-0.5 text-xs font-medium text-foreground shadow-sm`,children:`Drop to close this column`}):null,S?(0,P.jsx)(`div`,{"data-strip-chrome":``,className:`ml-auto flex shrink-0 items-center pb-1 pl-2`,children:(0,P.jsx)(H,{layouts:e,active:f===null?t:null,saved:s,onSelect:n,onClose:o,onApplySaved:c,onSaveCurrent:l,onDeleteSaved:u,suggestedName:V(e,f===null?t:null,f)})}):null]})}function z({hint:e,children:t}){let n=`pointer-events-none flex shrink-0 items-center justify-center rounded-[4px] bg-foreground font-mono text-[10px] leading-none font-semibold text-background`;return e?e.length===1?(0,P.jsx)(`kbd`,{"data-slot":`tab-key-hint`,"aria-hidden":`true`,className:r(n,`size-3.5`),children:e}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`invisible flex shrink-0`,children:t}),(0,P.jsx)(`kbd`,{"data-slot":`tab-key-hint`,"aria-hidden":`true`,className:r(n,`absolute -top-1 right-0 z-10 h-4 px-1`),children:e})]}):t}function B({count:e,className:t}){let n=Math.max(1,Math.min(e,3)),i=2.5,a=1.5,o=(20-i*2-a*(n-1))/n;return(0,P.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 20 14`,className:r(`h-3.5 w-5 shrink-0`,t),fill:`none`,children:[(0,P.jsx)(`rect`,{x:`0.6`,y:`0.6`,width:18.8,height:12.8,rx:`2`,stroke:`currentColor`,strokeWidth:`1.2`}),Array.from({length:n},(e,t)=>(0,P.jsx)(`rect`,{x:i+t*(o+a),y:i,width:o,height:14-i*2,rx:`0.75`,fill:`currentColor`,opacity:.55},t))]})}function V(e,t,n){let r=t===null?void 0:e.find(e=>e.name===t);return r&&r.name!==`Custom`?b(r.name):r?r.columns.map(e=>h(e.view)).join(` + `):n?`${h(n)} layout`:``}function H({layouts:e,active:t,saved:n,onSelect:a,onClose:o,onApplySaved:s,onSaveCurrent:c,onDeleteSaved:l,suggestedName:u}){let d=t===null?void 0:e.find(e=>e.name===t),f=new Set(n.map(e=>e.name)),p=e.filter(e=>!f.has(e.name)),[m,h]=(0,N.useState)(!1),g=(0,N.useRef)(!1),_=(0,N.useRef)(null);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(k,{asChild:!0,children:(0,P.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,ref:_,"data-action":`layouts`,"data-active-layout":d?d.name:void 0,"aria-label":d?`Layout: ${b(d.name)}`:`Layouts`,title:`Layouts — open a saved one, or save what is on screen`,className:r(`h-7 max-w-48 shrink-0 gap-1.5 px-2 text-[12.5px]`,d?`text-foreground`:`text-muted-foreground`),children:[(0,P.jsx)(B,{count:d?.columns.length??2}),(0,P.jsx)(`span`,{className:`truncate max-md:hidden`,children:d?b(d.name):`Layout`}),(0,P.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 opacity-60`})]})}),(0,P.jsxs)(O,{align:`end`,className:`max-h-96 w-64 overflow-y-auto`,onCloseAutoFocus:e=>{g.current&&(g.current=!1,e.preventDefault())},children:[(0,P.jsx)(C,{children:`Saved layouts`}),n.length===0?(0,P.jsx)(`p`,{className:`px-2 pb-1.5 text-xs text-muted-foreground`,children:`None yet — arrange the view (drag a tab onto it), then save it here. Saved layouts are offered in every task.`}):null,n.map(e=>(0,P.jsx)(U,{name:e.name,count:e.columns.length,selected:e.name===t,kind:`saved`,onPick:()=>s?.(e),remove:l?{label:`Delete saved layout ${e.name}`,run:()=>l(e.name)}:void 0},`saved:${e.name}`)),p.length>0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{}),(0,P.jsx)(C,{children:`This task`}),p.map(e=>(0,P.jsx)(U,{name:b(e.name),count:e.columns.length,selected:e.name===t,kind:`task`,onPick:()=>a(e.name),remove:{label:`Close layout ${b(e.name)}`,run:()=>o(e.name)}},`task:${e.name}`))]}):null,c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{}),(0,P.jsxs)(T,{"data-action":`save-layout`,onSelect:()=>{g.current=!0,h(!0)},children:[(0,P.jsx)(A,{"aria-hidden":`true`}),`Save current view as layout…`]})]}):null]})]}),(0,P.jsx)(W,{open:m,suggested:u,taken:f,onCommit:e=>{h(!1),c?.(e)},onCancel:()=>h(!1),returnFocus:()=>_.current?.focus()})]})}function U({name:e,count:t,selected:n,kind:r,onPick:i,remove:a}){return(0,P.jsxs)(T,{"data-layout":e,"data-layout-kind":r,"data-active":n?``:void 0,onSelect:i,"aria-keyshortcuts":a?`Delete`:void 0,onKeyDown:e=>{!a||e.key!==`Delete`&&e.key!==`Backspace`||(e.preventDefault(),a.run())},className:`group/layout pr-1`,children:[(0,P.jsx)(B,{count:t}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),n?(0,P.jsx)(x,{"aria-hidden":`true`,className:`size-3.5`}):null,a?(0,P.jsx)(`button`,{type:`button`,"aria-label":a.label,title:`${a.label} (Delete)`,className:`flex size-5 items-center justify-center rounded-sm text-muted-foreground opacity-0 group-hover/layout:opacity-100 group-focus/layout:opacity-100 hover:bg-background hover:text-foreground`,onPointerUp:e=>e.stopPropagation(),onClick:e=>{e.preventDefault(),e.stopPropagation(),a.run()},children:(0,P.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function W({open:e,suggested:t,taken:n,onCommit:r,onCancel:a,returnFocus:p}){let[m,h]=(0,N.useState)(``);(0,N.useEffect)(()=>{e&&h(t)},[e,t]);let g=m.trim(),_=g!==``&&y(g);return(0,P.jsx)(s,{open:e,onOpenChange:e=>!e&&a(),children:(0,P.jsx)(d,{className:`sm:max-w-sm`,onCloseAutoFocus:e=>{e.preventDefault(),p()},children:(0,P.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),g!==``&&!_&&r(g)},children:[(0,P.jsxs)(c,{children:[(0,P.jsx)(o,{children:`Save layout`}),(0,P.jsx)(u,{children:`Saved layouts are offered in every task, in every project.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{autoFocus:!0,"aria-label":`Layout name`,maxLength:v,value:m,onChange:e=>h(e.target.value),onFocus:e=>e.currentTarget.select()}),_?(0,P.jsx)(`p`,{className:`text-xs text-danger`,children:g===`Custom`?`“${f}” is the task's unsaved arrangement — pick another.`:`That name belongs to a view tab — pick another.`}):n.has(g)?(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Replaces the saved layout “`,g,`”.`]}):null]}),(0,P.jsxs)(l,{children:[(0,P.jsx)(i,{type:`button`,variant:`outline`,onClick:a,children:`Cancel`}),(0,P.jsx)(i,{type:`submit`,disabled:g===``||_,children:`Save`})]})]})})})}export{I as n,R as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./button-Clwd6u4_.js";import{t as a}from"./project-router-DZsR9P9C.js";import{_ as o,f as s,g as c,h as l,m as u,p as d}from"./reference-chip-DnemrSPW.js";import{$ as f,B as p,Dn as m,Et as h,Sn as g,W as _,Y as v,dt as y,mt as b}from"./git-tab-loading-BfC2ir8N.js";import{t as x}from"./check-Dt8U0Zvm.js";import{f as S}from"./tooltip-B628Gs7C.js";import{a as C,c as w,i as T,l as E,n as D,r as O,u as k}from"./icon-tooltip-YXzUubMO.js";import{t as A}from"./save-B8DEQI2V.js";import{t as j}from"./x-DMIsmLBt.js";import{t as M}from"./input-DIWTlsx6.js";var N=e(t(),1),P=n(),F=2,ee=new Map,te=[],ne=[],re=30,I=`text/cez-view`,L=`text/cez-column`;function R({layouts:e,active:t,onSelect:n,onClose:o,saved:s=ne,onApplySaved:c,onSaveCurrent:l,onDeleteSaved:u,fixedViews:d=[],fixedActive:f=null,onViews:v=te,onSelectFixed:y,notesHref:b,notesActive:x=!1,showLayouts:S=!0,onViewDragStart:C,onViewDragEnd:w,onOpenBeside:A,onColumnDropClose:j,keyHints:M=ee,showKeyHints:R=!1}){let B=b?_(d):[...d],U=e=>e===`notes`?x:f===e,W=(0,N.useRef)(null),[ie,ae]=(0,N.useState)(0),[G,K]=(0,N.useState)(null),oe=`${B.join(`|`)}#${S&&f===null?t:``}`;(0,N.useEffect)(()=>{let e=W.current;if(!e)return;let t=()=>ae(e.clientWidth),n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[]);let[se,ce]=(0,N.useState)(0);(0,N.useEffect)(()=>{let e=typeof document>`u`?void 0:document.fonts;if(!e)return;let t=()=>ce(e=>e+1);return e.ready.then(t),e.addEventListener?.(`loadingdone`,t),()=>e.removeEventListener?.(`loadingdone`,t)},[]),(0,N.useLayoutEffect)(()=>K(null),[oe,ie,se]),(0,N.useLayoutEffect)(()=>{let e=W.current;G===null||G===0||!e||e.scrollWidth>e.clientWidth+1&&K(G-1)}),(0,N.useLayoutEffect)(()=>{let e=W.current;if(G!==null||!e)return;let t=[...e.querySelectorAll(`[data-strip-item]`)].map(e=>e.offsetWidth+F),n=[...e.querySelectorAll(`[data-strip-chrome]`)].reduce((e,t)=>e+t.offsetWidth+F,0),r=e.clientWidth-n;if(t.reduce((e,t)=>e+t,0)<=r){K(B.length);return}let i=B.findIndex(U),a=re,o=0;for(let[e,n]of t.entries()){let s=i>e?t[i]??0:0;if(a+n+s>r)break;a+=n,o+=1}K(o)});let q=G??B.length,J=B.slice(0,q),Y=B.findIndex(U);Y>=q&&(J=[...J,B[Y]]);let X=B.filter(e=>!J.includes(e)),[Z,Q]=(0,N.useState)(!1),$=e=>j!==void 0&&e.dataTransfer.types.includes(L);return(0,P.jsxs)(`div`,{ref:W,"data-slot":`layout-cards`,"data-drop-close":Z?``:void 0,className:r(`relative flex min-w-0 flex-1 items-end gap-0.5 overflow-x-clip rounded-md`,Z&&`bg-muted outline-1 outline-dashed outline-border`),onDragOver:e=>{$(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Q(!0))},onDragLeave:e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||Q(!1)},onDrop:e=>{if(Q(!1),!$(e))return;let t=e.dataTransfer.getData(L),n=Number(t);t===``||!Number.isInteger(n)||(e.preventDefault(),j?.(n))},children:[J.map(e=>{if(e===`notes`)return(0,P.jsxs)(a,{to:b,"data-strip-item":``,"aria-current":x?`page`:void 0,className:r(`relative -mb-px flex h-9 shrink-0 items-center gap-1.5 border-b-2 px-2.5 text-[13px] font-medium`,x?`border-foreground text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(z,{hint:R?M.get(`view:notes`):void 0,children:(0,P.jsx)(g,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})}),`Notes`]},`notes`);let t=B.indexOf(e)+1,n=p[e],o=U(e),s=v.includes(e),c=h(e),l=M.get(`view:${e}`);return(0,P.jsxs)(i,{type:`button`,variant:`ghost`,"data-slot":`layout-card`,"data-strip-item":``,"data-fixed":e,"data-active":o?`true`:void 0,"data-on":s?``:void 0,"aria-pressed":o||s,draggable:C!==void 0,title:C?`${c}${t<=9?` (${t})`:``} — drag onto the workspace to split, ⌥-click to open beside`:c,onClick:t=>{t.altKey&&A?A(e):y?.(e)},onDragStart:t=>{t.dataTransfer.setData(I,e),t.dataTransfer.effectAllowed=`copyMove`,C?.(e)},onDragEnd:()=>w?.(),className:r(`relative -mb-px h-9 shrink-0 gap-1.5 rounded-none border-b-2 border-transparent px-2.5 text-[13px] font-medium text-muted-foreground hover:bg-transparent hover:text-foreground active:translate-y-0`,(o||s)&&`text-foreground`,o&&`border-foreground`),children:[(0,P.jsx)(z,{hint:R?l:void 0,children:(0,P.jsx)(n,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})}),c,s&&!o?(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-2 right-1 size-1.5 rounded-full bg-primary`}):null]},e)}),X.length>0?(0,P.jsxs)(D,{children:[(0,P.jsx)(k,{asChild:!0,children:(0,P.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-action":`more-views`,"aria-label":`${X.length} more views`,title:`More views`,className:`mb-1 size-7 shrink-0 text-muted-foreground`,children:(0,P.jsx)(m,{"aria-hidden":`true`})})}),(0,P.jsx)(O,{align:`start`,className:`max-h-72 w-56 overflow-y-auto`,children:X.map(e=>{if(e===`notes`)return(0,P.jsx)(T,{asChild:!0,children:(0,P.jsxs)(a,{to:b,children:[(0,P.jsx)(g,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`truncate`,children:`Notes`}),M.get(`view:notes`)?(0,P.jsx)(E,{children:M.get(`view:notes`)}):null]})},`notes`);let t=p[e],n=M.get(`view:${e}`);return(0,P.jsxs)(T,{"data-view":e,onSelect:()=>y?.(e),children:[(0,P.jsx)(t,{"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`truncate`,children:h(e)}),n?(0,P.jsx)(E,{children:n}):null]},e)})})]}):null,Z?(0,P.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 rounded bg-background px-2 py-0.5 text-xs font-medium text-foreground shadow-sm`,children:`Drop to close this column`}):null,S?(0,P.jsx)(`div`,{"data-strip-chrome":``,className:`ml-auto flex shrink-0 items-center pb-1 pl-2`,children:(0,P.jsx)(H,{layouts:e,active:f===null?t:null,saved:s,onSelect:n,onClose:o,onApplySaved:c,onSaveCurrent:l,onDeleteSaved:u,suggestedName:V(e,f===null?t:null,f)})}):null]})}function z({hint:e,children:t}){let n=`pointer-events-none flex shrink-0 items-center justify-center rounded-[4px] bg-foreground font-mono text-[10px] leading-none font-semibold text-background`;return e?e.length===1?(0,P.jsx)(`kbd`,{"data-slot":`tab-key-hint`,"aria-hidden":`true`,className:r(n,`size-3.5`),children:e}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`invisible flex shrink-0`,children:t}),(0,P.jsx)(`kbd`,{"data-slot":`tab-key-hint`,"aria-hidden":`true`,className:r(n,`absolute -top-1 right-0 z-10 h-4 px-1`),children:e})]}):t}function B({count:e,className:t}){let n=Math.max(1,Math.min(e,3)),i=2.5,a=1.5,o=(20-i*2-a*(n-1))/n;return(0,P.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 20 14`,className:r(`h-3.5 w-5 shrink-0`,t),fill:`none`,children:[(0,P.jsx)(`rect`,{x:`0.6`,y:`0.6`,width:18.8,height:12.8,rx:`2`,stroke:`currentColor`,strokeWidth:`1.2`}),Array.from({length:n},(e,t)=>(0,P.jsx)(`rect`,{x:i+t*(o+a),y:i,width:o,height:14-i*2,rx:`0.75`,fill:`currentColor`,opacity:.55},t))]})}function V(e,t,n){let r=t===null?void 0:e.find(e=>e.name===t);return r&&r.name!==`Custom`?b(r.name):r?r.columns.map(e=>h(e.view)).join(` + `):n?`${h(n)} layout`:``}function H({layouts:e,active:t,saved:n,onSelect:a,onClose:o,onApplySaved:s,onSaveCurrent:c,onDeleteSaved:l,suggestedName:u}){let d=t===null?void 0:e.find(e=>e.name===t),f=new Set(n.map(e=>e.name)),p=e.filter(e=>!f.has(e.name)),[m,h]=(0,N.useState)(!1),g=(0,N.useRef)(!1),_=(0,N.useRef)(null);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(k,{asChild:!0,children:(0,P.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,ref:_,"data-action":`layouts`,"data-active-layout":d?d.name:void 0,"aria-label":d?`Layout: ${b(d.name)}`:`Layouts`,title:`Layouts — open a saved one, or save what is on screen`,className:r(`h-7 max-w-48 shrink-0 gap-1.5 px-2 text-[12.5px]`,d?`text-foreground`:`text-muted-foreground`),children:[(0,P.jsx)(B,{count:d?.columns.length??2}),(0,P.jsx)(`span`,{className:`truncate max-md:hidden`,children:d?b(d.name):`Layout`}),(0,P.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 opacity-60`})]})}),(0,P.jsxs)(O,{align:`end`,className:`max-h-96 w-64 overflow-y-auto`,onCloseAutoFocus:e=>{g.current&&(g.current=!1,e.preventDefault())},children:[(0,P.jsx)(C,{children:`Saved layouts`}),n.length===0?(0,P.jsx)(`p`,{className:`px-2 pb-1.5 text-xs text-muted-foreground`,children:`None yet — arrange the view (drag a tab onto it), then save it here. Saved layouts are offered in every task.`}):null,n.map(e=>(0,P.jsx)(U,{name:e.name,count:e.columns.length,selected:e.name===t,kind:`saved`,onPick:()=>s?.(e),remove:l?{label:`Delete saved layout ${e.name}`,run:()=>l(e.name)}:void 0},`saved:${e.name}`)),p.length>0?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{}),(0,P.jsx)(C,{children:`This task`}),p.map(e=>(0,P.jsx)(U,{name:b(e.name),count:e.columns.length,selected:e.name===t,kind:`task`,onPick:()=>a(e.name),remove:{label:`Close layout ${b(e.name)}`,run:()=>o(e.name)}},`task:${e.name}`))]}):null,c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(w,{}),(0,P.jsxs)(T,{"data-action":`save-layout`,onSelect:()=>{g.current=!0,h(!0)},children:[(0,P.jsx)(A,{"aria-hidden":`true`}),`Save current view as layout…`]})]}):null]})]}),(0,P.jsx)(W,{open:m,suggested:u,taken:f,onCommit:e=>{h(!1),c?.(e)},onCancel:()=>h(!1),returnFocus:()=>_.current?.focus()})]})}function U({name:e,count:t,selected:n,kind:r,onPick:i,remove:a}){return(0,P.jsxs)(T,{"data-layout":e,"data-layout-kind":r,"data-active":n?``:void 0,onSelect:i,"aria-keyshortcuts":a?`Delete`:void 0,onKeyDown:e=>{!a||e.key!==`Delete`&&e.key!==`Backspace`||(e.preventDefault(),a.run())},className:`group/layout pr-1`,children:[(0,P.jsx)(B,{count:t}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),n?(0,P.jsx)(x,{"aria-hidden":`true`,className:`size-3.5`}):null,a?(0,P.jsx)(`button`,{type:`button`,"aria-label":a.label,title:`${a.label} (Delete)`,className:`flex size-5 items-center justify-center rounded-sm text-muted-foreground opacity-0 group-hover/layout:opacity-100 group-focus/layout:opacity-100 hover:bg-background hover:text-foreground`,onPointerUp:e=>e.stopPropagation(),onClick:e=>{e.preventDefault(),e.stopPropagation(),a.run()},children:(0,P.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function W({open:e,suggested:t,taken:n,onCommit:r,onCancel:a,returnFocus:p}){let[m,h]=(0,N.useState)(``);(0,N.useEffect)(()=>{e&&h(t)},[e,t]);let g=m.trim(),_=g!==``&&y(g);return(0,P.jsx)(s,{open:e,onOpenChange:e=>!e&&a(),children:(0,P.jsx)(d,{className:`sm:max-w-sm`,onCloseAutoFocus:e=>{e.preventDefault(),p()},children:(0,P.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),g!==``&&!_&&r(g)},children:[(0,P.jsxs)(c,{children:[(0,P.jsx)(o,{children:`Save layout`}),(0,P.jsx)(u,{children:`Saved layouts are offered in every task, in every project.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{autoFocus:!0,"aria-label":`Layout name`,maxLength:v,value:m,onChange:e=>h(e.target.value),onFocus:e=>e.currentTarget.select()}),_?(0,P.jsx)(`p`,{className:`text-xs text-danger`,children:g===`Custom`?`“${f}” is the task's unsaved arrangement — pick another.`:`That name belongs to a view tab — pick another.`}):n.has(g)?(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Replaces the saved layout “`,g,`”.`]}):null]}),(0,P.jsxs)(l,{children:[(0,P.jsx)(i,{type:`button`,variant:`outline`,onClick:a,children:`Cancel`}),(0,P.jsx)(i,{type:`submit`,disabled:g===``||_,children:`Save`})]})]})})})}export{I as n,R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./button-Clwd6u4_.js";var t=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./button-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./button-Clwd6u4_.js";import{t as n}from"./message-square-EWpWB_Gr.js";var r=e();function i({count:e,className:i}){if(e===0)return null;let a=`${e} ${e===1?`comment`:`comments`}`;return(0,r.jsxs)(`span`,{"data-slot":`comment-count`,title:`${a} for the agent`,"aria-label":a,className:t(`flex shrink-0 items-center gap-1 text-[11px] font-medium text-primary tabular-nums`,i),children:[(0,r.jsx)(n,{"aria-hidden":`true`,className:`size-3`}),e]})}var a=new Set([`md`,`markdown`,`mdx`,`mdown`,`mkd`]);function o(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n>0&&a.has(t.slice(n+1).toLowerCase())}function s(e){return o(e.path)&&e.status!==`deleted`&&!e.binary}export{i as n,s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/core-BCsw8oQw.js","assets/lib-BxQXEXDF.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r}from"./bundle-mjs-BT31bpU6.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./alert-dialog-
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r}from"./bundle-mjs-BT31bpU6.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./alert-dialog-DvPnvVvK.js";import{i as f,n as p}from"./chunk-BO2N2NFS-MDrqQfMl.js";var m=e(t(),1),h={name:`cezar-syn`,type:`dark`,fg:`var(--syn-var)`,bg:`transparent`,settings:[{scope:[`keyword`,`storage`,`constant.language`,`variable.language`,`entity.other.attribute-name`,`support.type.property-name`],settings:{foreground:`var(--syn-key)`}},{scope:[`string`,`punctuation.definition.string`],settings:{foreground:`var(--syn-str)`}},{scope:[`entity.name.function`,`support.function`,`entity.name.tag`,`entity.name.type`,`entity.name.class`,`support.class`,`support.type`],settings:{foreground:`var(--syn-fn)`}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:`var(--syn-com)`}},{scope:[`constant.numeric`,`constant.character`,`constant.other`,`support.constant`,`keyword.other.unit`],settings:{foreground:`var(--syn-num)`}},{scope:[`punctuation`,`keyword.operator`,`meta.brace`,`punctuation.separator`,`punctuation.terminator`],settings:{foreground:`var(--syn-punc)`}},{scope:[`variable`,`entity.name.variable`],settings:{foreground:`var(--syn-var)`}}]},g={typescript:()=>r(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>r(()=>import(`./tsx-udAQXfEw.js`),[]),javascript:()=>r(()=>import(`./javascript-BgS3c2Ky.js`),[]),jsx:()=>r(()=>import(`./jsx-Bz0zcwM4.js`),[]),json:()=>r(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>r(()=>import(`./jsonc-CYpm1nAK.js`),[]),shellscript:()=>r(()=>import(`./shellscript-CLZ0U2zV.js`),[]),python:()=>r(()=>import(`./python-gzcpVVnB.js`),[]),markdown:()=>r(()=>import(`./markdown-BYOwaDjH.js`),[]),css:()=>r(()=>import(`./css-BsVw1vtW.js`),[]),html:()=>r(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([0,1,2])),diff:()=>r(()=>import(`./diff-woXpYk--.js`),[]),yaml:()=>r(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>r(()=>import(`./toml-CcmNWLt0.js`),[]),go:()=>r(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>r(()=>import(`./rust-Cfkwpbl8.js`),[]),sql:()=>r(()=>import(`./sql-BsFa4tDR.js`),[])},_={ts:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,bash:`shellscript`,sh:`shellscript`,shell:`shellscript`,zsh:`shellscript`,console:`shellscript`,py:`python`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`,vue:`html`,xml:`html`},v=new Set([``,`plaintext`,`text`,`txt`,`plain`]);function y(e){let t=e.trim().toLowerCase();return t in g?t:_[t]??null}function b(e){return v.has(e.trim().toLowerCase())}function x(){return[...Object.keys(g),...Object.keys(_),...v].filter(e=>e!==``)}function S(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return null;let r=t.slice(n+1).toLowerCase();return y({mts:`typescript`,cts:`typescript`,htm:`html`}[r]??r)}var C=null,w=null,T=new Set,E=new Map;function D(){return w??=Promise.all([r(()=>import(`./core-BCsw8oQw.js`),__vite__mapDeps([3,4,5])),r(()=>import(`./engine-javascript-FQvzRocB.js`),[])]).then(async([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>(C=await e({themes:[h],langs:[],engine:t({forgiving:!0})}),C)),w}function O(e){let t=y(e);if(t===null||T.has(t))return Promise.resolve();let n=E.get(t);return n||(n=D().then(async e=>{await e.loadLanguage(await g[t]()),T.add(t)}).catch(()=>{E.delete(t)}),E.set(t,n)),n}function k(e){return{tokens:e.split(`
|
|
3
3
|
`).map(e=>[{content:e}]),fg:`var(--syn-var)`,bg:`transparent`}}function A(e,t,n={}){if(b(t))return k(e);let r=y(t);if(r===null)return k(e);if(!C||!T.has(r))return null;try{let t=C.codeToTokens(e,{lang:r,theme:h.name,tokenizeTimeLimit:n.tokenizeTimeLimit});return{tokens:t.tokens.map(e=>e.map(({content:e,color:t})=>({content:e,color:t}))),fg:t.fg??`var(--syn-var)`,bg:`transparent`}}catch{return k(e)}}async function j(e,t,n={}){return A(e,t,n)||(await O(t),A(e,t,n)??k(e))}var M=n();function N({isOpen:e,onClose:t,onConfirm:n,url:r}){return(0,M.jsx)(d,{open:e,onOpenChange:e=>{e||t()},children:(0,M.jsxs)(o,{"data-slot":`link-safety-dialog`,children:[(0,M.jsxs)(u,{children:[(0,M.jsx)(a,{children:`Open this link?`}),(0,M.jsxs)(i,{children:[`It leaves cezar in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,M.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:r})]})]}),(0,M.jsxs)(c,{children:[(0,M.jsx)(l,{children:`Cancel`}),(0,M.jsx)(s,{onClick:n,children:`Open link`})]})]})})}var P={name:`shiki`,type:`code-highlighter`,getThemes:()=>[h,h],getSupportedLanguages:()=>x(),supportsLanguage:e=>x().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>A(e,String(t))||(j(e,String(t)).then(e=>n?.(e)),null)};function F(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
4
4
|
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var I=[...Object.values(p),F],L=[`p`,`strong`,`em`,`del`,`code`,`a`],R={p:`span`,a:`span`},z=`cezar-local-only:`;function B(e){let t=e.trim();return t.startsWith(z)||/^file:/i.test(t)||/^[A-Za-z]:[\\/]/.test(t)||/^\\\\/.test(t)?!0:/^\/(?:tmp|Users|home|var|etc|opt|root|mnt|Volumes|private|bin|boot|dev|lib|proc|run|sbin|sys|usr)(?:\/|$)/i.test(t)}function V({href:e,children:t,className:n,...r}){let[i,a]=(0,m.useState)(!1);return!e||B(e)?(0,M.jsx)(`span`,{...r,"data-local-only-link":B(e??``)?``:void 0,title:B(e??``)?`This is a local filesystem path and cannot be opened here.`:void 0,className:n,children:t}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`a`,{...r,href:e,className:n,"data-streamdown":`link`,onClick:e=>{e.preventDefault(),a(!0)},children:t}),(0,M.jsx)(N,{isOpen:i,onClose:()=>a(!1),onConfirm:()=>window.open(e,`_blank`,`noreferrer`),url:e})]})}var H={a:V},U=e=>B(e)?`${z}${e}`:e,W={enabled:!0,renderModal:e=>(0,M.jsx)(N,{...e})},G=(0,m.memo)(function({children:e,breaks:t=!1,inline:n=!1,variant:r=`chat`,urlTransform:i}){return(0,M.jsx)(f,{className:n?`thread-markdown thread-markdown-inline`:r===`document`?`thread-markdown markdown-document`:`thread-markdown`,plugins:{code:P},shikiTheme:[h,h],remarkPlugins:t?I:void 0,allowedElements:n?L:void 0,unwrapDisallowed:n||void 0,components:n?R:H,urlTransform:U,linkSafety:W,...i?{urlTransform:i}:{},controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{A as a,j as i,y as n,S as o,O as r,G as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./button-
|
|
1
|
+
import{F as e}from"./button-Clwd6u4_.js";var t=e(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./button-Clwd6u4_.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{_a as r}from"./queries-B--Cyn_0.js";import{r as i}from"./button-ZPJ84lSe.js";import{i as a}from"./bundle-mjs-BT31bpU6.js";var o=e(t(),1),s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,c=/^[\\/]{2}/;function l(e,t){return t+e.replace(/\\/g,`/`)}var u=`popstate`;function d(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function f(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return _(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:v(t)}return b(t,n,null,e)}function p(e,t){if(e===!1||e==null)throw Error(t)}function m(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function h(){return Math.random().toString(36).substring(2,10)}function g(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 _(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?y(t):t,state:n,key:t&&t.key||r||h(),mask:i}}function v({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 y(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 b(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=f();l??(l=0,o.replaceState({...o.state,idx:l},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f()+1;let u=g(r,l),p=y.createHref(r.mask||r);try{o.pushState(u,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f();let i=g(r,l),u=y.createHref(r.mask||r);o.replaceState(i,``,u),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return x(i,e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(u,p),c=e,()=>{i.removeEventListener(u,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function x(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),p(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:v(t);return i=i.replace(/ $/,`%20`),!n&&c.test(i)&&(i=r+i),new URL(i,r)}function S(e,t,n=`/`){return C(e,t,n,!1)}function C(e,t,n,r,i){let a=O((typeof t==`string`?y(t):t).pathname||`/`,n);if(a==null)return null;let o=i??T(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=de(o[e],c,r);return s}function w(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function T(e){let t=E(e);return te(t),t}function E(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;p(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=A([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(p(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:le(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=pe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ee(e.path))a(e,t,!0,n)}),t}function ee(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ee(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?ue(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,re=3,ie=2,ae=1,oe=10,se=-2,ce=e=>e===`*`;function le(e,t){let n=e.split(`/`),r=n.length;return n.some(ce)&&(r+=se),t&&(r+=ie),n.filter(e=>!ce(e)).reduce((e,t)=>e+(ne.test(t)?re:t===``?ae:oe),r)}function ue(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function de(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?fe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:xe(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end);return fe(e,t,n,r)}function fe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t=!1,n=!0){m(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return m(!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 O(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)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?y(e):e,a;return n?(n=be(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Se(r),hash:Ce(i)}}function ge(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(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 ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=y(e):(i={...e},p(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),p(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),p(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var be=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>be(e.join(`/`)),j=e=>e.replace(/\/+$/,``),xe=e=>j(e).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,we=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 Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var De=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Oe(e,t){let n=e;if(typeof n!=`string`||!s.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(De)try{let e=new URL(window.location.href),r=c.test(n)?new URL(l(n,e.protocol)):new URL(n),a=O(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{m(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ke=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ke);var Ae=[`GET`,...ke];new Set(Ae);var je=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Me(e){try{return je.includes(new URL(e).protocol)}catch{return!1}}var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var Ne=o.createContext(!1);function Pe(){return o.useContext(Ne)}var Fe=o.createContext({isTransitioning:!1});Fe.displayName=`ViewTransition`;var Ie=o.createContext(new Map);Ie.displayName=`Fetchers`;var Le=o.createContext(null);Le.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var Re=o.createContext(null);Re.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))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 Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){p(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=B(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:s,hash:i})}function L(){return o.useContext(F)!=null}function R(){return p(L(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}function Ge(){return o.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){o.useContext(P).static||o.useLayoutEffect(e)}function z(){let{isDataRoute:e}=o.useContext(I);return e?gt():Je()}function Je(){p(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=R(),a=JSON.stringify(ye(r)),s=o.useRef(!1);return qe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(m(s.current,Ke),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}var Ye=o.createContext(null);function Xe(e){let t=o.useContext(I).outlet;return o.useMemo(()=>t&&o.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=o.useContext(I);return e[e.length-1]?.params??{}}function B(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=R(),i=JSON.stringify(ye(n));return o.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){p(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=o.useContext(P),{matches:i}=o.useContext(I),a=i[i.length-1],s=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;vt(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) 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.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{_a as r}from"./queries-CI0EmEcH.js";import{r as i}from"./button-Clwd6u4_.js";import{i as a}from"./bundle-mjs-BT31bpU6.js";var o=e(t(),1),s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,c=/^[\\/]{2}/;function l(e,t){return t+e.replace(/\\/g,`/`)}var u=`popstate`;function d(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function f(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return _(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:v(t)}return b(t,n,null,e)}function p(e,t){if(e===!1||e==null)throw Error(t)}function m(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function h(){return Math.random().toString(36).substring(2,10)}function g(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 _(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?y(t):t,state:n,key:t&&t.key||r||h(),mask:i}}function v({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 y(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 b(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=f();l??(l=0,o.replaceState({...o.state,idx:l},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f()+1;let u=g(r,l),p=y.createHref(r.mask||r);try{o.pushState(u,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f();let i=g(r,l),u=y.createHref(r.mask||r);o.replaceState(i,``,u),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return x(i,e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(u,p),c=e,()=>{i.removeEventListener(u,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function x(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),p(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:v(t);return i=i.replace(/ $/,`%20`),!n&&c.test(i)&&(i=r+i),new URL(i,r)}function S(e,t,n=`/`){return C(e,t,n,!1)}function C(e,t,n,r,i){let a=O((typeof t==`string`?y(t):t).pathname||`/`,n);if(a==null)return null;let o=i??T(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=de(o[e],c,r);return s}function w(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function T(e){let t=E(e);return te(t),t}function E(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;p(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=A([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(p(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:le(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=pe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ee(e.path))a(e,t,!0,n)}),t}function ee(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ee(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?ue(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,re=3,ie=2,ae=1,oe=10,se=-2,ce=e=>e===`*`;function le(e,t){let n=e.split(`/`),r=n.length;return n.some(ce)&&(r+=se),t&&(r+=ie),n.filter(e=>!ce(e)).reduce((e,t)=>e+(ne.test(t)?re:t===``?ae:oe),r)}function ue(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function de(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?fe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:xe(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end);return fe(e,t,n,r)}function fe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t=!1,n=!0){m(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return m(!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 O(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)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?y(e):e,a;return n?(n=be(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Se(r),hash:Ce(i)}}function ge(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(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 ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=y(e):(i={...e},p(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),p(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),p(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var be=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>be(e.join(`/`)),j=e=>e.replace(/\/+$/,``),xe=e=>j(e).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,we=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 Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var De=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Oe(e,t){let n=e;if(typeof n!=`string`||!s.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(De)try{let e=new URL(window.location.href),r=c.test(n)?new URL(l(n,e.protocol)):new URL(n),a=O(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{m(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ke=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ke);var Ae=[`GET`,...ke];new Set(Ae);var je=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Me(e){try{return je.includes(new URL(e).protocol)}catch{return!1}}var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var Ne=o.createContext(!1);function Pe(){return o.useContext(Ne)}var Fe=o.createContext({isTransitioning:!1});Fe.displayName=`ViewTransition`;var Ie=o.createContext(new Map);Ie.displayName=`Fetchers`;var Le=o.createContext(null);Le.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var Re=o.createContext(null);Re.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))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 Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){p(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=B(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:s,hash:i})}function L(){return o.useContext(F)!=null}function R(){return p(L(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}function Ge(){return o.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){o.useContext(P).static||o.useLayoutEffect(e)}function z(){let{isDataRoute:e}=o.useContext(I);return e?gt():Je()}function Je(){p(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=R(),a=JSON.stringify(ye(r)),s=o.useRef(!1);return qe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(m(s.current,Ke),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}var Ye=o.createContext(null);function Xe(e){let t=o.useContext(I).outlet;return o.useMemo(()=>t&&o.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=o.useContext(I);return e[e.length-1]?.params??{}}function B(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=R(),i=JSON.stringify(ye(n));return o.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){p(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=o.useContext(P),{matches:i}=o.useContext(I),a=i[i.length-1],s=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;vt(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) 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.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=R(),f;if(t){let e=typeof t==`string`?y(t):t;p(l===`/`||e.pathname?.startsWith(l),`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 "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let h=f.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):S(e,{pathname:g});m(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),m(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 v=ot(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:A([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:A([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&v?o.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function et(){let e=ht(),t=Te(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)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=o.createElement(o.Fragment,null,o.createElement(`p`,null,`💿 Hey developer 👋`),o.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,o.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,o.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),o.createElement(o.Fragment,null,o.createElement(`h2`,null,`Unexpected Application Error!`),o.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?o.createElement(`pre`,{style:i},n):null,s)}var tt=o.createElement(et,null),nt=class extends o.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?t.error:e.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`){let t=Ue(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:o.createElement(I.Provider,{value:this.props.routeContext},o.createElement(Re.Provider,{value:e,children:this.props.component}));return this.context?o.createElement(it,{error:e},t):t}};nt.contextType=Ne;var rt=new WeakMap;function it({children:e,error:t}){let{basename:n}=o.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=He(t.digest);if(e){let r=rt.get(t);if(r)throw r;let i=Oe(e.location,n),a=i.absoluteURL||i.to;if(Me(a))throw Error(`Invalid redirect location`);if(De&&!rt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rt.set(t,n),n}return o.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function at({routeContext:e,match:t,children:n}){let r=o.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(I.Provider,{value:e},n)}function ot(e,t=[],n){let r=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 i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:a}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ee(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tt,s&&(c<0&&l===0?(vt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(at,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?o.createElement(nt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=o.useContext(M);return p(t,st(e)),t}function lt(e){let t=o.useContext(N);return p(t,st(e)),t}function ut(e){let t=o.useContext(I);return p(t,st(e)),t}function dt(e){let t=ut(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ft(){return dt(`useRouteId`)}function pt(){let e=lt(`useNavigation`);return o.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function mt(){let{matches:e,loaderData:t}=lt(`useMatches`);return o.useMemo(()=>e.map(e=>w(e,t)),[e,t])}function ht(){let e=o.useContext(Re),t=lt(`useRouteError`),n=dt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gt(){let{router:e}=ct(`useNavigate`),t=dt(`useNavigate`),n=o.useRef(!1);return qe(()=>{n.current=!0}),o.useCallback(async(r,i={})=>{m(n.current,Ke),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _t={};function vt(e,t,n){!t&&!_t[e]&&(_t[e]=!0,m(!1,n))}o.memo(yt);function yt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $e(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function bt({to:e,replace:t,state:n,relative:r}){p(L(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=o.useContext(P);m(!i,`<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:a}=o.useContext(I),{pathname:s}=R(),c=z(),l=k(e,ye(a),s,r===`path`),u=JSON.stringify(l);return o.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function xt(e){return Xe(e.context)}function St(e){p(!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 Ct({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:s}){p(!L(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=o.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=y(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:h=null,key:g=`default`,mask:_}=n,v=o.useMemo(()=>{let e=O(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:h,key:g,mask:_},navigationType:r}},[c,u,d,f,h,g,r,_]);return m(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:o.createElement(P.Provider,{value:l},o.createElement(F.Provider,{children:t,value:v}))}function wt({children:e,location:t}){return Qe(Tt(e),t)}o.Component;function Tt(e,t=[]){let n=[];return o.Children.forEach(e,(e,r)=>{if(!o.isValidElement(e))return;let i=[...t,r];if(e.type===o.Fragment){n.push.apply(n,Tt(e.props.children,i));return}p(e.type===St,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Tt(e.props.children,i)),n.push(a)}),n}var V=`get`,H=`application/x-www-form-urlencoded`;function U(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Et(e){return U(e)&&e.tagName.toLowerCase()===`button`}function Dt(e){return U(e)&&e.tagName.toLowerCase()===`form`}function Ot(e){return U(e)&&e.tagName.toLowerCase()===`input`}function kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function At(e,t){return e.button===0&&(!t||t===`_self`)&&!kt(e)}function jt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Mt(e,t){let n=jt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var W=null;function Nt(){if(W===null)try{new FormData(document.createElement(`form`),0),W=!1}catch{W=!0}return W}var Pt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ft(e){return e!=null&&!Pt.has(e)?(m(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H}"`),null):e}function It(e,t){let n,r,i,a,o;if(Dt(e)){let o=e.getAttribute(`action`);r=o?O(o,t):null,n=e.getAttribute(`method`)||V,i=Ft(e.getAttribute(`enctype`))||H,a=new FormData(e)}else if(Et(e)||Ot(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?O(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||V,i=Ft(e.getAttribute(`formenctype`))||Ft(o.getAttribute(`enctype`))||H,a=new FormData(o,e),!Nt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(U(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=V,r=null,i=H,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Lt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Rt=/[&><\u2028\u2029]/g;function zt(e){return e.replace(Rt,e=>Lt[e])}function Bt(e,t){if(e===!1||e==null)throw Error(t)}function Vt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&O(i.pathname,t)===`/`?i.pathname=`${j(t)}/_root.${r}`:i.pathname=`${j(i.pathname)}.${r}`,i}async function Ht(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ut(e){return e!=null&&typeof e.page==`string`}function Wt(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 Gt(e,t,n){return Xt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ht(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Wt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Kt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function qt(e,t,{includeHydrateFallback:n}={}){return Jt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Jt(e){return[...new Set(e)]}function Yt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Xt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ut(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Yt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Zt(){let e=o.useContext(M);return Bt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Qt(){let e=o.useContext(N);return Bt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var G=o.createContext(void 0);G.displayName=`FrameworkContext`;function K(){let e=o.useContext(G);return Bt(e,`You must render this element inside a <HydratedRouter> element`),e}function $t(e,t){let n=o.useContext(G),[r,i]=o.useState(!1),[a,s]=o.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=o.useRef(null);o.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),o.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),s(!1)};return n?e===`intent`?[a,p,{onFocus:q(c,m),onBlur:q(l,h),onMouseEnter:q(u,m),onMouseLeave:q(d,h),onTouchStart:q(f,m)}]:[a,p,{}]:[!1,p,{}]}function q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function en({page:e,...t}){let n=Pe(),{nonce:r}=K(),{router:i}=Zt(),a=o.useMemo(()=>S(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?o.createElement(nn,{page:e,matches:a,...t}):o.createElement(rn,{page:e,matches:a,...t})):null}function tn(e){let{manifest:t,routeModules:n}=K(),[r,i]=o.useState([]);return o.useEffect(()=>{let r=!1;return Gt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function nn({page:e,matches:t,...n}){let r=R(),{future:i}=K(),{basename:a}=Zt(),s=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Vt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return o.createElement(o.Fragment,null,s.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function rn({page:e,matches:t,...n}){let r=R(),{future:i,manifest:a,routeModules:s}=K(),{basename:c}=Zt(),{loaderData:l,matches:u}=Qt(),d=o.useMemo(()=>Kt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=o.useMemo(()=>Kt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let u=Vt(e,c,i.v8_trailingSlashAwareDataRequests,`data`);return o&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,s]),m=o.useMemo(()=>qt(f,a),[f,a]),h=tn(f);return o.createElement(o.Fragment,null,p.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>o.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>o.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function an(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}o.Component;var on=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{on&&(window.__reactRouterVersion=`7.18.1`)}catch{}function sn({basename:e,children:t,useTransitions:n,window:r}){let i=o.useRef();i.current??=f({window:r,v5Compat:!0});let a=i.current,[s,c]=o.useState({action:a.action,location:a.location}),l=o.useCallback(e=>{n===!1?c(e):o.startTransition(()=>c(e))},[n]);return o.useLayoutEffect(()=>a.listen(l),[a,l]),o.createElement(Ct,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a,useTransitions:n})}function cn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=o.useState({action:n.action,location:n.location}),s=o.useCallback(e=>{r===!1?a(e):o.startTransition(()=>a(e))},[r]);return o.useLayoutEffect(()=>n.listen(s),[n,s]),o.createElement(Ct,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}cn.displayName=`unstable_HistoryRouter`;var J=o.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=o.useContext(P),b=typeof d==`string`&&s.test(d),x=Oe(d,_);d=x.to;let S=We(d,{relative:r}),C=R(),w=null;if(c){let e=k(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:A([_,e.pathname])),w=v.createHref(e)}let[T,E,ee]=$t(n,h),te=mn(d,{replace:a,mask:c,state:l,target:u,preventScrollReset:f,relative:r,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let re=!(x.isExternal||i),ie=o.createElement(`a`,{...h,...ee,href:(re?w:void 0)||x.absoluteURL||S,onClick:re?ne:e,ref:an(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?o.createElement(o.Fragment,null,ie,o.createElement(en,{page:S})):ie});J.displayName=`Link`;var ln=o.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...l},u){let d=B(a,{relative:l.relative}),f=R(),p=o.useContext(N),{navigator:m,basename:h}=o.useContext(P),g=p!=null&&wn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=O(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return o.createElement(J,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:s},typeof c==`function`?c(C):c)});ln.displayName=`NavLink`;var un=o.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:c=V,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=o.useContext(P),v=vn(),y=yn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&s.test(l);return o.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||c,l=()=>v(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?o.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});un.displayName=`Form`;function dn({getKey:e,storageKey:t,...n}){let r=o.useContext(G),{basename:i}=o.useContext(P),a=R(),s=mt();Sn({getKey:e,storageKey:t});let c=o.useMemo(()=>{if(!r||!e)return null;let t=xn(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),o.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${zt(JSON.stringify(t||bn))}, ${zt(JSON.stringify(c))})`}})}dn.displayName=`ScrollRestoration`;function fn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y(e){let t=o.useContext(M);return p(t,fn(e)),t}function pn(e){let t=o.useContext(N);return p(t,fn(e)),t}function mn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=z(),f=R(),p=B(e,{relative:s});return o.useCallback(m=>{if(At(m,t)){m.preventDefault();let t=n===void 0?v(f)===v(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?o.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,s,c,l,u])}function hn(e){m(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=o.useRef(jt(e)),n=o.useRef(!1),r=R(),i=o.useMemo(()=>Mt(r.search,n.current?null:t.current),[r.search]),a=z();return[i,o.useCallback((e,t)=>{let r=jt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var gn=0,_n=()=>`__${String(++gn)}__`;function vn(){let{router:e}=Y(`useSubmit`),{basename:t}=o.useContext(P),n=ft(),r=e.fetch,i=e.navigate;return o.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=It(e,t);if(a.navigate===!1){let e=a.fetcherKey||_n();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function yn(e,{relative:t}={}){let{basename:n}=o.useContext(P),r=o.useContext(I);p(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...B(e||`.`,{relative:t})},s=R();if(e==null){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:A([n,a.pathname])),v(a)}var bn=`react-router-scroll-positions`,X={};function xn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:O(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Sn({getKey:e,storageKey:t}={}){let{router:n}=Y(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=pn(`useScrollRestoration`),{basename:a}=o.useContext(P),s=R(),c=mt(),l=pt();o.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Cn(o.useCallback(()=>{if(l.state===`idle`){let t=xn(s,c,a,e);X[t]=window.scrollY}try{sessionStorage.setItem(t||bn,JSON.stringify(X))}catch(e){m(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(o.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||bn);e&&(X=JSON.parse(e))}catch{}},[t]),o.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(X,()=>window.scrollY,e?(t,n)=>xn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),o.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{m(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function Cn(e,t){let{capture:n}=t||{};o.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wn(e,{relative:t}={}){let n=o.useContext(Fe);p(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Y(`useViewTransitionState`),i=B(e,{relative:t});if(!n.isTransitioning)return!1;let a=O(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=O(n.nextLocation.pathname,r)||n.nextLocation.pathname;return D(i.pathname,s)!=null||D(i.pathname,a)!=null}var Z=n(),Tn=5e3,En=200,Q=[],Dn=1,On=new Set,kn=new Set;function An(e){Q=e;for(let e of On)e()}function jn(e){return On.add(e),()=>On.delete(e)}var Mn=new Set;function Nn(e){return Mn.add(e),()=>Mn.delete(e)}function Pn(e,t){let n=setTimeout(()=>{kn.delete(n),e()},t);kn.add(n)}function Fn(e,t={}){let n={id:Dn++,message:e,tone:t.tone??`default`,...t.action?{action:t.action}:{},exiting:!1},r=t.durationMs??Tn;if(An([...Q,n]),n.tone===`danger`&&!t.reported)for(let t of Mn)try{t(e)}catch{}Pn(()=>{An(Q.map(e=>e.id===n.id?{...e,exiting:!0}:e)),Pn(()=>An(Q.filter(e=>e.id!==n.id)),En)},r)}function In(){let e=(0,o.useSyncExternalStore)(jn,()=>Q);return e.length===0?null:(0,Z.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed top-[calc(61px+env(safe-area-inset-top))] right-[calc(16px+env(safe-area-inset-right))] z-[60] flex flex-col items-end gap-2 md:top-[calc(16px+env(safe-area-inset-top))]`,children:e.map(e=>(0,Z.jsxs)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,"data-state":e.exiting?`closed`:`open`,className:i(`pointer-events-auto max-w-[min(360px,calc(100vw-32px))] rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-200`,`motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:slide-out-to-right-4`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:[e.message,e.action?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsx)(`a`,{"data-slot":`toast-action`,href:e.action.href,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold underline underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:e.action.label})]}):null]},e.id))})}var Ln=/^\/p\/([^/]+)(?=\/|$)/;function Rn(e){let t=Ln.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function zn(e){let t=Ln.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function Bn(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function Vn(e,t){return e===null?t:typeof t==`string`?Bn(e,t):t.pathname===void 0?t:{...t,pathname:Bn(e,t.pathname)}}function Hn(){let{projectId:e}=r(),{pathname:t}=R();return e??Rn(t)}function $(){let e=Hn();return(0,o.useCallback)(t=>Vn(e,t),[e])}function Un(e){let{pathname:t}=R();return(0,o.useMemo)(()=>D(e,zn(t)),[e,t])}function Wn({to:e,...t}){let n=$();return(0,Z.jsx)(J,{...t,to:n(e)})}function Gn({to:e,...t}){let n=$();return(0,Z.jsx)(ln,{...t,to:n(e)})}function Kn({to:e,...t}){let n=$();return(0,Z.jsx)(bt,{...t,to:n(e)})}function qn(){let e=z(),t=$();return(0,o.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{Ge as C,z as S,hn as T,xt as _,Vn as a,D as b,qn as c,Nn as d,Fn as f,bt as g,ln as h,Rn as i,Un as l,J as m,Gn as n,zn as o,sn as p,Kn as r,Hn as s,Wn as t,In as u,St as v,Ze as w,R as x,wt as y};
|