@hearsay-tools/squawk 0.19.0-dev.9155 → 0.19.0-dev.9162
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/ci-wait/controller.d.ts +7 -7
- package/dist/features/reports/routes.d.ts +2 -2
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/projects-routes.d.ts +41 -41
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +311 -311
- package/dist/server/server.d.ts +1170 -1170
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-m_1ntZJh.js +1 -0
- package/web/dist/assets/activity-motion-DDqgr8eF.js +1 -0
- package/web/dist/assets/activity-route-BlEZZxyI.js +1 -0
- package/web/dist/assets/agent-accounts-D_ZKAmaW.js +1 -0
- package/web/dist/assets/{agent-config-section-D8pxNy2V.js → agent-config-section-wICtFVks.js} +2 -2
- package/web/dist/assets/agent-defaults-section-BC9Ypg0g.js +1 -0
- package/web/dist/assets/{appearance-D_t3wCjY.js → appearance-fkDdWPlG.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-C63xRNFZ.js → archive-on-merge-field-B6kX09p-.js} +1 -1
- package/web/dist/assets/{ask-card-kqWOqKIc.js → ask-card-Cue5EajQ.js} +5 -5
- package/web/dist/assets/attention-BI6592lk.js +1 -0
- package/web/dist/assets/{automation-format-DB34jUyF.js → automation-format-jKMOXcHS.js} +1 -1
- package/web/dist/assets/automations-route-BfOpJjLK.js +2 -0
- package/web/dist/assets/{badge-DVxxThpb.js → badge-DAnkqD7i.js} +1 -1
- package/web/dist/assets/{button-B22ANdCY.js → button-BV_AiLj2.js} +1 -1
- package/web/dist/assets/{centered-state-BgSV4e79.js → centered-state-N8vWM_Hw.js} +1 -1
- package/web/dist/assets/{cez-idle-CdswdDRd.js → cez-idle-C0drOeLs.js} +1 -1
- package/web/dist/assets/{change-counts-wqSYI3W8.js → change-counts-BLLRvt46.js} +1 -1
- package/web/dist/assets/chunk-KS7C4IRE-BdLLx37K.js +3 -0
- package/web/dist/assets/{code-editor-GfQChdgl.js → code-editor-DZMD1guX.js} +1 -1
- package/web/dist/assets/{code-workbench-CUkiQ1pF.js → code-workbench-B0GIezrD.js} +1 -1
- package/web/dist/assets/{collapsible-Bx2vViFx.js → collapsible-D5i3hm2L.js} +1 -1
- package/web/dist/assets/{command-B2Y0By1v.js → command-4D8sPZJy.js} +1 -1
- package/web/dist/assets/{commit-list-Bjc-pQxv.js → commit-list-StLehTiQ.js} +1 -1
- package/web/dist/assets/{dialog-rpNyAWGb.js → dialog-DKr-j9S6.js} +1 -1
- package/web/dist/assets/diff-DEw-tkVq.js +3 -0
- package/web/dist/assets/{diff-controls-CaCUSyxs.js → diff-controls-CSO8HgZ0.js} +1 -1
- package/web/dist/assets/{diff-stat-Dy4uLuyP.js → diff-stat-DCO_BkZB.js} +1 -1
- package/web/dist/assets/{diff-view-4wxDvYXE.js → diff-view-BcU4Rnuo.js} +3 -3
- package/web/dist/assets/discard-changes-dialog-BEsdWdyJ.js +1 -0
- package/web/dist/assets/{dist-BSUJIXeE.js → dist-B2_vvox1.js} +1 -1
- package/web/dist/assets/dist-CCX8mhHc.js +1 -0
- package/web/dist/assets/{dist-BuF3mvCA.js → dist-ClMNSUvT.js} +1 -1
- package/web/dist/assets/{dist--f2yFdPY.js → dist-CyFJ-9Ex.js} +1 -1
- package/web/dist/assets/{dist-DudPJH39.js → dist-Du6flkGD.js} +1 -1
- package/web/dist/assets/{dropdown-menu-DjtKUK8F.js → dropdown-menu-NJZfnQCU.js} +1 -1
- package/web/dist/assets/{es2015-CUEfzDjB.js → es2015-BHonSvOU.js} +1 -1
- package/web/dist/assets/file-preview-_4nAs_Ai.js +2 -0
- package/web/dist/assets/{folder-browser-Civftk0W.js → folder-browser-CFd1U5hn.js} +1 -1
- package/web/dist/assets/{git-toolbar-CepvG0Ng.js → git-toolbar-DXnIUFi1.js} +1 -1
- package/web/dist/assets/github-g-Ykk4uE.js +1 -0
- package/web/dist/assets/{global-activity-route-DhmrWj31.js → global-activity-route-OsAvUny-.js} +2 -2
- package/web/dist/assets/highlighter-Crq-WTmN.js +3 -0
- package/web/dist/assets/host-context-DDbYAKpm.js +1 -0
- package/web/dist/assets/host-storage-B72yoDU1.js +1 -0
- package/web/dist/assets/hosts-CpDMDiQW.js +1 -0
- package/web/dist/assets/{html-report-frame-Ck76gKfA.js → html-report-frame-Bk6UkqKa.js} +1 -1
- package/web/dist/assets/{image-preview-CeEKI2T5.js → image-preview-CdL9a1Zj.js} +1 -1
- package/web/dist/assets/index-D_WkVdwL.css +1 -0
- package/web/dist/assets/index-Dp7K74Jw.js +21 -0
- package/web/dist/assets/label-CgU9vxuM.js +1 -0
- package/web/dist/assets/{live-protocol-DMhTnCmf.js → live-protocol-CNUmr-VT.js} +1 -1
- package/web/dist/assets/markdown-BB-PN03o.js +2 -0
- package/web/dist/assets/{middle-truncated-name-D41ibfXD.js → middle-truncated-name-jUQS2QzL.js} +1 -1
- package/web/dist/assets/{nav-row-styles-CgP5uNp4.js → nav-row-styles-CIedRn3A.js} +1 -1
- package/web/dist/assets/{open-in-menu-CbQWVBD0.js → open-in-menu-BI7mnPPf.js} +1 -1
- package/web/dist/assets/{option-select-BwSkbCrQ.js → option-select-Bmm4ktgQ.js} +1 -1
- package/web/dist/assets/{page-shell-BgabWJ3w.js → page-shell-BdjH5hyc.js} +1 -1
- package/web/dist/assets/{popover-CvL6hQ5c.js → popover-BQolmvDR.js} +1 -1
- package/web/dist/assets/{preferences-section-Cvh644K0.js → preferences-section-dKDCZSWD.js} +1 -1
- package/web/dist/assets/preview-EtD19mg1.js +1 -0
- package/web/dist/assets/preview-pane-connected-DBbCXW1b.js +3 -0
- package/web/dist/assets/{project-location-DR8go8oL.js → project-location-DJjcFmsE.js} +1 -1
- package/web/dist/assets/project-router-Dc6KBQsv.js +1 -0
- package/web/dist/assets/projects-section-CVFyzORg.js +1 -0
- package/web/dist/assets/{prompt-templates-section-DcxD28iA.js → prompt-templates-section-Jj1YbCwG.js} +2 -2
- package/web/dist/assets/queries-IlC9MZgh.js +1 -0
- package/web/dist/assets/{read-state-c_RNJaXO.js → read-state-BeVNfGkB.js} +1 -1
- package/web/dist/assets/{reference-chip-z7dZJVH-.js → reference-chip-BjerVjzM.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-Dtaa3ovl.js → remote-settings-notice-Czl9yS5W.js} +1 -1
- package/web/dist/assets/repo-git-C9N9wa5l.js +1 -0
- package/web/dist/assets/{report-reader-mbkd2DKt.js → report-reader-Ci4sWoe1.js} +1 -1
- package/web/dist/assets/report-selection-CZ8eb9QP.js +1 -0
- package/web/dist/assets/reports-CQPRtR5G.js +1 -0
- package/web/dist/assets/{resources-section-g5XRlefz.js → resources-section-lLpdP6MD.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-BdBvLP6E.js → review-notes-drafts-BjXqp0gY.js} +1 -1
- package/web/dist/assets/{review-panel-Ba8yb8Fu.js → review-panel-B4dp-Rol.js} +1 -1
- package/web/dist/assets/{review-strip-CdlMeV2i.js → review-strip-BE71YjB6.js} +1 -1
- package/web/dist/assets/{run-detail-refresh-C5qmRdgD.js → run-detail-refresh-CE0vyYYA.js} +1 -1
- package/web/dist/assets/{run-diff-BDMdnSv7.js → run-diff-ClfLRsHF.js} +3 -3
- package/web/dist/assets/run-header-DvbVw3uo.js +2 -0
- package/web/dist/assets/{select-DdH25sWT.js → select-CYo1lo6a.js} +1 -1
- package/web/dist/assets/{session-context-section-BqEdLdTv.js → session-context-section-B_NEOGby.js} +2 -2
- package/web/dist/assets/{settings-agent-picker-b4M6fQ8m.js → settings-agent-picker-DeAST7qR.js} +1 -1
- package/web/dist/assets/{settings-field-Bhh8I9fJ.js → settings-field-AyinSFR_.js} +1 -1
- package/web/dist/assets/{settings-list-detail-D3ibaYUj.js → settings-list-detail-BlEEuyae.js} +1 -1
- package/web/dist/assets/settings-save-bar-Dd3bTznK.js +1 -0
- package/web/dist/assets/{settings-shell-BUwdvhI9.js → settings-shell-Bt7NYun7.js} +1 -1
- package/web/dist/assets/sidebar-section-DdrFJBTL.js +1 -0
- package/web/dist/assets/{skills-BLkPhZO8.js → skills-DNCuhhKf.js} +1 -1
- package/web/dist/assets/status-dot-Bmn4xhch.js +1 -0
- package/web/dist/assets/{switch-CAKeV99j.js → switch-B9OfOEzC.js} +1 -1
- package/web/dist/assets/{tab-link-BKlpD9sn.js → tab-link-6TltE1jl.js} +1 -1
- package/web/dist/assets/{task-changes-Drvnew5P.js → task-changes-CdAzeh9M.js} +2 -2
- package/web/dist/assets/{task-commits-1MJHuX1i.js → task-commits-CzZJZj2x.js} +1 -1
- package/web/dist/assets/{task-file-scope-CB3L3KQl.js → task-file-scope-BuFeMG6a.js} +1 -1
- package/web/dist/assets/task-files-BFdMVAb3.js +1 -0
- package/web/dist/assets/{task-github-item-CMNk7FxR.js → task-github-item-Dv0Uflz7.js} +1 -1
- package/web/dist/assets/{task-groups-CGCnVqHE.js → task-groups-DCg4iOB9.js} +1 -1
- package/web/dist/assets/task-thread-C98mqSie.js +2 -0
- package/web/dist/assets/{textarea-vEsJAUAV.js → textarea-BGp28xFr.js} +1 -1
- package/web/dist/assets/thread-state-DqBwIoCM.js +4 -0
- package/web/dist/assets/toaster-DNnL8v10.js +4 -0
- package/web/dist/assets/{tool-display-B9NN44oU.js → tool-display-CTbToGmi.js} +1 -1
- package/web/dist/assets/use-finish-run-CFEVvqeg.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-BYN578_s.js +1 -0
- package/web/dist/assets/use-path-bases-B238cLk1.js +1 -0
- package/web/dist/assets/{use-search-params-writer-ClMScnNe.js → use-search-params-writer-DD5PEEZw.js} +1 -1
- package/web/dist/assets/use-workspace-config-save-DScW6_8J.js +1 -0
- package/web/dist/assets/{workflows-BUcx-n8J.js → workflows-IT5WTfLr.js} +3 -3
- package/web/dist/assets/{workspace-tools-dbiR1fzO.js → workspace-tools-D_opTe6D.js} +1 -1
- package/web/dist/assets/{worktrees-section-Dyb_QkSd.js → worktrees-section-B8ycJMoK.js} +4 -4
- package/web/dist/assets/zoomable-image-CULOtYYp.js +1 -0
- package/web/dist/index.html +41 -37
- package/web/dist/live-worker.js +2 -2
- package/web/dist/assets/accounts-section-BsgnDmow.js +0 -1
- package/web/dist/assets/activity-motion-Ckq9kC3I.js +0 -1
- package/web/dist/assets/activity-route-5S9WhN9U.js +0 -1
- package/web/dist/assets/agent-accounts-D_7QcFSx.js +0 -1
- package/web/dist/assets/agent-defaults-section-et5LHv9W.js +0 -1
- package/web/dist/assets/attention-DnxGjw_R.js +0 -1
- package/web/dist/assets/automations-route-B5YBpGMc.js +0 -2
- package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +0 -3
- package/web/dist/assets/diff-lwWO-At7.js +0 -3
- package/web/dist/assets/discard-changes-dialog-B3gvm7lX.js +0 -1
- package/web/dist/assets/dist-C_rn70hE.js +0 -1
- package/web/dist/assets/file-preview-98pJhZJj.js +0 -2
- package/web/dist/assets/github-4Jhl7lLG.js +0 -1
- package/web/dist/assets/highlighter-Cfo7mLVB.js +0 -3
- package/web/dist/assets/index-BK1FcZrA.css +0 -1
- package/web/dist/assets/index-DJB0lid-.js +0 -21
- package/web/dist/assets/label-feCJ3WOT.js +0 -1
- package/web/dist/assets/markdown-BAPhDASs.js +0 -2
- package/web/dist/assets/preview-pane-connected-B08ZdGux.js +0 -3
- package/web/dist/assets/project-router-j0uBi7Ep.js +0 -1
- package/web/dist/assets/projects-section-XDboHBFP.js +0 -1
- package/web/dist/assets/queries-CchoEEzj.js +0 -1
- package/web/dist/assets/repo-git-Dp9R2TuI.js +0 -1
- package/web/dist/assets/report-selection-BdGxjISG.js +0 -1
- package/web/dist/assets/reports-ya2OW-iR.js +0 -1
- package/web/dist/assets/run-header-BTRXYB4W.js +0 -2
- package/web/dist/assets/settings-save-bar-DFY_Km4X.js +0 -1
- package/web/dist/assets/sidebar-section-CcucfASN.js +0 -1
- package/web/dist/assets/status-dot-Drd4-nfa.js +0 -1
- package/web/dist/assets/task-files-B9okW1TC.js +0 -1
- package/web/dist/assets/task-thread-_2ch8BRt.js +0 -2
- package/web/dist/assets/thread-state-qNczqxZQ.js +0 -4
- package/web/dist/assets/toaster-zMN8cNZQ.js +0 -4
- package/web/dist/assets/use-finish-run-Dvm4JnAH.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-CBJvP-US.js +0 -1
- package/web/dist/assets/use-path-bases-C9yvZF5B.js +0 -1
- package/web/dist/assets/use-workspace-config-save-9jm9qV6u.js +0 -1
- package/web/dist/assets/zoomable-image-BUTgYpld.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./preload-helper-Czpn1I53.js";var r=e(t(),1),i=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,a=/^[\\/]{2}/;function o(e,t){return t+e.replace(/\\/g,`/`)}var s=`popstate`;function c(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function l(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{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:h(t)}return _(t,n,null,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(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 m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),mask:i}}function h({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 g(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 _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let s=p(r,d),h=b.createHref(r.mask||r);try{o.pushState(s,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),s=b.createHref(r.mask||r);o.replaceState(i,``,s),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(i,e)}let b={get action(){return l},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,h),u=e,()=>{i.removeEventListener(s,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function v(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),u(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:h(t);return i=i.replace(/ $/,`%20`),!n&&a.test(i)&&(i=r+i),new URL(i,r)}function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r,i){let a=D((typeof t==`string`?g(t):t).pathname||`/`,n);if(a==null)return null;let o=i??S(e),s=null,c=fe(a);for(let e=0;s==null&&e<o.length;++e)s=le(o[e],c,r);return s}function x(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 S(e){let t=C(e);return T(t),t}function C(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;u(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=j([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),C(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:d.map((e,t)=>{let[n,r]=de(e.relativePath,e.caseSensitive,t===d.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 w(e.path))a(e,t,!0,n)}),t}function w(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=w(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 T(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:ie),r)}function ce(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 le(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?ue(u,l,s.matcher,s.compiledParams):E(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:j([a,d.pathname]),pathnameBase:_e(j([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=j([a,d.pathnameBase]))}return o}function E(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=de(e.path,e.caseSensitive,e.end);return ue(e,t,n,r)}function ue(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 de(e,t=!1,n=!0){d(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 fe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!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 D(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 pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=ge(n),a=n.startsWith(`/`)?me(n.substring(1),`/`):me(n,t)):a=t,{pathname:a,search:ve(r),hash:ye(i)}}function me(e,t){let n=M(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function O(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 he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function k(e){let t=he(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function A(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),O(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),O(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),O(`#`,`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=pe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var ge=e=>e.replace(/[\\/]{2,}/g,`/`),j=e=>ge(e.join(`/`)),M=e=>e.replace(/\/+$/,``),_e=e=>M(e).replace(/^\/*/,`/`),ve=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ye=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,be=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 xe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Se(e){return j(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ce=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function we(e,t){let n=e;if(typeof n!=`string`||!i.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Ce)try{let e=new URL(window.location.href),r=a.test(n)?new URL(o(n,e.protocol)):new URL(n),i=D(r.pathname,t);r.origin===e.origin&&i!=null?n=i+r.search+r.hash:s=!0}catch{d(!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:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Te=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Te);var Ee=[`GET`,...Te];new Set(Ee);var De=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Oe(e){try{return De.includes(new URL(e).protocol)}catch{return!1}}var N=r.createContext(null);N.displayName=`DataRouter`;var P=r.createContext(null);P.displayName=`DataRouterState`;var ke=r.createContext(!1);function Ae(){return r.useContext(ke)}var je=r.createContext({isTransitioning:!1});je.displayName=`ViewTransition`;var Me=r.createContext(new Map);Me.displayName=`Fetchers`;var Ne=r.createContext(null);Ne.displayName=`Await`;var F=r.createContext(null);F.displayName=`Navigation`;var I=r.createContext(null);I.displayName=`Location`;var L=r.createContext({outlet:null,matches:[],isDataRoute:!1});L.displayName=`Route`;var R=r.createContext(null);R.displayName=`RouteError`;var Pe=`REACT_ROUTER_ERROR`,Fe=`REDIRECT`,Ie=`ROUTE_ERROR_RESPONSE`;function Le(e){if(e.startsWith(`${Pe}:${Fe}:{`))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 Re(e){if(e.startsWith(`${Pe}:${Ie}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new be(t.status,t.statusText,t.data)}catch{}}function ze(e,{relative:t}={}){u(z(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(F),{hash:a,pathname:o,search:s}=H(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:j([n,o])),i.createHref({pathname:c,search:s,hash:a})}function z(){return r.useContext(I)!=null}function B(){return u(z(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(I).location}function Be(){return r.useContext(I).navigationType}var Ve=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function He(e){r.useContext(F).static||r.useLayoutEffect(e)}function V(){let{isDataRoute:e}=r.useContext(L);return e?dt():Ue()}function Ue(){u(z(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(N),{basename:t,navigator:n}=r.useContext(F),{matches:i}=r.useContext(L),{pathname:a}=B(),o=JSON.stringify(k(i)),s=r.useRef(!1);return He(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(d(s.current,Ve),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=A(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var We=r.createContext(null);function Ge(e){let t=r.useContext(L).outlet;return r.useMemo(()=>t&&r.createElement(We.Provider,{value:e},t),[t,e])}function Ke(){let{matches:e}=r.useContext(L);return e[e.length-1]?.params??{}}function H(e,{relative:t}={}){let{matches:n}=r.useContext(L),{pathname:i}=B(),a=JSON.stringify(k(n));return r.useMemo(()=>A(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qe(e,t){return Je(e,t)}function Je(e,t,n){u(z(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(F),{matches:a}=r.useContext(L),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,f=o&&o.route;{let e=f&&f.path||``;pt(c,!f||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
|
+
|
|
3
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let p=B(),m;if(t){let e=typeof t==`string`?g(t):t;u(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.`),m=e}else m=p;let h=m.pathname||`/`,_=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);_=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let v=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):y(e,{pathname:_});d(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),d(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 b=tt(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:j([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:j([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&b?r.createElement(I.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...m},navigationType:`POP`}},b):b}function Ye(){let e=ut(),t=xe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`💿 Hey developer 👋`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var Xe=r.createElement(Ye,null),Ze=class extends r.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=Re(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(L.Provider,{value:this.props.routeContext},r.createElement(R.Provider,{value:e,children:this.props.component}));return this.context?r.createElement($e,{error:e},t):t}};Ze.contextType=ke;var Qe=new WeakMap;function $e({children:e,error:t}){let{basename:n}=r.useContext(F);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Le(t.digest);if(e){let i=Qe.get(t);if(i)throw i;let a=we(e.location,n),o=a.absoluteURL||a.to;if(Oe(o))throw Error(`Invalid redirect location`);if(Ce&&!Qe.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Qe.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function et({routeContext:e,match:t,children:n}){let i=r.useContext(N);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(L.Provider,{value:e},n)}function tt(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,d=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Se(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let u,f=!1,p=null,m=null;i&&(u=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Xe,s&&(c<0&&l===0?(pt(`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(a.slice(0,l+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(et,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Ze,{location:i.location,revalidation:i.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function nt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rt(e){let t=r.useContext(N);return u(t,nt(e)),t}function it(e){let t=r.useContext(P);return u(t,nt(e)),t}function at(e){let t=r.useContext(L);return u(t,nt(e)),t}function ot(e){let t=at(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function st(){return ot(`useRouteId`)}function ct(){let e=it(`useNavigation`);return r.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function lt(){let{matches:e,loaderData:t}=it(`useMatches`);return r.useMemo(()=>e.map(e=>x(e,t)),[e,t])}function ut(){let e=r.useContext(R),t=it(`useRouteError`),n=ot(`useRouteError`);return e===void 0?t.errors?.[n]:e}function dt(){let{router:e}=rt(`useNavigate`),t=ot(`useNavigate`),n=r.useRef(!1);return He(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{d(n.current,Ve),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ft={};function pt(e,t,n){!t&&!ft[e]&&(ft[e]=!0,d(!1,n))}r.memo(mt);function mt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Je(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ht({to:e,replace:t,state:n,relative:i}){u(z(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(F);d(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(L),{pathname:s}=B(),c=V(),l=A(e,k(o),s,i===`path`),f=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:i})},[c,f,i,t,n]),null}function gt(e){return Ge(e.context)}function _t(e){u(!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 vt({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){u(!z(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=g(n));let{pathname:f=`/`,search:p=``,hash:m=``,state:h=null,key:_=`default`,mask:v}=n,y=r.useMemo(()=>{let e=D(f,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:_,mask:v},navigationType:i}},[c,f,p,m,h,_,i,v]);return d(y!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(F.Provider,{value:l},r.createElement(I.Provider,{children:t,value:y}))}function yt({children:e,location:t}){return qe(U(e),t)}r.Component;function U(e,t=[]){let n=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let a=[...t,i];if(e.type===r.Fragment){n.push.apply(n,U(e.props.children,a));return}u(e.type===_t,`[${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>`),u(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.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&&(o.children=U(e.props.children,a)),n.push(o)}),n}var bt=U,W=`get`,G=`application/x-www-form-urlencoded`;function K(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function xt(e){return K(e)&&e.tagName.toLowerCase()===`button`}function St(e){return K(e)&&e.tagName.toLowerCase()===`form`}function Ct(e){return K(e)&&e.tagName.toLowerCase()===`input`}function wt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Tt(e,t){return e.button===0&&(!t||t===`_self`)&&!wt(e)}function Et(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 Dt(e,t){let n=Et(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var q=null;function Ot(){if(q===null)try{new FormData(document.createElement(`form`),0),q=!1}catch{q=!0}return q}var kt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function At(e){return e!=null&&!kt.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${G}"`),null):e}function jt(e,t){let n,r,i,a,o;if(St(e)){let o=e.getAttribute(`action`);r=o?D(o,t):null,n=e.getAttribute(`method`)||W,i=At(e.getAttribute(`enctype`))||G,a=new FormData(e)}else if(xt(e)||Ct(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?D(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||W,i=At(e.getAttribute(`formenctype`))||At(o.getAttribute(`enctype`))||G,a=new FormData(o,e),!Ot()){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(K(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=W,r=null,i=G,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 Mt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Nt=/[&><\u2028\u2029]/g;function Pt(e){return e.replace(Nt,e=>Mt[e])}function Ft(e,t){if(e===!1||e==null)throw Error(t)}function It(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&&D(i.pathname,t)===`/`?i.pathname=`${M(t)}/_root.${r}`:i.pathname=`${M(i.pathname)}.${r}`,i}async function Lt(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}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 Rt(e){return e!=null&&typeof e.page==`string`}function zt(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 Bt(e,t,n){return Gt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Lt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(zt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Vt(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 Ht(e,t,{includeHydrateFallback:n}={}){return Ut(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 Ut(e){return[...new Set(e)]}function Wt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Gt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Rt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Wt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Kt(){let e=r.useContext(N);return Ft(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function qt(){let e=r.useContext(P);return Ft(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var J=r.createContext(void 0);J.displayName=`FrameworkContext`;function Y(){let e=r.useContext(J);return Ft(e,`You must render this element inside a <HydratedRouter> element`),e}function Jt(e,t){let n=r.useContext(J),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.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]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:X(c,m),onBlur:X(l,h),onMouseEnter:X(u,m),onMouseLeave:X(d,h),onTouchStart:X(f,m)}]:[o,p,{}]:[!1,p,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Yt({page:e,...t}){let n=Ae(),{nonce:i}=Y(),{router:a}=Kt(),o=r.useMemo(()=>y(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),n?r.createElement(Zt,{page:e,matches:o,...t}):r.createElement(Qt,{page:e,matches:o,...t})):null}function Xt(e){let{manifest:t,routeModules:n}=Y(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Bt(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Zt({page:e,matches:t,...n}){let i=B(),{future:a}=Y(),{basename:o}=Kt(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=It(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Qt({page:e,matches:t,...n}){let i=B(),{future:a,manifest:o,routeModules:s}=Y(),{basename:c}=Kt(),{loaderData:l,matches:u}=qt(),d=r.useMemo(()=>Vt(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Vt(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.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?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=It(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&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,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Ht(f,o),[f,o]),h=Xt(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function $t(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}r.Component;var en=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{en&&(window.__reactRouterVersion=`7.18.1`)}catch{}function tn({basename:e,children:t,useTransitions:n,window:i}){let a=r.useRef();a.current??=l({window:i,v5Compat:!0});let o=a.current,[s,c]=r.useState({action:o.action,location:o.location}),u=r.useCallback(e=>{n===!1?c(e):r.startTransition(()=>c(e))},[n]);return r.useLayoutEffect(()=>o.listen(u),[o,u]),r.createElement(vt,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:n})}function nn({basename:e,children:t,history:n,useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(vt,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,useTransitions:i})}nn.displayName=`unstable_HistoryRouter`;var Z=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:a,reloadDocument:o,replace:s,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=r.useContext(F),b=typeof d==`string`&&i.test(d),x=we(d,_);d=x.to;let S=ze(d,{relative:a}),C=B(),w=null;if(c){let e=A(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:j([_,e.pathname])),w=v.createHref(e)}let[T,ee,te]=Jt(n,h),ne=un(d,{replace:s,mask:c,state:l,target:u,preventScrollReset:f,relative:a,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(x.isExternal||o),ae=r.createElement(`a`,{...h,...te,href:(ie?w:void 0)||x.absoluteURL||S,onClick:ie?re:e,ref:$t(g,ee),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?r.createElement(r.Fragment,null,ae,r.createElement(Yt,{page:S})):ae});Z.displayName=`Link`;var rn=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=H(o,{relative:l.relative}),f=B(),p=r.useContext(P),{navigator:m,basename:h}=r.useContext(F),g=p!=null&&yn(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=D(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&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 ee=typeof a==`function`?a(C):a;return r.createElement(Z,{...l,"aria-current":w,className:T,ref:u,style:ee,to:o,viewTransition:s},typeof c==`function`?c(C):c)});rn.displayName=`NavLink`;var an=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=W,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=r.useContext(F),v=mn(),y=hn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&i.test(l);return r.createElement(`form`,{ref:g,method:b,action:y,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,a=i?.getAttribute(`formmethod`)||c,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:a,navigate:n,replace:o,state:s,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?r.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});an.displayName=`Form`;function on({getKey:e,storageKey:t,...n}){let i=r.useContext(J),{basename:a}=r.useContext(F),o=B(),s=lt();_n({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=$(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.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&&i?.nonce&&(n.nonce=i.nonce),r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Pt(JSON.stringify(t||gn))}, ${Pt(JSON.stringify(c))})`}})}on.displayName=`ScrollRestoration`;function sn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cn(e){let t=r.useContext(N);return u(t,sn(e)),t}function ln(e){let t=r.useContext(P);return u(t,sn(e)),t}function un(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=V(),f=B(),p=H(e,{relative:s});return r.useCallback(m=>{if(Tt(m,t)){m.preventDefault();let t=n===void 0?h(f)===h(p):n,g=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>g()):g()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function dn(e){d(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=r.useRef(Et(e)),n=r.useRef(!1),i=B(),a=r.useMemo(()=>Dt(i.search,n.current?null:t.current),[i.search]),o=V();return[a,r.useCallback((e,t)=>{let r=Et(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var fn=0,pn=()=>`__${String(++fn)}__`;function mn(){let{router:e}=cn(`useSubmit`),{basename:t}=r.useContext(F),n=st(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=jt(e,t);if(r.navigate===!1){let e=r.fetcherKey||pn();await i(e,n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync})}else await a(r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function hn(e,{relative:t}={}){let{basename:n}=r.useContext(F),i=r.useContext(L);u(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...H(e||`.`,{relative:t})},s=B();if(e==null){o.search=s.search;let e=new URLSearchParams(o.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();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:j([n,o.pathname])),h(o)}var gn=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:D(e.pathname,n)||e.pathname},t)),i??=e.key,i}function _n({getKey:e,storageKey:t}={}){let{router:n}=cn(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=ln(`useScrollRestoration`),{basename:o}=r.useContext(F),s=B(),c=lt(),l=ct();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),vn(r.useCallback(()=>{if(l.state===`idle`){let t=$(s,c,o,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||gn,JSON.stringify(Q))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||gn);e&&(Q=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function vn(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function yn(e,{relative:t}={}){let n=r.useContext(je);u(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=cn(`useViewTransitionState`),a=H(e,{relative:t});if(!n.isTransitioning)return!1;let o=D(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=D(n.nextLocation.pathname,i)||n.nextLocation.pathname;return E(a.pathname,s)!=null||E(a.pathname,o)!=null}export{dn as _,gt as a,bt as c,ze as d,z as f,Ke as g,Be as h,ht as i,E as l,V as m,Z as n,_t as o,B as p,rn as r,yt as s,tn as t,y as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{i,n as a,r as o}from"./highlighter-Crq-WTmN.js";var s=e(t(),1),c=n(),l=1500;function u(e,t){let n=(0,s.useMemo)(()=>e.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[e]),r=(0,s.useMemo)(()=>a(t),[t]),c=n.length>l,[u,d]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(r===null||c)return;let t=!1;return o(e,r).then(n=>{t||d({key:e,tokens:n.tokens})}),()=>{t=!0}},[e,r,c]),r===null||c?n:u?.key===e?u.tokens:i(e,r)?.tokens??n}var d=`code-editor-surface m-0 min-h-full w-full whitespace-pre font-mono text-xs pointer-coarse:text-base leading-[1.7] px-3 py-2 [tab-size:2]`;function f({value:e,onChange:t,language:n,readOnly:i,className:a,markedLines:o,inputRef:l,...f}){let p=u(e,n),m=(0,s.useRef)(null),h=(0,s.useRef)(null),g=()=>{let e=h.current,t=m.current;!e||!t||(t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft)};return(0,s.useLayoutEffect)(g,[e]),(0,c.jsxs)(`div`,{"data-slot":`code-editor`,className:r(`relative overflow-hidden rounded-md border border-input bg-card`,a),children:[(0,c.jsx)(`pre`,{ref:m,"aria-hidden":`true`,className:r(d,`pointer-events-none absolute inset-0 overflow-auto text-soft-foreground`),children:p.map((e,t)=>(0,c.jsx)(`span`,{"data-marked":o?.has(t+1)?``:void 0,className:r(`block`,o?.has(t+1)&&`-mx-3 bg-destructive/15 px-3 shadow-[inset_2px_0_0_var(--danger)]`),children:e.length===0?`
|
|
3
3
|
`:(0,c.jsxs)(c.Fragment,{children:[e.map((e,t)=>(0,c.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),`
|
|
4
4
|
`]})},t))}),(0,c.jsx)(`textarea`,{ref:e=>{h.current=e,l&&(l.current=e)},"data-slot":`code-editor-input`,value:e,readOnly:i,onChange:e=>t?.(e.target.value),onScroll:g,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,autoComplete:`off`,wrap:`off`,className:r(d,`relative block resize-none overflow-auto bg-transparent text-transparent caret-foreground outline-hidden`,`selection:bg-accent-strong/30 focus-visible:ring-0`,i&&`cursor-default`),...f})]})}export{f 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{o as r}from"./dist-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";var i=e(t(),1),a=`cez-workbench-tree-width`;function o(e){return e>0?Math.max(200,Math.floor(e/2)):1/0}function s(e,t=1/0){let n=typeof e==`number`?e:Number(e);return e===null||e===``||!Number.isFinite(n)?Math.min(288,t):Math.min(t,Math.max(200,Math.round(n)))}function c(){try{return s(localStorage.getItem(a))}catch{return 288}}function l(e){try{localStorage.setItem(a,String(s(e)))}catch{}}var u=n();function d({tree:e,treeSlot:t,treeClassName:n,treeRef:a,className:d,children:m}){let h=(0,i.useRef)(null),g=o(f(h)),[_,v]=(0,i.useState)(c),y=s(_,g);return(0,u.jsxs)(`div`,{ref:h,"data-slot":`code-workbench`,className:r(`flex min-h-0 flex-1 flex-col items-stretch gap-4 md:flex-row md:items-start md:gap-0`,d),style:{"--workbench-tree":`${y}px`},children:[(0,u.jsx)(`aside`,{ref:a,"data-slot":t,className:r(`w-full shrink-0`,n,`md:w-(--workbench-tree)`),children:e}),(0,u.jsx)(p,{width:y,max:g,onResize:e=>{let t=s(e,g);v(t),l(t)}}),m]})}function f(e){let[t,n]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(([e])=>n(e?.contentRect.width??0));return r.observe(t),()=>r.disconnect()},[e]),t}function p({width:e,max:t,onResize:n}){let r=(0,i.useRef)(null),[a,o]=(0,i.useState)(!1),s=t=>{t.button!==0||r.current||(r.current={pointerId:t.pointerId,x:t.clientX,width:e},t.currentTarget.setPointerCapture?.(t.pointerId),t.preventDefault(),t.currentTarget.focus(),o(!0))},c=e=>{let t=r.current;t?.pointerId===e.pointerId&&n(t.width+(e.clientX-t.x))},l=e=>{r.current?.pointerId===e.pointerId&&(r.current=null,o(!1),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},d=r=>{let i=r.key===`ArrowLeft`?e-16:r.key===`ArrowRight`?e+16:r.key===`Home`?200:r.key===`End`?t:r.key===`Enter`?288:null;i===null||!Number.isFinite(i)||(r.preventDefault(),n(i))};return(0,u.jsxs)(`div`,{"data-slot":`workbench-divider`,"data-dragging":a?``:void 0,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the file tree`,"aria-valuenow":e,"aria-valuemin":200,...Number.isFinite(t)?{"aria-valuemax":t}:{},tabIndex:0,title:`Drag to resize the file tree. Double-click to reset.`,onPointerDown:s,onPointerMove:c,onPointerUp:l,onPointerCancel:l,onKeyDown:d,onDoubleClick:()=>n(288),className:`group relative hidden w-5 shrink-0 cursor-col-resize touch-none self-stretch rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/50 any-pointer-coarse:w-11 md:block`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent motion-safe:transition-colors group-hover:bg-border group-focus-visible:bg-ring group-data-dragging:bg-ring`}),(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`sticky top-[calc(var(--diff-sticky-top,0px)+2rem)] mx-auto mt-8 block h-8 w-1 rounded-full bg-border motion-safe:transition-colors group-hover:bg-muted-foreground group-data-dragging:bg-ring`})]})}export{d 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{a as r}from"./dist-
|
|
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"./dist-CCX8mhHc.js";import{d as i,f as a,h as o,l as s,m as c,p as l,u}from"./es2015-BHonSvOU.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=c(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:c,onOpenChange:l,...u}=e,[m,h]=i({prop:r,defaultProp:a??!1,onChange:l,caller:p});return(0,f.jsx)(g,{scope:n,disabled:c,contentId:s(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(o.div,{"data-state":w(m),"data-disabled":c?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(o.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:l(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(u,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:s,...c}=e,l=_(x,n),[u,p]=d.useState(i),m=d.useRef(null),h=r(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=l.open||u,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),a(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[l.open,i]),(0,f.jsx)(o.div,{"data-state":w(l.open),"data-disabled":l.disabled?``:void 0,id:l.contentId,hidden:!S,...c,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&s})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E 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{c as r,i,o as a}from"./dist-C_rn70hE.js";import{Q as o}from"./design-icons-QbNMZniQ.js";import{h as s,l as c}from"./es2015-CUEfzDjB.js";import{a as l,o as u,r as d,t as f}from"./dist--f2yFdPY.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-rpNyAWGb.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),a=v.useContext(H),o=B(),l=J(e),u=l.current?.forceMount??a?.forceMount;Y(()=>{if(!u)return o.item(n,a?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:i(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||o.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:a}),[a]);return v.createElement(s.div,{ref:i(u,t),...o,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),o=Z(e=>!e.search);return!n&&!o?null:v.createElement(s.div,{ref:i(a,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&o.current){let e=c.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:i(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:i(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:a(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:i,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:a(`overflow-hidden p-0`,i),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:a(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:a(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:a(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:a(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:a(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:a(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he 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{c as r,i,o as a}from"./dist-CCX8mhHc.js";import{Q as o}from"./design-icons-QbNMZniQ.js";import{h as s,l as c}from"./es2015-BHonSvOU.js";import{a as l,o as u,r as d,t as f}from"./dist-CyFJ-9Ex.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-DKr-j9S6.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),a=v.useContext(H),o=B(),l=J(e),u=l.current?.forceMount??a?.forceMount;Y(()=>{if(!u)return o.item(n,a?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:i(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||o.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>a||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:a}),[a]);return v.createElement(s.div,{ref:i(u,t),...o,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),o=Z(e=>!e.search);return!n&&!o?null:v.createElement(s.div,{ref:i(a,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&o.current){let e=c.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:i(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:i(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:a(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:i,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:a(`overflow-hidden p-0`,i),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:a(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:a(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:a(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:a(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:a(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:a(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he 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{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Yn as r}from"./toaster-DNnL8v10.js";import{o as i}from"./dist-CCX8mhHc.js";import{M as a,Q as o,ct as s,r as c}from"./design-icons-QbNMZniQ.js";import{n as l,r as u}from"./diff-controls-CSO8HgZ0.js";import{t as d}from"./search-x-I9Q8pgUa.js";import{t as f}from"./button-BV_AiLj2.js";import{t as p}from"./project-router-Dc6KBQsv.js";import{m}from"./page-shell-BdjH5hyc.js";import{t as h}from"./centered-state-N8vWM_Hw.js";import{Bn as g,Ln as _,Xt as v,Zt as y,lr as b,o as x}from"./index-Dp7K74Jw.js";import{t as S}from"./diff-DEw-tkVq.js";var C=e(t(),1),w=n();function T({commit:e,sha:t,slot:n,heading:o=`h2`,diffRef:c,loadFileText:f,className:p}){let y=m(),[b,x]=(0,C.useState)(`unified`),[T,D]=(0,C.useState)(!0),O=(0,C.useRef)(null);E(O,t);let k=e.isError&&e.error instanceof r&&e.error.status===409;return(0,w.jsx)(`section`,{ref:O,"data-slot":n,"data-sha":t,"aria-label":`Selected commit`,className:i(`min-w-0 flex-1 scroll-mt-4 overflow-clip rounded-xl border border-border bg-card`,p),children:e.isPending?(0,w.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):e.isError?(0,w.jsx)(h,{icon:k?(0,w.jsx)(d,{}):(0,w.jsx)(s,{size:16}),tone:k?`neutral`:`danger`,heading:`h2`,title:k?`Commit not found`:`Could not load commit diff`,subtitle:e.error.message}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{"data-slot":`commit-meta`,className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(o,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:e.data.subject}),(0,w.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,w.jsx)(`span`,{children:e.data.author}),(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,w.jsx)(`span`,{title:e.data.when,children:v(e.data.when)}),(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,w.jsx)(g,{sha:e.data.sha,variant:`inline`}),(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,w.jsx)(`span`,{"data-slot":`commit-stat`,children:(0,w.jsx)(_,{stat:e.data.stat})})]})]}),(0,w.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,w.jsx)(u,{mode:b,wrap:T,onModeChange:x,onWrapChange:D}),(0,w.jsx)(l,{wrap:T,onWrapChange:D})]})]}),e.data.files.length===0?(0,w.jsx)(h,{icon:(0,w.jsx)(a,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,w.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px]`,children:(0,w.jsx)(S,{...c?{viewRef:c}:{},...f?{loadFileText:f}:{},files:e.data.files,mode:y?b:`unified`,wrap:T,totals:!1,className:`min-w-0`},t)})]})})}function E(e,t){let n=(0,C.useRef)(t);(0,C.useLayoutEffect)(()=>{if(n.current===t)return;n.current=``;let r=e.current,i=r?.closest(`[data-slot="main"]`);if(!(!r||!i)&&r.getBoundingClientRect().top<i.getBoundingClientRect().top){let e=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView?.({block:`start`,behavior:e?`auto`:`smooth`})}},[e,t])}function D({commit:e,sha:t,backTo:n,backLabel:r,slot:i,loadFileText:a,diffRef:o}){return(0,w.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,w.jsx)(`div`,{className:`mx-4 border-b border-border py-2`,children:(0,w.jsx)(f,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,w.jsxs)(p,{to:n,children:[(0,w.jsx)(c,{size:16,"aria-hidden":`true`}),r]})})}),(0,w.jsx)(T,{commit:e,sha:t,slot:i,loadFileText:a,...o?{diffRef:o}:{},className:`rounded-none border-0 bg-transparent`})]})}var O=56;function k({slot:e,commits:t,selectedSha:n,className:r,heading:a}){let[s,c]=(0,C.useState)(``),l=s.trim().toLowerCase(),u=l?t.filter(e=>e.subject.toLowerCase().includes(l)):t,d=u.length>150,f=(0,C.useRef)(null),p=(0,C.useRef)(null),[m,h]=(0,C.useState)(0);(0,C.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=f.current,t=p.current;!e||!t||h(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[d]);let g=u.map(e=>(0,w.jsx)(A,{commit:e,selected:n!==void 0&&e.sha===n},e.sha));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`relative mb-3 block`,children:[(0,w.jsx)(o,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3 left-3 size-4 text-muted-foreground`}),(0,w.jsx)(b,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-10`})]}),(0,w.jsxs)(`div`,{ref:e=>{f.current=e,e&&(p.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":d,className:i(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-3 py-1 md:px-4`,r),children:[a?(0,w.jsx)(`div`,{className:`flex min-h-11 flex-wrap items-center gap-2 py-2.5`,children:a}):null,u.length===0?(0,w.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,d?(0,w.jsx)(x,{scrollRef:p,startMargin:m,itemSize:O,children:g}):g]})]})}function A({commit:e,selected:t}){return(0,w.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_56px] [content-visibility:auto]`,children:(0,w.jsxs)(p,{"data-slot":`commit-row`,"data-sha":e.sha,"data-selected":t?`true`:void 0,"aria-current":t?`true`:void 0,to:e.href,className:i(`flex min-h-11 min-w-0 items-start gap-2.5 rounded-md px-2 py-2.5 transition-colors hover:bg-muted`,t&&`bg-muted/70`),children:[(0,w.jsx)(a,{size:16,"aria-hidden":`true`,className:`mt-px size-4 shrink-0 text-accent-text`}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`span`,{"data-slot":`commit-row-subject`,title:e.subject,className:`line-clamp-2 text-[13px] leading-snug font-medium break-words text-foreground`,children:e.subject}),(0,w.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,w.jsx)(j,{sha:e.sha}),(0,w.jsxs)(`span`,{className:`min-w-0 truncate`,children:[e.author,` · `,(0,w.jsx)(`span`,{title:y(e.when,e.at),children:v(e.when,e.at)})]}),e.stat?(0,w.jsx)(_,{stat:e.stat}):null]})]})]})})}function j({sha:e}){return(0,w.jsx)(g,{"data-slot":`commit-sha`,sha:e,variant:`chip`})}export{T as i,j as n,D as r,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-CCX8mhHc.js";import{mt as r}from"./design-icons-QbNMZniQ.js";import{t as i}from"./button-BV_AiLj2.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-CyFJ-9Ex.js";e();var f=t();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:n(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,i&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(r,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:n(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...t})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:n(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...t})}function y({className:e,showCloseButton:t=!1,children:r,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[r,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(i,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:n(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:n(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-BcU4Rnuo.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/dist-CCX8mhHc.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/button-BV_AiLj2.js","assets/diff-stat-DCO_BkZB.js","assets/index-Dp7K74Jw.js","assets/queries-IlC9MZgh.js","assets/host-context-DDbYAKpm.js","assets/toaster-DNnL8v10.js","assets/live-protocol-CNUmr-VT.js","assets/host-storage-B72yoDU1.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-BdLLx37K.js","assets/label-CgU9vxuM.js","assets/cez-idle-C0drOeLs.js","assets/hosts-CpDMDiQW.js","assets/run-detail-refresh-CE0vyYYA.js","assets/es2015-BHonSvOU.js","assets/reference-chip-BjerVjzM.js","assets/design-icons-QbNMZniQ.js","assets/popover-BQolmvDR.js","assets/dist-Du6flkGD.js","assets/dist-ClMNSUvT.js","assets/attention-BI6592lk.js","assets/task-groups-DCg4iOB9.js","assets/open-in-menu-BI7mnPPf.js","assets/bot-TkDIw4y-.js","assets/external-link-BE6y205O.js","assets/folder-o-AvL3y3.js","assets/smartphone-Lr8Ug2z_.js","assets/square-terminal-B6RYYieR.js","assets/dropdown-menu-NJZfnQCU.js","assets/dist-B2_vvox1.js","assets/own-lookup-DS54wXvD.js","assets/check-OP-CVgZG.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-CIedRn3A.js","assets/folder-browser-CFd1U5hn.js","assets/loader-circle-CPBhhDbB.js","assets/play-CmVAj_fu.js","assets/search-x-I9Q8pgUa.js","assets/preview-EtD19mg1.js","assets/dist-CyFJ-9Ex.js","assets/switch-B9OfOEzC.js","assets/dist-Czz3Y5qH.js","assets/badge-DAnkqD7i.js","assets/dialog-DKr-j9S6.js","assets/project-router-Dc6KBQsv.js","assets/read-state-BeVNfGkB.js","assets/status-dot-Bmn4xhch.js","assets/report-selection-CZ8eb9QP.js","assets/use-search-params-writer-DD5PEEZw.js","assets/page-shell-BdjH5hyc.js","assets/page-shell-CEIoW56O.css","assets/format-BU7D3IfE.js","assets/command-4D8sPZJy.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/agent-accounts-D_ZKAmaW.js","assets/control-locations-kCPVEtOM.js","assets/agents-settings-path-7X6_cvUg.js","assets/centered-state-N8vWM_Hw.js","assets/html-report-BX3msvci.js","assets/index-D_WkVdwL.css","assets/highlighter-Crq-WTmN.js","assets/image-preview-CdL9a1Zj.js","assets/zoomable-image-CULOtYYp.js","assets/textarea-BGp28xFr.js","assets/markdown-BBDDg-4t.js","assets/markdown-BB-PN03o.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.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{t as r}from"./preload-helper-Czpn1I53.js";import{o as i}from"./dist-CCX8mhHc.js";import{t as a}from"./diff-stat-DCO_BkZB.js";import{n as o,r as s,t as c}from"./image-preview-CdL9a1Zj.js";var l=e(t(),1),u=n();function d(e){let[t,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=!1;return r(()=>import(`./diff-view-BcU4Rnuo.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76])),()=>{e=!0}},[]),e.files.length===0?(0,u.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-muted-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,u.jsx)(f,{...e}):t===null?(0,u.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-muted-foreground`,e.className),children:`Loading diff…`}):(0,u.jsx)(t.View,{...e})}function f({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:a,totals:o=!0,actions:c,className:d}){let f={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},m=(0,l.useRef)(null);return(0,l.useImperativeHandle)(a,()=>({scrollToPath:e=>{for(let t of m.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,u.jsxs)(`div`,{ref:m,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,d),children:[(0,u.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!o&&!c,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1`,children:[(0,u.jsx)(s,{stat:f,hidden:!o}),c?(0,u.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:c}):null]}),e.map(e=>(0,u.jsx)(p,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function p({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){let s=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,u.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,u.jsxs)(`header`,{className:`flex items-start gap-2 border-b border-border px-3 py-2`,children:[(0,u.jsx)(`span`,{"data-slot":`diff-file-path`,title:s,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:s}),(0,u.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,u.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),o(e)?(0,u.jsx)(c,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes (metadata only).`}):(0,u.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
|
+
`).map((e,t)=>(0,u.jsxs)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-muted-foreground`),children:[e,e===``?` `:``]},t))})]})}export{d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";import{j as n,nt as r,u as i,v as a}from"./design-icons-QbNMZniQ.js";import{t as o}from"./createLucideIcon-BHp8sXmF.js";import{t as s}from"./button-BV_AiLj2.js";import{n as c,p as l,r as u,t as d}from"./dropdown-menu-NJZfnQCU.js";import{vr as f}from"./index-Dp7K74Jw.js";var p=o(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),m=o(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),h=e();function g({mode:e,wrap:t,onModeChange:n,onWrapChange:r,disabled:i=!1}){return(0,h.jsxs)(`span`,{className:`flex items-center gap-1.5 max-md:hidden`,children:[(0,h.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`inline-flex items-center rounded-lg border border-border bg-card p-0.5`,children:[(0,h.jsx)(S,{current:e,value:`unified`,onModeChange:n,disabled:i}),(0,h.jsx)(S,{current:e,value:`split`,onModeChange:n,disabled:i})]}),(0,h.jsx)(b,{wrap:t,onWrapChange:r,disabled:i,labelled:!0,className:`gap-1.5 rounded-lg px-3 text-xs font-medium`})]})}function _({wrap:e,onWrapChange:t,preview:n=!1,onPreviewChange:a,disabled:o=!1}){return(0,h.jsxs)(d,{children:[(0,h.jsx)(l,{asChild:!0,children:(0,h.jsxs)(s,{variant:`outline`,size:`sm`,"data-slot":`diff-view-menu`,className:`gap-1.5 rounded-lg px-3 text-xs font-medium md:hidden`,children:[(0,h.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),`View`,(0,h.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`})]})}),(0,h.jsxs)(u,{align:`end`,"data-slot":`diff-view-menu-content`,children:[(0,h.jsx)(c,{"data-slot":`diff-view-wrap`,className:`min-h-11`,checked:e,disabled:o,onCheckedChange:e=>t(e===!0),children:`Wrap long lines`}),a?(0,h.jsx)(c,{"data-slot":`diff-view-preview`,className:`min-h-11`,checked:n,onCheckedChange:e=>a(e===!0),children:`Preview Markdown`}):null]})]})}var v=`Unavailable while Markdown preview is on`;function y(){return(0,h.jsx)(`span`,{"data-slot":`markdown-preview-hint`,role:`status`,className:`text-xs text-muted-foreground max-sm:sr-only`,children:`Full-document preview — layout and wrap are off`})}function b({wrap:e,onWrapChange:n,className:r=`rounded-lg`,disabled:i=!1,labelled:a=!1}){return(0,h.jsxs)(s,{variant:`outline`,size:a?`default`:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:i?v:`Wrap long lines`,disabled:i,className:t(r,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(m,{"aria-hidden":`true`}),a?(0,h.jsx)(`span`,{"aria-hidden":`true`,children:`Wrap`}):null]})}function x({preview:e,onPreviewChange:n}){return(0,h.jsxs)(s,{variant:`outline`,size:`default`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`gap-1.5 rounded-lg px-0 text-xs font-medium sm:px-3`,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(f,{"aria-hidden":`true`,className:`size-4`}),(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function S({current:e,value:n,onModeChange:r,disabled:i}){let o=e===n;return(0,h.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":o,disabled:i,title:i?v:void 0,onClick:()=>r(n),className:t(`inline-flex h-[30px] items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o?`bg-muted text-foreground`:`text-muted-foreground pointer-hover:text-foreground`),children:[n===`unified`?(0,h.jsx)(p,{"aria-hidden":`true`,className:`size-4`}):(0,h.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function C({branch:e}){return(0,h.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs font-medium`,children:[(0,h.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e})]})}export{x as a,y as i,_ as n,b as o,g as r,C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";var n=e();function r(e){if(e<1e3)return String(e);let t=[`k`,`M`,`B`,`T`],n=Math.floor(Math.log10(e)/3);return n>t.length?e.toExponential(0).replace(`+`,``):`${Math.floor(e/1e3**n)}${t[n-1]}`}function i({stat:e,className:i,compact:a=!1}){let o=`+${e.adds} −${e.dels} across ${e.files} ${e.files===1?`file`:`files`}`,s=e.repointed?`${o} — measured against another branch checked out in this task's worktree, as this task found it`:void 0;return(0,n.jsxs)(`span`,{"data-slot":`diff-stat`,...s?{"data-repointed":`true`,"aria-label":s}:{},...a&&!s?{"aria-label":o}:{},title:s??o,className:t(`font-mono! text-xs font-semibold tabular-nums`,e.repointed&&`cursor-help underline decoration-dotted underline-offset-2`,i),children:[e.adds===0&&e.dels===0?(0,n.jsx)(`span`,{"data-zero":!0,className:`text-muted-foreground`,children:`—`}):null,e.adds>0?(0,n.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,a?r(e.adds):e.adds.toLocaleString(`en-US`)]}):null,e.adds>0&&e.dels>0?` `:null,e.dels>0?(0,n.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,a?r(e.dels):e.dels.toLocaleString(`en-US`)]}):null]})}export{i as t};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BV_AiLj2.js";import{t as s}from"./diff-stat-DCO_BkZB.js";import{o as c,rt as l,wn as u}from"./index-Dp7K74Jw.js";import{a as d,i as f,r as p}from"./highlighter-Crq-WTmN.js";import{n as m,r as h,t as g}from"./image-preview-CdL9a1Zj.js";import{t as _}from"./textarea-BGp28xFr.js";import{n as v,t as y}from"./markdown-BBDDg-4t.js";import{t as b}from"./markdown-BB-PN03o.js";var x=e(t(),1),S=44;function C(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function ee(e){return C(e)*20+S}function te(e){return e.reduce((e,t)=>e+C(t),0)}function ne(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function w(e){return`${e.oldPath??``}→${e.path}`}function T(e){let t=0;for(let n of e.split(`
|
|
3
|
-
`))n.length>t&&(t=n.length);return t}var E=n();function D({path:e,side:t,line:n,hunk:r}){let i=typeof n==`number`?String(n):`${n.start}-${n.end}`;return`${r?`hunk`:`line`}:${t}:${i}:${e}`}function O(e,t){return t.kind===`del`||t.newLine===void 0?{path:e,side:`old`,line:t.oldLine??0,hunk:!1}:{path:e,side:`new`,line:t.newLine,hunk:!1}}function k(e,t){let[n,r,i]=t.newCount===0?[t.oldStart,t.oldCount,`old`]:[t.newStart,t.newCount,`new`];return{path:e,side:i,line:{start:n,end:n+Math.max(r,1)-1},hunk:!0}}function A(e){return e.hunk?`Add a note on this hunk`:`Add a note on ${e.side===`old`?`old `:``}line ${String(e.line)}`}function j(e){return typeof e.line==`number`?`Note on ${e.side===`old`?`old `:``}line ${e.line} of ${e.path}`:`Note on lines ${e.line.start}–${e.line.end} of ${e.path}`}function re(e){let[t,n]=(0,x.useState)(()=>new Map),r=(0,x.useRef)(null);if(
|
|
3
|
+
`))n.length>t&&(t=n.length);return t}var E=n();function D({path:e,side:t,line:n,hunk:r}){let i=typeof n==`number`?String(n):`${n.start}-${n.end}`;return`${r?`hunk`:`line`}:${t}:${i}:${e}`}function O(e,t){return t.kind===`del`||t.newLine===void 0?{path:e,side:`old`,line:t.oldLine??0,hunk:!1}:{path:e,side:`new`,line:t.newLine,hunk:!1}}function k(e,t){let[n,r,i]=t.newCount===0?[t.oldStart,t.oldCount,`old`]:[t.newStart,t.newCount,`new`];return{path:e,side:i,line:{start:n,end:n+Math.max(r,1)-1},hunk:!0}}function A(e){return e.hunk?`Add a note on this hunk`:`Add a note on ${e.side===`old`?`old `:``}line ${String(e.line)}`}function j(e){return typeof e.line==`number`?`Note on ${e.side===`old`?`old `:``}line ${e.line} of ${e.path}`:`Note on lines ${e.line.start}–${e.line.end} of ${e.path}`}function re(e){let[t,n]=(0,x.useState)(()=>new Map),r=(0,x.useRef)(null);if(u([...t.values()].some(e=>e.text.trim()!==``)),!e)return;let i=e=>n(t=>{let n=new Map(t);return n.delete(e),n});return{drafts:t,open:e=>{let t=D(e);r.current=t,n(n=>new Map(n).set(t,n.get(t)??{anchor:e,text:``}))},change:(e,t)=>n(n=>{let r=n.get(e);return r?new Map(n).set(e,{...r,text:t}):n}),close:i,save:n=>{let r=t.get(n);!r||r.text.trim()===``||(e(r.anchor,r.text),i(n))},takeFocus:e=>r.current===e?(r.current=null,!0):!1}}var M=r(`cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11 hover:text-foreground hover:underline`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`);function N({noteKey:e,draft:t,notes:n}){let r=(0,x.useRef)(null);(0,x.useEffect)(()=>{n.takeFocus(e)&&r.current?.focus()});let i=t.text.trim()===``;return(0,E.jsxs)(`div`,{"data-slot":`diff-note-editor`,className:`sticky left-0 flex w-full max-w-[100cqi] flex-col gap-2 border-y border-border bg-card px-3 py-2 font-sans`,children:[(0,E.jsx)(_,{ref:r,"data-slot":`diff-note-text`,"aria-label":j(t.anchor),placeholder:`What should change here?`,rows:2,value:t.text,onChange:t=>n.change(e,t.target.value),onKeyDown:t=>{if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),n.close(e);return}l(t)&&(t.preventDefault(),n.save(e))},className:`min-h-11 text-base md:text-[13px]`}),(0,E.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,E.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`diff-note-cancel`,onClick:()=>n.close(e),children:`Cancel`}),(0,E.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`diff-note-save`,disabled:i,onClick:()=>n.save(e),children:`Save`})]})]})}var P=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,F=300,I=.3;function L(e,t){if(e===t)return null;let n=e.match(P)??[],r=t.match(P)??[];if(n.length===0||r.length===0||n.length>F||r.length>F)return null;let i=ie(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<I?null:ae(n,r,i)}function ie(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function ae(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:R(e,i),add:R(t,a)}}function R(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function oe(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var se=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,ce=`… (patch truncated)`;function z(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=se.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(ce)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function le(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function ue(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function de(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=L(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function B(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(de(t,i))}else t(i),r++}}function fe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function pe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}function me({file:e,loadFileText:t,imageSrc:n}){let r=(0,x.useMemo)(()=>he(e),[e]),i=(0,x.useRef)(t);i.current=t;let a=(0,x.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,x.useState)(null);(0,x.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&c({path:e.path,text:t}),()=>!n&&c({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let l=(0,x.useCallback)(t=>{let n=a.current,r=n?v(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),u=s?.path===e.path?s:null;if(o&&u===null)return(0,E.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Loading preview…`});let d=u?.text??null;if(d===null&&r.text===``)return(0,E.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes to preview.`});let f=d!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,E.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,E.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:f}):null,(0,E.jsx)(b,{document:!0,imageSrc:l,children:d??r.text})]})})}function he(e){let t=z(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
|
|
5
5
|
`)).join(`
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
`),complete:e.status===`added`&&!t.truncated}}var V=`[data-scroll-root], [data-slot="main"]`,ge=1500,H=new Map;function _e(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function ve({files:e,mode:t=`unified`,wrap:n=!1,preview:i,loadFileText:a,imageSrc:o,onOpenInApp:s,onNote:c,viewRef:l,totals:u=!0,actions:d,className:f}){let p=(0,x.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[m,g]=(0,x.useState)(()=>new Set),[_,v]=(0,x.useState)(()=>new Map),[b,S]=(0,x.useState)(()=>new Map),[C,T]=(0,x.useState)(i);C!==i&&(T(i),S(new Map));let D=(0,x.useCallback)((e,t)=>{S(n=>new Map(n).set(e,t))},[]),O=(0,x.useCallback)(e=>{g(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),k=(0,x.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=ue(t,n.split(`
|
|
10
|
-
`));v(n=>{let i=w(e);return new Map(n).set(i,new Map(n.get(i)??H).set(t.beforeHunk,r))})},[a]),A=re(c),j=(0,x.useMemo)(()=>te(e),[e]),[M]=(0,x.useState)(()=>typeof window>`u`?``:window.location.search),N=ne(M,j),P=(0,x.useRef)(null),F=(0,x.useRef)(null),I=(0,x.useRef)(null);(0,x.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=F.current;r?r.scrollToIndex(n,{align:`start`}):_e(I.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let L=e=>{let r=w(e),c=i!==void 0&&y(e),l=c&&(b.get(r)??i);return(0,E.jsx)(xe,{file:e,open:!m.has(r),onToggle:()=>O(r),preview:l,onPreviewChange:c?e=>D(r,e):void 0,loadFileText:a,expanded:_.get(r)??H,onExpand:t=>void k(e,t),mode:t,wrap:n,canExpand:a!==void 0,imageSrc:o,onOpenInApp:s,notes:A})};return(0,E.jsxs)(`div`,{ref:e=>{I.current=e,e&&(P.current=e.closest(V))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,f),children:[(0,E.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!u&&!d,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1 pb-3`,children:[(0,E.jsx)(h,{stat:p,hidden:!u}),d?(0,E.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:d}):null]}),N===`virtual`?(0,E.jsx)(ye,{files:e,handleRef:F,scrollElRef:P,card:L}):(0,E.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,E.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${ee(e)}px`},className:`pb-3 [content-visibility:auto]`,children:L(e)},w(e)))})]})}function ye({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,x.useRef)(null),[a,o]=(0,x.useState)(0);return(0,x.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,E.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(V))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,E.jsx)(
|
|
10
|
+
`));v(n=>{let i=w(e);return new Map(n).set(i,new Map(n.get(i)??H).set(t.beforeHunk,r))})},[a]),A=re(c),j=(0,x.useMemo)(()=>te(e),[e]),[M]=(0,x.useState)(()=>typeof window>`u`?``:window.location.search),N=ne(M,j),P=(0,x.useRef)(null),F=(0,x.useRef)(null),I=(0,x.useRef)(null);(0,x.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=F.current;r?r.scrollToIndex(n,{align:`start`}):_e(I.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let L=e=>{let r=w(e),c=i!==void 0&&y(e),l=c&&(b.get(r)??i);return(0,E.jsx)(xe,{file:e,open:!m.has(r),onToggle:()=>O(r),preview:l,onPreviewChange:c?e=>D(r,e):void 0,loadFileText:a,expanded:_.get(r)??H,onExpand:t=>void k(e,t),mode:t,wrap:n,canExpand:a!==void 0,imageSrc:o,onOpenInApp:s,notes:A})};return(0,E.jsxs)(`div`,{ref:e=>{I.current=e,e&&(P.current=e.closest(V))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,f),children:[(0,E.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!u&&!d,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1 pb-3`,children:[(0,E.jsx)(h,{stat:p,hidden:!u}),d?(0,E.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:d}):null]}),N===`virtual`?(0,E.jsx)(ye,{files:e,handleRef:F,scrollElRef:P,card:L}):(0,E.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,E.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${ee(e)}px`},className:`pb-3 [content-visibility:auto]`,children:L(e)},w(e)))})]})}function ye({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,x.useRef)(null),[a,o]=(0,x.useState)(0);return(0,x.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,E.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(V))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,E.jsx)(c,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,E.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},w(e)))})})}var be={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function xe({file:e,open:t,onToggle:n,expanded:o,onExpand:c,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g,notes:_}){let v=be[e.status],y=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,E.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,E.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border bg-card`,children:[(0,E.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":t,onClick:n,className:`flex min-w-0 flex-1 items-start gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,E.jsx)(i,{className:r(`mbs-[1px] size-3.5 shrink-0 text-muted-foreground motion-safe:transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,E.jsx)(`span`,{"data-slot":`diff-file-path`,title:y,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:e.oldPath?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),v?(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:v}):null,e.image?(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`image`}):e.binary?(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,E.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,E.jsx)(s,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),f?(0,E.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-preview-toggle`,"aria-pressed":d,"aria-label":`Preview ${e.path} as a document`,title:d?`Show this file as a diff`:`Preview this file as a document`,onClick:()=>f(!d),className:r(`mr-1.5 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12px] font-medium max-md:h-11 max-md:px-3 pointer-coarse:h-11 pointer-coarse:px-3`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,d?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,E.jsx)(a,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),t&&d?(0,E.jsx)(me,{file:e,loadFileText:p,imageSrc:h}):t?(0,E.jsx)(Se,{file:e,expanded:o,onExpand:c,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g,notes:_}):null]})}function Se({file:e,expanded:t,onExpand:n,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c,notes:l}){let u=(0,x.useMemo)(()=>z(e.patch),[e.patch]),d=o&&e.status!==`added`&&e.status!==`deleted`,f=(0,x.useMemo)(()=>le(u.hunks,d),[u.hunks,d]),p=(0,x.useMemo)(()=>{let e=[];u.hunks.forEach((n,r)=>{let i=t.get(r);i&&e.push(...i),e.push(...n.lines)});let n=t.get(u.hunks.length);return n&&e.push(...n),e},[u.hunks,t]),h=(0,x.useMemo)(()=>new Map(p.map((e,t)=>[e,t])),[p]),_=Ce(e.path,p),v=(0,x.useMemo)(()=>i===`unified`?fe(u.hunks,f,t):null,[i,u.hunks,f,t]),y=(0,x.useMemo)(()=>i===`split`?pe(u.hunks,f,t):null,[i,u.hunks,f,t]),b=(0,x.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${T(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(m(e))return(0,E.jsx)(g,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,E.jsx)(U,{children:`Binary file — no text diff.`});if(u.hunks.length===0)return(0,E.jsx)(U,{children:u.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let S=e=>{if(!_)return null;let t=h.get(e);return t===void 0?null:_[t]??null};return(0,E.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:r(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`,l&&`@container`),children:[(0,E.jsxs)(`div`,{"data-slot":`diff-rows`,style:b,className:`[&>*]:[contain-intrinsic-block-size:auto_20px] [&>*]:[content-visibility:auto]`,children:[v?v.map((t,r)=>(0,E.jsxs)(x.Fragment,{children:[(0,E.jsx)(De,{row:t,wrap:a,tokensFor:S,onExpand:d?n:void 0,path:e.path,notes:l}),(0,E.jsx)(Q,{anchors:Te(e.path,t),notes:l})]},r)):null,y?y.map((t,r)=>(0,E.jsxs)(x.Fragment,{children:[(0,E.jsx)(Oe,{row:t,wrap:a,tokensFor:S,onExpand:d?n:void 0,path:e.path,notes:l}),(0,E.jsx)(Q,{anchors:Ee(e.path,t),notes:l})]},r)):null]}),u.truncated?(0,E.jsx)(U,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function Ce(e,t){let n=(0,x.useMemo)(()=>t.length>ge?null:t.map(e=>e.text).join(`
|
|
11
11
|
`),[t]),r=(0,x.useMemo)(()=>d(e),[e]),[i,a]=(0,x.useState)(null);return(0,x.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return p(n,r).then(t=>{e||a({text:n,tokens:t.tokens})}),()=>{e=!0}},[n,r]),n===null||r===null?null:i?.text===n?i.tokens:f(n,r)?.tokens??null}function U({children:e}){return(0,E.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}var W={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},we={add:`+`,del:`−`,context:` `};function G({hunk:e,wrap:t,onNote:n}){let i=r(`border-y border-border/70 bg-muted/60 px-4 py-0.5 text-muted-foreground max-sm:px-2`,t?`break-words whitespace-pre-wrap`:`truncate`);return n?(0,E.jsx)(`button`,{type:`button`,"data-slot":`diff-hunk`,"aria-label":`Add a note on this hunk`,title:e.header,onClick:n,className:r(i,M,`block w-full text-left hover:bg-muted hover:no-underline`),children:e.header}):(0,E.jsx)(`div`,{"data-slot":`diff-hunk`,title:t?void 0:e.header,className:i,children:e.header})}function K({gap:e,onExpand:t}){let n=e.count===void 0?`⋯ unchanged lines to end of file`:`⋯ ${e.count} unchanged ${e.count===1?`line`:`lines`}`;return t?(0,E.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,"aria-label":e.count===void 0?`Expand unchanged lines to end of file`:`Expand ${e.count} unchanged ${e.count===1?`line`:`lines`}`,onClick:()=>t(e),className:`block w-full border-y border-border/70 bg-muted/40 px-4 py-1 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[n,` — expand`]}):(0,E.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/70 bg-muted/40 px-4 py-1 text-xs text-muted-foreground`,children:n})}function q({cell:e,tokens:t,wrap:n}){let i=oe(t,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,E.jsxs)(`span`,{className:r(`min-w-0 flex-1 pr-4 max-sm:pr-1 max-sm:pl-1.5`,n?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((t,n)=>(0,E.jsx)(`span`,{"data-word":t.changed?e.line.kind:void 0,style:t.color===void 0?void 0:{color:t.color},className:t.changed?r(`rounded-[2px]`,a):void 0,children:t.text},n)),e.line.text===``?` `:``]})}function J({value:e,className:t,onNote:n}){return n&&e!==void 0?(0,E.jsx)(`button`,{type:`button`,"data-slot":`diff-gutter`,"aria-label":A(n.anchor),onClick:()=>n.notes.open(n.anchor),className:r(`flex w-10 shrink-0 items-start justify-end pr-2 text-right text-muted-foreground tabular-nums select-none max-sm:w-7 max-sm:pr-1.5`,M,t),children:e}):(0,E.jsx)(`span`,{"data-slot":`diff-gutter`,className:r(`w-10 shrink-0 pr-2 text-right text-muted-foreground tabular-nums select-none max-sm:w-7 max-sm:pr-1.5`,t),children:e??``})}function Y({kind:e}){return(0,E.jsx)(`span`,{"data-slot":`diff-marker`,className:`w-4 shrink-0 text-muted-foreground select-none max-sm:text-center`,children:we[e]})}function X(e,t,n){return n?()=>n.open(k(e,t)):void 0}function Z(e,t,n,r){if(!r)return;let i=O(e,t);return i.side===n?{anchor:i,notes:r}:void 0}function Te(e,t){return t.type===`hunk`?[k(e,t.hunk)]:t.type===`gap`?[]:[O(e,t.cell.line)]}function Ee(e,t){if(t.type===`hunk`)return[k(e,t.hunk)];if(t.type===`gap`)return[];let n=[t.left,t.right].flatMap(t=>t?[O(e,t.line)]:[]);return n.filter((e,t)=>n.findIndex(t=>D(t)===D(e))===t)}function Q({anchors:e,notes:t}){return t?e.map(e=>{let n=D(e),r=t.drafts.get(n);return r?(0,E.jsx)(N,{noteKey:n,draft:r,notes:t},n):null}):null}function De({row:e,wrap:t,tokensFor:n,onExpand:i,path:a,notes:o}){if(e.type===`hunk`)return(0,E.jsx)(G,{hunk:e.hunk,wrap:t,onNote:X(a,e.hunk,o)});if(e.type===`gap`)return(0,E.jsx)(K,{gap:e.gap,onExpand:i});let{line:s}=e.cell;return(0,E.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":s.kind,className:r(`flex`,W[s.kind]),children:[(0,E.jsx)(J,{value:s.oldLine,className:`max-sm:hidden`,onNote:Z(a,s,`old`,o)}),(0,E.jsx)(J,{value:s.newLine,className:`max-sm:hidden`,onNote:Z(a,s,`new`,o)}),(0,E.jsx)(J,{value:s.newLine??s.oldLine,className:`sm:hidden`,onNote:o?{anchor:O(a,s),notes:o}:void 0}),(0,E.jsx)(Y,{kind:s.kind}),(0,E.jsx)(q,{cell:e.cell,tokens:n(s),wrap:t})]})}function Oe({row:e,wrap:t,tokensFor:n,onExpand:r,path:i,notes:a}){return e.type===`hunk`?(0,E.jsx)(G,{hunk:e.hunk,wrap:t,onNote:X(i,e.hunk,a)}):e.type===`gap`?(0,E.jsx)(K,{gap:e.gap,onExpand:r}):(0,E.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,E.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t,path:i,notes:a}),(0,E.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t,path:i,notes:a})]})}function $({cell:e,side:t,tokensFor:n,wrap:i,path:a,notes:o}){if(!e)return(0,E.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:r(`bg-muted/20`,t===`new`&&`border-l border-border/70`)});let{line:s}=e;return(0,E.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":s.kind,className:r(`flex min-w-0 overflow-x-auto`,W[s.kind],t===`new`&&`border-l border-border/70`),children:[(0,E.jsx)(J,{value:t===`old`?s.oldLine:s.newLine,onNote:Z(a,s,t,o)}),(0,E.jsx)(Y,{kind:s.kind}),(0,E.jsx)(q,{cell:e,tokens:n(s),wrap:i})]})}export{ve as DiffView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$t as t,an as n,en as r,in as i,nn as a,on as o,rn as s,tn as c}from"./index-Dp7K74Jw.js";var l=e();function u({open:e,subject:u,onKeep:d,onDiscard:f}){return(0,l.jsx)(t,{open:e,onOpenChange:e=>!e&&d(),children:(0,l.jsxs)(a,{"data-slot":`discard-changes-dialog`,className:`sm:max-w-[560px]`,children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(o,{children:`Discard unsaved changes?`}),(0,l.jsxs)(s,{children:[`Your edits to `,(0,l.jsx)(`span`,{className:`font-medium text-foreground`,children:u}),` are not saved. They are lost if you continue.`]})]}),(0,l.jsxs)(i,{children:[(0,l.jsx)(c,{"data-slot":`discard-changes-keep`,children:`Keep editing`}),(0,l.jsx)(r,{"data-slot":`discard-changes-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:f,children:`Discard changes`})]})]})})}export{u 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{a as r,n as i}from"./dist-
|
|
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,n as i}from"./dist-CCX8mhHc.js";import{m as a}from"./es2015-BHonSvOU.js";var o=e(t(),1),s=n();function c(e){let t=e+`CollectionProvider`,[n,c]=a(t),[l,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=o.useRef(null),i=o.useRef(new Map).current;return(0,s.jsx)(l,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=i(f),m=o.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,u(f,n).collectionRef);return(0,s.jsx)(p,{ref:a,children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=o.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,c=o.useRef(null),l=r(t,c),d=u(h,n);return o.useEffect(()=>(d.itemMap.set(c,{ref:c,...a}),()=>void d.itemMap.delete(c))),(0,s.jsx)(_,{[g]:``,ref:l,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,c]}var l=o.createContext(void 0);function u(e){let t=o.useContext(l);return e||t||`ltr`}export{c as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{r as n,t as r}from"./bundle-mjs-rHxsej31.js";function i(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var a=r({extend:{classGroups:{shadow:[`shadow-modal`]}}});function o(...e){return a(n(e))}function s(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}var c=e(t(),1);function l(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function u(...e){return t=>{let n=!1,r=e.map(e=>{let r=l(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():l(e[t],null)}}}}function d(...e){return c.useCallback(u(...e),e)}function f(e){let t=c.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];x(r)&&typeof T==`function`&&(r=T(r._payload)),c.Children.forEach(r,e=>{if(y(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;x(n)&&typeof T==`function`&&(n=T(n._payload)),a=g(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=c.cloneElement(a,void 0,s):!o&&c.Children.count(r)===1&&c.isValidElement(r)&&(a=r);let l=a?v(a):void 0,u=d(n,l);if(!a){if(r||r===0)throw Error(o?w(e):C(e));return r}let f=_(i,a.props??{});return a.type!==c.Fragment&&(f.ref=n?u:l),c.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}var p=f(`Slot`),m=Symbol.for(`radix.slottable`);function h(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=m,t}var g=(e,t)=>{if(`child`in e.props){let t=e.props.child;return c.isValidElement(t)?c.cloneElement(t,void 0,e.props.children(t.props.children)):null}return c.isValidElement(t)?t:null};function _(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function y(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===m}var b=Symbol.for(`react.lazy`);function x(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===b&&`_payload`in e&&S(e._payload)}function S(e){return typeof e==`object`&&!!e&&`then`in e}var C=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,w=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,T=c.use;export{d as a,i as c,u as i,f as n,o,h as r,s,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{f as n}from"./es2015-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{f as n}from"./es2015-BHonSvOU.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}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{a as r,n as i}from"./dist-
|
|
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,n as i}from"./dist-CCX8mhHc.js";import{a,d as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _}from"./es2015-BHonSvOU.js";var v=e(t(),1),y=n(),b=`Dialog`,[x,S]=u(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=v.useRef(null),u=v.useRef(null),[d,f]=o({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:c,contentRef:u,contentId:l(),titleId:l(),descriptionId:l(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=w(E,n),o=r(t,a.triggerRef);return(0,y.jsx)(s.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q(a.open),...i,ref:o,onClick:p(e.onClick,a.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(_,{present:n||a.open,children:(0,y.jsx)(c,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(_,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=i(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=w(M,n),o=r(t,h());return(0,y.jsx)(d,{as:P,allowPinchZoom:!0,shards:[a.contentRef],children:(0,y.jsx)(s.div,{"data-state":q(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(_,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),i=v.useRef(null),a=r(t,n.contentRef,i);return v.useEffect(()=>{let e=i.current;if(e)return g(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,c=w(I,n);return m(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(a,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,y.jsx)(f,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":q(c.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(s.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(s.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(s.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}export{N as a,D as c,W as i,S as l,K as n,j as o,L as r,H as s,T as t};
|