failproofai 1.0.12-beta.1 → 1.0.12-beta.2
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +2 -2
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00l2u6j86cb8y._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pwj2h2efe5f-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b78b0j8iyv6l._.js → [root-of-the-server]__1vofkb2oq7p7e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bseae9u7g98r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0mouhaflye1ro._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_1a3tubds7s7ow._.js → _0ouu886szh6yj._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1fw0_nzkae5ao._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_20hn4gn87nsjc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_components_project-list_tsx_1ke6anr0vt64h._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_1i8oid1gc7s1f.js → node_modules_html-to-image_es_index_1fv03uigni8s5.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589gp4p60j._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{2-tf6_7u623kd.js → 0ay__-d2h1xb5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{18433qz-8njv3.js → 0tbm3vjm62h-2.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1b32-afqacaen.js → 1c_jf6g5wnslk.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_zfad4co-t2z.js → 1my3-5p47t7r-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0jutamwqz8pg5.js → 20py8k1gd_i1m.js} +1 -1
- package/.next/standalone/.next/static/chunks/21hckpmsc4g70.js +6 -0
- package/.next/standalone/.next/static/chunks/2hmex93ppj1ke.js +1 -0
- package/.next/standalone/.next/static/chunks/{42e8zab314654.js → 2o6d37j425uci.js} +1 -1
- package/.next/standalone/.next/static/chunks/40oworn_-x12p.js +1 -0
- package/.next/standalone/.next/static/chunks/{24w3x2da9sk49.js → 42xptz88mtq3x.js} +1 -1
- package/.next/standalone/app/actions/update-jev-config.ts +5 -3
- package/.next/standalone/app/settings/jev-panel.tsx +1 -1
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +9 -18
- package/.next/standalone/fp-cloud-cli/README.md +7 -9
- package/.next/standalone/fp-cloud-cli/fp_cli/client.py +1 -27
- package/.next/standalone/fp-cloud-cli/fp_cli/commands/fleet_cmds.py +12 -216
- package/.next/standalone/fp-cloud-cli/fp_cli/enforcement.py +7 -53
- package/.next/standalone/fp-cloud-cli/fp_cli/output.py +2 -71
- package/.next/standalone/fp-cloud-cli/skill/SKILL.md +1 -1
- package/.next/standalone/fp-cloud-cli/skill/references/commands.md +6 -7
- package/.next/standalone/fp-cloud-cli/tests/test_cloud_jev.py +32 -197
- package/.next/standalone/hermes-plugin/__init__.py +11 -0
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/package.json +11 -10
- package/.next/standalone/sdk/python/uv.lock +31 -8
- package/.next/standalone/server.js +1 -1
- package/dist/cli.mjs +1686 -612
- package/dist/worker.mjs +354 -49
- package/hermes-plugin/__init__.py +11 -0
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +11 -10
- package/src/audit/open-browser.ts +24 -7
- package/src/hooks/agent-roster.ts +9 -1
- package/src/hooks/agent-skill.ts +203 -0
- package/src/hooks/cloud-connection.ts +27 -51
- package/src/hooks/cloud-introspect.ts +5 -2
- package/src/hooks/cloud-login.ts +248 -0
- package/src/hooks/cloud-managed-policies.ts +54 -4
- package/src/hooks/codex-system-hooks.ts +10 -4
- package/src/hooks/config-status.ts +9 -3
- package/src/hooks/configure-wizard.ts +356 -32
- package/src/hooks/delivery-health.ts +47 -2
- package/src/hooks/effective-reviewers.ts +14 -0
- package/src/hooks/fp-config.ts +19 -0
- package/src/hooks/handler.ts +21 -2
- package/src/hooks/hook-activity-store.ts +7 -1
- package/src/hooks/integrations.ts +18 -3
- package/src/hooks/jev-activity.ts +117 -1
- package/src/hooks/jev-cli.ts +7 -9
- package/src/hooks/manager.ts +80 -46
- package/src/hooks/policy-evaluator.ts +17 -0
- package/src/hooks/policy-reviewability.ts +4 -2
- package/src/hooks/semantic/cloud-jev.ts +219 -28
- package/src/hooks/semantic/combine.ts +26 -1
- package/src/hooks/semantic/jev-client.ts +1 -1
- package/src/hooks/semantic/jev-config.ts +6 -27
- package/src/hooks/semantic/jev-review.ts +90 -2
- package/src/hooks/tui.ts +280 -0
- package/src/hooks/uninstall-cli.ts +12 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0588st-tpiuia._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_128ebxr83nk6g._.js +0 -3
- package/.next/standalone/.next/static/chunks/114hbolvrv94e.js +0 -1
- package/.next/standalone/.next/static/chunks/1p-hsi58i-6h0.js +0 -6
- package/.next/standalone/.next/static/chunks/3-pku9qwv1yfu.js +0 -1
- /package/.next/standalone/.next/static/{xq8UgF5yFxty1VWxY2hyn → LHCtFxVG0mdvd4lsXAOFC}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{xq8UgF5yFxty1VWxY2hyn → LHCtFxVG0mdvd4lsXAOFC}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{xq8UgF5yFxty1VWxY2hyn → LHCtFxVG0mdvd4lsXAOFC}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[24380,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(8734),o=e.i(89664),l=e.i(47163);function a(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:i}){let[u,c]=(0,r.useState)(!1),s=(0,r.useRef)(void 0);(0,r.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let d=(0,r.useCallback)(()=>{s.current&&clearTimeout(s.current),c(!0),s.current=setTimeout(()=>c(!1),2e3)},[]),f=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!a(e))throw Error("Both clipboard methods failed");d()}catch(t){console.error("Failed to copy to clipboard:",t);try{a(e)&&d()}catch{}}},[e,d]);return(0,t.jsx)("button",{type:"button",onClick:f,title:"Copy to clipboard",className:(0,l.f)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",i),children:u?(0,t.jsx)(o.f,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(n.f,{className:"w-3.5 h-3.5"})})}])},69186,e=>{var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});e.s(["default",0,function({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}])},89664,e=>{var t=e.i(56420);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],89664)},8734,e=>{var t=e.i(56420);let r={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],8734)},90317,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return s},createAsyncLocalStorage:function(){return u},createSnapshot:function(){return d},getOrCreateGlobalAsyncLocalStorage:function(){return c}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let l=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class a{disable(){throw l}getStore(){}run(){throw l}exit(){throw l}enterWith(){throw l}static bind(e){return e}}let i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function u(){return i?new i:new a}function c(e){let t=Symbol.for(`@next/${e}@16.4.2`),r=globalThis;return r[t]??=u()}function s(e){return i?i.bind(e):a.bind(e)}function d(){return i?i.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},63599,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(42344)},70703,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},9885,(e,t,r)=>{function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},67585,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return a}});let n=e.r(71645),o=e.r(74080);e.r(32061);let l=e.r(49354).createReactBrowserBailoutReason.bind(null,"next/dynamic");function a({children:e}){return(0,n.use)((0,o.browser)(l)),e}},69093,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return c}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),a=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(i)),c=t.loading;function s(e){let i=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,s=u?o.Suspense:o.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSRForNextDynamic,{children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(s,{...u?{fallback:i}:{},children:d})}return s.displayName="LoadableComponent",s}},52157,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),a=e.r(9885),i=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},49354,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={createReactBrowserBailoutReason:function(){return a},getReactBrowserBailoutReason:function(){return i},isNextBrowserBailoutError:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let l=Symbol.for("next.browser-bailout-reason");function a(e){return{$$typeof:l,reason:e}}function i(e){let t=e?.cause;return t?.$$typeof===l?t.reason:void 0}function u(e){return void 0!==i(e)}}],79348,e=>{e.v(t=>Promise.all(["static/chunks/
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[24380,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(8734),o=e.i(89664),l=e.i(47163);function a(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:i}){let[u,c]=(0,r.useState)(!1),s=(0,r.useRef)(void 0);(0,r.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let d=(0,r.useCallback)(()=>{s.current&&clearTimeout(s.current),c(!0),s.current=setTimeout(()=>c(!1),2e3)},[]),f=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!a(e))throw Error("Both clipboard methods failed");d()}catch(t){console.error("Failed to copy to clipboard:",t);try{a(e)&&d()}catch{}}},[e,d]);return(0,t.jsx)("button",{type:"button",onClick:f,title:"Copy to clipboard",className:(0,l.f)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",i),children:u?(0,t.jsx)(o.f,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(n.f,{className:"w-3.5 h-3.5"})})}])},69186,e=>{var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});e.s(["default",0,function({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}])},89664,e=>{var t=e.i(56420);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],89664)},8734,e=>{var t=e.i(56420);let r={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],8734)},90317,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return s},createAsyncLocalStorage:function(){return u},createSnapshot:function(){return d},getOrCreateGlobalAsyncLocalStorage:function(){return c}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let l=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class a{disable(){throw l}getStore(){}run(){throw l}exit(){throw l}enterWith(){throw l}static bind(e){return e}}let i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function u(){return i?new i:new a}function c(e){let t=Symbol.for(`@next/${e}@16.4.2`),r=globalThis;return r[t]??=u()}function s(e){return i?i.bind(e):a.bind(e)}function d(){return i?i.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},63599,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(42344)},70703,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},9885,(e,t,r)=>{function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},67585,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return a}});let n=e.r(71645),o=e.r(74080);e.r(32061);let l=e.r(49354).createReactBrowserBailoutReason.bind(null,"next/dynamic");function a({children:e}){return(0,n.use)((0,o.browser)(l)),e}},69093,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return c}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),a=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(i)),c=t.loading;function s(e){let i=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,s=u?o.Suspense:o.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSRForNextDynamic,{children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(s,{...u?{fallback:i}:{},children:d})}return s.displayName="LoadableComponent",s}},52157,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),a=e.r(9885),i=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},49354,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={createReactBrowserBailoutReason:function(){return a},getReactBrowserBailoutReason:function(){return i},isNextBrowserBailoutError:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let l=Symbol.for("next.browser-bailout-reason");function a(e){return{$$typeof:l,reason:e}}function i(e){let t=e?.cause;return t?.$$typeof===l?t.reason:void 0}function u(e){return void 0!==i(e)}}],79348,e=>{e.v(t=>Promise.all(["static/chunks/2hmex93ppj1ke.js","static/chunks/1my3-5p47t7r-.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,39440,e=>{var t=e.i(95187);let r=(0,t.createServerReference)("00de9ed6392ff068792d68e272f943ca9a05f589fa",t.callServer,void 0,t.findSourceMapURL,"getTelemetryConfig");e.s(["f",0,r])},53348,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(39440),l=e.i(9969);e.s(["default",0,function({error:e,reset:a}){return(0,r.useEffect)(()=>{(0,n.f)().then(t=>{(0,l.$)(t),(0,l.L)("client_error",{error_message:e.message,error_name:e.name,error_digest:e.digest,boundary:"global"})}).catch(()=>{})},[e]),(0,t.jsx)("html",{children:(0,t.jsx)("body",{children:(0,t.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,t.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,t.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,t.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:e.message||"An unexpected error occurred."}),(0,t.jsx)("button",{onClick:a,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])},9969,e=>{let t=null;e.s(["L",0,function(e,r){if(!t||!t.enabled)return;let n=JSON.stringify({api_key:t.apiKey,event:e,distinct_id:t.distinctId,properties:{...r,$lib:"failproofai-web",failproofai_version:t.version,product:"failproofai-oss",$current_url:window.location.href,$pathname:window.location.pathname}});fetch(t.host.replace(/\/+$/,"")+"/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,signal:AbortSignal.timeout(5e3)}).catch(()=>{})},"$",0,function(e){t=e}],9969)},95187,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return u.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(32120),o=e.r(92245),u=e.r(35326)},28298,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useRouterBFCache",{enumerable:!0,get:function(){return l}});let n=e.r(71645);function l(e,t,r){let[l,a]=(0,n.useState)(()=>({tree:e,renderTree:t,stateKey:r,next:null}));if(l.tree===e)return l;let o={tree:e,renderTree:t,stateKey:r,next:null},u=1,i=l,d=o;for(;null!==i&&u<1;){if(i.stateKey===r){d.next=i.next;break}{u++;let e={tree:i.tree,renderTree:i.renderTree,stateKey:i.stateKey,next:null};d.next=e,d=e}i=i.next}return a(o),o}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},15783,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={createClientParams:function(){return a.createRenderParamsFromClient},createClientSearchParams:function(){return o.createRenderSearchParamsFromClient}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(14193),o=e.r(66996);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},47257,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientPageRoot",{enumerable:!0,get:function(){return d}});let n=e.r(43476),l=e.r(8372),a=e.r(71645),o=e.r(33906),u=e.r(61994),i=e.r(15783);function d({Component:e,serverProvidedParams:t}){let r,s;if(null!==t)r=t.searchParams,s=t.params;else{let e=(0,a.use)(l.LayoutRouterContext);s=null!==e?e.parentParams:{},r=(0,o.urlSearchParamsToParsedUrlQuery)((0,a.use)(u.SearchParamsContext))}let c=(0,i.createClientSearchParams)(r),f=(0,i.createClientParams)(s);return(0,n.jsx)(e,{params:f,searchParams:c})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},92825,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientSegmentRoot",{enumerable:!0,get:function(){return u}});let n=e.r(43476),l=e.r(8372),a=e.r(71645),o=e.r(15783);function u({Component:e,slots:t,serverProvidedParams:r}){let i;if(null!==r)i=r.params;else{let e=(0,a.use)(l.LayoutRouterContext);i=null!==e?e.parentParams:{}}let d=(0,o.createClientParams)(i);return(0,n.jsx)(e,{...t,params:d})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},68017,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HTTPAccessFallbackBoundary",{enumerable:!0,get:function(){return s}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(90373),u=e.r(54394),i=e.r(8372);class d extends a.default.Component{constructor(e){super(e),this.state={triggeredStatus:void 0,previousPathname:e.pathname}}componentDidCatch(){}static getDerivedStateFromError(e){if((0,u.isHTTPAccessFallbackError)(e))return{triggeredStatus:(0,u.getAccessFallbackHTTPStatus)(e)};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.triggeredStatus?{triggeredStatus:void 0,previousPathname:e.pathname}:{triggeredStatus:t.triggeredStatus,previousPathname:e.pathname}}render(){let{notFound:e,forbidden:t,unauthorized:r,children:n}=this.props,{triggeredStatus:a}=this.state,o={[u.HTTPAccessErrorStatus.NOT_FOUND]:e,[u.HTTPAccessErrorStatus.FORBIDDEN]:t,[u.HTTPAccessErrorStatus.UNAUTHORIZED]:r};if(a){let i=a===u.HTTPAccessErrorStatus.NOT_FOUND&&e,d=a===u.HTTPAccessErrorStatus.FORBIDDEN&&t,s=a===u.HTTPAccessErrorStatus.UNAUTHORIZED&&r;return i||d||s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("meta",{name:"robots",content:"noindex"}),!1,o[a]]}):n}return n}}function s({notFound:e,forbidden:t,unauthorized:r,children:n}){let u=(0,o.useUntrackedPathname)(),c=(0,a.useContext)(i.MissingSlotContext);return e||t||r?(0,l.jsx)(d,{pathname:u,notFound:e,forbidden:t,unauthorized:r,missingSlots:c,children:n}):(0,l.jsx)(l.Fragment,{children:n})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77694,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a.InstantValidationBoundaryContext},PlaceValidationBoundaryBelowThisLevel:function(){return a.PlaceValidationBoundaryBelowThisLevel},RenderValidationBoundaryAtThisLevel:function(){return a.RenderValidationBoundaryAtThisLevel},SlotMarker:function(){return a.SlotMarker}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(22976);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},22976,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a},PlaceValidationBoundaryBelowThisLevel:function(){return o},RenderValidationBoundaryAtThisLevel:function(){return u},SlotMarker:function(){return i}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=null,o=null,u=null,i=null;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},39756,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={LoadingBoundaryProvider:function(){return x},default:function(){return T}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(90809),o=e.r(43476),u=a._(e.r(71645)),i=e.r(8372),d=e.r(1244),s=e.r(72383),c=e.r(91915),f=e.r(58442),p=e.r(68017);e.r(77694);let m=e.r(27828),y=e.r(28298);e.r(74180);let b=e.r(61994),h=e.r(33906),g=e.r(24988);function v(e,t,r){let n=e.getClientRects();if(0===n.length)return 0;let l=1/0;for(let e=0;e<n.length;e++){let t=n[e];t.top<l&&(l=t.top)}return l>=r()&&l<=t?1:2}function P(e){let t=u.default.useRef(null);return(0,u.useLayoutEffect)(()=>{let{scrollRef:r,renderTree:n}=e,l=r.forceScroll?r.scrollRef:n.data.scrollRef;if(null===l||!l.current)return;let a=null,o=r.hashFragment;if(o){if(null===(a="top"===o?document.body:document.getElementById(o)??document.getElementsByName(o)[0]??null)){l.current=!1,r.onlyHashChange=!1,r.hashFragment=null;return}}else a=t.current;if(null===a)return;let u=!1;(0,c.disableSmoothScrollDuringRouteTransition)(()=>{let e=document.documentElement,t=null,r=null,n=null,i=()=>{var r;let l,a;return null===n&&(r=t,n=!Number.isFinite(a=Number.parseFloat(l=getComputedStyle(e).scrollPaddingTop))||a<0?0:l.endsWith("px")?a:l.endsWith("%")?a/100*r:0),n};(o||(t=e.clientHeight,0!==(r=v(a,t,i))))&&((u=!0,l.current=!1,o)?a.scrollIntoView():1!==r&&(e.scrollTop=0,2===v(a,t,i)&&a.scrollIntoView()))},{dontForceLayout:!0,onlyHashChange:r.onlyHashChange}),u&&(r.onlyHashChange=!1,r.hashFragment=null)},void 0),(0,o.jsx)(u.Fragment,{ref:t,children:e.children})}function j({children:e,renderTree:t}){let r=(0,u.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,o.jsx)(P,{scrollRef:r.scrollRef,renderTree:t,children:e})}function _({tree:e,segmentPath:t,debugNameContext:r,renderTree:n,params:l,url:a,isActive:s}){let c,f=(0,u.useContext)(i.GlobalLayoutRouterContext);if((0,u.useContext)(b.NavigationPromisesContext),!f)throw Error("invariant global layout router not mounted");let p=null!==n.data.prefetchRsc?n.data.prefetchRsc:n.data.rsc,m=(0,u.useDeferredValue)(n.data.rsc,p);if((0,g.isDeferredRsc)(m)){let e=(0,u.use)(m);null===e&&(0,u.use)(d.unresolvedThenable),c=e}else null===m&&(0,u.use)(d.unresolvedThenable),c=m;let y=c;return(0,o.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:e,parentRenderTree:n,parentSegmentPath:t,parentParams:l,parentLoadingData:null,debugNameContext:r,url:a,isActive:s},children:y})}function x({loading:e,children:t}){let r=(0,u.use)(i.LayoutRouterContext);return null===r?t:(0,o.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:r.parentTree,parentRenderTree:r.parentRenderTree,parentSegmentPath:r.parentSegmentPath,parentParams:r.parentParams,parentLoadingData:e,debugNameContext:r.debugNameContext,url:r.url,isActive:r.isActive},children:t})}function O({name:e,loading:t,children:r}){if(null!==t){let n=t[0],l=t[1],a=t[2];return(0,o.jsx)(u.Suspense,{name:e,fallback:(0,o.jsxs)(o.Fragment,{children:[l,a,n]}),children:r})}return(0,o.jsx)(o.Fragment,{children:r})}function T({parallelRouterKey:e,error:t,errorStyles:r,errorScripts:n,templateStyles:l,templateScripts:a,template:c,notFound:b,forbidden:g,unauthorized:v,segmentViewBoundaries:P}){let x=(0,u.useContext)(i.LayoutRouterContext);if(!x)throw Error("invariant expected layout router to be mounted");let{parentTree:C,parentRenderTree:S,parentSegmentPath:R,parentParams:M,parentLoadingData:F,url:B,isActive:A,debugNameContext:L}=x,w=C[0],E=null===R?[e]:R.concat([w,e]),H=C[1][e],k=S.slots?.get(e);(void 0===H||void 0===k)&&(0,u.use)(d.unresolvedThenable);let D=H[0],N=(0,m.createSegmentKey)(D),I=(0,y.useRouterBFCache)(H,k,N),U=[];do{let e=I.tree,u=I.renderTree,d=I.stateKey,m=e[0],y=M;if(Array.isArray(m)){let e=m[0],t=m[1],r=m[2],n=(0,h.getParamValueFromCacheKey)(t,r);null!==n&&(y={...M,[e]:n})}let P=function(e){if("/"===e)return"/";if("string"==typeof e)if("(__SLOT__)"===e)return;else return e+"/";return e[1]+"/"}(m),x=P??L,T=void 0===P?void 0:L,C=(0,o.jsxs)(j,{renderTree:u,children:[(0,o.jsx)(s.ErrorBoundary,{errorComponent:t,errorStyles:r,errorScripts:n,children:(0,o.jsx)(O,{name:T,loading:F,children:(0,o.jsx)(p.HTTPAccessFallbackBoundary,{notFound:b,forbidden:g,unauthorized:v,children:(0,o.jsxs)(f.RedirectBoundary,{children:[(0,o.jsx)(_,{url:B,tree:e,params:y,renderTree:u,segmentPath:E,debugNameContext:x,isActive:A&&d===N}),null]})})})}),null]}),S=(0,o.jsxs)(i.TemplateContext.Provider,{value:C,children:[l,a,c]},d);U.push(S),I=I.next}while(null!==I)return U}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},37457,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(8372);function u(){let e=(0,a.useContext)(o.TemplateContext);return(0,l.jsx)(l.Fragment,{children:e})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},14193,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(6831).createRenderParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},6831,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return l}});let n=new WeakMap;function l(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},66996,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(93504).createRenderSearchParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},93504,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return l}});let n=new WeakMap;function l(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},27201,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"IconMark",{enumerable:!0,get:function(){return l}});let n=e.r(43476),l=()=>"u">typeof window?null:(0,n.jsx)("meta",{name:"«nxt-icon»"})},91915,(e,t,r)=>{function n(e,t={}){if(t.onlyHashChange)return void e();let r=document.documentElement;if("smooth"!==r.dataset.scrollBehavior)return void e();let l=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=l}e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"disableSmoothScrollDuringRouteTransition",{enumerable:!0,get:function(){return n}})}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41146,e=>{var t=e.i(95187);let r=(0,t.createServerReference)("00728227e41042729b3182aad2fe4c5d77f021b514",t.callServer,void 0,t.findSourceMapURL,"getTelemetryConfig");e.s(["f",0,r])},53348,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(41146),l=e.i(9969);e.s(["default",0,function({error:e,reset:a}){return(0,r.useEffect)(()=>{(0,n.f)().then(t=>{(0,l.$)(t),(0,l.L)("client_error",{error_message:e.message,error_name:e.name,error_digest:e.digest,boundary:"global"})}).catch(()=>{})},[e]),(0,t.jsx)("html",{children:(0,t.jsx)("body",{children:(0,t.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,t.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,t.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,t.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:e.message||"An unexpected error occurred."}),(0,t.jsx)("button",{onClick:a,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])},9969,e=>{let t=null;e.s(["L",0,function(e,r){if(!t||!t.enabled)return;let n=JSON.stringify({api_key:t.apiKey,event:e,distinct_id:t.distinctId,properties:{...r,$lib:"failproofai-web",failproofai_version:t.version,product:"failproofai-oss",$current_url:window.location.href,$pathname:window.location.pathname}});fetch(t.host.replace(/\/+$/,"")+"/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,signal:AbortSignal.timeout(5e3)}).catch(()=>{})},"$",0,function(e){t=e}],9969)},95187,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return u.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(32120),o=e.r(92245),u=e.r(35326)},28298,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useRouterBFCache",{enumerable:!0,get:function(){return l}});let n=e.r(71645);function l(e,t,r){let[l,a]=(0,n.useState)(()=>({tree:e,renderTree:t,stateKey:r,next:null}));if(l.tree===e)return l;let o={tree:e,renderTree:t,stateKey:r,next:null},u=1,i=l,d=o;for(;null!==i&&u<1;){if(i.stateKey===r){d.next=i.next;break}{u++;let e={tree:i.tree,renderTree:i.renderTree,stateKey:i.stateKey,next:null};d.next=e,d=e}i=i.next}return a(o),o}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},15783,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={createClientParams:function(){return a.createRenderParamsFromClient},createClientSearchParams:function(){return o.createRenderSearchParamsFromClient}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(14193),o=e.r(66996);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},47257,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientPageRoot",{enumerable:!0,get:function(){return d}});let n=e.r(43476),l=e.r(8372),a=e.r(71645),o=e.r(33906),u=e.r(61994),i=e.r(15783);function d({Component:e,serverProvidedParams:t}){let r,s;if(null!==t)r=t.searchParams,s=t.params;else{let e=(0,a.use)(l.LayoutRouterContext);s=null!==e?e.parentParams:{},r=(0,o.urlSearchParamsToParsedUrlQuery)((0,a.use)(u.SearchParamsContext))}let c=(0,i.createClientSearchParams)(r),f=(0,i.createClientParams)(s);return(0,n.jsx)(e,{params:f,searchParams:c})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},92825,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ClientSegmentRoot",{enumerable:!0,get:function(){return u}});let n=e.r(43476),l=e.r(8372),a=e.r(71645),o=e.r(15783);function u({Component:e,slots:t,serverProvidedParams:r}){let i;if(null!==r)i=r.params;else{let e=(0,a.use)(l.LayoutRouterContext);i=null!==e?e.parentParams:{}}let d=(0,o.createClientParams)(i);return(0,n.jsx)(e,{...t,params:d})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},68017,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HTTPAccessFallbackBoundary",{enumerable:!0,get:function(){return s}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(90373),u=e.r(54394),i=e.r(8372);class d extends a.default.Component{constructor(e){super(e),this.state={triggeredStatus:void 0,previousPathname:e.pathname}}componentDidCatch(){}static getDerivedStateFromError(e){if((0,u.isHTTPAccessFallbackError)(e))return{triggeredStatus:(0,u.getAccessFallbackHTTPStatus)(e)};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.triggeredStatus?{triggeredStatus:void 0,previousPathname:e.pathname}:{triggeredStatus:t.triggeredStatus,previousPathname:e.pathname}}render(){let{notFound:e,forbidden:t,unauthorized:r,children:n}=this.props,{triggeredStatus:a}=this.state,o={[u.HTTPAccessErrorStatus.NOT_FOUND]:e,[u.HTTPAccessErrorStatus.FORBIDDEN]:t,[u.HTTPAccessErrorStatus.UNAUTHORIZED]:r};if(a){let i=a===u.HTTPAccessErrorStatus.NOT_FOUND&&e,d=a===u.HTTPAccessErrorStatus.FORBIDDEN&&t,s=a===u.HTTPAccessErrorStatus.UNAUTHORIZED&&r;return i||d||s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("meta",{name:"robots",content:"noindex"}),!1,o[a]]}):n}return n}}function s({notFound:e,forbidden:t,unauthorized:r,children:n}){let u=(0,o.useUntrackedPathname)(),c=(0,a.useContext)(i.MissingSlotContext);return e||t||r?(0,l.jsx)(d,{pathname:u,notFound:e,forbidden:t,unauthorized:r,missingSlots:c,children:n}):(0,l.jsx)(l.Fragment,{children:n})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},77694,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a.InstantValidationBoundaryContext},PlaceValidationBoundaryBelowThisLevel:function(){return a.PlaceValidationBoundaryBelowThisLevel},RenderValidationBoundaryAtThisLevel:function(){return a.RenderValidationBoundaryAtThisLevel},SlotMarker:function(){return a.SlotMarker}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(22976);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},22976,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={InstantValidationBoundaryContext:function(){return a},PlaceValidationBoundaryBelowThisLevel:function(){return o},RenderValidationBoundaryAtThisLevel:function(){return u},SlotMarker:function(){return i}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=null,o=null,u=null,i=null;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},39756,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={LoadingBoundaryProvider:function(){return x},default:function(){return T}};for(var l in n)Object.defineProperty(r,l,{enumerable:!0,get:n[l]});let a=e.r(90809),o=e.r(43476),u=a._(e.r(71645)),i=e.r(8372),d=e.r(1244),s=e.r(72383),c=e.r(91915),f=e.r(58442),p=e.r(68017);e.r(77694);let m=e.r(27828),y=e.r(28298);e.r(74180);let b=e.r(61994),h=e.r(33906),g=e.r(24988);function v(e,t,r){let n=e.getClientRects();if(0===n.length)return 0;let l=1/0;for(let e=0;e<n.length;e++){let t=n[e];t.top<l&&(l=t.top)}return l>=r()&&l<=t?1:2}function P(e){let t=u.default.useRef(null);return(0,u.useLayoutEffect)(()=>{let{scrollRef:r,renderTree:n}=e,l=r.forceScroll?r.scrollRef:n.data.scrollRef;if(null===l||!l.current)return;let a=null,o=r.hashFragment;if(o){if(null===(a="top"===o?document.body:document.getElementById(o)??document.getElementsByName(o)[0]??null)){l.current=!1,r.onlyHashChange=!1,r.hashFragment=null;return}}else a=t.current;if(null===a)return;let u=!1;(0,c.disableSmoothScrollDuringRouteTransition)(()=>{let e=document.documentElement,t=null,r=null,n=null,i=()=>{var r;let l,a;return null===n&&(r=t,n=!Number.isFinite(a=Number.parseFloat(l=getComputedStyle(e).scrollPaddingTop))||a<0?0:l.endsWith("px")?a:l.endsWith("%")?a/100*r:0),n};(o||(t=e.clientHeight,0!==(r=v(a,t,i))))&&((u=!0,l.current=!1,o)?a.scrollIntoView():1!==r&&(e.scrollTop=0,2===v(a,t,i)&&a.scrollIntoView()))},{dontForceLayout:!0,onlyHashChange:r.onlyHashChange}),u&&(r.onlyHashChange=!1,r.hashFragment=null)},void 0),(0,o.jsx)(u.Fragment,{ref:t,children:e.children})}function j({children:e,renderTree:t}){let r=(0,u.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,o.jsx)(P,{scrollRef:r.scrollRef,renderTree:t,children:e})}function _({tree:e,segmentPath:t,debugNameContext:r,renderTree:n,params:l,url:a,isActive:s}){let c,f=(0,u.useContext)(i.GlobalLayoutRouterContext);if((0,u.useContext)(b.NavigationPromisesContext),!f)throw Error("invariant global layout router not mounted");let p=null!==n.data.prefetchRsc?n.data.prefetchRsc:n.data.rsc,m=(0,u.useDeferredValue)(n.data.rsc,p);if((0,g.isDeferredRsc)(m)){let e=(0,u.use)(m);null===e&&(0,u.use)(d.unresolvedThenable),c=e}else null===m&&(0,u.use)(d.unresolvedThenable),c=m;let y=c;return(0,o.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:e,parentRenderTree:n,parentSegmentPath:t,parentParams:l,parentLoadingData:null,debugNameContext:r,url:a,isActive:s},children:y})}function x({loading:e,children:t}){let r=(0,u.use)(i.LayoutRouterContext);return null===r?t:(0,o.jsx)(i.LayoutRouterContext.Provider,{value:{parentTree:r.parentTree,parentRenderTree:r.parentRenderTree,parentSegmentPath:r.parentSegmentPath,parentParams:r.parentParams,parentLoadingData:e,debugNameContext:r.debugNameContext,url:r.url,isActive:r.isActive},children:t})}function O({name:e,loading:t,children:r}){if(null!==t){let n=t[0],l=t[1],a=t[2];return(0,o.jsx)(u.Suspense,{name:e,fallback:(0,o.jsxs)(o.Fragment,{children:[l,a,n]}),children:r})}return(0,o.jsx)(o.Fragment,{children:r})}function T({parallelRouterKey:e,error:t,errorStyles:r,errorScripts:n,templateStyles:l,templateScripts:a,template:c,notFound:b,forbidden:g,unauthorized:v,segmentViewBoundaries:P}){let x=(0,u.useContext)(i.LayoutRouterContext);if(!x)throw Error("invariant expected layout router to be mounted");let{parentTree:C,parentRenderTree:S,parentSegmentPath:R,parentParams:M,parentLoadingData:F,url:B,isActive:A,debugNameContext:L}=x,w=C[0],E=null===R?[e]:R.concat([w,e]),H=C[1][e],k=S.slots?.get(e);(void 0===H||void 0===k)&&(0,u.use)(d.unresolvedThenable);let D=H[0],N=(0,m.createSegmentKey)(D),I=(0,y.useRouterBFCache)(H,k,N),U=[];do{let e=I.tree,u=I.renderTree,d=I.stateKey,m=e[0],y=M;if(Array.isArray(m)){let e=m[0],t=m[1],r=m[2],n=(0,h.getParamValueFromCacheKey)(t,r);null!==n&&(y={...M,[e]:n})}let P=function(e){if("/"===e)return"/";if("string"==typeof e)if("(__SLOT__)"===e)return;else return e+"/";return e[1]+"/"}(m),x=P??L,T=void 0===P?void 0:L,C=(0,o.jsxs)(j,{renderTree:u,children:[(0,o.jsx)(s.ErrorBoundary,{errorComponent:t,errorStyles:r,errorScripts:n,children:(0,o.jsx)(O,{name:T,loading:F,children:(0,o.jsx)(p.HTTPAccessFallbackBoundary,{notFound:b,forbidden:g,unauthorized:v,children:(0,o.jsxs)(f.RedirectBoundary,{children:[(0,o.jsx)(_,{url:B,tree:e,params:y,renderTree:u,segmentPath:E,debugNameContext:x,isActive:A&&d===N}),null]})})})}),null]}),S=(0,o.jsxs)(i.TemplateContext.Provider,{value:C,children:[l,a,c]},d);U.push(S),I=I.next}while(null!==I)return U}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},37457,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}});let n=e.r(90809),l=e.r(43476),a=n._(e.r(71645)),o=e.r(8372);function u(){let e=(0,a.useContext)(o.TemplateContext);return(0,l.jsx)(l.Fragment,{children:e})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},14193,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(6831).createRenderParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},6831,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderParamsFromClient",{enumerable:!0,get:function(){return l}});let n=new WeakMap;function l(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},66996,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return n}});let n=e.r(93504).createRenderSearchParamsFromClient;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},93504,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return l}});let n=new WeakMap;function l(e){let t=n.get(e);if(t)return t;let r=Promise.resolve(e);return r.status="fulfilled",r.value=e,n.set(e,r),r}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},27201,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"IconMark",{enumerable:!0,get:function(){return l}});let n=e.r(43476),l=()=>"u">typeof window?null:(0,n.jsx)("meta",{name:"«nxt-icon»"})},91915,(e,t,r)=>{function n(e,t={}){if(t.onlyHashChange)return void e();let r=document.documentElement;if("smooth"!==r.dataset.scrollBehavior)return void e();let l=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=l}e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"disableSmoothScrollDuringRouteTransition",{enumerable:!0,get:function(){return n}})}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";let t,s;var n=e.i(43476),r=e.i(71645),l=e.i(74080);function i(e,t,s){let n,r=s.initialDeps??[],l=!0;function i(){let i=e();return(i.length!==r.length||i.some((e,t)=>r[t]!==e))&&(r=i,n=t(...i),(null==s?void 0:s.onChange)&&!(l&&s.skipInitialOnChange)&&s.onChange(n),l=!1),n}return i.updateDeps=e=>{r=e},i}function o(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let a=(e,t)=>1.01>Math.abs(e-t),h=()=>{if(void 0!==t)return t;if("u"<typeof navigator)return t=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return t=!0;let e=navigator.maxTouchPoints;return t="MacIntel"===navigator.platform&&void 0!==e&&e>0},d={capture:!0,passive:!0};class c{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>null!==this._touch&&"lateFling"!==this._touch.phase,this.dragging=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved},this.tail=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:e,ownReadBack:t,moved:s,external:n})=>{var r,l,i;return e&&(null==(r=this._touch)?void 0:r.phase)==="tail"?this._openTail(this._touch.moved||!t,!1):(null==(l=this._touch)?void 0:l.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:n&&e&&s&&this._openTail(!0,!1)),!t&&!!e&&!!s&&(null==(i=this._touch)?void 0:i.phase)==="down"&&(this._touch.moved=!0,!0)},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var e;let t=(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved;this.end(),this._openTail(t,t)},this.end=()=>{var e;let t=this.host.getWindow();(null==(e=this._touch)?void 0:e.phase)==="tail"&&null!=t&&t.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),s=()=>this.touchEnd();return e.addEventListener("touchstart",t,d),e.addEventListener("touchend",s,d),e.addEventListener("touchcancel",s,d),()=>{e.removeEventListener("touchstart",t,d),e.removeEventListener("touchend",s,d),e.removeEventListener("touchcancel",s,d),this.end()}},this._openTail=(e,t)=>{let s=this.host.getWindow();if(!h()||null==s)return;this.end();let n={phase:"tail",moved:e,awaitingFling:t,timerId:s.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(n.moved,n.awaitingFling):(this._touch=n.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=n}}get touch(){return this._touch}}let u=e=>e,m=e=>{let t=e.overscan*Math.max(e.lanes??1,1),s=Math.max(e.startIndex-t,0),n=Math.min(e.endIndex+t,e.count-1)-s+1,r=Array(n);for(let e=0;e<n;e++)r[e]=s+e;return r},f={passive:!0},p=(e,t)=>{let s=e.scrollElement;if(!s)return;let n=()=>{t({width:s.innerWidth,height:s.innerHeight})};return n(),s.addEventListener("resize",n,f),()=>{s.removeEventListener("resize",n)}},g="u"<typeof window||"onscrollend"in window,x=(e,t)=>((e,t,s)=>{var n,r;let l,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=e.options.useScrollendEvent&&g,h=0,d=a?null:(n=()=>t(s(i),!1),r=e.options.isScrollingResetDelay,Object.assign(function(...e){o.clearTimeout(l),l=o.setTimeout(()=>n.apply(this,e),r)},{cancel:()=>{o.clearTimeout(l)}})),c=e=>()=>{h=s(i),null==d||d(),t(h,e)},u=c(!0),m=c(!1);return i.addEventListener("scroll",u,f),a&&i.addEventListener("scrollend",m,f),()=>{i.removeEventListener("scroll",u),a&&i.removeEventListener("scrollend",m),null==d||d.cancel()}})(e,t,t=>e.options.horizontal?t.scrollX:t.scrollY),y=(e,t,s)=>{if(s.options.useCachedMeasurements){let t=s.indexFromElement(e),n=s.options.getItemKey(t);return s.itemSizeCache.get(n)??s.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}if(!t){let t=s.indexFromElement(e),n=s.options.getItemKey(t),r=s.itemSizeCache.get(n);if(void 0!==r)return r}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},v=(e,{adjustments:t=0,behavior:s},n)=>{var r,l;null==(l=null==(r=n.scrollElement)?void 0:r.scrollTo)||l.call(r,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})},b=(e,t)=>"smooth"===e?t?"smoothLanded":"smooth":"instant",S=e=>(null==e?void 0:e.phase)==="smooth"||(null==e?void 0:e.phase)==="smoothLanded";class j{constructor(e){let t,s,n,r;this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new c({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if((null==e?void 0:e.phase)!=="queued"||null!==this.pendingWrite)return!1;let t=this._readElementOffset();return!(null===t||null===this._lastElementOffset||1>Math.abs(t-this._lastElementOffset))&&(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;(null==e?void 0:e.phase)==="queued"&&function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(t=null,s=null,n=()=>{let e;if(t)return t;let n=this.targetWindow;if(!n||!n.ResizeObserver)return null;let l=(e=new Set,s={schedule:t=>{let s=n.requestAnimationFrame(()=>{e.delete(s),t()});e.add(s)},cancel:()=>{e.forEach(e=>n.cancelAnimationFrame(e)),e.clear()}});return t=new n.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(r)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment())}};this.options.useAnimationFrameWithResizeObserver?l.schedule(t):t()})},r=e=>{let t=e.target,s=this.indexFromElement(t);if(!t.isConnected){for(let[e,s]of(this.observer.unobserve(t),this.elementsCache))if(s===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(s)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this))},{disconnect:()=>{var e;null==(e=n())||e.disconnect(),null==s||s.cancel(),t=null,s=null},observe:e=>{var t;return null==(t=n())?void 0:t.observe(e,{box:"border-box"})},unobserve:e=>{var t;return null==(t=n())?void 0:t.unobserve(e)}}),this.range=null,this.setOptions=e=>{var t;let s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u,rangeExtractor:m,onChange:()=>{},measureElement:y,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let t in e){let n=e[t];void 0!==n&&(s[t]=n)}let n=this.options,r=null,l=null,i=!1;if(void 0!==n&&n.enabled&&s.enabled&&"end"===s.anchorTo&&null!==this.scrollElement){let e=n.count,o=s.count,a=this.getMeasurements(),h=(null==(t=this._singleLaneMeasurements)?void 0:t.items)??a,d=e=>{var t;return"object"==typeof(t=h[e])?t.key:t},c=e>0?d(0):null,u=e>0?d(e-1):null;if(o!==e||e>0&&o>0&&(s.getItemKey(0)!==c||s.getItemKey(o-1)!==u)){i=!0;let t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??a[0]:null;t&&(r=[t.key,this.getScrollOffset()-t.start]);let h=!0===s.followOnAppend?"auto":s.followOnAppend||null;h&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(0===e||s.getItemKey(o-1)!==u)&&(o>e||function(e,t,s,n){if(0===t)return!1;let r=n(0),l=new Set,i=0;for(;i<e;){let e=s(i);if(e===r)break;l.add(e),i++}let o=e-i;if(0===o||o>=t)return!1;for(let e=0;e<o;e++)if(n(e)!==s(i+e))return!1;for(let e=o;e<t;e++)if(l.has(n(e)))return!1;return!0}(e,o,d,s.getItemKey))&&(l=h)}}this.options=s,i&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&null!==this.scrollOffset&&!this._awaitingCommandReadBack()){let[e,t]=r,s=this.getMeasurements(),{count:n,getItemKey:i}=this.options,a=0;for(;a<n&&i(a)!==e;)a++;if(a<n){let e=s[a];if(e){let s=Math.max(0,e.start+t);l||s===this.scrollOffset||(o=s-this.scrollOffset,this.scrollOffset=s)}}}l?this.pendingScrollAnchor={kind:"follow",behavior:l}:null!==o&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=i(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,null==(e=this._momentumStop)||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{var s,n,r,l;let i=t?this._elementMaxScrollOffset():null,o=this._reportedOverscroll;this._reportedOverscroll=e<0||null!==i&&e>i+1;let h=e;this._lastElementOffset=h,e=this._toLayoutOffset(e);let d=this._classifyScrollEvent(e,t,i);if("spurious"===d)return;"readBack"===d?e=this.pendingWrite.target:"clampedReadBack"===d&&(null==(s=this.scrollState)?void 0:s.index)!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:function({kind:e,offset:t,command:s,target:n}){let r;return"spurious"!==e&&"readBack"!==e&&"clampedReadBack"!==e&&(null==s?void 0:s.index)!=null&&"queued"!==s.phase&&"smooth"!==(r=s.phase)&&"smoothFinishing"!==r&&!a(t,s.lastTargetOffset)&&!a(t,n())&&"clampedEcho"!==e}({kind:d,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,null!==this._clampedAdjustment&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let c=this.getScrollOffset(),u=this.scrollDirection;this.scrollDirection=t?c===e?this.scrollDirection:c<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t;let m=this.scrollState;if((null==m?void 0:m.phase)==="queued"&&"external"===d&&t)if(o||this._reportedOverscroll)m.samples=[];else{let e=this.now();m.samples=[...(m.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:h}],(null!==u&&this.scrollDirection!==u||function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s],r=s-1;for(;r>=0&&n.t-e[r].t<40;)r--;if(r<0)return!1;let l=e[r],i=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-l.offset)/(n.t-l.t);return i*o>=0&&Math.abs(i)>=2*Math.abs(o)&&Math.abs(i)-Math.abs(o)>=.8}(m.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:t,ownReadBack:"readBack"===d,moved:e!==c,external:"external"===d&&(null==(n=this.scrollState)?void 0:n.phase)!=="smooth"&&(null==(r=this.scrollState)?void 0:r.phase)!=="smoothFinishing"})&&(null==(l=this.scrollState)?void 0:l.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let s=this.pendingScrollAnchor;this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled&&("anchor"===s.kind?this._canWriteScroll()?S(this.scrollState)&&!a(this.getScrollOffset()-s.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(s.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=s.delta,this._followOffsetTarget(s.delta),this.notify(!1)):this.scrollToEnd({behavior:s.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,s)=>{var n;return function({offset:e,isScrolling:t,elementMax:s,holdOffset:n,scrollOffset:r,pendingWrite:l,clampedMaxAtWrite:i}){var o;return t&&null===l&&e===r?"spurious":null!==l&&1.5>Math.abs(e-l.target)?"readBack":null!==l&&!l.smooth&&null!==s&&l.target>s+n+.5&&1.5>Math.abs(e-(s+n))||null!==l&&!l.smooth&&(null==(o=l.lowMaxes)?void 0:o.some(t=>1.5>Math.abs(e-t)))?"clampedReadBack":null!==i&&1.5>Math.abs(e-i)?"clampedEcho":"external"}({offset:e,isScrolling:t,elementMax:s,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:(null==(n=this._clampedAdjustment)?void 0:n.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(null===this._clampedAdjustment||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>t+.5&&(this._clampedAdjustment=e>s+.5?{target:e,maxAtWrite:s}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(null===e||"queued"!==e.phase)return;let{behavior:t}=e;this.getMeasurements();let s=this.getScrollStateTarget(e);e.lastTargetOffset=s,this._clampedAdjustment=null,e.phase=b(t,null!=e.index&&a(s,this.getScrollOffset())),this._scrollToOffset(s,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(null==e)return null;let{horizontal:t,isRtl:s}=this.options;return"number"==typeof e.scrollTop?t?e.scrollLeft*(s&&-1||1):e.scrollTop:"number"==typeof e.scrollY?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(h()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{var t;if(0===this._holdOffset||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||(null==(t=this.scrollState)?void 0:t.phase)==="smooth")return;this._holdOffset=0,null!==this.scrollOffset&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let s=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s),this._scrollToOffset(s)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=i(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,s,n,r,l,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=i(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o},a)=>{var h,d;let c=this.itemSizeCache;if(!r)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===l){let r,l,i=2*e,a=null==(h=this._singleLaneMeasurements)?void 0:h.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,2*u)),a=e}let m=0===u?Array(e):this._singleLaneMeasurements.items.slice();if(0===u)r=t+s;else{let e=u-1;r=a[2*e]+a[2*e+1]+o}for(let t=u;t<e;t++){let e=n(t);m[t]=e;let s=c.get(e),l="number"==typeof s?s:this.options.estimateSize(t);a[2*t]=r,a[2*t+1]=l,r+=l+o}this._singleLaneMeasurements={flat:a,items:m};let f=(d=a,l=m.length,new Proxy(m,{get(e,t,s){if("string"==typeof t){let s=t.charCodeAt(0);if(s>=48&&s<=57){let s=+t;if(Number.isInteger(s)&&s>=0&&s<l){let t=e[s];if("object"!=typeof t){let n=d[2*s];t=e[s]={index:s,key:t,start:n,size:d[2*s+1],end:n+d[2*s+1],lane:0}}return t}}if("length"===t)return l}return Reflect.get(e,t,s)}}));return this.measurementsCache=f,f}let m=this.measurementsCache.slice(0,u),f=Array(l).fill(void 0),p=new Float64Array(l),g=0;for(let e=0;e<u;e++){let t=m[e];t&&(void 0===f[t.lane]&&g++,f[t.lane]=e,p[t.lane]=t.end)}for(let r=u;r<e;r++){let e,a,h=n(r),d=this.laneAssignments.get(r),u="estimate"===i||c.has(h);if(void 0!==d&&this.options.lanes>1){let n=f[e=d],r=void 0!==n?m[n]:void 0;a=r?r.end+o:t+s}else if(g===l){let t=0,s=p[0],n=f[0];for(let e=1;e<l;e++){let r=p[e];(r<s||r===s&&f[e]<n)&&(t=e,s=r,n=f[e])}e=t,a=s+o,u&&this.laneAssignments.set(r,e)}else e=r%this.options.lanes,a=t+s,u&&this.laneAssignments.set(r,e);let x=c.get(h),y="number"==typeof x?x:this.options.estimateSize(r),v=a+y;m[r]={index:r,start:a,size:y,end:v,key:h,lane:e},void 0===f[e]&&g++,f[e]=r,p[e]=v}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=i(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,n)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,s,n,r){let l=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:l};if(1===n&&null!==r){let e=function(e,t,s){let n=0;for(;n<=t;){let r=(n+t)/2|0,l=e[2*r];if(l<s)n=r+1;else{if(!(l>s))return r;t=r-1}}return n>0?n-1:0}(r,l,s),n=e,i=s+t;for(;n<l&&r[2*n]+r[2*n+1]<i;)n++;return{startIndex:e,endIndex:n}}let i=w(0,l,t=>e[t].start,s),o=i;if(1===n)for(;o<l&&e[o].end<s+t;)o++;else if(n>1){let r=Array(n).fill(0);for(;o<l&&r.some(e=>e<s+t);){let t=e[o];r[t.lane]=t.end,o++}let a=Array(n).fill(s+t);for(;i>=0&&a.some(e=>e>=s);){let t=e[i];a[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}(e,t,s,n,1===n&&null!==this._singleLaneMeasurements?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=i(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,s,n,r,l)=>null===n||null===r?[]:e({startIndex:n,endIndex:r,overscan:t,count:s,lanes:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!S(this.scrollState))return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),n=Math.max(0,s-t),r=Math.min(this.options.count-1,s+t);return e>=n&&e<=r}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let s=this.options.getItemKey(t),n=this.elementsCache.get(s);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(s,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s,n,r;let l,i,o;if(!this.isIndexInRange(e))return;(null==(s=this._resizeBatch)?void 0:s.sync)&&this.getMeasurements();let a=null==(n=this._singleLaneMeasurements)?void 0:n.flat;if(1===this.options.lanes&&null!=a)o=this.options.getItemKey(e),i=a[2*e],l=a[2*e+1];else{let t=this.measurementsCache[e];if(!t)return;o=t.key,i=t.start,l=t.size}let h=this.itemSizeCache.get(o)??l,d=t-h;if(0!==d){let s="end"===this.options.anchorTo&&!S(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,n=s?this._getLayoutTotalSize():0,a=this.getScrollOffset(),c=this.itemSizeCache.has(o)?i+h<=a&&"backward"!==this.scrollDirection:i<a,u=!S(this.scrollState)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:o,start:i,size:l,end:i+l,lane:0},d,this):c);(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(o,t),this.itemSizeCacheVersion++;let m=!1;if(!this._awaitingCommandReadBack()&&(s?m=this.applyScrollAdjustment(this._getLayoutTotalSize()-n):u&&(m=this.applyScrollAdjustment(d))),this._resizeBatch){this._resizeBatch.notify=!0,(r=this._resizeBatch).sync||(r.sync=m);return}this.notify(m),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=i(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,s)=>{let n=[];for(let r=0,l=e.length;r<l;r++){let l=t[e[r]];n.push(0===s?l:{...l,start:l.start-s,end:l.end-s})}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{var t;let s=this.getMeasurements();if(0===s.length)return;let n=null==(t=this._singleLaneMeasurements)?void 0:t.flat,r=1===this.options.lanes&&null!=n,l=w(0,s.length-1,r?e=>n[2*e]:e=>o(s[e]).start,e);return o(s[l])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(null===e)return;let t=this.pendingWrite,s=Math.max(e,0)+this._holdOffset;if(s>=t.target)return;let n=t.lowMaxes??(t.lowMaxes=[]);n[n.length-1]!==s&&n.push(s)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{var t;let s=e+this._holdOffset;return(null==(t=this.pendingScrollAnchor)?void 0:t.kind)==="anchor"&&(s+=this.pendingScrollAnchor.delta),s},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(null===e)return null;if("scrollHeight"in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if("document"in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,s=this.targetWindow;if(null===t||null===s)return;let n="document"in t?t.document.scrollingElement:t;if(!(null==n?void 0:n.style))return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:r}=n,l=this.options.horizontal?"overflow-x":"overflow-y",i=r.getPropertyValue(l),o=r.getPropertyPriority(l);r.setProperty(l,"hidden","important");let a={restore:()=>"hidden"===r.getPropertyValue(l)&&"important"===r.getPropertyPriority(l)&&(r.setProperty(l,i,o),!0),done:e};this._momentumStop=a,s.requestAnimationFrame(()=>s.requestAnimationFrame(()=>{this._momentumStop===a&&(this._momentumStop=null,a.restore()&&a.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(null===t)return null;let s=t+this._holdOffset;return e>s+.5?{target:e,maxAtWrite:s}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),r=this.getScrollOffset();return"auto"===t&&(t=e>=r+n?"end":"start"),"center"===t?e+=(s-n)/2:"end"===t&&(e-=n),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if("auto"===t)if(r.end>=n+s-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1){let e=this.getMaxScrollOffset();return[Math.max(Math.min(e-this.options.paddingEnd+this.options.scrollPaddingEnd,e),0),t]}let l="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,t,r.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),s,"absolute")},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getOffsetForIndex(e,t);if(!n)return;let[r,l]=n;this._startScroll({index:e,align:l},r,s,"absolute")},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,"start");this._startScroll({index:null,align:"start"},s,t,"relative")},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,"absolute"):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var e,t;let s,n=this.getMeasurements();if(0===n.length)s=this.options.paddingStart;else if(1===this.options.lanes){let r=n.length-1,l=null==(e=this._singleLaneMeasurements)?void 0:e.flat;s=null!=l?l[2*r]+l[2*r+1]:(null==(t=n[r])?void 0:t.end)??0}else{let e=Array(this.options.lanes).fill(null),t=n.length-1;for(;t>=0&&e.some(e=>null===e);){let s=n[t];null===e[s.lane]&&(e[s.lane]=s.end),t--}s=Math.max(...e.filter(e=>null!==e))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(0===this.itemSizeCache.size)return e;for(let t of this.getMeasurements())t&&this.itemSizeCache.has(t.key)&&e.push({index:t.index,key:t.key,start:t.start,size:t.size,end:t.end,lane:t.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:s}={})=>{let n={target:e+(t??0),smooth:"smooth"===s};return this.pendingWrite=n,this.options.scrollToFn(e-this._holdOffset,{behavior:s,adjustments:t},this),n},this.getCommandWrittenOffset=()=>null===this.scrollState||null===this.pendingWrite||this.pendingWrite.smooth?null:this.pendingWrite.target,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(h()&&this._iosGesture.dragging())&&null!==e&&!a(e,this.getScrollOffset())},this._followOffsetTarget=e=>{null!==this.scrollState&&null==this.scrollState.index&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(0===e)return!1;if(this._followOffsetTarget(e),!this._canWriteScroll())return this._holdOffset+=e,null!==this.scrollOffset&&(this.scrollOffset+=e),!0;{let s=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s+e);let n=this._scrollToOffset(s,{adjustments:e,behavior:t});return null!==this.scrollOffset&&(this.pendingWrite===n&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:null!=e.index?this.getOffsetForIndex(e.index,e.align):void 0;return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if("queued"===this.scrollState.phase)return void this.scheduleScrollReconcile();this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=null==this.scrollState.index?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=e!==this.scrollState.lastTargetOffset;if(!s&&a(e,this.getScrollOffset())){if("smooth"===this.scrollState.phase?this.scrollState.phase="smoothLanded":"smoothFinishing"===this.scrollState.phase&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){let t=this.getSize()||600,s=Math.abs(e-this.getScrollOffset()),n=S(this.scrollState)&&s>t;this.scrollState.lastTargetOffset=e,n?this.scrollState.phase="smooth":"smooth"===this.scrollState.phase?this.scrollState.phase="smoothFinishing":"smoothLanded"===this.scrollState.phase&&(this.scrollState.phase="instant"),this._scrollToOffset(e,{behavior:n?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){let l=this._iosGesture.tail();if("absolute"===r&&null!==l){if("fling"===l&&(void 0!==s?s:s=h()&&"u">typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("overflow-anchor: auto"))){this._stopMomentum(()=>{let e=this.scrollState;(null==e?void 0:e.phase)!=="queued"||"fling"!==this._iosGesture.tail()||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:b(n,null!=e.index&&a(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}}let w=(e,t,s,n)=>{for(;e<=t;){let r=(e+t)/2|0,l=s(r);if(l<n)e=r+1;else{if(!(l>n))return r;t=r-1}}return e>0?e-1:0},M="u">typeof document?r.useLayoutEffect:r.useEffect;var N=e.i(16327),_=e.i(56420);let O={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};O.node;let k=(0,_.f)(O);function E(e){let t=new Map,s=new Map;for(let n of e){let e=n.uuid||`${n._source}:${n.timestamp}`,r=s.get(e)??0;s.set(e,r+1),t.set(n,0===r?e:`${e}#${r}`)}return t}let C={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};C.node;let I=(0,_.f)(C),T={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};T.node;let z=(0,_.f)(T),A={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};A.node;let F=(0,_.f)(A),R={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};R.node;let W=(0,_.f)(R),L={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};L.node;let $=(0,_.f)(L),D={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};D.node;let B=(0,_.f)(D);var P=e.i(34713);let q=r.default.memo(function({entries:e,compact:t=!1}){let s=(0,r.useMemo)(()=>(function(e){let t=0,s=0,n=0,r=0,l=0,i=new Set;for(let o of e)if("user"===o.type&&t++,"queue-operation"===o.type&&l++,"assistant"===o.type){for(let e of(s++,o.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?r++:n++);o.message.model&&i.add(o.message.model)}let o="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;o=(0,P.M)(t)}return{turnCount:l,userCount:t,assistantCount:s,toolCallCount:n,subagentCount:r,duration:o,models:Array.from(i)}})(e),[e]),l=t?"w-3.5 h-3.5":"w-4 h-4",i=t?"text-xs font-medium":"text-sm font-medium",o=t?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",a=[...t?[]:[{Icon:$,color:"text-primary",v:s.turnCount,l:"Turns"}],{Icon:I,color:"text-[color:var(--chart-1)]",v:s.userCount,l:"User"},{Icon:z,color:"text-[color:var(--chart-2)]",v:s.assistantCount,l:"Assistant"},{Icon:k,color:"text-[color:var(--chart-3)]",v:s.toolCallCount,l:t?"Tools":"Tool Calls"},{Icon:B,color:"text-[color:var(--chart-5)]",v:s.subagentCount,l:"Subagents"},{Icon:W,color:"text-[color:var(--chart-4)]",v:s.duration||"—",l:"Duration"},{Icon:F,color:"text-[color:var(--chart-5)]",v:s.models.length>0?s.models.join(", "):"—",l:t?"Model":"Model(s)"}];return(0,n.jsx)("div",{className:t?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,n.jsx)("div",{className:`grid grid-cols-2 ${t?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:a.map(({Icon:e,color:t,v:s,l:r})=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(e,{className:`${l} ${t}`}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:s}),(0,n.jsx)("div",{className:o,children:r})]})]},r))})})}),U={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};U.node;let H=(0,_.f)(U);var V=e.i(67927);function K(e){return JSON.stringify(e.raw,null,2)}let G=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function Y(e){let t=new Date(e),s=G.format(t),n=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${n}`}let J=r.default.memo(function({entry:e,isCollapsed:t,entryCount:s,onToggle:r}){let l="function"==typeof r,i=(0,n.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${l?" group-hover:bg-primary/20 transition-colors":""}`,children:[l?(0,n.jsx)(V.f,{className:`w-3 h-3 transition-transform ${t?"":"rotate-90"}`}):(0,n.jsx)(H,{className:"w-3 h-3"}),(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground",children:Y(e.timestampMs)}),l&&t&&"number"==typeof s&&(0,n.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[s," ",1===s?"entry":"entries"]})]});return l?(0,n.jsxs)("button",{type:"button",onClick:r,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var X=e.i(47163);let Q={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},Z={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},ee={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},et={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};et.node;let es=(0,_.f)(et),en={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};en.node;let er=(0,_.f)(en);var el=e.i(66794);function ei({type:e}){let t="w-4 h-4";switch(e){case"user":return(0,n.jsx)(I,{className:t});case"assistant":return(0,n.jsx)(z,{className:t});case"file-history-snapshot":return(0,n.jsx)(es,{className:t});case"progress":return(0,n.jsx)(er,{className:t});case"system":return(0,n.jsx)(el.f,{className:t});case"queue-operation":return(0,n.jsx)(H,{className:t})}}function eo({type:e}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${Z[e]}`,children:[(0,n.jsx)(ei,{type:e}),Q[e]]})}var ea=e.i(24380);function eh({block:e}){let t=(0,r.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,n.jsx)(ea.CopyButton,{text:t})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t})]}),e.result?(0,n.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:Y(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,n.jsx)(ea.CopyButton,{text:e.result.content})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,t)=>(0,n.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${t+1}`,className:"mt-2 max-w-full rounded border border-border"},t))]}):(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let ed={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};ed.node;let ec=(0,_.f)(ed),eu=r.default.memo(function({block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"text":return(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let o=e.subagentId&&t?t.get(`agent-${e.subagentId}`):void 0;return(0,n.jsx)(eb,{block:e,subagentEntries:o,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i})}return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(k,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,n.jsx)(eh,{block:e})]});case"thinking":return(0,n.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,n.jsxs)("details",{children:[(0,n.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,n.jsx)(ec,{className:"w-4 h-4"}),(0,n.jsx)("span",{children:"Thinking"}),(0,n.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function em({entry:e}){return(0,n.jsx)("div",{children:e.message.content&&(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){let{content:o}=e.message;return(0,n.jsx)("div",{className:"space-y-3",children:o.map((e,o)=>(0,n.jsx)(eu,{block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i},o))})}),ep=r.default.memo(function({entry:e}){let t=(0,r.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,n.jsxs)("div",{className:"text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:t}),(0,n.jsxs)("details",{className:"mt-1",children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:K(e)})]})]})}),eg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};eg.node;let ex=(0,_.f)(eg);var ey=e.i(55574);function ev({uuid:e}){let t=(0,r.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,n.jsx)("button",{onClick:t,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,n.jsx)(ex,{className:"w-3.5 h-3.5"})})}function eb({block:e,subagentEntries:t,projectName:s,sessionId:l,highlightedUuid:i,autoExpandForUuid:o}){let a=!!(o&&t?.some(e=>e.uuid===o)),[h,d]=(0,r.useState)(a);(0,r.useEffect)(()=>{if(!a)return;let e=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(e)},[a]);let c=(0,r.useCallback)(()=>{d(e=>!e)},[]),u=t&&t.length>0,m=(0,r.useMemo)(()=>E(t??[]),[t]);return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(B,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,n.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&t&&(0,n.jsxs)("button",{onClick:c,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,n.jsx)(V.f,{className:(0,X.f)("w-3 h-3 transition-transform",h&&"rotate-90")}),(0,n.jsxs)("span",{children:["agent-",e.subagentId]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:h?"Collapse":"View subagent log"})]}),h&&(0,n.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[t&&0===t.length&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),u&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(q,{entries:t,compact:!0})}),t&&t.map(e=>"queue-operation"===e.type?(0,n.jsx)(J,{entry:e},m.get(e)):(0,n.jsx)(ej,{entry:e,projectName:s,sessionId:l,isHighlighted:!!i&&e.uuid===i},m.get(e)))]}),(0,n.jsx)(eh,{block:e})]})}function eS({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"user":return(0,n.jsx)(em,{entry:e});case"assistant":return(0,n.jsx)(ef,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,n.jsx)(ep,{entry:e})}}let ej=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,isHighlighted:l,highlightedUuid:i,autoExpandForUuid:o}){return(0,n.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,X.f)(`group border-l-4 ${ee[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,l&&"entry-highlighted"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,n.jsx)(eo,{type:e.type}),(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,n.jsx)(ev,{uuid:e.uuid}),(0,n.jsx)(ea.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return K(e);case"queue-operation":return e.label}}(e)}),(0,n.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:Y(e.timestampMs)})]})]}),(0,n.jsx)("div",{className:"px-4 py-3",children:(0,n.jsx)(eS,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:i,autoExpandForUuid:o})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var ew=e.i(32344),eM=e.i(84026),eN=e.i(29407),e_=e.i(16306),eO=e.i(82954),ek=e.i(73520),eE=e.i(85881);function eC({decision:e}){return"deny"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,n.jsx)(eN.f,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,n.jsx)(e_.f,{className:"h-3 w-3"}),"Instruct"]}):(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,n.jsx)(eM.f,{className:"h-3 w-3"}),"Allow"]})}function eI({eventType:e}){return(0,n.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eT({mode:e}){let t="default"===e;return(0,n.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${t?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function ez({ms:e}){return(0,n.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eA({value:e,onChange:t}){return(0,n.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(s=>(0,n.jsx)("button",{onClick:()=>t(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function eF({item:e}){return(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,n.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,n.jsx)(ea.CopyButton,{text:e.sessionId})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,n.jsx)(ea.CopyButton,{text:e.cwd})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,n.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"}),e.transcriptPath?.startsWith("opencode-db://")&&(0,n.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,n.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eR({sessionId:e,initialData:t}){let{intervalSec:s}=(0,eE.useAutoRefresh)(),[l,i]=(0,r.useState)(!1),[o,a]=(0,r.useState)(1),[h,d]=(0,r.useState)(t),[c,u]=(0,r.useState)(null),[m,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),v=(0,r.useRef)(null),b=(0,r.useRef)({filterDecision:m,filterEventType:p,filterPolicy:x});b.current={filterDecision:m,filterEventType:p,filterPolicy:x};let S=""!==m||""!==p||""!==x,j=(0,r.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:n,filterPolicy:r}=b.current,l=await (0,ew.f)({sessionId:e,decision:s||void 0,eventType:n||void 0,policyName:r||void 0},t);d(l)}catch{}},[e]);(0,r.useEffect)(()=>{j(o);let e=setInterval(()=>j(o),s>0?1e3*s:5e3);return()=>clearInterval(e)},[o,j,s]),(0,r.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{a(1),u(null),j(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,p,x]);let w=h.entries,M=h.totalPages;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!l&&(0,n.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,n.jsx)(eA,{value:m,onChange:f}),(0,n.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,n.jsx)("option",{value:"",children:"All Events"}),(0,n.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,n.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,n.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,n.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,n.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,n.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===w.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,n.jsx)(eO.f,{className:"h-10 w-10 text-muted-foreground/30"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:S?"No matching hook events.":"No hook events found."})]}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,n.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map((e,t)=>{let s="deny"===e.decision,l=c===t,i="instruct"===e.decision;return(0,n.jsxs)(r.default.Fragment,{children:[(0,n.jsxs)("tr",{onClick:()=>{u(e=>e===t?null:t)},className:`cursor-pointer transition-colors ${s?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":t%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,n.jsx)("td",{className:"px-4 py-2",children:(0,n.jsx)(N.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eC,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eI,{eventType:e.eventType})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,n.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,n.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(ez,{ms:e.durationMs})}),(0,n.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,n.jsx)(eT,{mode:e.permissionMode}):"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,P.g)(e.timestamp)})]}),l&&(0,n.jsx)(eF,{item:e})]},`${e.timestamp}-${t}`)})})]})}),(0,n.jsx)(ek.f,{currentPage:o,totalPages:M,onPageChange:e=>{a(e),u(null)}})]})]})}function eW(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eL({tools:e,compact:t}){return(0,n.jsx)("div",{className:`bg-card border border-border rounded-lg ${t?"p-3":"p-4"}`,children:(0,n.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${t?"gap-2":"gap-3"}`,children:e.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)(k,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:`${t?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e$(e,t){return t.get(e)??`${e.uuid}-${e.timestampMs}`}function eD(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function eB({entries:e,entriesBySource:t,projectName:s,sessionId:i}){let o=(0,r.useMemo)(()=>Array.from(t.values()).flat(),[t]),[a,h]=(0,r.useState)(new Set),[d,c]=(0,r.useState)(0),[u,m]=(0,r.useState)(()=>eD()),f=(0,r.useRef)(void 0),g=(0,r.useRef)(!1),y=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().top+window.scrollY;c(e=>e===t?e:t)};t();let s=new ResizeObserver(t);return s.observe(document.body),window.addEventListener("resize",t),()=>{s.disconnect(),window.removeEventListener("resize",t)}},[]);let b=(0,r.useMemo)(()=>E(e),[e]),S=(0,r.useMemo)(()=>(function(e,t){let s=new Map,n=null,r=0;for(let l of e)"queue-operation"===l.type?(null!==n&&s.set(n,r),n=e$(l,t),r=0):null!==n&&r++;return null!==n&&s.set(n,r),s})(e,b),[e,b]),w=(0,r.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=a.has(e$(e,b)),!0):!t)},[e,a,b]),N=(0,r.useMemo)(()=>{let e=new Map;return w.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[w]),_=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let n of e){if(!n._source?.startsWith("agent-")||!n.uuid)continue;let e=n._source.slice(6),r=t.get(e);r&&s.set(n.uuid,r)}return s})(o),[o]),O=(0,r.useMemo)(()=>u&&_.has(u)?u:null,[u,_]),k=O?_.get(O)??null:null;(0,r.useEffect)(()=>{if(u)return f.current=setTimeout(()=>m(null),4e3),()=>{f.current&&clearTimeout(f.current)}},[]),(0,r.useEffect)(()=>{let e=()=>{let e=eD();m(e),g.current=!1,f.current&&clearTimeout(f.current),e&&(f.current=setTimeout(()=>m(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,r.useMemo)(()=>{if(!u)return null;let t=k??u,s=e.some(e=>e.uuid===t),n=N.has(t);if(s&&!n){let s=null;for(let n of e)if("queue-operation"===n.type)s=e$(n,b);else if(n.uuid===t&&s)return s}return null},[u,k,e,N,b]);(0,r.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{h(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let I=(0,r.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=(0,r.useCallback)(e=>b.get(w[e])??e,[b,w]),z=function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:s="transform",...n}){let i=r.useReducer(e=>e+1,0)[1],o=r.useRef({enabled:t,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=s;let a=r.useRef(!1),h=e=>{let t=o.current;if(!t.enabled||!t.container)return;let s=e.getTotalSize();if(s!==t.lastSize){t.lastSize=s;let n=e.options.horizontal?"width":"height";t.container.style[n]=`${s}px`}},d=(e,t,s)=>{let n=o.current,r=!!e.options.horizontal,l=t.start-e.options.scrollMargin;n.lastPositions.get(s)!==l&&(n.lastPositions.set(s,l),"transform"===n.mode?s.style.transform=r?`translate3d(${l}px, 0, 0)`:`translate3d(0, ${l}px, 0)`:s.style[r?"left":"top"]=`${l}px`)},c=e=>{let t=o.current;if(t.enabled&&t.container)for(let t of(h(e),e.getVirtualItems())){let s=e.elementsCache.get(t.key);s&&d(e,t,s)}},u={...n,onChange:(t,s)=>{var r;let h=o.current,d=!0;if(h.enabled){c(t);let e=t.range,s=h.prevRange;(d=!s||s.isScrolling!==t.isScrolling||s.startIndex!==(null==e?void 0:e.startIndex)||s.endIndex!==(null==e?void 0:e.endIndex))&&(h.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}d&&(e&&s&&!a.current?(0,l.flushSync)(i):i()),null==(r=n.onChange)||r.call(n,t,s)}},[m]=r.useState(()=>{let e=new j(u),t=e.measureElement;return e.measureElement=s=>{a.current=!0;try{t(s)}finally{a.current=!1}let n=o.current;if(null!==s&&n.enabled&&n.container){let t=e.measurementsCache[e.indexFromElement(s)];t&&d(e,t,s)}},Object.assign(e,{containerRef:t=>{let s=o.current;s.container=t,s.lastSize=null,null!==t&&c(e)}})});return m.setOptions(u),M(()=>m._didMount(),[]),M(()=>(h(m),m._willUpdate())),M(()=>{c(m)}),m}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:p,observeElementOffset:x,scrollToFn:v,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:w.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(w[e]),getItemKey:T,overscan:5,scrollMargin:d}});return(0,r.useEffect)(()=>{if(!u||g.current)return;let e=k??u,t=N.get(e);null!=t&&(g.current=!0,requestAnimationFrame(()=>{z.scrollToIndex(t,{align:"center"})}))},[u,k,N,z]),(0,n.jsx)("div",{ref:y,children:(0,n.jsx)("div",{style:{height:`${z.getTotalSize()}px`,width:"100%",position:"relative"},children:z.getVirtualItems().map(e=>{let r=w[e.index],l=!!u&&r.uuid===(k??u);return(0,n.jsx)("div",{"data-index":e.index,ref:z.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-z.options.scrollMargin}px)`},children:"queue-operation"===r.type?(0,n.jsx)(J,{entry:r,isCollapsed:a.has(e$(r,b)),entryCount:S.get(e$(r,b))??0,onToggle:()=>I(e$(r,b))}):(0,n.jsx)(ej,{entry:r,entriesBySource:t,projectName:s,sessionId:i,isHighlighted:!O&&l,highlightedUuid:O,autoExpandForUuid:O})},e.key)})})})}let eP=[];e.s(["default",0,function({entries:e,projectName:t,sessionId:s}){let l=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),i=l.get("session")??eP,o=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),a=(0,r.useMemo)(()=>eW(i),[i]),[h,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(new Set),[m,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null);(0,r.useEffect)(()=>{(0,ew.f)({sessionId:s},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[s]),(0,r.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&f(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let x=(0,r.useCallback)(e=>{u(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(q,{entries:i}),p&&(0,n.jsx)(eR,{sessionId:s,initialData:p},s),o.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.length,")"]})]}),!h&&o.map(e=>{let t;return(0,n.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,n.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${c.has(e.id)?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!c.has(e.id)&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q,{entries:l.get(`agent-${e.id}`)||[],compact:!0}),(t=eW(l.get(`agent-${e.id}`)||[])).length>0?(0,n.jsx)(eL,{tools:t,compact:!0}):null]})]},e.id)})]}),a.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.reduce((e,t)=>e+t.count,0),")"]})]}),(0,n.jsx)(eL,{tools:a})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>f(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,n.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===i.length?(0,n.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,n.jsx)(eB,{entries:i,entriesBySource:l,projectName:t,sessionId:s})})]})]})}],36406)},5780,function(e){e.n(e.i(36406))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";let t,s;var n=e.i(43476),r=e.i(71645),l=e.i(74080);function i(e,t,s){let n,r=s.initialDeps??[],l=!0;function i(){let i=e();return(i.length!==r.length||i.some((e,t)=>r[t]!==e))&&(r=i,n=t(...i),(null==s?void 0:s.onChange)&&!(l&&s.skipInitialOnChange)&&s.onChange(n),l=!1),n}return i.updateDeps=e=>{r=e},i}function o(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let a=(e,t)=>1.01>Math.abs(e-t),h=()=>{if(void 0!==t)return t;if("u"<typeof navigator)return t=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return t=!0;let e=navigator.maxTouchPoints;return t="MacIntel"===navigator.platform&&void 0!==e&&e>0},d={capture:!0,passive:!0};class c{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>null!==this._touch&&"lateFling"!==this._touch.phase,this.dragging=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved},this.tail=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:e,ownReadBack:t,moved:s,external:n})=>{var r,l,i;return e&&(null==(r=this._touch)?void 0:r.phase)==="tail"?this._openTail(this._touch.moved||!t,!1):(null==(l=this._touch)?void 0:l.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:n&&e&&s&&this._openTail(!0,!1)),!t&&!!e&&!!s&&(null==(i=this._touch)?void 0:i.phase)==="down"&&(this._touch.moved=!0,!0)},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var e;let t=(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved;this.end(),this._openTail(t,t)},this.end=()=>{var e;let t=this.host.getWindow();(null==(e=this._touch)?void 0:e.phase)==="tail"&&null!=t&&t.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),s=()=>this.touchEnd();return e.addEventListener("touchstart",t,d),e.addEventListener("touchend",s,d),e.addEventListener("touchcancel",s,d),()=>{e.removeEventListener("touchstart",t,d),e.removeEventListener("touchend",s,d),e.removeEventListener("touchcancel",s,d),this.end()}},this._openTail=(e,t)=>{let s=this.host.getWindow();if(!h()||null==s)return;this.end();let n={phase:"tail",moved:e,awaitingFling:t,timerId:s.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(n.moved,n.awaitingFling):(this._touch=n.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=n}}get touch(){return this._touch}}let u=e=>e,m=e=>{let t=e.overscan*Math.max(e.lanes??1,1),s=Math.max(e.startIndex-t,0),n=Math.min(e.endIndex+t,e.count-1)-s+1,r=Array(n);for(let e=0;e<n;e++)r[e]=s+e;return r},f={passive:!0},p=(e,t)=>{let s=e.scrollElement;if(!s)return;let n=()=>{t({width:s.innerWidth,height:s.innerHeight})};return n(),s.addEventListener("resize",n,f),()=>{s.removeEventListener("resize",n)}},g="u"<typeof window||"onscrollend"in window,x=(e,t)=>((e,t,s)=>{var n,r;let l,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=e.options.useScrollendEvent&&g,h=0,d=a?null:(n=()=>t(s(i),!1),r=e.options.isScrollingResetDelay,Object.assign(function(...e){o.clearTimeout(l),l=o.setTimeout(()=>n.apply(this,e),r)},{cancel:()=>{o.clearTimeout(l)}})),c=e=>()=>{h=s(i),null==d||d(),t(h,e)},u=c(!0),m=c(!1);return i.addEventListener("scroll",u,f),a&&i.addEventListener("scrollend",m,f),()=>{i.removeEventListener("scroll",u),a&&i.removeEventListener("scrollend",m),null==d||d.cancel()}})(e,t,t=>e.options.horizontal?t.scrollX:t.scrollY),y=(e,t,s)=>{if(s.options.useCachedMeasurements){let t=s.indexFromElement(e),n=s.options.getItemKey(t);return s.itemSizeCache.get(n)??s.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}if(!t){let t=s.indexFromElement(e),n=s.options.getItemKey(t),r=s.itemSizeCache.get(n);if(void 0!==r)return r}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},v=(e,{adjustments:t=0,behavior:s},n)=>{var r,l;null==(l=null==(r=n.scrollElement)?void 0:r.scrollTo)||l.call(r,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})},b=(e,t)=>"smooth"===e?t?"smoothLanded":"smooth":"instant",S=e=>(null==e?void 0:e.phase)==="smooth"||(null==e?void 0:e.phase)==="smoothLanded";class j{constructor(e){let t,s,n,r;this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new c({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if((null==e?void 0:e.phase)!=="queued"||null!==this.pendingWrite)return!1;let t=this._readElementOffset();return!(null===t||null===this._lastElementOffset||1>Math.abs(t-this._lastElementOffset))&&(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;(null==e?void 0:e.phase)==="queued"&&function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(t=null,s=null,n=()=>{let e;if(t)return t;let n=this.targetWindow;if(!n||!n.ResizeObserver)return null;let l=(e=new Set,s={schedule:t=>{let s=n.requestAnimationFrame(()=>{e.delete(s),t()});e.add(s)},cancel:()=>{e.forEach(e=>n.cancelAnimationFrame(e)),e.clear()}});return t=new n.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(r)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment())}};this.options.useAnimationFrameWithResizeObserver?l.schedule(t):t()})},r=e=>{let t=e.target,s=this.indexFromElement(t);if(!t.isConnected){for(let[e,s]of(this.observer.unobserve(t),this.elementsCache))if(s===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(s)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this))},{disconnect:()=>{var e;null==(e=n())||e.disconnect(),null==s||s.cancel(),t=null,s=null},observe:e=>{var t;return null==(t=n())?void 0:t.observe(e,{box:"border-box"})},unobserve:e=>{var t;return null==(t=n())?void 0:t.unobserve(e)}}),this.range=null,this.setOptions=e=>{var t;let s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u,rangeExtractor:m,onChange:()=>{},measureElement:y,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let t in e){let n=e[t];void 0!==n&&(s[t]=n)}let n=this.options,r=null,l=null,i=!1;if(void 0!==n&&n.enabled&&s.enabled&&"end"===s.anchorTo&&null!==this.scrollElement){let e=n.count,o=s.count,a=this.getMeasurements(),h=(null==(t=this._singleLaneMeasurements)?void 0:t.items)??a,d=e=>{var t;return"object"==typeof(t=h[e])?t.key:t},c=e>0?d(0):null,u=e>0?d(e-1):null;if(o!==e||e>0&&o>0&&(s.getItemKey(0)!==c||s.getItemKey(o-1)!==u)){i=!0;let t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??a[0]:null;t&&(r=[t.key,this.getScrollOffset()-t.start]);let h=!0===s.followOnAppend?"auto":s.followOnAppend||null;h&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(0===e||s.getItemKey(o-1)!==u)&&(o>e||function(e,t,s,n){if(0===t)return!1;let r=n(0),l=new Set,i=0;for(;i<e;){let e=s(i);if(e===r)break;l.add(e),i++}let o=e-i;if(0===o||o>=t)return!1;for(let e=0;e<o;e++)if(n(e)!==s(i+e))return!1;for(let e=o;e<t;e++)if(l.has(n(e)))return!1;return!0}(e,o,d,s.getItemKey))&&(l=h)}}this.options=s,i&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&null!==this.scrollOffset&&!this._awaitingCommandReadBack()){let[e,t]=r,s=this.getMeasurements(),{count:n,getItemKey:i}=this.options,a=0;for(;a<n&&i(a)!==e;)a++;if(a<n){let e=s[a];if(e){let s=Math.max(0,e.start+t);l||s===this.scrollOffset||(o=s-this.scrollOffset,this.scrollOffset=s)}}}l?this.pendingScrollAnchor={kind:"follow",behavior:l}:null!==o&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=i(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,null==(e=this._momentumStop)||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{var s,n,r,l;let i=t?this._elementMaxScrollOffset():null,o=this._reportedOverscroll;this._reportedOverscroll=e<0||null!==i&&e>i+1;let h=e;this._lastElementOffset=h,e=this._toLayoutOffset(e);let d=this._classifyScrollEvent(e,t,i);if("spurious"===d)return;"readBack"===d?e=this.pendingWrite.target:"clampedReadBack"===d&&(null==(s=this.scrollState)?void 0:s.index)!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:function({kind:e,offset:t,command:s,target:n}){let r;return"spurious"!==e&&"readBack"!==e&&"clampedReadBack"!==e&&(null==s?void 0:s.index)!=null&&"queued"!==s.phase&&"smooth"!==(r=s.phase)&&"smoothFinishing"!==r&&!a(t,s.lastTargetOffset)&&!a(t,n())&&"clampedEcho"!==e}({kind:d,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,null!==this._clampedAdjustment&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let c=this.getScrollOffset(),u=this.scrollDirection;this.scrollDirection=t?c===e?this.scrollDirection:c<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t;let m=this.scrollState;if((null==m?void 0:m.phase)==="queued"&&"external"===d&&t)if(o||this._reportedOverscroll)m.samples=[];else{let e=this.now();m.samples=[...(m.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:h}],(null!==u&&this.scrollDirection!==u||function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s],r=s-1;for(;r>=0&&n.t-e[r].t<40;)r--;if(r<0)return!1;let l=e[r],i=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-l.offset)/(n.t-l.t);return i*o>=0&&Math.abs(i)>=2*Math.abs(o)&&Math.abs(i)-Math.abs(o)>=.8}(m.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:t,ownReadBack:"readBack"===d,moved:e!==c,external:"external"===d&&(null==(n=this.scrollState)?void 0:n.phase)!=="smooth"&&(null==(r=this.scrollState)?void 0:r.phase)!=="smoothFinishing"})&&(null==(l=this.scrollState)?void 0:l.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let s=this.pendingScrollAnchor;this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled&&("anchor"===s.kind?this._canWriteScroll()?S(this.scrollState)&&!a(this.getScrollOffset()-s.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(s.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=s.delta,this._followOffsetTarget(s.delta),this.notify(!1)):this.scrollToEnd({behavior:s.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,s)=>{var n;return function({offset:e,isScrolling:t,elementMax:s,holdOffset:n,scrollOffset:r,pendingWrite:l,clampedMaxAtWrite:i}){var o;return t&&null===l&&e===r?"spurious":null!==l&&1.5>Math.abs(e-l.target)?"readBack":null!==l&&!l.smooth&&null!==s&&l.target>s+n+.5&&1.5>Math.abs(e-(s+n))||null!==l&&!l.smooth&&(null==(o=l.lowMaxes)?void 0:o.some(t=>1.5>Math.abs(e-t)))?"clampedReadBack":null!==i&&1.5>Math.abs(e-i)?"clampedEcho":"external"}({offset:e,isScrolling:t,elementMax:s,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:(null==(n=this._clampedAdjustment)?void 0:n.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(null===this._clampedAdjustment||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>t+.5&&(this._clampedAdjustment=e>s+.5?{target:e,maxAtWrite:s}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(null===e||"queued"!==e.phase)return;let{behavior:t}=e;this.getMeasurements();let s=this.getScrollStateTarget(e);e.lastTargetOffset=s,this._clampedAdjustment=null,e.phase=b(t,null!=e.index&&a(s,this.getScrollOffset())),this._scrollToOffset(s,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(null==e)return null;let{horizontal:t,isRtl:s}=this.options;return"number"==typeof e.scrollTop?t?e.scrollLeft*(s&&-1||1):e.scrollTop:"number"==typeof e.scrollY?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(h()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{var t;if(0===this._holdOffset||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||(null==(t=this.scrollState)?void 0:t.phase)==="smooth")return;this._holdOffset=0,null!==this.scrollOffset&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let s=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s),this._scrollToOffset(s)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=i(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,s,n,r,l,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=i(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o},a)=>{var h,d;let c=this.itemSizeCache;if(!r)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===l){let r,l,i=2*e,a=null==(h=this._singleLaneMeasurements)?void 0:h.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,2*u)),a=e}let m=0===u?Array(e):this._singleLaneMeasurements.items.slice();if(0===u)r=t+s;else{let e=u-1;r=a[2*e]+a[2*e+1]+o}for(let t=u;t<e;t++){let e=n(t);m[t]=e;let s=c.get(e),l="number"==typeof s?s:this.options.estimateSize(t);a[2*t]=r,a[2*t+1]=l,r+=l+o}this._singleLaneMeasurements={flat:a,items:m};let f=(d=a,l=m.length,new Proxy(m,{get(e,t,s){if("string"==typeof t){let s=t.charCodeAt(0);if(s>=48&&s<=57){let s=+t;if(Number.isInteger(s)&&s>=0&&s<l){let t=e[s];if("object"!=typeof t){let n=d[2*s];t=e[s]={index:s,key:t,start:n,size:d[2*s+1],end:n+d[2*s+1],lane:0}}return t}}if("length"===t)return l}return Reflect.get(e,t,s)}}));return this.measurementsCache=f,f}let m=this.measurementsCache.slice(0,u),f=Array(l).fill(void 0),p=new Float64Array(l),g=0;for(let e=0;e<u;e++){let t=m[e];t&&(void 0===f[t.lane]&&g++,f[t.lane]=e,p[t.lane]=t.end)}for(let r=u;r<e;r++){let e,a,h=n(r),d=this.laneAssignments.get(r),u="estimate"===i||c.has(h);if(void 0!==d&&this.options.lanes>1){let n=f[e=d],r=void 0!==n?m[n]:void 0;a=r?r.end+o:t+s}else if(g===l){let t=0,s=p[0],n=f[0];for(let e=1;e<l;e++){let r=p[e];(r<s||r===s&&f[e]<n)&&(t=e,s=r,n=f[e])}e=t,a=s+o,u&&this.laneAssignments.set(r,e)}else e=r%this.options.lanes,a=t+s,u&&this.laneAssignments.set(r,e);let x=c.get(h),y="number"==typeof x?x:this.options.estimateSize(r),v=a+y;m[r]={index:r,start:a,size:y,end:v,key:h,lane:e},void 0===f[e]&&g++,f[e]=r,p[e]=v}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=i(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,n)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,s,n,r){let l=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:l};if(1===n&&null!==r){let e=function(e,t,s){let n=0;for(;n<=t;){let r=(n+t)/2|0,l=e[2*r];if(l<s)n=r+1;else{if(!(l>s))return r;t=r-1}}return n>0?n-1:0}(r,l,s),n=e,i=s+t;for(;n<l&&r[2*n]+r[2*n+1]<i;)n++;return{startIndex:e,endIndex:n}}let i=w(0,l,t=>e[t].start,s),o=i;if(1===n)for(;o<l&&e[o].end<s+t;)o++;else if(n>1){let r=Array(n).fill(0);for(;o<l&&r.some(e=>e<s+t);){let t=e[o];r[t.lane]=t.end,o++}let a=Array(n).fill(s+t);for(;i>=0&&a.some(e=>e>=s);){let t=e[i];a[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}(e,t,s,n,1===n&&null!==this._singleLaneMeasurements?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=i(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,s,n,r,l)=>null===n||null===r?[]:e({startIndex:n,endIndex:r,overscan:t,count:s,lanes:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!S(this.scrollState))return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),n=Math.max(0,s-t),r=Math.min(this.options.count-1,s+t);return e>=n&&e<=r}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let s=this.options.getItemKey(t),n=this.elementsCache.get(s);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(s,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s,n,r;let l,i,o;if(!this.isIndexInRange(e))return;(null==(s=this._resizeBatch)?void 0:s.sync)&&this.getMeasurements();let a=null==(n=this._singleLaneMeasurements)?void 0:n.flat;if(1===this.options.lanes&&null!=a)o=this.options.getItemKey(e),i=a[2*e],l=a[2*e+1];else{let t=this.measurementsCache[e];if(!t)return;o=t.key,i=t.start,l=t.size}let h=this.itemSizeCache.get(o)??l,d=t-h;if(0!==d){let s="end"===this.options.anchorTo&&!S(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,n=s?this._getLayoutTotalSize():0,a=this.getScrollOffset(),c=this.itemSizeCache.has(o)?i+h<=a&&"backward"!==this.scrollDirection:i<a,u=!S(this.scrollState)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:o,start:i,size:l,end:i+l,lane:0},d,this):c);(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(o,t),this.itemSizeCacheVersion++;let m=!1;if(!this._awaitingCommandReadBack()&&(s?m=this.applyScrollAdjustment(this._getLayoutTotalSize()-n):u&&(m=this.applyScrollAdjustment(d))),this._resizeBatch){this._resizeBatch.notify=!0,(r=this._resizeBatch).sync||(r.sync=m);return}this.notify(m),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=i(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,s)=>{let n=[];for(let r=0,l=e.length;r<l;r++){let l=t[e[r]];n.push(0===s?l:{...l,start:l.start-s,end:l.end-s})}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{var t;let s=this.getMeasurements();if(0===s.length)return;let n=null==(t=this._singleLaneMeasurements)?void 0:t.flat,r=1===this.options.lanes&&null!=n,l=w(0,s.length-1,r?e=>n[2*e]:e=>o(s[e]).start,e);return o(s[l])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(null===e)return;let t=this.pendingWrite,s=Math.max(e,0)+this._holdOffset;if(s>=t.target)return;let n=t.lowMaxes??(t.lowMaxes=[]);n[n.length-1]!==s&&n.push(s)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{var t;let s=e+this._holdOffset;return(null==(t=this.pendingScrollAnchor)?void 0:t.kind)==="anchor"&&(s+=this.pendingScrollAnchor.delta),s},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(null===e)return null;if("scrollHeight"in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if("document"in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,s=this.targetWindow;if(null===t||null===s)return;let n="document"in t?t.document.scrollingElement:t;if(!(null==n?void 0:n.style))return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:r}=n,l=this.options.horizontal?"overflow-x":"overflow-y",i=r.getPropertyValue(l),o=r.getPropertyPriority(l);r.setProperty(l,"hidden","important");let a={restore:()=>"hidden"===r.getPropertyValue(l)&&"important"===r.getPropertyPriority(l)&&(r.setProperty(l,i,o),!0),done:e};this._momentumStop=a,s.requestAnimationFrame(()=>s.requestAnimationFrame(()=>{this._momentumStop===a&&(this._momentumStop=null,a.restore()&&a.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(null===t)return null;let s=t+this._holdOffset;return e>s+.5?{target:e,maxAtWrite:s}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),r=this.getScrollOffset();return"auto"===t&&(t=e>=r+n?"end":"start"),"center"===t?e+=(s-n)/2:"end"===t&&(e-=n),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if("auto"===t)if(r.end>=n+s-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1){let e=this.getMaxScrollOffset();return[Math.max(Math.min(e-this.options.paddingEnd+this.options.scrollPaddingEnd,e),0),t]}let l="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,t,r.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),s,"absolute")},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getOffsetForIndex(e,t);if(!n)return;let[r,l]=n;this._startScroll({index:e,align:l},r,s,"absolute")},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,"start");this._startScroll({index:null,align:"start"},s,t,"relative")},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,"absolute"):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var e,t;let s,n=this.getMeasurements();if(0===n.length)s=this.options.paddingStart;else if(1===this.options.lanes){let r=n.length-1,l=null==(e=this._singleLaneMeasurements)?void 0:e.flat;s=null!=l?l[2*r]+l[2*r+1]:(null==(t=n[r])?void 0:t.end)??0}else{let e=Array(this.options.lanes).fill(null),t=n.length-1;for(;t>=0&&e.some(e=>null===e);){let s=n[t];null===e[s.lane]&&(e[s.lane]=s.end),t--}s=Math.max(...e.filter(e=>null!==e))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(0===this.itemSizeCache.size)return e;for(let t of this.getMeasurements())t&&this.itemSizeCache.has(t.key)&&e.push({index:t.index,key:t.key,start:t.start,size:t.size,end:t.end,lane:t.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:s}={})=>{let n={target:e+(t??0),smooth:"smooth"===s};return this.pendingWrite=n,this.options.scrollToFn(e-this._holdOffset,{behavior:s,adjustments:t},this),n},this.getCommandWrittenOffset=()=>null===this.scrollState||null===this.pendingWrite||this.pendingWrite.smooth?null:this.pendingWrite.target,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(h()&&this._iosGesture.dragging())&&null!==e&&!a(e,this.getScrollOffset())},this._followOffsetTarget=e=>{null!==this.scrollState&&null==this.scrollState.index&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(0===e)return!1;if(this._followOffsetTarget(e),!this._canWriteScroll())return this._holdOffset+=e,null!==this.scrollOffset&&(this.scrollOffset+=e),!0;{let s=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s+e);let n=this._scrollToOffset(s,{adjustments:e,behavior:t});return null!==this.scrollOffset&&(this.pendingWrite===n&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:null!=e.index?this.getOffsetForIndex(e.index,e.align):void 0;return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if("queued"===this.scrollState.phase)return void this.scheduleScrollReconcile();this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=null==this.scrollState.index?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=e!==this.scrollState.lastTargetOffset;if(!s&&a(e,this.getScrollOffset())){if("smooth"===this.scrollState.phase?this.scrollState.phase="smoothLanded":"smoothFinishing"===this.scrollState.phase&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){let t=this.getSize()||600,s=Math.abs(e-this.getScrollOffset()),n=S(this.scrollState)&&s>t;this.scrollState.lastTargetOffset=e,n?this.scrollState.phase="smooth":"smooth"===this.scrollState.phase?this.scrollState.phase="smoothFinishing":"smoothLanded"===this.scrollState.phase&&(this.scrollState.phase="instant"),this._scrollToOffset(e,{behavior:n?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){let l=this._iosGesture.tail();if("absolute"===r&&null!==l){if("fling"===l&&(void 0!==s?s:s=h()&&"u">typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("overflow-anchor: auto"))){this._stopMomentum(()=>{let e=this.scrollState;(null==e?void 0:e.phase)!=="queued"||"fling"!==this._iosGesture.tail()||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:b(n,null!=e.index&&a(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}}let w=(e,t,s,n)=>{for(;e<=t;){let r=(e+t)/2|0,l=s(r);if(l<n)e=r+1;else{if(!(l>n))return r;t=r-1}}return e>0?e-1:0},M="u">typeof document?r.useLayoutEffect:r.useEffect;var N=e.i(16327),_=e.i(56420);let O={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};O.node;let k=(0,_.f)(O);function E(e){let t=new Map,s=new Map;for(let n of e){let e=n.uuid||`${n._source}:${n.timestamp}`,r=s.get(e)??0;s.set(e,r+1),t.set(n,0===r?e:`${e}#${r}`)}return t}let C={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};C.node;let I=(0,_.f)(C),T={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};T.node;let z=(0,_.f)(T),A={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};A.node;let F=(0,_.f)(A),R={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};R.node;let W=(0,_.f)(R),L={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};L.node;let $=(0,_.f)(L),D={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};D.node;let B=(0,_.f)(D);var P=e.i(34713);let q=r.default.memo(function({entries:e,compact:t=!1}){let s=(0,r.useMemo)(()=>(function(e){let t=0,s=0,n=0,r=0,l=0,i=new Set;for(let o of e)if("user"===o.type&&t++,"queue-operation"===o.type&&l++,"assistant"===o.type){for(let e of(s++,o.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?r++:n++);o.message.model&&i.add(o.message.model)}let o="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;o=(0,P.M)(t)}return{turnCount:l,userCount:t,assistantCount:s,toolCallCount:n,subagentCount:r,duration:o,models:Array.from(i)}})(e),[e]),l=t?"w-3.5 h-3.5":"w-4 h-4",i=t?"text-xs font-medium":"text-sm font-medium",o=t?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",a=[...t?[]:[{Icon:$,color:"text-primary",v:s.turnCount,l:"Turns"}],{Icon:I,color:"text-[color:var(--chart-1)]",v:s.userCount,l:"User"},{Icon:z,color:"text-[color:var(--chart-2)]",v:s.assistantCount,l:"Assistant"},{Icon:k,color:"text-[color:var(--chart-3)]",v:s.toolCallCount,l:t?"Tools":"Tool Calls"},{Icon:B,color:"text-[color:var(--chart-5)]",v:s.subagentCount,l:"Subagents"},{Icon:W,color:"text-[color:var(--chart-4)]",v:s.duration||"—",l:"Duration"},{Icon:F,color:"text-[color:var(--chart-5)]",v:s.models.length>0?s.models.join(", "):"—",l:t?"Model":"Model(s)"}];return(0,n.jsx)("div",{className:t?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,n.jsx)("div",{className:`grid grid-cols-2 ${t?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:a.map(({Icon:e,color:t,v:s,l:r})=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(e,{className:`${l} ${t}`}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:s}),(0,n.jsx)("div",{className:o,children:r})]})]},r))})})}),U={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};U.node;let H=(0,_.f)(U);var V=e.i(67927);function K(e){return JSON.stringify(e.raw,null,2)}let G=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function Y(e){let t=new Date(e),s=G.format(t),n=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${n}`}let J=r.default.memo(function({entry:e,isCollapsed:t,entryCount:s,onToggle:r}){let l="function"==typeof r,i=(0,n.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${l?" group-hover:bg-primary/20 transition-colors":""}`,children:[l?(0,n.jsx)(V.f,{className:`w-3 h-3 transition-transform ${t?"":"rotate-90"}`}):(0,n.jsx)(H,{className:"w-3 h-3"}),(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground",children:Y(e.timestampMs)}),l&&t&&"number"==typeof s&&(0,n.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[s," ",1===s?"entry":"entries"]})]});return l?(0,n.jsxs)("button",{type:"button",onClick:r,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var X=e.i(47163);let Q={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},Z={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},ee={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},et={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};et.node;let es=(0,_.f)(et),en={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};en.node;let er=(0,_.f)(en);var el=e.i(66794);function ei({type:e}){let t="w-4 h-4";switch(e){case"user":return(0,n.jsx)(I,{className:t});case"assistant":return(0,n.jsx)(z,{className:t});case"file-history-snapshot":return(0,n.jsx)(es,{className:t});case"progress":return(0,n.jsx)(er,{className:t});case"system":return(0,n.jsx)(el.f,{className:t});case"queue-operation":return(0,n.jsx)(H,{className:t})}}function eo({type:e}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${Z[e]}`,children:[(0,n.jsx)(ei,{type:e}),Q[e]]})}var ea=e.i(24380);function eh({block:e}){let t=(0,r.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,n.jsx)(ea.CopyButton,{text:t})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t})]}),e.result?(0,n.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:Y(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,n.jsx)(ea.CopyButton,{text:e.result.content})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,t)=>(0,n.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${t+1}`,className:"mt-2 max-w-full rounded border border-border"},t))]}):(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let ed={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};ed.node;let ec=(0,_.f)(ed),eu=r.default.memo(function({block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"text":return(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let o=e.subagentId&&t?t.get(`agent-${e.subagentId}`):void 0;return(0,n.jsx)(eb,{block:e,subagentEntries:o,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i})}return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(k,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,n.jsx)(eh,{block:e})]});case"thinking":return(0,n.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,n.jsxs)("details",{children:[(0,n.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,n.jsx)(ec,{className:"w-4 h-4"}),(0,n.jsx)("span",{children:"Thinking"}),(0,n.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function em({entry:e}){return(0,n.jsx)("div",{children:e.message.content&&(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){let{content:o}=e.message;return(0,n.jsx)("div",{className:"space-y-3",children:o.map((e,o)=>(0,n.jsx)(eu,{block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i},o))})}),ep=r.default.memo(function({entry:e}){let t=(0,r.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,n.jsxs)("div",{className:"text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:t}),(0,n.jsxs)("details",{className:"mt-1",children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:K(e)})]})]})}),eg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};eg.node;let ex=(0,_.f)(eg);var ey=e.i(55574);function ev({uuid:e}){let t=(0,r.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,n.jsx)("button",{onClick:t,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,n.jsx)(ex,{className:"w-3.5 h-3.5"})})}function eb({block:e,subagentEntries:t,projectName:s,sessionId:l,highlightedUuid:i,autoExpandForUuid:o}){let a=!!(o&&t?.some(e=>e.uuid===o)),[h,d]=(0,r.useState)(a);(0,r.useEffect)(()=>{if(!a)return;let e=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(e)},[a]);let c=(0,r.useCallback)(()=>{d(e=>!e)},[]),u=t&&t.length>0,m=(0,r.useMemo)(()=>E(t??[]),[t]);return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(B,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,n.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&t&&(0,n.jsxs)("button",{onClick:c,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,n.jsx)(V.f,{className:(0,X.f)("w-3 h-3 transition-transform",h&&"rotate-90")}),(0,n.jsxs)("span",{children:["agent-",e.subagentId]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:h?"Collapse":"View subagent log"})]}),h&&(0,n.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[t&&0===t.length&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),u&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(q,{entries:t,compact:!0})}),t&&t.map(e=>"queue-operation"===e.type?(0,n.jsx)(J,{entry:e},m.get(e)):(0,n.jsx)(ej,{entry:e,projectName:s,sessionId:l,isHighlighted:!!i&&e.uuid===i},m.get(e)))]}),(0,n.jsx)(eh,{block:e})]})}function eS({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"user":return(0,n.jsx)(em,{entry:e});case"assistant":return(0,n.jsx)(ef,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,n.jsx)(ep,{entry:e})}}let ej=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,isHighlighted:l,highlightedUuid:i,autoExpandForUuid:o}){return(0,n.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,X.f)(`group border-l-4 ${ee[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,l&&"entry-highlighted"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,n.jsx)(eo,{type:e.type}),(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,n.jsx)(ev,{uuid:e.uuid}),(0,n.jsx)(ea.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return K(e);case"queue-operation":return e.label}}(e)}),(0,n.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:Y(e.timestampMs)})]})]}),(0,n.jsx)("div",{className:"px-4 py-3",children:(0,n.jsx)(eS,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:i,autoExpandForUuid:o})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var ew=e.i(3967),eM=e.i(84026),eN=e.i(29407),e_=e.i(16306),eO=e.i(82954),ek=e.i(73520),eE=e.i(85881);function eC({decision:e}){return"deny"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,n.jsx)(eN.f,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,n.jsx)(e_.f,{className:"h-3 w-3"}),"Instruct"]}):(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,n.jsx)(eM.f,{className:"h-3 w-3"}),"Allow"]})}function eI({eventType:e}){return(0,n.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eT({mode:e}){let t="default"===e;return(0,n.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${t?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function ez({ms:e}){return(0,n.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eA({value:e,onChange:t}){return(0,n.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(s=>(0,n.jsx)("button",{onClick:()=>t(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function eF({item:e}){return(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,n.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,n.jsx)(ea.CopyButton,{text:e.sessionId})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,n.jsx)(ea.CopyButton,{text:e.cwd})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,n.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"}),e.transcriptPath?.startsWith("opencode-db://")&&(0,n.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,n.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eR({sessionId:e,initialData:t}){let{intervalSec:s}=(0,eE.useAutoRefresh)(),[l,i]=(0,r.useState)(!1),[o,a]=(0,r.useState)(1),[h,d]=(0,r.useState)(t),[c,u]=(0,r.useState)(null),[m,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),v=(0,r.useRef)(null),b=(0,r.useRef)({filterDecision:m,filterEventType:p,filterPolicy:x});b.current={filterDecision:m,filterEventType:p,filterPolicy:x};let S=""!==m||""!==p||""!==x,j=(0,r.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:n,filterPolicy:r}=b.current,l=await (0,ew.f)({sessionId:e,decision:s||void 0,eventType:n||void 0,policyName:r||void 0},t);d(l)}catch{}},[e]);(0,r.useEffect)(()=>{j(o);let e=setInterval(()=>j(o),s>0?1e3*s:5e3);return()=>clearInterval(e)},[o,j,s]),(0,r.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{a(1),u(null),j(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,p,x]);let w=h.entries,M=h.totalPages;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!l&&(0,n.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,n.jsx)(eA,{value:m,onChange:f}),(0,n.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,n.jsx)("option",{value:"",children:"All Events"}),(0,n.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,n.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,n.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,n.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,n.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,n.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===w.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,n.jsx)(eO.f,{className:"h-10 w-10 text-muted-foreground/30"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:S?"No matching hook events.":"No hook events found."})]}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,n.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map((e,t)=>{let s="deny"===e.decision,l=c===t,i="instruct"===e.decision;return(0,n.jsxs)(r.default.Fragment,{children:[(0,n.jsxs)("tr",{onClick:()=>{u(e=>e===t?null:t)},className:`cursor-pointer transition-colors ${s?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":t%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,n.jsx)("td",{className:"px-4 py-2",children:(0,n.jsx)(N.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eC,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eI,{eventType:e.eventType})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,n.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,n.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(ez,{ms:e.durationMs})}),(0,n.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,n.jsx)(eT,{mode:e.permissionMode}):"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,P.g)(e.timestamp)})]}),l&&(0,n.jsx)(eF,{item:e})]},`${e.timestamp}-${t}`)})})]})}),(0,n.jsx)(ek.f,{currentPage:o,totalPages:M,onPageChange:e=>{a(e),u(null)}})]})]})}function eW(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eL({tools:e,compact:t}){return(0,n.jsx)("div",{className:`bg-card border border-border rounded-lg ${t?"p-3":"p-4"}`,children:(0,n.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${t?"gap-2":"gap-3"}`,children:e.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)(k,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:`${t?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e$(e,t){return t.get(e)??`${e.uuid}-${e.timestampMs}`}function eD(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function eB({entries:e,entriesBySource:t,projectName:s,sessionId:i}){let o=(0,r.useMemo)(()=>Array.from(t.values()).flat(),[t]),[a,h]=(0,r.useState)(new Set),[d,c]=(0,r.useState)(0),[u,m]=(0,r.useState)(()=>eD()),f=(0,r.useRef)(void 0),g=(0,r.useRef)(!1),y=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().top+window.scrollY;c(e=>e===t?e:t)};t();let s=new ResizeObserver(t);return s.observe(document.body),window.addEventListener("resize",t),()=>{s.disconnect(),window.removeEventListener("resize",t)}},[]);let b=(0,r.useMemo)(()=>E(e),[e]),S=(0,r.useMemo)(()=>(function(e,t){let s=new Map,n=null,r=0;for(let l of e)"queue-operation"===l.type?(null!==n&&s.set(n,r),n=e$(l,t),r=0):null!==n&&r++;return null!==n&&s.set(n,r),s})(e,b),[e,b]),w=(0,r.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=a.has(e$(e,b)),!0):!t)},[e,a,b]),N=(0,r.useMemo)(()=>{let e=new Map;return w.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[w]),_=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let n of e){if(!n._source?.startsWith("agent-")||!n.uuid)continue;let e=n._source.slice(6),r=t.get(e);r&&s.set(n.uuid,r)}return s})(o),[o]),O=(0,r.useMemo)(()=>u&&_.has(u)?u:null,[u,_]),k=O?_.get(O)??null:null;(0,r.useEffect)(()=>{if(u)return f.current=setTimeout(()=>m(null),4e3),()=>{f.current&&clearTimeout(f.current)}},[]),(0,r.useEffect)(()=>{let e=()=>{let e=eD();m(e),g.current=!1,f.current&&clearTimeout(f.current),e&&(f.current=setTimeout(()=>m(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,r.useMemo)(()=>{if(!u)return null;let t=k??u,s=e.some(e=>e.uuid===t),n=N.has(t);if(s&&!n){let s=null;for(let n of e)if("queue-operation"===n.type)s=e$(n,b);else if(n.uuid===t&&s)return s}return null},[u,k,e,N,b]);(0,r.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{h(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let I=(0,r.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=(0,r.useCallback)(e=>b.get(w[e])??e,[b,w]),z=function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:s="transform",...n}){let i=r.useReducer(e=>e+1,0)[1],o=r.useRef({enabled:t,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=s;let a=r.useRef(!1),h=e=>{let t=o.current;if(!t.enabled||!t.container)return;let s=e.getTotalSize();if(s!==t.lastSize){t.lastSize=s;let n=e.options.horizontal?"width":"height";t.container.style[n]=`${s}px`}},d=(e,t,s)=>{let n=o.current,r=!!e.options.horizontal,l=t.start-e.options.scrollMargin;n.lastPositions.get(s)!==l&&(n.lastPositions.set(s,l),"transform"===n.mode?s.style.transform=r?`translate3d(${l}px, 0, 0)`:`translate3d(0, ${l}px, 0)`:s.style[r?"left":"top"]=`${l}px`)},c=e=>{let t=o.current;if(t.enabled&&t.container)for(let t of(h(e),e.getVirtualItems())){let s=e.elementsCache.get(t.key);s&&d(e,t,s)}},u={...n,onChange:(t,s)=>{var r;let h=o.current,d=!0;if(h.enabled){c(t);let e=t.range,s=h.prevRange;(d=!s||s.isScrolling!==t.isScrolling||s.startIndex!==(null==e?void 0:e.startIndex)||s.endIndex!==(null==e?void 0:e.endIndex))&&(h.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}d&&(e&&s&&!a.current?(0,l.flushSync)(i):i()),null==(r=n.onChange)||r.call(n,t,s)}},[m]=r.useState(()=>{let e=new j(u),t=e.measureElement;return e.measureElement=s=>{a.current=!0;try{t(s)}finally{a.current=!1}let n=o.current;if(null!==s&&n.enabled&&n.container){let t=e.measurementsCache[e.indexFromElement(s)];t&&d(e,t,s)}},Object.assign(e,{containerRef:t=>{let s=o.current;s.container=t,s.lastSize=null,null!==t&&c(e)}})});return m.setOptions(u),M(()=>m._didMount(),[]),M(()=>(h(m),m._willUpdate())),M(()=>{c(m)}),m}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:p,observeElementOffset:x,scrollToFn:v,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:w.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(w[e]),getItemKey:T,overscan:5,scrollMargin:d}});return(0,r.useEffect)(()=>{if(!u||g.current)return;let e=k??u,t=N.get(e);null!=t&&(g.current=!0,requestAnimationFrame(()=>{z.scrollToIndex(t,{align:"center"})}))},[u,k,N,z]),(0,n.jsx)("div",{ref:y,children:(0,n.jsx)("div",{style:{height:`${z.getTotalSize()}px`,width:"100%",position:"relative"},children:z.getVirtualItems().map(e=>{let r=w[e.index],l=!!u&&r.uuid===(k??u);return(0,n.jsx)("div",{"data-index":e.index,ref:z.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-z.options.scrollMargin}px)`},children:"queue-operation"===r.type?(0,n.jsx)(J,{entry:r,isCollapsed:a.has(e$(r,b)),entryCount:S.get(e$(r,b))??0,onToggle:()=>I(e$(r,b))}):(0,n.jsx)(ej,{entry:r,entriesBySource:t,projectName:s,sessionId:i,isHighlighted:!O&&l,highlightedUuid:O,autoExpandForUuid:O})},e.key)})})})}let eP=[];e.s(["default",0,function({entries:e,projectName:t,sessionId:s}){let l=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),i=l.get("session")??eP,o=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),a=(0,r.useMemo)(()=>eW(i),[i]),[h,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(new Set),[m,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null);(0,r.useEffect)(()=>{(0,ew.f)({sessionId:s},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[s]),(0,r.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&f(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let x=(0,r.useCallback)(e=>{u(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(q,{entries:i}),p&&(0,n.jsx)(eR,{sessionId:s,initialData:p},s),o.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.length,")"]})]}),!h&&o.map(e=>{let t;return(0,n.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,n.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${c.has(e.id)?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!c.has(e.id)&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q,{entries:l.get(`agent-${e.id}`)||[],compact:!0}),(t=eW(l.get(`agent-${e.id}`)||[])).length>0?(0,n.jsx)(eL,{tools:t,compact:!0}):null]})]},e.id)})]}),a.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.reduce((e,t)=>e+t.count,0),")"]})]}),(0,n.jsx)(eL,{tools:a})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>f(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,n.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===i.length?(0,n.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,n.jsx)(eB,{entries:i,entriesBySource:l,projectName:t,sessionId:s})})]})]})}],36406)},5780,function(e){e.n(e.i(36406))}]);
|