purplemux 0.3.1 → 0.3.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 +47 -47
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +7 -7
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06an6au._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02f5zis._.js → [root-of-the-server]__08dxtof._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08z3drz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__11uqzxt._.js → [root-of-the-server]__0kumyrr._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s7k1je._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_13qovxu._.js → _0.stp0n._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_11h746h._.js → _00cx0p2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_02rms4q._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0uwytsj._.js → _078y4dk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0uph6rf._.js → _0kzht5v._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0pg-q18._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0r90z3l._.js +8 -0
- package/.next/standalone/.next/server/chunks/ssr/_0w.1ts8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0w6jc9p._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0z6yp7a._.js → _0y_feze._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0v2czf2._.js → _10dec5o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{messages_01~7za1._.js → messages_0f3u1ly._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{messages_10_yt3k._.js → messages_0k204ao._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0t5csgq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_use-intl_dist_esm_production_react_0bnxcps.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_00nri37._.js → src_components_05-kki3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_0jrgsp7._.js → src_components_0fb83uz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_0mhu5-5._.js → src_components_0gkfyrc._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_0~e6p9k._.js → src_components_0n3s0.7._.js} +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +47 -47
- package/.next/standalone/.next/server/pages/_app/build-manifest.json +5 -5
- package/.next/standalone/.next/server/pages/_app/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/_app.js +2 -2
- package/.next/standalone/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/_document.js +3 -3
- package/.next/standalone/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/_error/build-manifest.json +3 -3
- package/.next/standalone/.next/server/pages/_error/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/_error.js +4 -4
- package/.next/standalone/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/de/404.html +1 -1
- package/.next/standalone/.next/server/pages/de/500.html +1 -1
- package/.next/standalone/.next/server/pages/en/404.html +1 -1
- package/.next/standalone/.next/server/pages/en/500.html +1 -1
- package/.next/standalone/.next/server/pages/es/404.html +1 -1
- package/.next/standalone/.next/server/pages/es/500.html +1 -1
- package/.next/standalone/.next/server/pages/fr/404.html +1 -1
- package/.next/standalone/.next/server/pages/fr/500.html +1 -1
- package/.next/standalone/.next/server/pages/index/build-manifest.json +6 -6
- package/.next/standalone/.next/server/pages/index/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/index.js +5 -5
- package/.next/standalone/.next/server/pages/index.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/ja/404.html +1 -1
- package/.next/standalone/.next/server/pages/ja/500.html +1 -1
- package/.next/standalone/.next/server/pages/ko/404.html +1 -1
- package/.next/standalone/.next/server/pages/ko/500.html +1 -1
- package/.next/standalone/.next/server/pages/login/build-manifest.json +4 -4
- package/.next/standalone/.next/server/pages/login/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/login.js +4 -4
- package/.next/standalone/.next/server/pages/login.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/pt-BR/404.html +1 -1
- package/.next/standalone/.next/server/pages/pt-BR/500.html +1 -1
- package/.next/standalone/.next/server/pages/reports/build-manifest.json +6 -6
- package/.next/standalone/.next/server/pages/reports/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/reports.js +5 -5
- package/.next/standalone/.next/server/pages/reports.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/reset/build-manifest.json +4 -4
- package/.next/standalone/.next/server/pages/reset/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/reset.js +5 -5
- package/.next/standalone/.next/server/pages/reset.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/ru/404.html +1 -1
- package/.next/standalone/.next/server/pages/ru/500.html +1 -1
- package/.next/standalone/.next/server/pages/stats/build-manifest.json +6 -6
- package/.next/standalone/.next/server/pages/stats/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/stats.js +5 -5
- package/.next/standalone/.next/server/pages/stats.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/tools-required/build-manifest.json +4 -4
- package/.next/standalone/.next/server/pages/tools-required/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/tools-required.js +5 -5
- package/.next/standalone/.next/server/pages/tools-required.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/tr/404.html +1 -1
- package/.next/standalone/.next/server/pages/tr/500.html +1 -1
- package/.next/standalone/.next/server/pages/webview/build-manifest.json +6 -6
- package/.next/standalone/.next/server/pages/webview/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/webview.js +5 -5
- package/.next/standalone/.next/server/pages/webview.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/zh-CN/404.html +1 -1
- package/.next/standalone/.next/server/pages/zh-CN/500.html +1 -1
- package/.next/standalone/.next/server/pages/zh-TW/404.html +1 -1
- package/.next/standalone/.next/server/pages/zh-TW/500.html +1 -1
- package/.next/standalone/.next/static/chunks/{0~23in~aqup16.js → 0176ysv-agwwx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0icark0o3b_6j.js → 03s5e91.zrsi_.js} +4 -4
- package/.next/standalone/.next/static/chunks/{0rmatoyiks~hz.js → 05zk.ks4roh-4.js} +6 -6
- package/.next/standalone/.next/static/chunks/{14_wa..vd6~2y.js → 0984g4~der6-4.js} +2 -2
- package/.next/standalone/.next/static/chunks/{016ho28abx9rt.js → 0_psc1~qmka.m.js} +4 -4
- package/.next/standalone/.next/static/chunks/{0tiyhrw_x-gl6.js → 0ap~c~__qw2_0.js} +6 -6
- package/.next/standalone/.next/static/chunks/0cir.n19rqu--.js +8 -0
- package/.next/standalone/.next/static/chunks/0euxle0n3zjm3.js +1 -0
- package/.next/standalone/.next/static/chunks/0fax5v7rwhm7g.js +6 -0
- package/.next/standalone/.next/static/chunks/{0tas57q8obfk5.js → 0kep81gqgj5f5.js} +6 -6
- package/.next/standalone/.next/static/chunks/0kriln8d9.mdo.js +1 -0
- package/.next/standalone/.next/static/chunks/{0n151-2s40k0u.js → 0l.88yoxq6tq8.js} +6 -6
- package/.next/standalone/.next/static/chunks/{0ea-k_kbq5gi1.js → 0n7jmg60eqx1a.js} +1 -1
- package/.next/standalone/.next/static/chunks/0wu-q.gmu-64d.js +5 -0
- package/.next/standalone/.next/static/chunks/{00l132mp04ubq.js → 0xfp8sfehtui9.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0d5f43qfndq3j.js → 12f3vk2rnkb8u.js} +5 -5
- package/.next/standalone/.next/static/chunks/14vposxx99rq4.js +1 -0
- package/.next/standalone/.next/static/chunks/{0nr5ul7mf1bo7.js → 179vwj~zm1gya.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0pmncak0.t.kh.js → turbopack-0.6hkxuraykc4.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-05.ehb143ourd.js → turbopack-0g2bivvnd2gyd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0ji23rzquaykn.js → turbopack-0heaqdupr4xj6.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0iut_-96gi_mf.js → turbopack-0jcfxeuy1ge85.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0j8i.~gybpblu.js → turbopack-0rntg0~hh7h.0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-11zge3dxjjxf~.js → turbopack-0sk1uk-fkcqdx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-11utvoktq4lmr.js → turbopack-0w89gj59tho~b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-04t3309-jsj3y.js → turbopack-0~gn911-6yqk2.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-06t563i9s945k.js → turbopack-14fnzd5yh28gy.js} +1 -1
- package/.next/standalone/.next/static/{uKYyYLvzxwDsQU-gGPKuh → pZhcwQ83aP87HDTIzzyJ6}/_buildManifest.js +8 -8
- package/.next/standalone/.next/static/{uKYyYLvzxwDsQU-gGPKuh → pZhcwQ83aP87HDTIzzyJ6}/_clientMiddlewareManifest.js +1 -1
- package/.next/standalone/package.json +6 -5
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/config/tmux.conf +11 -3
- package/dist/server.js +6 -5
- package/package.json +6 -5
- package/src/config/tmux.conf +11 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y7-o~r._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_08ytq3p._.js +0 -8
- package/.next/standalone/.next/static/chunks/00yfl7agnve...js +0 -5
- package/.next/standalone/.next/static/chunks/0ff6a07hvp4pu.js +0 -6
- package/.next/standalone/.next/static/chunks/0igpvbu84cx5u.js +0 -1
- package/.next/standalone/.next/static/chunks/0vd9lnyxn~kql.js +0 -1
- package/.next/standalone/.next/static/chunks/11.ybdv0u2ho6.js +0 -1
- package/.next/standalone/.next/static/chunks/14cccdp9z2qvf.js +0 -8
- /package/.next/standalone/.next/static/{uKYyYLvzxwDsQU-gGPKuh → pZhcwQ83aP87HDTIzzyJ6}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399267,e=>{"use strict";var t=e.i(505888);let a={terminalConnected:!1,agentProcess:null,agentProcessCheckedAt:0,agentInstalled:!0,sessionView:"session-list",cliState:"inactive",isTimelineLoading:!0,workspaceId:""},n=(e,t,a)=>{let n=e[t];return n?{...e,[t]:{...n,...a}}:e},s=(e,t)=>null!=t&&"inactive"!==t&&"unknown"!==t&&"cancelled"!==t&&"check"===e?"timeline":e,i=(e,t)=>t.agentProviderId||"terminal"!==e.panelType||!0!==e.agentProcess?{}:{agentProviderId:e.agentProviderId,agentSessionId:e.agentSessionId},r=(0,t.create)(e=>({tabs:{},tabOrders:{},statusWsConnected:!1,initTab:(t,n)=>e(e=>{let s=e.tabs[t],i={...a,...s,...n};return s?.cliState==="ready-for-review"&&"ready-for-review"!==i.cliState&&(i.cliState="ready-for-review",i.readyForReviewAt=s.readyForReviewAt),{tabs:{...e.tabs,[t]:i}}}),removeTab:t=>e(e=>{let{[t]:a,...n}=e.tabs;return{tabs:n}}),setTerminalConnected:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.terminalConnected!==a?{tabs:n(e.tabs,t,{terminalConnected:a})}:e}),setAgentProcess:(t,a,s)=>e(e=>{let i=e.tabs[t];if(!i||i.agentProcessCheckedAt>s)return e;let r={agentProcess:a,agentProcessCheckedAt:s};return(!0===a&&("check"===i.sessionView||"session-list"===i.sessionView)&&(r.sessionView="timeline"),!1===a&&!0===i.agentProcess&&"timeline"===i.sessionView&&(r.sessionView="session-list"),i.agentProcess===a&&i.agentProcessCheckedAt===s&&void 0===r.sessionView)?e:{tabs:n(e.tabs,t,r)}}),setAgentInstalled:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.agentInstalled!==a?{tabs:n(e.tabs,t,{agentInstalled:a})}:e}),setSessionView:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.sessionView!==a?{tabs:n(e.tabs,t,{sessionView:a})}:e}),setTimelineLoading:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.isTimelineLoading!==a?{tabs:n(e.tabs,t,{isTimelineLoading:a})}:e}),setSessionMetaCache:(t,a)=>e(e=>{let s=e.tabs[t];if(!s)return e;let i=s.sessionMetaCache;return i&&i.sessionId===a.sessionId&&i.jsonlPath===a.jsonlPath&&i.meta===a.meta?e:{tabs:n(e.tabs,t,{sessionMetaCache:a})}}),cancelTab:t=>e(e=>{let a=e.tabs[t];return a&&"cancelled"!==a.cliState?{tabs:n(e.tabs,t,{cliState:"cancelled",localUpdatedAt:Date.now()})}:e}),dismissTab:t=>e(e=>{let a=e.tabs[t];return a&&"ready-for-review"===a.cliState?{tabs:n(e.tabs,t,{cliState:"idle",dismissedAt:Date.now()})}:e}),setWorkspaceId:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.workspaceId!==a?{tabs:n(e.tabs,t,{workspaceId:a})}:e}),setPanelType:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.panelType!==a?{tabs:n(e.tabs,t,{panelType:a})}:e}),setCurrentProcess:(t,a)=>e(e=>{let s=e.tabs[t];if(!s)return e;let i=a??void 0;return s.currentProcess===i?e:{tabs:n(e.tabs,t,{currentProcess:i,localUpdatedAt:Date.now()})}}),setDetectedAgent:(t,a)=>e(e=>{let s=e.tabs[t],i=a.checkedAt??Date.now();if(!s||s.agentProcessCheckedAt>i)return e;let r={agentProcess:a.running,agentProcessCheckedAt:i};return a.running?(a.providerId&&(r.agentProviderId=a.providerId),void 0!==a.sessionId&&(r.agentSessionId=a.sessionId),("check"===s.sessionView||"session-list"===s.sessionView)&&(r.sessionView="timeline")):"terminal"===s.panelType?(r.agentProviderId=void 0,r.agentSessionId=null,!0===s.agentProcess&&"timeline"===s.sessionView&&(r.sessionView="session-list")):"timeline"===s.sessionView&&(!0===s.agentProcess||s.agentSessionId&&!s.isTimelineLoading)&&(r.sessionView="session-list"),{tabs:n(e.tabs,t,r)}}),setTabOrder:(t,a)=>e(e=>{let n=e.tabOrders[t];return n&&n.length===a.length&&n.every((e,t)=>e===a[t])?e:{tabOrders:{...e.tabOrders,[t]:a}}}),setStatusWsConnected:t=>e({statusWsConnected:t}),syncAllFromServer:t=>e(e=>{let n=Date.now(),r={};for(let[l,o]of Object.entries(t)){let t=e.tabs[l];if(t?.cliState==="cancelled"){r[l]=t;continue}t?.localUpdatedAt&&n-t.localUpdatedAt<3e4?r[l]={...t,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,...i(t,o),agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(t.sessionView,o.cliState)}:t?r[l]={...t,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,panelType:o.panelType??t.panelType,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,currentProcess:o.currentProcess,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,...i(t,o),agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(t.sessionView,o.cliState)}:r[l]={...a,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,panelType:o.panelType,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,currentProcess:o.currentProcess,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(a.sessionView,o.cliState)}}for(let[t,a]of Object.entries(e.tabs))r[t]||(r[t]=a);return{tabs:r}}),updateFromServer:(t,r)=>e(e=>{if(null===r.cliState){let{[t]:a,...n}=e.tabs;return{tabs:n}}let l=e.tabs[t];if(l){if("cancelled"===l.cliState)return e;let a=void 0!==r.eventSeq&&void 0!==l.eventSeq&&r.eventSeq<l.eventSeq,o=void 0!==r.eventSeq&&(void 0===l.eventSeq||r.eventSeq>=l.eventSeq)?{lastEvent:r.lastEvent,eventSeq:r.eventSeq}:{},c=a?{cliState:l.cliState,readyForReviewAt:l.readyForReviewAt,busySince:l.busySince,dismissedAt:l.dismissedAt}:{cliState:r.cliState,readyForReviewAt:r.readyForReviewAt,busySince:r.busySince,dismissedAt:r.dismissedAt};return{tabs:n(e.tabs,t,{...c,workspaceId:r.workspaceId,tabName:r.tabName,panelType:r.panelType??l.panelType,terminalStatus:r.terminalStatus,listeningPorts:r.listeningPorts,currentProcess:r.currentProcess,agentProviderId:r.agentProviderId,agentSessionId:r.agentSessionId,...i(l,r),agentSummary:r.agentSummary,lastUserMessage:r.lastUserMessage,lastAssistantMessage:r.lastAssistantMessage,currentAction:r.currentAction,compactingSince:r.compactingSince,permissionRequest:r.permissionRequest,sessionView:s(l.sessionView,r.cliState),...o})}}return{tabs:{...e.tabs,[t]:{...a,cliState:r.cliState,workspaceId:r.workspaceId,tabName:r.tabName,panelType:r.panelType,terminalStatus:r.terminalStatus,listeningPorts:r.listeningPorts,currentProcess:r.currentProcess,agentProviderId:r.agentProviderId,agentSessionId:r.agentSessionId,agentSummary:r.agentSummary,lastUserMessage:r.lastUserMessage,lastAssistantMessage:r.lastAssistantMessage,readyForReviewAt:r.readyForReviewAt,busySince:r.busySince,dismissedAt:r.dismissedAt,compactingSince:r.compactingSince,permissionRequest:r.permissionRequest,lastEvent:r.lastEvent,eventSeq:r.eventSeq,sessionView:s(a.sessionView,r.cliState)}}}}),applyHookEvent:(t,a)=>e(e=>{let s=e.tabs[t];if(!s||void 0!==s.eventSeq&&a.seq<=s.eventSeq)return e;let i=((e,t)=>{if(!e||"cancelled"===t)return t;switch(e.name){case"session-start":case"interrupt":return"idle";case"prompt-submit":return"busy";case"notification":return"needs-input";case"stop":return"ready-for-review"}})(a,s.cliState);return{tabs:n(e.tabs,t,{cliState:i,lastEvent:a,eventSeq:a.seq,readyForReviewAt:"ready-for-review"===i?Date.now():null,busySince:"busy"===i?Date.now():null,dismissedAt:"busy"===i?null:s.dismissedAt,permissionRequest:"needs-input"===s.cliState&&"needs-input"!==i?null:s.permissionRequest})}})}));e.s(["default",0,r,"getInitialTabStateFromLayoutTab",0,e=>{let t={panelType:e.panelType},a=e.agentState?.providerId??("codex-cli"===e.panelType?"codex":"claude-code"===e.panelType?"claude":void 0),n=e.agentState?.sessionId??e.claudeSessionId??null;return a&&(t.agentProviderId=a),n&&(t.agentSessionId=n,t.agentSummary=e.agentState?.summary??e.claudeSummary??null,t.sessionView="timeline"),t},"isCliIdle",0,e=>"idle"===e||"ready-for-review"===e,"selectGlobalStatus",0,e=>{let t=0,a=0;for(let n of Object.values(e))"busy"===n.cliState?t++:("ready-for-review"===n.cliState||"needs-input"===n.cliState)&&a++;return{busyCount:t,attentionCount:a}},"selectSessionView",0,(e,t)=>{let a=e[t];return a?a.sessionView:"session-list"},"selectTabDisplayStatus",0,(e,t)=>{let a=e[t];return a&&"inactive"!==a.cliState?"busy"===a.cliState?"busy":"ready-for-review"===a.cliState?"ready-for-review":"needs-input"===a.cliState?"needs-input":"unknown"===a.cliState?"unknown":"idle":"idle"},"selectWorkspacePortsLabel",0,(e,t)=>{let a=new Set;for(let n of Object.values(e))if(n.workspaceId===t&&n.listeningPorts)for(let e of n.listeningPorts)a.add(e);return 0===a.size?"":":"+[...a].sort((e,t)=>e-t).join(", :")}],399267)},117653,e=>{"use strict";var t=e.i(191788);let a=(e,t)=>{let a=e instanceof Map?e:new Map(e.entries()),n=t instanceof Map?t:new Map(t.entries());if(a.size!==n.size)return!1;for(let[e,t]of a)if(!n.has(e)||!Object.is(t,n.get(e)))return!1;return!0};e.s(["useShallow",0,function(e){let n=t.default.useRef(void 0);return t=>{let s=e(t);return!function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Symbol.iterator in e&&Symbol.iterator in t){if("entries"in e&&"entries"in t)return a(e,t);let n=e[Symbol.iterator](),s=t[Symbol.iterator](),i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done}return a({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}(n.current,s)?n.current=s:n.current}}],117653)},358915,e=>{"use strict";var t=e.i(191788),a=e.i(679935),n=e.i(844044),s=e.i(399267);let i=new Set(["/new","/clear"]),r=e=>`pt-input-draft:${e}`,l=e=>{try{localStorage.removeItem(r(e))}catch{}};e.s(["clearInputDraft",0,l,"default",0,(e,o,c,d)=>{let u=d?.tabId,[p,f]=(0,t.useState)(()=>u?(e=>{try{return localStorage.getItem(r(e))??""}catch{return""}})(u):""),b=(0,t.useRef)(null),m=(0,t.useMemo)(()=>(0,s.isCliIdle)(e)||"unknown"===e?"input":"busy"===e||"needs-input"===e?"interrupt":"disabled",[e]),y=d?.onRestartSession,S=d?.onMessageSent,g=d?.submitDelayMs??250,h=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(u)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>((e,t)=>{try{t?localStorage.setItem(r(e),t):localStorage.removeItem(r(e))}catch{}})(u,p),300),()=>{h.current&&clearTimeout(h.current)}},[u,p]);let v=(0,t.useCallback)(()=>{if("disabled"===m)return void a.toast.error(d?.disabledMessage??(0,n.t)("terminal","inputDisabledPlaceholder"));if(!c)return void a.toast.error((0,n.t)("connection","terminalDisconnected"));if(""!==p.trim()){if(i.has(p.trim().toLowerCase())){y?.(),f(""),u&&l(u);return}p.includes("\n")?o(`\x1b[200~${p}\x1b[201~`):o(p),setTimeout(()=>o("\r"),g),p.trim().startsWith("/")||S?.(p.trim()),f(""),u&&l(u)}},[m,p,o,c,y,S,u,d?.disabledMessage,g]),I=(0,t.useCallback)(()=>{c?o("\x1b\x1b"):a.toast.error((0,n.t)("connection","terminalDisconnected"))},[o,c]),w=(0,t.useCallback)(()=>{let e=b.current;if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)},[]),T="disabled"!==m&&c;return{value:p,setValue:f,mode:m,canSend:T,send:v,interrupt:I,textareaRef:b,focusInput:w}}])},898589,e=>{"use strict";let t=e=>"web-browser"===e?"Web Browser":"";e.s(["resolveTabNameForPanelTypeChange",0,(e,a,n)=>{let s=t(a),i="agent-sessions"===a?"Session List":"",r=t(n),l=e.trim();return!l&&r||(""!==s&&l===s||""!==i&&l===i)&&l!==r?r:e}])},806185,e=>{"use strict";let t=e=>"pane"===e.type?[e]:[...t(e.children[0]),...t(e.children[1])],a=(e,t)=>"pane"===e.type?e.id===t?e:null:a(e.children[0],t)||a(e.children[1],t),n=e=>"pane"===e.type?e.id:n(e.children[0]),s=e=>"pane"===e.type?e.id:s(e.children[1]),i=(e,t)=>{if("pane"===e.type)return null;let[a,n]=e.children;if("pane"===a.type&&a.id===t)return n;if("pane"===n.type&&n.id===t)return a;let s=i(a,t);if(s)return{...e,children:[s,n]};let r=i(n,t);return r?{...e,children:[a,r]}:null},r=(e,t)=>{if("pane"===e.type)return null;let[a,i]=e.children;return"pane"===a.type&&a.id===t?n(i):"pane"===i.type&&i.id===t?s(a):r(a,t)||r(i,t)},l=(e,t,a)=>{if("split"!==e.type)return e;if(0===t.length)return{...e,ratio:a};let[n,...s]=t,i=[e.children[0],e.children[1]];return i[n]=l(e.children[n],s,a),{...e,children:i}},o=(e,t)=>"pane"===e.type||e.orientation!==t?1:o(e.children[0],t)+o(e.children[1],t),c=e=>{if("pane"===e.type)return e;let t=o(e.children[0],e.orientation),a=Math.round(t/(t+o(e.children[1],e.orientation))*1e4)/100;return{...e,ratio:a,children:[c(e.children[0]),c(e.children[1])]}},d=(e,t,a)=>{if("pane"===e.type)return e.id===t?a(e):e;let n=d(e.children[0],t,a);if(n!==e.children[0])return{...e,children:[n,e.children[1]]};let s=d(e.children[1],t,a);return s!==e.children[1]?{...e,children:[e.children[0],s]}:e};e.s(["collectAllTabs",0,e=>t(e).flatMap(e=>e.tabs),"collectPanes",0,t,"equalizeNode",0,c,"findAdjacentPaneInDirection",0,(e,t,a)=>{let i=[],r=e=>{if("pane"===e.type)return e.id===t;for(let t=0;t<2;t++){if(i.push({node:e,childIndex:t}),r(e.children[t]))return!0;i.pop()}return!1};if(!r(e))return null;let l="left"===a||"right"===a?"horizontal":"vertical",o=+("left"===a||"up"===a);for(let e=i.length-1;e>=0;e--){let{node:t,childIndex:r}=i[e];if("split"===t.type&&t.orientation===l&&r===o){let e=t.children[1-o];return"left"===a||"up"===a?s(e):n(e)}}return null},"findPane",0,a,"findResizeTarget",0,(e,t,a)=>{let n=[],s=e=>{if("pane"===e.type)return e.id===t;for(let t=0;t<2;t++){if(n.push({node:e,childIndex:t}),s(e.children[t]))return!0;n.pop()}return!1};if(!s(e))return null;let i="left"===a||"right"===a?"horizontal":"vertical",r=+("right"!==a&&"down"!==a),l="right"===a||"down"===a;for(let e=n.length-1;e>=0;e--){let{node:t,childIndex:a}=n[e];if("split"===t.type&&t.orientation===i&&a===r)return{path:n.slice(0,e).map(e=>e.childIndex),currentRatio:t.ratio,increase:l}}return null},"getFirstPaneId",0,n,"removePaneWithFocus",0,(e,a)=>{let n=r(e.root,a),s=i(e.root,a);s&&(e.root=s),e.activePaneId===a&&(e.activePaneId=n??t(e.root)[0]?.id??null)},"updatePaneInTree",0,d,"updateRatioAtPath",0,l])},335288,e=>{"use strict";e.s(["default",()=>L,"navigateToTab",()=>E,"navigateToTabOrCreate",()=>F,"useLayoutStore",()=>O]);var t=e.i(191788),a=e.i(203828),n=e.i(505888),s=e.i(117653),i=e.i(679935),r=e.i(844044),l=e.i(358915),o=e.i(399267),c=e.i(490034),d=e.i(453783),u=e.i(898589),p=e.i(806185);let f="pt-active-pane-",b="pt-active-tab-",m="pt-terminal-ratio-",y="pt-terminal-collapsed-",S=e=>{try{return sessionStorage.getItem(`${b}${e}`)}catch{return null}},g=e=>{try{let t=sessionStorage.getItem(`${m}${e}`);if(null==t)return null;let a=Number(t);return Number.isFinite(a)?a:null}catch{return null}},h=e=>{try{let t=sessionStorage.getItem(`${y}${e}`);if(null==t)return null;return"1"===t}catch{return null}},v=null,I=null,w=null,T=!1,P=new Map,k=(e,t)=>{if(!t)return e;let a=e.includes("?")?"&":"?";return`${e}${a}workspace=${t}`},A=(e,t)=>{let a=e?(0,p.collectPanes)(e.root).length:0;return{paneCount:a,canSplit:a<10&&!t}},C=(e,t,a)=>{e({layout:a,...A(a,t().isSplitting)})},$=(e,t,a)=>{let n=t().layout;if(n){let e=(0,p.collectPanes)(a.root);for(let t of(n.activePaneId&&e.some(e=>e.id===n.activePaneId)&&(a.activePaneId=n.activePaneId),e)){let e=(0,p.findPane)(n.root,t.id);e?.activeTabId&&t.tabs.some(t=>t.id===e.activeTabId)&&(t.activeTabId=e.activeTabId)}}e({layout:a,...A(a,t().isSplitting)})},q=(e,t,a,n)=>{let{layout:s}=t();if(!s)return;let i=(0,p.updatePaneInTree)(s.root,a,n);i!==s.root&&C(e,t,{...s,root:i})},R=async(e,t)=>{try{let a=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)return null;return await a.json()}catch{return null}},O=(0,n.create)((e,t)=>({layout:null,isLoading:!0,error:null,isSplitting:!1,workspaceId:null,retryCount:0,paneCount:0,canSplit:!1,pendingFocusTabId:null,setWorkspaceId:t=>{T=!1,e({workspaceId:t})},setLayout:a=>{C(e,t,a)},fetchLayout:async(a,n)=>{if(T)return;let s=a??t().workspaceId;if(!s)return;v?.abort();let l=new AbortController;v=l,t().layout||e({isLoading:!0,error:null});try{let a=await fetch(k("/api/layout",s),{signal:l.signal});if(!a.ok)throw Error();let i=await a.json();if(l.signal.aborted)return;let r=t().layout;if(!1!==n){let e=(0,p.collectPanes)(i.root);if(r)for(let t of(r.activePaneId&&e.some(e=>e.id===r.activePaneId)&&(i.activePaneId=r.activePaneId),e)){let e=(0,p.findPane)(r.root,t.id);e?.activeTabId&&t.tabs.some(t=>t.id===e.activeTabId)&&(t.activeTabId=e.activeTabId)}else{let t=(e=>{try{return sessionStorage.getItem(`${f}${e}`)}catch{return null}})(s);for(let a of(t&&e.some(e=>e.id===t)&&(i.activePaneId=t),e)){let e=S(a.id);for(let t of(e&&a.tabs.some(t=>t.id===e)&&(a.activeTabId=e),a.tabs)){let e=g(t.id);null!==e&&(t.terminalRatio=e);let a=h(t.id);null!==a&&(t.terminalCollapsed=a)}}}}if(r){let a={root:r.root,activePaneId:r.activePaneId},n={root:i.root,activePaneId:i.activePaneId};if(JSON.stringify(a)===JSON.stringify(n)){let a=t().pendingFocusTabId;a&&(e({pendingFocusTabId:null}),t().focusTab(a));return}}let o=t().pendingFocusTabId,c=null;if(o){for(let t of(e({pendingFocusTabId:null}),(0,p.collectPanes)(i.root)))if(t.tabs.some(e=>e.id===o)){i.activePaneId=t.id,t.activeTabId=o,c=t.id;break}}e({layout:i,retryCount:0,...A(i,t().isSplitting)}),c&&(R(k("/api/layout",s),{activePaneId:c}),R(k(`/api/layout/pane/${c}`,s),{activeTabId:o}))}catch(n){if(n instanceof DOMException&&"AbortError"===n.name)return;let a=t().retryCount+1;if(e({retryCount:a}),a>=3)try{let a=await fetch(k("/api/layout/pane",s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){let{paneId:n,tab:s}=await a.json(),l={root:{type:"pane",id:n,tabs:[s],activeTabId:s.id},activePaneId:n,updatedAt:new Date().toISOString()};e({layout:l,...A(l,t().isSplitting)}),i.toast.info((0,r.t)("terminal","fallbackLayout")),e({retryCount:0});return}}catch{}e({error:(0,r.t)("terminal","layoutFetchError")}),I?.()}finally{l.signal.aborted||e({isLoading:!1})}},splitPane:async(a,n)=>{let{layout:s,isSplitting:l,workspaceId:o}=t();if(s&&!l&&!((0,p.collectPanes)(s.root).length>=10)){e({isSplitting:!0,canSplit:!1});try{let i,r,l=(0,p.findPane)(s.root,a),c=l?.tabs.find(e=>e.id===l.activeTabId);if(c){r=c.panelType;try{let e=await fetch(k(`/api/layout/cwd?session=${c.sessionName}`,o));e.ok&&(i=(await e.json()).cwd)}catch{}}let d=await fetch(k("/api/layout/pane",o),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourcePaneId:a,orientation:n,cwd:i,panelType:r})});if(!d.ok)throw Error();let u=await d.json();C(e,t,u)}catch{i.toast.error((0,r.t)("terminal","splitFailed"))}finally{e(e=>({isSplitting:!1,canSplit:e.paneCount<10}))}}},closePane:async a=>{let{layout:n,workspaceId:s}=t();if(n&&!((0,p.collectPanes)(n.root).length<=1))try{let n=await fetch(k(`/api/layout/pane/${a}`,s),{method:"DELETE"});if(!n.ok)throw Error();let i=await n.json();C(e,t,i)}catch{i.toast.error("Pane을 닫을 수 없습니다")}},focusPane:a=>{let{layout:n,workspaceId:s}=t();n&&n.activePaneId!==a&&(e({layout:{...n,activePaneId:a}}),R(k("/api/layout",s),{activePaneId:a}).then(a=>{a&&$(e,t,a)}))},updateRatio:(a,n)=>{let{layout:s,workspaceId:i}=t();s&&(e({layout:{...s,root:(0,p.updateRatioAtPath)(s.root,a,n)}}),w&&clearTimeout(w),w=setTimeout(()=>{w=null,R(k("/api/layout",i),{ratioUpdate:{path:a,ratio:n}}).then(a=>{a&&$(e,t,a)})},300))},moveTab:(a,n,s,i)=>{if(n===s)return;let{layout:r,workspaceId:l}=t();if(!r)return;let o=JSON.parse(JSON.stringify(r)),c=(0,p.findPane)(o.root,n),d=(0,p.findPane)(o.root,s);if(c&&d){let r=c.tabs.findIndex(e=>e.id===a);if(-1!==r){let[l]=c.tabs.splice(r,1);c.activeTabId===a&&(c.activeTabId=c.tabs[0]?.id??null),c.tabs.forEach((e,t)=>{e.order=t}),d.tabs.splice(i,0,l),d.tabs.forEach((e,t)=>{e.order=t}),d.activeTabId=a,0===c.tabs.length&&(0,p.collectPanes)(o.root).length>1&&(0,p.removePaneWithFocus)(o,n),o.activePaneId=s,C(e,t,o)}}fetch(k(`/api/layout/pane/${n}/tabs/${a}/move`,l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toPaneId:s,toIndex:i})}).then(async a=>{a.ok?$(e,t,await a.json()):await t().fetchLayout(void 0,!1)}).catch(()=>t().fetchLayout(void 0,!1))},createTabInPane:async(a,n,s,l)=>{let{layout:c,workspaceId:u}=t();try{let i,r=n,f=c?(0,p.findPane)(c.root,a):void 0,b=f?.tabs.find(e=>e.id===f.activeTabId);!r&&b&&(r=b.panelType),"web-browser"!==r&&b&&(i=d.default.getState().metadata[b.id]?.cwd);let m=await fetch(k(`/api/layout/pane/${a}/tabs`,u),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:i,panelType:r,command:s,resumeSessionId:l})});if(!m.ok)throw Error();let y=await m.json();return(s||l)&&o.default.getState().initTab(y.id,{panelType:r,sessionView:"check"}),q(e,t,a,e=>({...e,tabs:[...e.tabs,y],activeTabId:y.id})),t().fetchLayout(),y}catch{return i.toast.error((0,r.t)("terminal","tabCreateFailed")),null}},deleteTabInPane:async(a,n)=>{(0,l.clearInputDraft)(n),o.default.getState().cancelTab(n),q(e,t,a,e=>{let t=[...e.tabs].sort((e,t)=>e.order-t.order),a=t.findIndex(e=>e.id===n),s=t.filter(e=>e.id!==n);s.forEach((e,t)=>{e.order=t});let i=e.activeTabId;if(e.activeTabId===n){let e=t[a+1]||t[a-1];i=e?.id??null}return{...e,tabs:s,activeTabId:i}});let{workspaceId:s}=t();try{let e=await fetch(k(`/api/layout/pane/${a}/tabs/${n}`,s),{method:"DELETE"});e.ok||404===e.status||(i.toast.error((0,r.t)("terminal","tabDeleteError")),await t().fetchLayout())}catch{i.toast.error((0,r.t)("terminal","tabDeleteError")),await t().fetchLayout()}},restartTabInPane:async(e,a,n)=>{let{workspaceId:s}=t();try{return(await fetch(k(`/api/layout/pane/${e}/tabs/${a}`,s),{method:"POST",headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify({command:n}):void 0})).ok}catch{return i.toast.error((0,r.t)("terminal","sessionRestartFailed")),!1}},switchTabInPane:(a,n)=>{q(e,t,a,e=>({...e,activeTabId:n}));let{workspaceId:s}=t();R(k(`/api/layout/pane/${a}`,s),{activeTabId:n}).then(a=>{a&&$(e,t,a)})},renameTabInPane:async(a,n,s)=>{q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>e.id===n?{...e,name:s}:e)}));let{workspaceId:l}=t(),o=await R(k(`/api/layout/pane/${a}/tabs/${n}`,l),{name:s});o?$(e,t,o):i.toast.error((0,r.t)("terminal","tabRenameFailed"))},reorderTabsInPane:(a,n)=>{q(e,t,a,e=>{let t=new Map(e.tabs.map(e=>[e.id,e])),a=n.map((e,a)=>{let n=t.get(e);return n?{...n,order:a}:null}).filter(e=>null!==e);return{...e,tabs:a}});let{workspaceId:s}=t();R(k(`/api/layout/pane/${a}/tabs/order`,s),{tabIds:n}).then(a=>{a&&$(e,t,a)})},removeTabLocally:(e,a)=>{(0,l.clearInputDraft)(a);let{workspaceId:n}=t();fetch(k(`/api/layout/pane/${e}/tabs/${a}`,n),{method:"DELETE"}).then(()=>t().fetchLayout()).catch(()=>{console.log("[layout] removeTabLocally failed")})},equalizeRatios:()=>{let{workspaceId:a}=t();R(k("/api/layout",a),{equalize:!0}).then(a=>{a&&$(e,t,a)})},updateDiffSettings:a=>{let{layout:n,workspaceId:s}=t();n&&(C(e,t,{...n,diffSettings:{...n.diffSettings??{},...a}}),R(k("/api/layout",s),{diffSettings:a}).then(a=>{a&&$(e,t,a)}))},updateTabPanelType:(a,n,s)=>{let i;q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>{if(e.id!==n)return e;let t=(0,u.resolveTabNameForPanelTypeChange)(e.name,e.panelType,s),a={...e,panelType:s,name:t};return t!==e.name&&(i=t),"codex-cli"===s&&"claude-code"===e.panelType&&(a.claudeSessionId=null,a.agentState=void 0),a})})),o.default.getState().setPanelType(n,s);let{workspaceId:r}=t();R(k(`/api/layout/pane/${a}/tabs/${n}`,r),{panelType:s,...void 0!==i?{name:i}:{}}).then(a=>{a&&$(e,t,a)})},updateTabTerminalLayout:(a,n,s)=>{q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>e.id===n?{...e,...s}:e)}));try{void 0!==s.terminalRatio&&sessionStorage.setItem(`${m}${n}`,String(s.terminalRatio)),void 0!==s.terminalCollapsed&&sessionStorage.setItem(`${y}${n}`,s.terminalCollapsed?"1":"0")}catch{}let{workspaceId:i}=t(),r=P.get(n);r&&clearTimeout(r),P.set(n,setTimeout(()=>{P.delete(n),R(k(`/api/layout/pane/${a}/tabs/${n}`,i),s)},300))},clearLayout:()=>{T=!0,v?.abort(),e({layout:null,paneCount:0,canSplit:!1})},focusTab:e=>{let{layout:a}=t();if(!a)return!1;for(let n of(0,p.collectPanes)(a.root))if(n.tabs.some(t=>t.id===e))return t().focusPane(n.id),t().switchTabInPane(n.id,e),!0;return!1},focusPrevTab:()=>{let{layout:e}=t();if(!e)return;let a=(0,p.collectPanes)(e.root),n=a.find(t=>t.id===e.activePaneId);if(!n)return;let s=[...n.tabs].sort((e,t)=>e.order-t.order),i=s.findIndex(e=>e.id===n.activeTabId);if(i>0)t().switchTabInPane(n.id,s[i-1].id);else{let e=a.indexOf(n);if(e>0){let n=a[e-1],s=[...n.tabs].sort((e,t)=>e.order-t.order);t().focusPane(n.id),t().switchTabInPane(n.id,s[s.length-1].id)}}},focusNextTab:()=>{let{layout:e}=t();if(!e)return;let a=(0,p.collectPanes)(e.root),n=a.find(t=>t.id===e.activePaneId);if(!n)return;let s=[...n.tabs].sort((e,t)=>e.order-t.order),i=s.findIndex(e=>e.id===n.activeTabId);if(i<s.length-1)t().switchTabInPane(n.id,s[i+1].id);else{let e=a.indexOf(n);if(e<a.length-1){let n=a[e+1],s=[...n.tabs].sort((e,t)=>e.order-t.order);t().focusPane(n.id),t().switchTabInPane(n.id,s[0].id)}}},focusTabByIndex:e=>{let{layout:a}=t();if(!a?.activePaneId)return;let n=(0,p.collectPanes)(a.root).find(e=>e.id===a.activePaneId);if(!n)return;let s=[...n.tabs].sort((e,t)=>e.order-t.order),i=e>=s.length?s[s.length-1]:s[e];i&&i.id!==n.activeTabId&&t().switchTabInPane(n.id,i.id)}}));O.subscribe((e,t)=>{if(e.layout&&e.workspaceId&&e.layout!==t.layout){var a=e.workspaceId,n=e.layout;try{for(let e of(n.activePaneId&&sessionStorage.setItem(`${f}${a}`,n.activePaneId),(0,p.collectPanes)(n.root)))for(let t of(e.activeTabId&&sessionStorage.setItem(`${b}${e.id}`,e.activeTabId),e.tabs))void 0!==t.terminalRatio&&sessionStorage.setItem(`${m}${t.id}`,String(t.terminalRatio)),void 0!==t.terminalCollapsed&&sessionStorage.setItem(`${y}${t.id}`,t.terminalCollapsed?"1":"0")}catch{}}});let E=(e,t)=>{let n=O.getState();if("/"!==a.default.pathname){O.setState({pendingFocusTabId:t}),c.default.getState().switchWorkspace(e),a.default.push("/");return}e===n.workspaceId?n.focusTab(t):(n.clearLayout(),O.setState({pendingFocusTabId:t}),c.default.getState().switchWorkspace(e))},F=async(e,t,a,n,s,i="claude")=>{let r=c.default.getState(),l="codex"===i?"codex-cli":"claude-code",d=e,u=r.workspaces.find(t=>t.id===e);if(!u){if(!s)return;let e=await r.createWorkspace(s,n,a??void 0,l);if(!e)return;d=e.id;let t=await fetch(k("/api/layout",d));if(!t.ok)return;let i=await t.json(),c=(0,p.collectAllTabs)(i.root)[0];if(!c)return;a&&o.default.getState().initTab(c.id,{panelType:l,sessionView:"check"}),E(d,c.id);return}let f=await fetch(k("/api/layout",d));if(!f.ok)return;let b=await f.json();if(a){let e=(0,p.collectAllTabs)(b.root).find(e=>"codex"===i?e.agentState?.providerId==="codex"&&e.agentState.sessionId===a:e.agentState?.providerId==="claude"?e.agentState.sessionId===a:e.claudeSessionId===a);if(e){o.default.getState().setSessionView(e.id,"timeline"),E(d,e.id);return}}else if((0,p.collectAllTabs)(b.root).find(e=>e.id===t))return void E(d,t);let m=b.activePaneId??(0,p.getFirstPaneId)(b.root),y={panelType:l,cwd:u.directories[0]};a&&(y.resumeSessionId=a);let S=await fetch(k(`/api/layout/pane/${m}/tabs`,d),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!S.ok)return;let g=await S.json();a&&o.default.getState().initTab(g.id,{panelType:l,sessionView:"check"}),d===O.getState().workspaceId?(O.setState({pendingFocusTabId:g.id}),O.getState().fetchLayout()):E(d,g.id)},L=({workspaceId:e,onFetchError:a})=>((0,t.useEffect)(()=>{I=a??null},[a]),(0,t.useEffect)(()=>{if(e){let t=O.getState();t.setWorkspaceId(e),t.fetchLayout(e)}},[e]),(0,t.useEffect)(()=>O.subscribe(e=>{let t=e.workspaceId;if(!t||!e.layout?.root)return;let a=(0,p.collectPanes)(e.layout.root).flatMap(e=>e.tabs.map(e=>e.id));o.default.getState().setTabOrder(t,a)}),[]),O((0,s.useShallow)(e=>({layout:e.layout,isLoading:e.isLoading,error:e.error,isSplitting:e.isSplitting,paneCount:e.paneCount,canSplit:e.canSplit,splitPane:e.splitPane,closePane:e.closePane,focusPane:e.focusPane,updateRatio:e.updateRatio,moveTab:e.moveTab,createTabInPane:e.createTabInPane,deleteTabInPane:e.deleteTabInPane,restartTabInPane:e.restartTabInPane,switchTabInPane:e.switchTabInPane,renameTabInPane:e.renameTabInPane,reorderTabsInPane:e.reorderTabsInPane,removeTabLocally:e.removeTabLocally,equalizeRatios:e.equalizeRatios,updateDiffSettings:e.updateDiffSettings,updateTabPanelType:e.updateTabPanelType,clearLayout:e.clearLayout,fetchLayout:e.fetchLayout,focusTab:e.focusTab,focusPrevTab:e.focusPrevTab,focusNextTab:e.focusNextTab,focusTabByIndex:e.focusTabByIndex}))))},453783,e=>{"use strict";e.s(["default",()=>c]);var t=e.i(505888),a=e.i(335288),n=e.i(806185);let s=null,i=new Map,r=new Map,l=()=>{s&&clearTimeout(s),s=setTimeout(()=>{s=null;let{metadata:e}=o.getState(),t=a.useLayoutStore.getState().layout,i=a.useLayoutStore.getState().workspaceId;if(!t||!i)return;let r=`?workspace=${i}`;for(let a of(0,n.collectPanes)(t.root))for(let t of a.tabs){let n=e[t.id];if(!n)continue;let s={};void 0!==n.title&&n.title!==t.title&&(s.title=n.title),void 0!==n.cwd&&n.cwd!==t.cwd&&(s.cwd=n.cwd),void 0!==n.lastCommand&&(n.lastCommand??null)!==(t.lastCommand??null)&&(s.lastCommand=n.lastCommand??null),Object.keys(s).length>0&&fetch(`/api/layout/pane/${a.id}/tabs/${t.id}${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(e=>{console.log(`[tab-metadata] sync failed: ${e instanceof Error?e.message:e}`)})}},100)},o=(0,t.create)(e=>({metadata:{},setTitle:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.title===a?e:(i.set(t,Date.now()),{metadata:{...e.metadata,[t]:{...n,title:a}}})}),l()},setCwd:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.cwd===a?e:(r.set(t,Date.now()),{metadata:{...e.metadata,[t]:{...n,cwd:a}}})}),l()},setLastCommand:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.lastCommand===a?e:{metadata:{...e.metadata,[t]:{...n,lastCommand:a}}}}),l()},removeTab:t=>{e(e=>{let{[t]:a,...n}=e.metadata;return{metadata:n}}),l()},hydrate:t=>{e(e=>{let a={},n=Date.now();for(let[s,l]of Object.entries(t)){let t=e.metadata[s],o=n-(i.get(s)??0)<1e3,c=n-(r.get(s)??0)<1e3;a[s]={...l,...o&&t?.title!==void 0?{title:t.title}:{},...c&&t?.cwd!==void 0?{cwd:t.cwd}:{}}}return{metadata:a}})},retainOnly:t=>{e(e=>{let a={};for(let n of t)e.metadata[n]&&(a[n]=e.metadata[n]);return{metadata:a}})},reset:()=>{s&&clearTimeout(s),s=null,i.clear(),r.clear(),e({metadata:{}})}})),c=o},15623,e=>{"use strict";let t=(0,e.i(505888).create)(e=>({data:null,setData:t=>e({data:t})}));e.s(["default",0,t])},116962,e=>{"use strict";let t=(0,e.i(505888).create)(e=>({entries:[],syncFromServer:t=>e({entries:t}),upsertEntry:t=>e(e=>{let a=e.entries.findIndex(e=>e.id===t.id);if(a>=0){let n=[...e.entries];return n[a]=t,{entries:n}}return{entries:[t,...e.entries]}})}));e.s(["default",0,t])},237022,e=>{"use strict";var t=e.i(505888);let a={phase:"idle",status:null,branch:null,error:null,lastFetchedAt:null},n=e=>e?e.staged+e.modified+e.untracked:0,s=(0,t.create)((e,t)=>({cwdKey:null,tmuxSession:null,...a,requestSeq:0,resetForTarget:({cwdKey:t,tmuxSession:n})=>{e(e=>e.cwdKey===t?e.tmuxSession===n?e:{tmuxSession:n}:{...a,cwdKey:t,tmuxSession:n,requestSeq:e.requestSeq+1})},fetchForTarget:async({cwdKey:a,tmuxSession:n},s)=>{if(!a||!n)return void t().resetForTarget({cwdKey:null,tmuxSession:null});let i=t(),r=i.cwdKey!==a,l=null!==i.lastFetchedAt&&Date.now()-i.lastFetchedAt<15e3;if(!r&&!s?.force&&l&&"error"!==i.phase){i.tmuxSession!==n&&e({tmuxSession:n});return}let o=i.requestSeq+1;e({cwdKey:a,tmuxSession:n,phase:"loading",status:r?null:i.status,branch:r?null:i.branch,error:null,lastFetchedAt:null,requestSeq:o});try{let a=new URLSearchParams({tmuxSession:n});s?.force&&a.set("force","true");let i=await fetch(`/api/git/status?${a.toString()}`,{cache:"no-store"});if(!i.ok)throw Error(`status-${i.status}`);let r=await i.json();if(t().requestSeq!==o)return;if(!r.status)return void e({phase:"not-git",status:null,branch:null,error:null,lastFetchedAt:Date.now()});let l=null;try{let e=new URLSearchParams({tmuxSession:n});s?.force&&e.set("force","true");let t=await fetch(`/api/git/branch?${e.toString()}`,{cache:"no-store"});t.ok&&(l=(await t.json()).branch)}catch{l=null}if(t().requestSeq!==o)return;e({phase:"ready",status:r.status,branch:l,error:null,lastFetchedAt:Date.now()})}catch(a){if(t().requestSeq!==o)return;e({phase:"error",status:null,branch:null,error:a instanceof Error?a.message:String(a),lastFetchedAt:Date.now()})}}}));e.s(["default",0,s,"formatGitStatusSummary",0,(e,t,a,s)=>{if("idle"===e)return s;if("loading"===e)return"Checking Git status...";if("not-git"===e)return"Not a Git repository";if("error"===e)return"Git status unavailable";if(!a)return s;let i=n(a),r=[t??"Git",i>0?`${i} changed`:"clean"];return(a.insertions>0||a.deletions>0)&&r.push(`+${a.insertions} -${a.deletions}`),a.ahead>0&&r.push(`ahead ${a.ahead}`),a.behind>0&&r.push(`behind ${a.behind}`),a.stash>0&&r.push(`${a.stash} stash`),r.join(" · ")},"getGitStatusIndicators",0,e=>{if(!e)return[];let t=n(e),a=[];return t>0&&a.push({key:"changed",label:t>99?"99+":String(t),tone:"dirty"}),e.ahead>0&&a.push({key:"ahead",label:`↑${e.ahead}`,tone:"sync"}),e.behind>0&&a.push({key:"behind",label:`↓${e.behind}`,tone:"sync"}),e.stash>0&&a.push({key:"stash",label:`S${e.stash}`,tone:"stash"}),a}])},3450,251748,e=>{"use strict";var t=e.i(191788),a=e.i(399267),n=e.i(453783),s=e.i(15623),i=e.i(116962),r=e.i(237022),l=e.i(335288);let o=new Set(["zsh","bash","fish","sh","-zsh","-bash","-fish","-sh"]),c=new Set(["codex","Codex","node"]),d=e=>{if("~"===e||"/"===e)return e;let t=e.replace(/\/$/,"").split("/");return t[t.length-1]||e},u=e=>{let t=e.trim();if(!t)return null;let a=t.indexOf("|");return a>0?t.slice(0,a):null},p=(e,t)=>"codex-cli"===t&&c.has(e)?"Codex":e,f=(e,t)=>{let a=e.trim();if(!a)return"";let n=u(e);if(null!==n){let e=a.slice(a.indexOf("|")+1);return o.has(n)?d(e):p(n,t)}let s=a.match(/@[^:]+:\s*(.*)/);if(s)return d(s[1].trim());if(a.startsWith("/")||a.startsWith("~"))return d(a);let i=a.split(/\s+/)[0];return o.has(i)?"":p(i||"",t)};e.s(["formatTabTitle",0,f,"isShellProcess",0,e=>{let t=u(e);return null!==t&&o.has(t)},"parseCurrentCommand",0,u],251748);var b=e.i(806185);let m=null;e.s(["ackNotificationInput",0,(e,t)=>{m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:ack-notification",tabId:e,seq:t}))},"default",0,()=>{let e=(0,t.useRef)(0),o=(0,t.useRef)(null),c=(0,t.useRef)(!0);(0,t.useEffect)(()=>{c.current=!0;let t=()=>{if(!c.current)return;let d="https:"===location.protocol?"wss:":"ws:",u=new WebSocket(`${d}//${location.host}/api/status`);m=u,u.onopen=()=>{c.current&&(e.current=0,a.default.getState().setStatusWsConnected(!0))},u.onmessage=e=>{if(c.current)try{let t=JSON.parse(e.data);switch(t.type){case"status:sync":for(let[e,s]of(a.default.getState().syncAllFromServer(t.tabs),Object.entries(t.tabs)))"agent-sessions"!==s.panelType&&s.paneTitle&&!n.default.getState().metadata[e]?.title&&n.default.getState().setTitle(e,f(s.paneTitle,s.panelType));break;case"status:update":a.default.getState().updateFromServer(t.tabId,{cliState:t.cliState,workspaceId:t.workspaceId,tabName:t.tabName,panelType:t.panelType,terminalStatus:t.terminalStatus,listeningPorts:t.listeningPorts,currentProcess:t.currentProcess,agentProviderId:t.agentProviderId,agentSessionId:t.agentSessionId,agentSummary:t.agentSummary,lastUserMessage:t.lastUserMessage,lastAssistantMessage:t.lastAssistantMessage,currentAction:t.currentAction,readyForReviewAt:t.readyForReviewAt,busySince:t.busySince,dismissedAt:t.dismissedAt,compactingSince:t.compactingSince,permissionRequest:t.permissionRequest,lastEvent:t.lastEvent,eventSeq:t.eventSeq}),t.paneTitle&&"agent-sessions"!==t.panelType&&n.default.getState().setTitle(t.tabId,f(t.paneTitle,t.panelType));break;case"status:hook-event":a.default.getState().applyHookEvent(t.tabId,t.event),((e,t)=>{if("stop"!==t.name)return;let a=r.default.getState();if(!a.cwdKey||!a.tmuxSession)return;let n=l.useLayoutStore.getState().layout;if(!n)return;let s=(0,b.collectAllTabs)(n.root).find(t=>t.id===e);s&&s.sessionName===a.tmuxSession&&a.fetchForTarget({cwdKey:a.cwdKey,tmuxSession:a.tmuxSession},{force:!0})})(t.tabId,t.event);break;case"rate-limits:update":s.default.getState().setData(t.data);break;case"session-history:sync":i.default.getState().syncFromServer(t.entries);break;case"session-history:update":i.default.getState().upsertEntry(t.entry)}}catch{}},u.onclose=()=>{if(!c.current)return;a.default.getState().setStatusWsConnected(!1),m=null;let n=Math.min(1e3*Math.pow(2,e.current),3e4);e.current++,o.current=setTimeout(t,n)},u.onerror=()=>{}};t();let d=()=>{if("visible"!==document.visibilityState)return;let a=m?.readyState;a!==WebSocket.OPEN&&a!==WebSocket.CONNECTING&&(o.current&&(clearTimeout(o.current),o.current=null),e.current=0,t())};return document.addEventListener("visibilitychange",d),()=>{c.current=!1,o.current&&(clearTimeout(o.current),o.current=null),m&&(m.close(),m=null),document.removeEventListener("visibilitychange",d)}},[])},"dismissTab",0,e=>{a.default.getState().dismissTab(e),m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:tab-dismissed",tabId:e}))},"requestSync",0,()=>{m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:request-sync"}))}],3450)},266231,e=>{"use strict";var t=e.i(191788);let a=768;e.s(["default",0,(e=a)=>{let n=`(max-width: ${e-1}px)`,s=(0,t.useCallback)(e=>{let t=window.matchMedia(n);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n]),i=(0,t.useCallback)(()=>window.matchMedia(n).matches,[n]),r=(0,t.useCallback)(()=>!1,[]);return(0,t.useSyncExternalStore)(s,i,r)}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,399267,e=>{"use strict";var t=e.i(505888);let a={terminalConnected:!1,agentProcess:null,agentProcessCheckedAt:0,agentInstalled:!0,sessionView:"session-list",cliState:"inactive",isTimelineLoading:!0,workspaceId:""},n=(e,t,a)=>{let n=e[t];return n?{...e,[t]:{...n,...a}}:e},s=(e,t)=>null!=t&&"inactive"!==t&&"unknown"!==t&&"cancelled"!==t&&"check"===e?"timeline":e,i=(e,t)=>t.agentProviderId||"terminal"!==e.panelType||!0!==e.agentProcess?{}:{agentProviderId:e.agentProviderId,agentSessionId:e.agentSessionId},r=(0,t.create)(e=>({tabs:{},tabOrders:{},statusWsConnected:!1,initTab:(t,n)=>e(e=>{let s=e.tabs[t],i={...a,...s,...n};return s?.cliState==="ready-for-review"&&"ready-for-review"!==i.cliState&&(i.cliState="ready-for-review",i.readyForReviewAt=s.readyForReviewAt),{tabs:{...e.tabs,[t]:i}}}),removeTab:t=>e(e=>{let{[t]:a,...n}=e.tabs;return{tabs:n}}),setTerminalConnected:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.terminalConnected!==a?{tabs:n(e.tabs,t,{terminalConnected:a})}:e}),setAgentProcess:(t,a,s)=>e(e=>{let i=e.tabs[t];if(!i||i.agentProcessCheckedAt>s)return e;let r={agentProcess:a,agentProcessCheckedAt:s};return(!0===a&&("check"===i.sessionView||"session-list"===i.sessionView)&&(r.sessionView="timeline"),!1===a&&!0===i.agentProcess&&"timeline"===i.sessionView&&(r.sessionView="session-list"),i.agentProcess===a&&i.agentProcessCheckedAt===s&&void 0===r.sessionView)?e:{tabs:n(e.tabs,t,r)}}),setAgentInstalled:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.agentInstalled!==a?{tabs:n(e.tabs,t,{agentInstalled:a})}:e}),setSessionView:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.sessionView!==a?{tabs:n(e.tabs,t,{sessionView:a})}:e}),setTimelineLoading:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.isTimelineLoading!==a?{tabs:n(e.tabs,t,{isTimelineLoading:a})}:e}),setSessionMetaCache:(t,a)=>e(e=>{let s=e.tabs[t];if(!s)return e;let i=s.sessionMetaCache;return i&&i.sessionId===a.sessionId&&i.jsonlPath===a.jsonlPath&&i.meta===a.meta?e:{tabs:n(e.tabs,t,{sessionMetaCache:a})}}),cancelTab:t=>e(e=>{let a=e.tabs[t];return a&&"cancelled"!==a.cliState?{tabs:n(e.tabs,t,{cliState:"cancelled",localUpdatedAt:Date.now()})}:e}),dismissTab:t=>e(e=>{let a=e.tabs[t];return a&&"ready-for-review"===a.cliState?{tabs:n(e.tabs,t,{cliState:"idle",dismissedAt:Date.now()})}:e}),setWorkspaceId:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.workspaceId!==a?{tabs:n(e.tabs,t,{workspaceId:a})}:e}),setPanelType:(t,a)=>e(e=>{let s=e.tabs[t];return s&&s.panelType!==a?{tabs:n(e.tabs,t,{panelType:a})}:e}),setCurrentProcess:(t,a)=>e(e=>{let s=e.tabs[t];if(!s)return e;let i=a??void 0;return s.currentProcess===i?e:{tabs:n(e.tabs,t,{currentProcess:i,localUpdatedAt:Date.now()})}}),setDetectedAgent:(t,a)=>e(e=>{let s=e.tabs[t],i=a.checkedAt??Date.now();if(!s||s.agentProcessCheckedAt>i)return e;let r={agentProcess:a.running,agentProcessCheckedAt:i};return a.running?(a.providerId&&(r.agentProviderId=a.providerId),void 0!==a.sessionId&&(r.agentSessionId=a.sessionId),("check"===s.sessionView||"session-list"===s.sessionView)&&(r.sessionView="timeline")):"terminal"===s.panelType?(r.agentProviderId=void 0,r.agentSessionId=null,!0===s.agentProcess&&"timeline"===s.sessionView&&(r.sessionView="session-list")):"timeline"===s.sessionView&&(!0===s.agentProcess||s.agentSessionId&&!s.isTimelineLoading)&&(r.sessionView="session-list"),{tabs:n(e.tabs,t,r)}}),setTabOrder:(t,a)=>e(e=>{let n=e.tabOrders[t];return n&&n.length===a.length&&n.every((e,t)=>e===a[t])?e:{tabOrders:{...e.tabOrders,[t]:a}}}),setStatusWsConnected:t=>e({statusWsConnected:t}),syncAllFromServer:t=>e(e=>{let n=Date.now(),r={};for(let[l,o]of Object.entries(t)){let t=e.tabs[l];if(t?.cliState==="cancelled"){r[l]=t;continue}t?.localUpdatedAt&&n-t.localUpdatedAt<3e4?r[l]={...t,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,...i(t,o),agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(t.sessionView,o.cliState)}:t?r[l]={...t,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,panelType:o.panelType??t.panelType,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,currentProcess:o.currentProcess,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,...i(t,o),agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(t.sessionView,o.cliState)}:r[l]={...a,cliState:o.cliState,workspaceId:o.workspaceId,tabName:o.tabName,panelType:o.panelType,terminalStatus:o.terminalStatus,listeningPorts:o.listeningPorts,currentProcess:o.currentProcess,agentProviderId:o.agentProviderId,agentSessionId:o.agentSessionId,agentSummary:o.agentSummary,lastUserMessage:o.lastUserMessage,lastAssistantMessage:o.lastAssistantMessage,currentAction:o.currentAction,readyForReviewAt:o.readyForReviewAt,busySince:o.busySince,dismissedAt:o.dismissedAt,compactingSince:o.compactingSince,permissionRequest:o.permissionRequest,lastEvent:o.lastEvent,eventSeq:o.eventSeq,sessionView:s(a.sessionView,o.cliState)}}for(let[t,a]of Object.entries(e.tabs))r[t]||(r[t]=a);return{tabs:r}}),updateFromServer:(t,r)=>e(e=>{if(null===r.cliState){let{[t]:a,...n}=e.tabs;return{tabs:n}}let l=e.tabs[t];if(l){if("cancelled"===l.cliState)return e;let a=void 0!==r.eventSeq&&void 0!==l.eventSeq&&r.eventSeq<l.eventSeq,o=void 0!==r.eventSeq&&(void 0===l.eventSeq||r.eventSeq>=l.eventSeq)?{lastEvent:r.lastEvent,eventSeq:r.eventSeq}:{},c=a?{cliState:l.cliState,readyForReviewAt:l.readyForReviewAt,busySince:l.busySince,dismissedAt:l.dismissedAt}:{cliState:r.cliState,readyForReviewAt:r.readyForReviewAt,busySince:r.busySince,dismissedAt:r.dismissedAt};return{tabs:n(e.tabs,t,{...c,workspaceId:r.workspaceId,tabName:r.tabName,panelType:r.panelType??l.panelType,terminalStatus:r.terminalStatus,listeningPorts:r.listeningPorts,currentProcess:r.currentProcess,agentProviderId:r.agentProviderId,agentSessionId:r.agentSessionId,...i(l,r),agentSummary:r.agentSummary,lastUserMessage:r.lastUserMessage,lastAssistantMessage:r.lastAssistantMessage,currentAction:r.currentAction,compactingSince:r.compactingSince,permissionRequest:r.permissionRequest,sessionView:s(l.sessionView,r.cliState),...o})}}return{tabs:{...e.tabs,[t]:{...a,cliState:r.cliState,workspaceId:r.workspaceId,tabName:r.tabName,panelType:r.panelType,terminalStatus:r.terminalStatus,listeningPorts:r.listeningPorts,currentProcess:r.currentProcess,agentProviderId:r.agentProviderId,agentSessionId:r.agentSessionId,agentSummary:r.agentSummary,lastUserMessage:r.lastUserMessage,lastAssistantMessage:r.lastAssistantMessage,readyForReviewAt:r.readyForReviewAt,busySince:r.busySince,dismissedAt:r.dismissedAt,compactingSince:r.compactingSince,permissionRequest:r.permissionRequest,lastEvent:r.lastEvent,eventSeq:r.eventSeq,sessionView:s(a.sessionView,r.cliState)}}}}),applyHookEvent:(t,a)=>e(e=>{let s=e.tabs[t];if(!s||void 0!==s.eventSeq&&a.seq<=s.eventSeq)return e;let i=((e,t)=>{if(!e||"cancelled"===t)return t;switch(e.name){case"session-start":case"interrupt":return"idle";case"prompt-submit":return"busy";case"notification":return"needs-input";case"stop":return"ready-for-review"}})(a,s.cliState);return{tabs:n(e.tabs,t,{cliState:i,lastEvent:a,eventSeq:a.seq,readyForReviewAt:"ready-for-review"===i?Date.now():null,busySince:"busy"===i?Date.now():null,dismissedAt:"busy"===i?null:s.dismissedAt,permissionRequest:"needs-input"===s.cliState&&"needs-input"!==i?null:s.permissionRequest})}})}));e.s(["default",0,r,"getInitialTabStateFromLayoutTab",0,e=>{let t={panelType:e.panelType},a=e.agentState?.providerId??("codex-cli"===e.panelType?"codex":"claude-code"===e.panelType?"claude":void 0),n=e.agentState?.sessionId??e.claudeSessionId??null;return a&&(t.agentProviderId=a),n&&(t.agentSessionId=n,t.agentSummary=e.agentState?.summary??e.claudeSummary??null,t.sessionView="timeline"),t},"isCliIdle",0,e=>"idle"===e||"ready-for-review"===e,"selectGlobalStatus",0,e=>{let t=0,a=0;for(let n of Object.values(e))"busy"===n.cliState?t++:("ready-for-review"===n.cliState||"needs-input"===n.cliState)&&a++;return{busyCount:t,attentionCount:a}},"selectSessionView",0,(e,t)=>{let a=e[t];return a?a.sessionView:"session-list"},"selectTabDisplayStatus",0,(e,t)=>{let a=e[t];return a&&"inactive"!==a.cliState?"busy"===a.cliState?"busy":"ready-for-review"===a.cliState?"ready-for-review":"needs-input"===a.cliState?"needs-input":"unknown"===a.cliState?"unknown":"idle":"idle"},"selectWorkspacePortsLabel",0,(e,t)=>{let a=new Set;for(let n of Object.values(e))if(n.workspaceId===t&&n.listeningPorts)for(let e of n.listeningPorts)a.add(e);return 0===a.size?"":":"+[...a].sort((e,t)=>e-t).join(", :")}],399267)},117653,e=>{"use strict";var t=e.i(191788);let a=(e,t)=>{let a=e instanceof Map?e:new Map(e.entries()),n=t instanceof Map?t:new Map(t.entries());if(a.size!==n.size)return!1;for(let[e,t]of a)if(!n.has(e)||!Object.is(t,n.get(e)))return!1;return!0};e.s(["useShallow",0,function(e){let n=t.default.useRef(void 0);return t=>{let s=e(t);return!function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Symbol.iterator in e&&Symbol.iterator in t){if("entries"in e&&"entries"in t)return a(e,t);let n=e[Symbol.iterator](),s=t[Symbol.iterator](),i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done}return a({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}(n.current,s)?n.current=s:n.current}}],117653)},358915,e=>{"use strict";var t=e.i(191788),a=e.i(679935),n=e.i(844044),s=e.i(399267);let i=new Set(["/new","/clear"]),r=e=>`pt-input-draft:${e}`,l=e=>{try{localStorage.removeItem(r(e))}catch{}};e.s(["clearInputDraft",0,l,"default",0,(e,o,c,d)=>{let u=d?.tabId,[p,f]=(0,t.useState)(()=>u?(e=>{try{return localStorage.getItem(r(e))??""}catch{return""}})(u):""),b=(0,t.useRef)(null),m=(0,t.useMemo)(()=>(0,s.isCliIdle)(e)||"unknown"===e?"input":"busy"===e||"needs-input"===e?"interrupt":"disabled",[e]),y=d?.onRestartSession,S=d?.onMessageSent,g=d?.submitDelayMs??250,h=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(u)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>((e,t)=>{try{t?localStorage.setItem(r(e),t):localStorage.removeItem(r(e))}catch{}})(u,p),300),()=>{h.current&&clearTimeout(h.current)}},[u,p]);let v=(0,t.useCallback)(()=>{if("disabled"===m)return void a.toast.error(d?.disabledMessage??(0,n.t)("terminal","inputDisabledPlaceholder"));if(!c)return void a.toast.error((0,n.t)("connection","terminalDisconnected"));if(""!==p.trim()){if(i.has(p.trim().toLowerCase())){y?.(),f(""),u&&l(u);return}p.includes("\n")?o(`\x1b[200~${p}\x1b[201~`):o(p),setTimeout(()=>o("\r"),g),p.trim().startsWith("/")||S?.(p.trim()),f(""),u&&l(u)}},[m,p,o,c,y,S,u,d?.disabledMessage,g]),I=(0,t.useCallback)(()=>{c?o("\x1b\x1b"):a.toast.error((0,n.t)("connection","terminalDisconnected"))},[o,c]),w=(0,t.useCallback)(()=>{let e=b.current;if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)},[]),T="disabled"!==m&&c;return{value:p,setValue:f,mode:m,canSend:T,send:v,interrupt:I,textareaRef:b,focusInput:w}}])},898589,e=>{"use strict";let t=e=>"web-browser"===e?"Web Browser":"";e.s(["resolveTabNameForPanelTypeChange",0,(e,a,n)=>{let s=t(a),i="agent-sessions"===a?"Session List":"",r=t(n),l=e.trim();return!l&&r||(""!==s&&l===s||""!==i&&l===i)&&l!==r?r:e}])},806185,e=>{"use strict";let t=e=>"pane"===e.type?[e]:[...t(e.children[0]),...t(e.children[1])],a=(e,t)=>"pane"===e.type?e.id===t?e:null:a(e.children[0],t)||a(e.children[1],t),n=e=>"pane"===e.type?e.id:n(e.children[0]),s=e=>"pane"===e.type?e.id:s(e.children[1]),i=(e,t)=>{if("pane"===e.type)return null;let[a,n]=e.children;if("pane"===a.type&&a.id===t)return n;if("pane"===n.type&&n.id===t)return a;let s=i(a,t);if(s)return{...e,children:[s,n]};let r=i(n,t);return r?{...e,children:[a,r]}:null},r=(e,t)=>{if("pane"===e.type)return null;let[a,i]=e.children;return"pane"===a.type&&a.id===t?n(i):"pane"===i.type&&i.id===t?s(a):r(a,t)||r(i,t)},l=(e,t,a)=>{if("split"!==e.type)return e;if(0===t.length)return{...e,ratio:a};let[n,...s]=t,i=[e.children[0],e.children[1]];return i[n]=l(e.children[n],s,a),{...e,children:i}},o=(e,t)=>"pane"===e.type||e.orientation!==t?1:o(e.children[0],t)+o(e.children[1],t),c=e=>{if("pane"===e.type)return e;let t=o(e.children[0],e.orientation),a=Math.round(t/(t+o(e.children[1],e.orientation))*1e4)/100;return{...e,ratio:a,children:[c(e.children[0]),c(e.children[1])]}},d=(e,t,a)=>{if("pane"===e.type)return e.id===t?a(e):e;let n=d(e.children[0],t,a);if(n!==e.children[0])return{...e,children:[n,e.children[1]]};let s=d(e.children[1],t,a);return s!==e.children[1]?{...e,children:[e.children[0],s]}:e};e.s(["collectAllTabs",0,e=>t(e).flatMap(e=>e.tabs),"collectPanes",0,t,"equalizeNode",0,c,"findAdjacentPaneInDirection",0,(e,t,a)=>{let i=[],r=e=>{if("pane"===e.type)return e.id===t;for(let t=0;t<2;t++){if(i.push({node:e,childIndex:t}),r(e.children[t]))return!0;i.pop()}return!1};if(!r(e))return null;let l="left"===a||"right"===a?"horizontal":"vertical",o=+("left"===a||"up"===a);for(let e=i.length-1;e>=0;e--){let{node:t,childIndex:r}=i[e];if("split"===t.type&&t.orientation===l&&r===o){let e=t.children[1-o];return"left"===a||"up"===a?s(e):n(e)}}return null},"findPane",0,a,"findResizeTarget",0,(e,t,a)=>{let n=[],s=e=>{if("pane"===e.type)return e.id===t;for(let t=0;t<2;t++){if(n.push({node:e,childIndex:t}),s(e.children[t]))return!0;n.pop()}return!1};if(!s(e))return null;let i="left"===a||"right"===a?"horizontal":"vertical",r=+("right"!==a&&"down"!==a),l="right"===a||"down"===a;for(let e=n.length-1;e>=0;e--){let{node:t,childIndex:a}=n[e];if("split"===t.type&&t.orientation===i&&a===r)return{path:n.slice(0,e).map(e=>e.childIndex),currentRatio:t.ratio,increase:l}}return null},"getFirstPaneId",0,n,"removePaneWithFocus",0,(e,a)=>{let n=r(e.root,a),s=i(e.root,a);s&&(e.root=s),e.activePaneId===a&&(e.activePaneId=n??t(e.root)[0]?.id??null)},"updatePaneInTree",0,d,"updateRatioAtPath",0,l])},335288,e=>{"use strict";e.s(["default",()=>L,"navigateToTab",()=>E,"navigateToTabOrCreate",()=>F,"useLayoutStore",()=>O]);var t=e.i(191788),a=e.i(203828),n=e.i(505888),s=e.i(117653),i=e.i(679935),r=e.i(844044),l=e.i(358915),o=e.i(399267),c=e.i(490034),d=e.i(453783),u=e.i(898589),p=e.i(806185);let f="pt-active-pane-",b="pt-active-tab-",m="pt-terminal-ratio-",y="pt-terminal-collapsed-",S=e=>{try{return sessionStorage.getItem(`${b}${e}`)}catch{return null}},g=e=>{try{let t=sessionStorage.getItem(`${m}${e}`);if(null==t)return null;let a=Number(t);return Number.isFinite(a)?a:null}catch{return null}},h=e=>{try{let t=sessionStorage.getItem(`${y}${e}`);if(null==t)return null;return"1"===t}catch{return null}},v=null,I=null,w=null,T=!1,P=new Map,k=(e,t)=>{if(!t)return e;let a=e.includes("?")?"&":"?";return`${e}${a}workspace=${t}`},A=(e,t)=>{let a=e?(0,p.collectPanes)(e.root).length:0;return{paneCount:a,canSplit:a<10&&!t}},C=(e,t,a)=>{e({layout:a,...A(a,t().isSplitting)})},$=(e,t,a)=>{let n=t().layout;if(n){let e=(0,p.collectPanes)(a.root);for(let t of(n.activePaneId&&e.some(e=>e.id===n.activePaneId)&&(a.activePaneId=n.activePaneId),e)){let e=(0,p.findPane)(n.root,t.id);e?.activeTabId&&t.tabs.some(t=>t.id===e.activeTabId)&&(t.activeTabId=e.activeTabId)}}e({layout:a,...A(a,t().isSplitting)})},q=(e,t,a,n)=>{let{layout:s}=t();if(!s)return;let i=(0,p.updatePaneInTree)(s.root,a,n);i!==s.root&&C(e,t,{...s,root:i})},R=async(e,t)=>{try{let a=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)return null;return await a.json()}catch{return null}},O=(0,n.create)((e,t)=>({layout:null,isLoading:!0,error:null,isSplitting:!1,workspaceId:null,retryCount:0,paneCount:0,canSplit:!1,pendingFocusTabId:null,setWorkspaceId:t=>{T=!1,e({workspaceId:t})},setLayout:a=>{C(e,t,a)},fetchLayout:async(a,n)=>{if(T)return;let s=a??t().workspaceId;if(!s)return;v?.abort();let l=new AbortController;v=l,t().layout||e({isLoading:!0,error:null});try{let a=await fetch(k("/api/layout",s),{signal:l.signal});if(!a.ok)throw Error();let i=await a.json();if(l.signal.aborted)return;let r=t().layout;if(!1!==n){let e=(0,p.collectPanes)(i.root);if(r)for(let t of(r.activePaneId&&e.some(e=>e.id===r.activePaneId)&&(i.activePaneId=r.activePaneId),e)){let e=(0,p.findPane)(r.root,t.id);e?.activeTabId&&t.tabs.some(t=>t.id===e.activeTabId)&&(t.activeTabId=e.activeTabId)}else{let t=(e=>{try{return sessionStorage.getItem(`${f}${e}`)}catch{return null}})(s);for(let a of(t&&e.some(e=>e.id===t)&&(i.activePaneId=t),e)){let e=S(a.id);for(let t of(e&&a.tabs.some(t=>t.id===e)&&(a.activeTabId=e),a.tabs)){let e=g(t.id);null!==e&&(t.terminalRatio=e);let a=h(t.id);null!==a&&(t.terminalCollapsed=a)}}}}if(r){let a={root:r.root,activePaneId:r.activePaneId},n={root:i.root,activePaneId:i.activePaneId};if(JSON.stringify(a)===JSON.stringify(n)){let a=t().pendingFocusTabId;a&&(e({pendingFocusTabId:null}),t().focusTab(a));return}}let o=t().pendingFocusTabId,c=null;if(o){for(let t of(e({pendingFocusTabId:null}),(0,p.collectPanes)(i.root)))if(t.tabs.some(e=>e.id===o)){i.activePaneId=t.id,t.activeTabId=o,c=t.id;break}}e({layout:i,retryCount:0,...A(i,t().isSplitting)}),c&&(R(k("/api/layout",s),{activePaneId:c}),R(k(`/api/layout/pane/${c}`,s),{activeTabId:o}))}catch(n){if(n instanceof DOMException&&"AbortError"===n.name)return;let a=t().retryCount+1;if(e({retryCount:a}),a>=3)try{let a=await fetch(k("/api/layout/pane",s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){let{paneId:n,tab:s}=await a.json(),l={root:{type:"pane",id:n,tabs:[s],activeTabId:s.id},activePaneId:n,updatedAt:new Date().toISOString()};e({layout:l,...A(l,t().isSplitting)}),i.toast.info((0,r.t)("terminal","fallbackLayout")),e({retryCount:0});return}}catch{}e({error:(0,r.t)("terminal","layoutFetchError")}),I?.()}finally{l.signal.aborted||e({isLoading:!1})}},splitPane:async(a,n)=>{let{layout:s,isSplitting:l,workspaceId:o}=t();if(s&&!l&&!((0,p.collectPanes)(s.root).length>=10)){e({isSplitting:!0,canSplit:!1});try{let i,r,l=(0,p.findPane)(s.root,a),c=l?.tabs.find(e=>e.id===l.activeTabId);if(c){r=c.panelType;try{let e=await fetch(k(`/api/layout/cwd?session=${c.sessionName}`,o));e.ok&&(i=(await e.json()).cwd)}catch{}}let d=await fetch(k("/api/layout/pane",o),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourcePaneId:a,orientation:n,cwd:i,panelType:r})});if(!d.ok)throw Error();let u=await d.json();C(e,t,u)}catch{i.toast.error((0,r.t)("terminal","splitFailed"))}finally{e(e=>({isSplitting:!1,canSplit:e.paneCount<10}))}}},closePane:async a=>{let{layout:n,workspaceId:s}=t();if(n&&!((0,p.collectPanes)(n.root).length<=1))try{let n=await fetch(k(`/api/layout/pane/${a}`,s),{method:"DELETE"});if(!n.ok)throw Error();let i=await n.json();C(e,t,i)}catch{i.toast.error("Pane을 닫을 수 없습니다")}},focusPane:a=>{let{layout:n,workspaceId:s}=t();n&&n.activePaneId!==a&&(e({layout:{...n,activePaneId:a}}),R(k("/api/layout",s),{activePaneId:a}).then(a=>{a&&$(e,t,a)}))},updateRatio:(a,n)=>{let{layout:s,workspaceId:i}=t();s&&(e({layout:{...s,root:(0,p.updateRatioAtPath)(s.root,a,n)}}),w&&clearTimeout(w),w=setTimeout(()=>{w=null,R(k("/api/layout",i),{ratioUpdate:{path:a,ratio:n}}).then(a=>{a&&$(e,t,a)})},300))},moveTab:(a,n,s,i)=>{if(n===s)return;let{layout:r,workspaceId:l}=t();if(!r)return;let o=JSON.parse(JSON.stringify(r)),c=(0,p.findPane)(o.root,n),d=(0,p.findPane)(o.root,s);if(c&&d){let r=c.tabs.findIndex(e=>e.id===a);if(-1!==r){let[l]=c.tabs.splice(r,1);c.activeTabId===a&&(c.activeTabId=c.tabs[0]?.id??null),c.tabs.forEach((e,t)=>{e.order=t}),d.tabs.splice(i,0,l),d.tabs.forEach((e,t)=>{e.order=t}),d.activeTabId=a,0===c.tabs.length&&(0,p.collectPanes)(o.root).length>1&&(0,p.removePaneWithFocus)(o,n),o.activePaneId=s,C(e,t,o)}}fetch(k(`/api/layout/pane/${n}/tabs/${a}/move`,l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toPaneId:s,toIndex:i})}).then(async a=>{a.ok?$(e,t,await a.json()):await t().fetchLayout(void 0,!1)}).catch(()=>t().fetchLayout(void 0,!1))},createTabInPane:async(a,n,s,l)=>{let{layout:c,workspaceId:u}=t();try{let i,r=n,f=c?(0,p.findPane)(c.root,a):void 0,b=f?.tabs.find(e=>e.id===f.activeTabId);!r&&b&&(r=b.panelType),"web-browser"!==r&&b&&(i=d.default.getState().metadata[b.id]?.cwd);let m=await fetch(k(`/api/layout/pane/${a}/tabs`,u),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:i,panelType:r,command:s,resumeSessionId:l})});if(!m.ok)throw Error();let y=await m.json();return(s||l)&&o.default.getState().initTab(y.id,{panelType:r,sessionView:"check"}),q(e,t,a,e=>({...e,tabs:[...e.tabs,y],activeTabId:y.id})),t().fetchLayout(),y}catch{return i.toast.error((0,r.t)("terminal","tabCreateFailed")),null}},deleteTabInPane:async(a,n)=>{(0,l.clearInputDraft)(n),o.default.getState().cancelTab(n),q(e,t,a,e=>{let t=[...e.tabs].sort((e,t)=>e.order-t.order),a=t.findIndex(e=>e.id===n),s=t.filter(e=>e.id!==n);s.forEach((e,t)=>{e.order=t});let i=e.activeTabId;if(e.activeTabId===n){let e=t[a+1]||t[a-1];i=e?.id??null}return{...e,tabs:s,activeTabId:i}});let{workspaceId:s}=t();try{let e=await fetch(k(`/api/layout/pane/${a}/tabs/${n}`,s),{method:"DELETE"});e.ok||404===e.status||(i.toast.error((0,r.t)("terminal","tabDeleteError")),await t().fetchLayout())}catch{i.toast.error((0,r.t)("terminal","tabDeleteError")),await t().fetchLayout()}},restartTabInPane:async(e,a,n)=>{let{workspaceId:s}=t();try{return(await fetch(k(`/api/layout/pane/${e}/tabs/${a}`,s),{method:"POST",headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify({command:n}):void 0})).ok}catch{return i.toast.error((0,r.t)("terminal","sessionRestartFailed")),!1}},switchTabInPane:(a,n)=>{q(e,t,a,e=>({...e,activeTabId:n}));let{workspaceId:s}=t();R(k(`/api/layout/pane/${a}`,s),{activeTabId:n}).then(a=>{a&&$(e,t,a)})},renameTabInPane:async(a,n,s)=>{q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>e.id===n?{...e,name:s}:e)}));let{workspaceId:l}=t(),o=await R(k(`/api/layout/pane/${a}/tabs/${n}`,l),{name:s});o?$(e,t,o):i.toast.error((0,r.t)("terminal","tabRenameFailed"))},reorderTabsInPane:(a,n)=>{q(e,t,a,e=>{let t=new Map(e.tabs.map(e=>[e.id,e])),a=n.map((e,a)=>{let n=t.get(e);return n?{...n,order:a}:null}).filter(e=>null!==e);return{...e,tabs:a}});let{workspaceId:s}=t();R(k(`/api/layout/pane/${a}/tabs/order`,s),{tabIds:n}).then(a=>{a&&$(e,t,a)})},removeTabLocally:(e,a)=>{(0,l.clearInputDraft)(a);let{workspaceId:n}=t();fetch(k(`/api/layout/pane/${e}/tabs/${a}`,n),{method:"DELETE"}).then(()=>t().fetchLayout()).catch(()=>{console.log("[layout] removeTabLocally failed")})},equalizeRatios:()=>{let{workspaceId:a}=t();R(k("/api/layout",a),{equalize:!0}).then(a=>{a&&$(e,t,a)})},updateDiffSettings:a=>{let{layout:n,workspaceId:s}=t();n&&(C(e,t,{...n,diffSettings:{...n.diffSettings??{},...a}}),R(k("/api/layout",s),{diffSettings:a}).then(a=>{a&&$(e,t,a)}))},updateTabPanelType:(a,n,s)=>{let i;q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>{if(e.id!==n)return e;let t=(0,u.resolveTabNameForPanelTypeChange)(e.name,e.panelType,s),a={...e,panelType:s,name:t};return t!==e.name&&(i=t),"codex-cli"===s&&"claude-code"===e.panelType&&(a.claudeSessionId=null,a.agentState=void 0),a})})),o.default.getState().setPanelType(n,s);let{workspaceId:r}=t();R(k(`/api/layout/pane/${a}/tabs/${n}`,r),{panelType:s,...void 0!==i?{name:i}:{}}).then(a=>{a&&$(e,t,a)})},updateTabTerminalLayout:(a,n,s)=>{q(e,t,a,e=>({...e,tabs:e.tabs.map(e=>e.id===n?{...e,...s}:e)}));try{void 0!==s.terminalRatio&&sessionStorage.setItem(`${m}${n}`,String(s.terminalRatio)),void 0!==s.terminalCollapsed&&sessionStorage.setItem(`${y}${n}`,s.terminalCollapsed?"1":"0")}catch{}let{workspaceId:i}=t(),r=P.get(n);r&&clearTimeout(r),P.set(n,setTimeout(()=>{P.delete(n),R(k(`/api/layout/pane/${a}/tabs/${n}`,i),s)},300))},clearLayout:()=>{T=!0,v?.abort(),e({layout:null,paneCount:0,canSplit:!1})},focusTab:e=>{let{layout:a}=t();if(!a)return!1;for(let n of(0,p.collectPanes)(a.root))if(n.tabs.some(t=>t.id===e))return t().focusPane(n.id),t().switchTabInPane(n.id,e),!0;return!1},focusPrevTab:()=>{let{layout:e}=t();if(!e)return;let a=(0,p.collectPanes)(e.root),n=a.findIndex(t=>t.id===e.activePaneId);if(-1===n)return;let s=a[n],i=[...s.tabs].sort((e,t)=>e.order-t.order),r=i.findIndex(e=>e.id===s.activeTabId);if(r>0)return void t().switchTabInPane(s.id,i[r-1].id);let l=a[(n-1+a.length)%a.length],o=[...l.tabs].sort((e,t)=>e.order-t.order);0!==o.length&&(l.id!==s.id&&t().focusPane(l.id),t().switchTabInPane(l.id,o[o.length-1].id))},focusNextTab:()=>{let{layout:e}=t();if(!e)return;let a=(0,p.collectPanes)(e.root),n=a.findIndex(t=>t.id===e.activePaneId);if(-1===n)return;let s=a[n],i=[...s.tabs].sort((e,t)=>e.order-t.order),r=i.findIndex(e=>e.id===s.activeTabId);if(-1!==r&&r<i.length-1)return void t().switchTabInPane(s.id,i[r+1].id);let l=a[(n+1)%a.length],o=[...l.tabs].sort((e,t)=>e.order-t.order);0!==o.length&&(l.id!==s.id&&t().focusPane(l.id),t().switchTabInPane(l.id,o[0].id))},focusTabByIndex:e=>{let{layout:a}=t();if(!a?.activePaneId)return;let n=(0,p.collectPanes)(a.root).find(e=>e.id===a.activePaneId);if(!n)return;let s=[...n.tabs].sort((e,t)=>e.order-t.order),i=e>=s.length?s[s.length-1]:s[e];i&&i.id!==n.activeTabId&&t().switchTabInPane(n.id,i.id)}}));O.subscribe((e,t)=>{if(e.layout&&e.workspaceId&&e.layout!==t.layout){var a=e.workspaceId,n=e.layout;try{for(let e of(n.activePaneId&&sessionStorage.setItem(`${f}${a}`,n.activePaneId),(0,p.collectPanes)(n.root)))for(let t of(e.activeTabId&&sessionStorage.setItem(`${b}${e.id}`,e.activeTabId),e.tabs))void 0!==t.terminalRatio&&sessionStorage.setItem(`${m}${t.id}`,String(t.terminalRatio)),void 0!==t.terminalCollapsed&&sessionStorage.setItem(`${y}${t.id}`,t.terminalCollapsed?"1":"0")}catch{}}});let E=(e,t)=>{let n=O.getState();if("/"!==a.default.pathname){O.setState({pendingFocusTabId:t}),c.default.getState().switchWorkspace(e),a.default.push("/");return}e===n.workspaceId?n.focusTab(t):(n.clearLayout(),O.setState({pendingFocusTabId:t}),c.default.getState().switchWorkspace(e))},F=async(e,t,a,n,s,i="claude")=>{let r=c.default.getState(),l="codex"===i?"codex-cli":"claude-code",d=e,u=r.workspaces.find(t=>t.id===e);if(!u){if(!s)return;let e=await r.createWorkspace(s,n,a??void 0,l);if(!e)return;d=e.id;let t=await fetch(k("/api/layout",d));if(!t.ok)return;let i=await t.json(),c=(0,p.collectAllTabs)(i.root)[0];if(!c)return;a&&o.default.getState().initTab(c.id,{panelType:l,sessionView:"check"}),E(d,c.id);return}let f=await fetch(k("/api/layout",d));if(!f.ok)return;let b=await f.json();if(a){let e=(0,p.collectAllTabs)(b.root).find(e=>"codex"===i?e.agentState?.providerId==="codex"&&e.agentState.sessionId===a:e.agentState?.providerId==="claude"?e.agentState.sessionId===a:e.claudeSessionId===a);if(e){o.default.getState().setSessionView(e.id,"timeline"),E(d,e.id);return}}else if((0,p.collectAllTabs)(b.root).find(e=>e.id===t))return void E(d,t);let m=b.activePaneId??(0,p.getFirstPaneId)(b.root),y={panelType:l,cwd:u.directories[0]};a&&(y.resumeSessionId=a);let S=await fetch(k(`/api/layout/pane/${m}/tabs`,d),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!S.ok)return;let g=await S.json();a&&o.default.getState().initTab(g.id,{panelType:l,sessionView:"check"}),d===O.getState().workspaceId?(O.setState({pendingFocusTabId:g.id}),O.getState().fetchLayout()):E(d,g.id)},L=({workspaceId:e,onFetchError:a})=>((0,t.useEffect)(()=>{I=a??null},[a]),(0,t.useEffect)(()=>{if(e){let t=O.getState();t.setWorkspaceId(e),t.fetchLayout(e)}},[e]),(0,t.useEffect)(()=>O.subscribe(e=>{let t=e.workspaceId;if(!t||!e.layout?.root)return;let a=(0,p.collectPanes)(e.layout.root).flatMap(e=>e.tabs.map(e=>e.id));o.default.getState().setTabOrder(t,a)}),[]),O((0,s.useShallow)(e=>({layout:e.layout,isLoading:e.isLoading,error:e.error,isSplitting:e.isSplitting,paneCount:e.paneCount,canSplit:e.canSplit,splitPane:e.splitPane,closePane:e.closePane,focusPane:e.focusPane,updateRatio:e.updateRatio,moveTab:e.moveTab,createTabInPane:e.createTabInPane,deleteTabInPane:e.deleteTabInPane,restartTabInPane:e.restartTabInPane,switchTabInPane:e.switchTabInPane,renameTabInPane:e.renameTabInPane,reorderTabsInPane:e.reorderTabsInPane,removeTabLocally:e.removeTabLocally,equalizeRatios:e.equalizeRatios,updateDiffSettings:e.updateDiffSettings,updateTabPanelType:e.updateTabPanelType,clearLayout:e.clearLayout,fetchLayout:e.fetchLayout,focusTab:e.focusTab,focusPrevTab:e.focusPrevTab,focusNextTab:e.focusNextTab,focusTabByIndex:e.focusTabByIndex}))))},453783,e=>{"use strict";e.s(["default",()=>c]);var t=e.i(505888),a=e.i(335288),n=e.i(806185);let s=null,i=new Map,r=new Map,l=()=>{s&&clearTimeout(s),s=setTimeout(()=>{s=null;let{metadata:e}=o.getState(),t=a.useLayoutStore.getState().layout,i=a.useLayoutStore.getState().workspaceId;if(!t||!i)return;let r=`?workspace=${i}`;for(let a of(0,n.collectPanes)(t.root))for(let t of a.tabs){let n=e[t.id];if(!n)continue;let s={};void 0!==n.title&&n.title!==t.title&&(s.title=n.title),void 0!==n.cwd&&n.cwd!==t.cwd&&(s.cwd=n.cwd),void 0!==n.lastCommand&&(n.lastCommand??null)!==(t.lastCommand??null)&&(s.lastCommand=n.lastCommand??null),Object.keys(s).length>0&&fetch(`/api/layout/pane/${a.id}/tabs/${t.id}${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(e=>{console.log(`[tab-metadata] sync failed: ${e instanceof Error?e.message:e}`)})}},100)},o=(0,t.create)(e=>({metadata:{},setTitle:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.title===a?e:(i.set(t,Date.now()),{metadata:{...e.metadata,[t]:{...n,title:a}}})}),l()},setCwd:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.cwd===a?e:(r.set(t,Date.now()),{metadata:{...e.metadata,[t]:{...n,cwd:a}}})}),l()},setLastCommand:(t,a)=>{e(e=>{let n=e.metadata[t];return n?.lastCommand===a?e:{metadata:{...e.metadata,[t]:{...n,lastCommand:a}}}}),l()},removeTab:t=>{e(e=>{let{[t]:a,...n}=e.metadata;return{metadata:n}}),l()},hydrate:t=>{e(e=>{let a={},n=Date.now();for(let[s,l]of Object.entries(t)){let t=e.metadata[s],o=n-(i.get(s)??0)<1e3,c=n-(r.get(s)??0)<1e3;a[s]={...l,...o&&t?.title!==void 0?{title:t.title}:{},...c&&t?.cwd!==void 0?{cwd:t.cwd}:{}}}return{metadata:a}})},retainOnly:t=>{e(e=>{let a={};for(let n of t)e.metadata[n]&&(a[n]=e.metadata[n]);return{metadata:a}})},reset:()=>{s&&clearTimeout(s),s=null,i.clear(),r.clear(),e({metadata:{}})}})),c=o},15623,e=>{"use strict";let t=(0,e.i(505888).create)(e=>({data:null,setData:t=>e({data:t})}));e.s(["default",0,t])},116962,e=>{"use strict";let t=(0,e.i(505888).create)(e=>({entries:[],syncFromServer:t=>e({entries:t}),upsertEntry:t=>e(e=>{let a=e.entries.findIndex(e=>e.id===t.id);if(a>=0){let n=[...e.entries];return n[a]=t,{entries:n}}return{entries:[t,...e.entries]}})}));e.s(["default",0,t])},237022,e=>{"use strict";var t=e.i(505888);let a={phase:"idle",status:null,branch:null,error:null,lastFetchedAt:null},n=e=>e?e.staged+e.modified+e.untracked:0,s=(0,t.create)((e,t)=>({cwdKey:null,tmuxSession:null,...a,requestSeq:0,resetForTarget:({cwdKey:t,tmuxSession:n})=>{e(e=>e.cwdKey===t?e.tmuxSession===n?e:{tmuxSession:n}:{...a,cwdKey:t,tmuxSession:n,requestSeq:e.requestSeq+1})},fetchForTarget:async({cwdKey:a,tmuxSession:n},s)=>{if(!a||!n)return void t().resetForTarget({cwdKey:null,tmuxSession:null});let i=t(),r=i.cwdKey!==a,l=null!==i.lastFetchedAt&&Date.now()-i.lastFetchedAt<15e3;if(!r&&!s?.force&&l&&"error"!==i.phase){i.tmuxSession!==n&&e({tmuxSession:n});return}let o=i.requestSeq+1;e({cwdKey:a,tmuxSession:n,phase:"loading",status:r?null:i.status,branch:r?null:i.branch,error:null,lastFetchedAt:null,requestSeq:o});try{let a=new URLSearchParams({tmuxSession:n});s?.force&&a.set("force","true");let i=await fetch(`/api/git/status?${a.toString()}`,{cache:"no-store"});if(!i.ok)throw Error(`status-${i.status}`);let r=await i.json();if(t().requestSeq!==o)return;if(!r.status)return void e({phase:"not-git",status:null,branch:null,error:null,lastFetchedAt:Date.now()});let l=null;try{let e=new URLSearchParams({tmuxSession:n});s?.force&&e.set("force","true");let t=await fetch(`/api/git/branch?${e.toString()}`,{cache:"no-store"});t.ok&&(l=(await t.json()).branch)}catch{l=null}if(t().requestSeq!==o)return;e({phase:"ready",status:r.status,branch:l,error:null,lastFetchedAt:Date.now()})}catch(a){if(t().requestSeq!==o)return;e({phase:"error",status:null,branch:null,error:a instanceof Error?a.message:String(a),lastFetchedAt:Date.now()})}}}));e.s(["default",0,s,"formatGitStatusSummary",0,(e,t,a,s)=>{if("idle"===e)return s;if("loading"===e)return"Checking Git status...";if("not-git"===e)return"Not a Git repository";if("error"===e)return"Git status unavailable";if(!a)return s;let i=n(a),r=[t??"Git",i>0?`${i} changed`:"clean"];return(a.insertions>0||a.deletions>0)&&r.push(`+${a.insertions} -${a.deletions}`),a.ahead>0&&r.push(`ahead ${a.ahead}`),a.behind>0&&r.push(`behind ${a.behind}`),a.stash>0&&r.push(`${a.stash} stash`),r.join(" · ")},"getGitStatusIndicators",0,e=>{if(!e)return[];let t=n(e),a=[];return t>0&&a.push({key:"changed",label:t>99?"99+":String(t),tone:"dirty"}),e.ahead>0&&a.push({key:"ahead",label:`↑${e.ahead}`,tone:"sync"}),e.behind>0&&a.push({key:"behind",label:`↓${e.behind}`,tone:"sync"}),e.stash>0&&a.push({key:"stash",label:`S${e.stash}`,tone:"stash"}),a}])},3450,251748,e=>{"use strict";var t=e.i(191788),a=e.i(399267),n=e.i(453783),s=e.i(15623),i=e.i(116962),r=e.i(237022),l=e.i(335288);let o=new Set(["zsh","bash","fish","sh","-zsh","-bash","-fish","-sh"]),c=new Set(["codex","Codex","node"]),d=e=>{if("~"===e||"/"===e)return e;let t=e.replace(/\/$/,"").split("/");return t[t.length-1]||e},u=e=>{let t=e.trim();if(!t)return null;let a=t.indexOf("|");return a>0?t.slice(0,a):null},p=(e,t)=>"codex-cli"===t&&c.has(e)?"Codex":e,f=(e,t)=>{let a=e.trim();if(!a)return"";let n=u(e);if(null!==n){let e=a.slice(a.indexOf("|")+1);return o.has(n)?d(e):p(n,t)}let s=a.match(/@[^:]+:\s*(.*)/);if(s)return d(s[1].trim());if(a.startsWith("/")||a.startsWith("~"))return d(a);let i=a.split(/\s+/)[0];return o.has(i)?"":p(i||"",t)};e.s(["formatTabTitle",0,f,"isShellProcess",0,e=>{let t=u(e);return null!==t&&o.has(t)},"parseCurrentCommand",0,u],251748);var b=e.i(806185);let m=null;e.s(["ackNotificationInput",0,(e,t)=>{m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:ack-notification",tabId:e,seq:t}))},"default",0,()=>{let e=(0,t.useRef)(0),o=(0,t.useRef)(null),c=(0,t.useRef)(!0);(0,t.useEffect)(()=>{c.current=!0;let t=()=>{if(!c.current)return;let d="https:"===location.protocol?"wss:":"ws:",u=new WebSocket(`${d}//${location.host}/api/status`);m=u,u.onopen=()=>{c.current&&(e.current=0,a.default.getState().setStatusWsConnected(!0))},u.onmessage=e=>{if(c.current)try{let t=JSON.parse(e.data);switch(t.type){case"status:sync":for(let[e,s]of(a.default.getState().syncAllFromServer(t.tabs),Object.entries(t.tabs)))"agent-sessions"!==s.panelType&&s.paneTitle&&!n.default.getState().metadata[e]?.title&&n.default.getState().setTitle(e,f(s.paneTitle,s.panelType));break;case"status:update":a.default.getState().updateFromServer(t.tabId,{cliState:t.cliState,workspaceId:t.workspaceId,tabName:t.tabName,panelType:t.panelType,terminalStatus:t.terminalStatus,listeningPorts:t.listeningPorts,currentProcess:t.currentProcess,agentProviderId:t.agentProviderId,agentSessionId:t.agentSessionId,agentSummary:t.agentSummary,lastUserMessage:t.lastUserMessage,lastAssistantMessage:t.lastAssistantMessage,currentAction:t.currentAction,readyForReviewAt:t.readyForReviewAt,busySince:t.busySince,dismissedAt:t.dismissedAt,compactingSince:t.compactingSince,permissionRequest:t.permissionRequest,lastEvent:t.lastEvent,eventSeq:t.eventSeq}),t.paneTitle&&"agent-sessions"!==t.panelType&&n.default.getState().setTitle(t.tabId,f(t.paneTitle,t.panelType));break;case"status:hook-event":a.default.getState().applyHookEvent(t.tabId,t.event),((e,t)=>{if("stop"!==t.name)return;let a=r.default.getState();if(!a.cwdKey||!a.tmuxSession)return;let n=l.useLayoutStore.getState().layout;if(!n)return;let s=(0,b.collectAllTabs)(n.root).find(t=>t.id===e);s&&s.sessionName===a.tmuxSession&&a.fetchForTarget({cwdKey:a.cwdKey,tmuxSession:a.tmuxSession},{force:!0})})(t.tabId,t.event);break;case"rate-limits:update":s.default.getState().setData(t.data);break;case"session-history:sync":i.default.getState().syncFromServer(t.entries);break;case"session-history:update":i.default.getState().upsertEntry(t.entry)}}catch{}},u.onclose=()=>{if(!c.current)return;a.default.getState().setStatusWsConnected(!1),m=null;let n=Math.min(1e3*Math.pow(2,e.current),3e4);e.current++,o.current=setTimeout(t,n)},u.onerror=()=>{}};t();let d=()=>{if("visible"!==document.visibilityState)return;let a=m?.readyState;a!==WebSocket.OPEN&&a!==WebSocket.CONNECTING&&(o.current&&(clearTimeout(o.current),o.current=null),e.current=0,t())};return document.addEventListener("visibilitychange",d),()=>{c.current=!1,o.current&&(clearTimeout(o.current),o.current=null),m&&(m.close(),m=null),document.removeEventListener("visibilitychange",d)}},[])},"dismissTab",0,e=>{a.default.getState().dismissTab(e),m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:tab-dismissed",tabId:e}))},"requestSync",0,()=>{m?.readyState===WebSocket.OPEN&&m.send(JSON.stringify({type:"status:request-sync"}))}],3450)},266231,e=>{"use strict";var t=e.i(191788);let a=768;e.s(["default",0,(e=a)=>{let n=`(max-width: ${e-1}px)`,s=(0,t.useCallback)(e=>{let t=window.matchMedia(n);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n]),i=(0,t.useCallback)(()=>window.matchMedia(n).matches,[n]),r=(0,t.useCallback)(()=>!1,[]);return(0,t.useSyncExternalStore)(s,i,r)}])}]);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
__turbopack_load_page_chunks__("/login", [
|
|
2
2
|
"static/chunks/0amz67ga8kcr7.js",
|
|
3
3
|
"static/chunks/0pojknlc_-2a2.js",
|
|
4
|
-
"static/chunks/
|
|
4
|
+
"static/chunks/0984g4~der6-4.js",
|
|
5
5
|
"static/chunks/0oh5xnzizgxt1.js",
|
|
6
6
|
"static/chunks/0xa1.t1vj1mw0.js",
|
|
7
7
|
"static/chunks/0jml98og5gb-~.js",
|
|
8
8
|
"static/chunks/038s7u_er9zkt.js",
|
|
9
9
|
"static/chunks/0f73mm-~6n8dq.js",
|
|
10
|
-
"static/chunks/
|
|
10
|
+
"static/chunks/0n7jmg60eqx1a.js",
|
|
11
11
|
"static/chunks/15aj3kd.p7zw6.js",
|
|
12
12
|
"static/chunks/07yop4v9xcwb9.js",
|
|
13
|
-
"static/chunks/
|
|
13
|
+
"static/chunks/0wu-q.gmu-64d.js",
|
|
14
14
|
"static/chunks/166~a4sl8v944.js",
|
|
15
|
-
"static/chunks/turbopack-
|
|
15
|
+
"static/chunks/turbopack-0~gn911-6yqk2.js"
|
|
16
16
|
])
|
|
@@ -4,21 +4,21 @@ __turbopack_load_page_chunks__("/webview", [
|
|
|
4
4
|
"static/chunks/0pojknlc_-2a2.js",
|
|
5
5
|
"static/chunks/0.znxwgo-re2m.js",
|
|
6
6
|
"static/chunks/0x2nrv0y7ik9o.js",
|
|
7
|
-
"static/chunks/
|
|
8
|
-
"static/chunks/
|
|
7
|
+
"static/chunks/0wu-q.gmu-64d.js",
|
|
8
|
+
"static/chunks/0xfp8sfehtui9.js",
|
|
9
9
|
"static/chunks/0ddh4qmi2awdq.js",
|
|
10
10
|
"static/chunks/01fkwofcdqa6f.js",
|
|
11
11
|
"static/chunks/0lrjdru2bjp.x.js",
|
|
12
12
|
"static/chunks/0szl_dovu0hgw.js",
|
|
13
13
|
"static/chunks/0g3stahwz~vh..js",
|
|
14
|
-
"static/chunks/
|
|
14
|
+
"static/chunks/0n7jmg60eqx1a.js",
|
|
15
15
|
"static/chunks/15aj3kd.p7zw6.js",
|
|
16
|
-
"static/chunks/
|
|
16
|
+
"static/chunks/0984g4~der6-4.js",
|
|
17
17
|
"static/chunks/04kxxll_g8~ja.js",
|
|
18
18
|
"static/chunks/051z~faikiw.t.js",
|
|
19
|
-
"static/chunks/
|
|
19
|
+
"static/chunks/14vposxx99rq4.js",
|
|
20
20
|
"static/chunks/0-wv6sqgkc5wn.js",
|
|
21
21
|
"static/chunks/0t5w4x7owhfbe.js",
|
|
22
22
|
"static/chunks/0~-0t4i~p3pcf.js",
|
|
23
|
-
"static/chunks/turbopack-
|
|
23
|
+
"static/chunks/turbopack-14fnzd5yh28gy.js"
|
|
24
24
|
])
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,167559,e=>{"use strict";var t,r,i,n,s,o,h=e.i(191788);function a(e,t){let r=t&&t.cache?t.cache:f,i=t&&t.serializer?t.serializer:c;return(t&&t.strategy?t.strategy:function(e,t){var r,i;let n=1===e.length?l:u;return r=t.cache.create(),i=t.serializer,n.bind(this,e,r,i)})(e,{cache:r,serializer:i})}function l(e,t,r,i){let n=null==i||"number"==typeof i||"boolean"==typeof i?i:r(i),s=t.get(n);return void 0===s&&(s=e.call(this,i),t.set(n,s)),s}function u(e,t,r){let i=Array.prototype.slice.call(arguments,3),n=r(i),s=t.get(n);return void 0===s&&(s=e.apply(this,i),t.set(n,s)),s}let c=function(){return JSON.stringify(arguments)};var m=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}};let f={create:function(){return new m}},E={variadic:function(e,t){var r,i;return r=t.cache.create(),i=t.serializer,u.bind(this,e,r,i)},monadic:function(e,t){var r,i;return r=t.cache.create(),i=t.serializer,l.bind(this,e,r,i)}};class p extends Error{constructor(e,t){let r=e;t&&(r+=": "+t),super(r),this.code=e,t&&(this.originalMessage=t)}}var g=((t=g||{}).MISSING_MESSAGE="MISSING_MESSAGE",t.MISSING_FORMAT="MISSING_FORMAT",t.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",t.INSUFFICIENT_PATH="INSUFFICIENT_PATH",t.INVALID_MESSAGE="INVALID_MESSAGE",t.INVALID_KEY="INVALID_KEY",t.FORMATTING_ERROR="FORMATTING_ERROR",t);function b(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function T(e,t){return a(e,{cache:{create:()=>({get:e=>t[e],set(e,r){t[e]=r}})},strategy:E.variadic})}function H(e,t){return T((...t)=>new e(...t),t)}function B(e){return{getDateTimeFormat:H(Intl.DateTimeFormat,e.dateTime),getNumberFormat:H(Intl.NumberFormat,e.number),getPluralRules:H(Intl.PluralRules,e.pluralRules),getRelativeTimeFormat:H(Intl.RelativeTimeFormat,e.relativeTime),getListFormat:H(Intl.ListFormat,e.list),getDisplayNames:H(Intl.DisplayNames,e.displayNames)}}let d=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g,A=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,_=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,y=/^(@+)?(\+|#+)?[rs]?$/g,N=/(\*)(0+)|(#+)(0+)|(0+)/g,S=/^(0+)$/;function I(e){let t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(y,function(e,r,i){return"string"!=typeof i?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===i?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof i?i.length:0)),""}),t}function L(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function P(e){let t=L(e);return t||{}}let M=((r={})[r.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",r[r.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",r[r.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",r[r.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",r[r.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",r[r.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",r[r.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",r[r.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",r[r.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",r[r.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",r[r.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",r[r.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",r[r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",r[r.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",r[r.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",r[r.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",r[r.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",r[r.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",r[r.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",r[r.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",r[r.INVALID_TAG=23]="INVALID_TAG",r[r.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",r[r.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",r[r.UNCLOSED_TAG=27]="UNCLOSED_TAG",r),R=((i={})[i.literal=0]="literal",i[i.argument=1]="argument",i[i.number=2]="number",i[i.date=3]="date",i[i.time=4]="time",i[i.select=5]="select",i[i.plural=6]="plural",i[i.pound=7]="pound",i[i.tag=8]="tag",i),C=((n={})[n.number=0]="number",n[n.dateTime=1]="dateTime",n);function O(e){return e.type===R.literal}function G(e){return e.type===R.number}function v(e){return e.type===R.date}function U(e){return e.type===R.time}function F(e){return e.type===R.select}function w(e){return e.type===R.plural}function D(e){return e.type===R.tag}function k(e){return!!(e&&"object"==typeof e&&e.type===C.number)}function V(e){return!!(e&&"object"==typeof e&&e.type===C.dateTime)}let K=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,X={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]},x=RegExp(`^${K.source}*`),Z=RegExp(`${K.source}*$`);function Y(e,t){return{start:e,end:t}}let j=!!Object.fromEntries,$=!!String.prototype.trimStart,W=!!String.prototype.trimEnd,z=j?Object.fromEntries:function(e){let t={};for(let[r,i]of e)t[r]=i;return t},Q=$?function(e){return e.trimStart()}:function(e){return e.replace(x,"")},q=W?function(e){return e.trimEnd()}:function(e){return e.replace(Z,"")},J=RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");var ee=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let i=[];for(;!this.isEOF();){let n=this.char();if(123===n){let t=this.parseArgument(e,r);if(t.err)return t;i.push(t.val)}else if(125===n&&e>0)break;else if(35===n&&("plural"===t||"selectordinal"===t)){let e=this.clonePosition();this.bump(),i.push({type:R.pound,location:Y(e,this.clonePosition())})}else if(60!==n||this.ignoreTag||47!==this.peek())if(60===n&&!this.ignoreTag&&et(this.peek()||0)){let r=this.parseTag(e,t);if(r.err)return r;i.push(r.val)}else{let r=this.parseLiteral(e,t);if(r.err)return r;i.push(r.val)}else if(!r)return this.error(M.UNMATCHED_CLOSING_TAG,Y(this.clonePosition(),this.clonePosition()));else break}return{val:i,err:null}}parseTag(e,t){let r=this.clonePosition();this.bump();let i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:R.literal,value:`<${i}/>`,location:Y(r,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(M.INVALID_TAG,Y(r,this.clonePosition()));{let n=this.parseMessage(e+1,t,!0);if(n.err)return n;let s=n.val,o=this.clonePosition();if(!this.bumpIf("</"))return this.error(M.UNCLOSED_TAG,Y(r,this.clonePosition()));{if(this.isEOF()||!et(this.char()))return this.error(M.INVALID_TAG,Y(o,this.clonePosition()));let e=this.clonePosition();return i!==this.parseTagName()?this.error(M.UNMATCHED_CLOSING_TAG,Y(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">"))?{val:{type:R.tag,value:i,children:s,location:Y(r,this.clonePosition())},err:null}:this.error(M.INVALID_TAG,Y(o,this.clonePosition()))}}}parseTagName(){var e;let t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())}parseLiteral(e,t){let r=this.clonePosition(),i="";for(;;){let r=this.tryParseQuote(t);if(r){i+=r;continue}let n=this.tryParseUnquoted(e,t);if(n){i+=n;continue}let s=this.tryParseLeftAngleBracket();if(s){i+=s;continue}break}let n=Y(r,this.clonePosition());return{val:{type:R.literal,value:i,location:n},err:null}}tryParseLeftAngleBracket(){var e;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(et(e=this.peek()||0)||47===e)?null:(this.bump(),"<")}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();let t=[this.char()];for(this.bump();!this.isEOF();){let e=this.char();if(39===e)if(39===this.peek())t.push(39),this.bump();else{this.bump();break}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;let r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){let r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(M.EMPTY_ARGUMENT,Y(r,this.clonePosition()));let i=this.parseIdentifierIfPossible().value;if(!i)return this.error(M.MALFORMED_ARGUMENT,Y(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:R.argument,value:i,location:Y(r,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));return this.parseArgumentOptions(e,t,i,r);default:return this.error(M.MALFORMED_ARGUMENT,Y(r,this.clonePosition()))}}parseIdentifierIfPossible(){var e;let t=this.clonePosition(),r=this.offset(),i=(e=this.message,J.lastIndex=r,J.exec(e)[1]??""),n=r+i.length;return this.bumpTo(n),{value:i,location:Y(t,this.clonePosition())}}parseArgumentOptions(e,t,r,i){let n=this.clonePosition(),s=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(s){case"":return this.error(M.EXPECT_ARGUMENT_TYPE,Y(n,o));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();let t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;let i=q(r.val);if(0===i.length)return this.error(M.EXPECT_ARGUMENT_STYLE,Y(this.clonePosition(),this.clonePosition()));e={style:i,styleLocation:Y(t,this.clonePosition())}}let t=this.tryParseArgumentClose(i);if(t.err)return t;let n=Y(i,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Q(e.style.slice(2));if("number"===s){let i=this.parseNumberSkeletonFromString(t,e.styleLocation);if(i.err)return i;return{val:{type:R.number,value:r,location:n,style:i.val},err:null}}{let i;if(0===t.length)return this.error(M.EXPECT_DATE_TIME_SKELETON,n);let o=t;this.locale&&(o=function(e,t){let r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);if("j"===n){let s=0;for(;i+1<e.length&&e.charAt(i+1)===n;)s++,i++;let o=1+(1&s),h=s<2?1:3+(s>>1),a=function(e){let t,r=e.hourCycle;if(void 0===r&&e.hourCycles&&e.hourCycles.length&&(r=e.hourCycles[0]),r)switch(r){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}let i=e.language;return"root"!==i&&(t=e.maximize().region),(X[t||""]||X[i||""]||X[`${i}-001`]||X["001"])[0]}(t);for(("H"==a||"k"==a)&&(h=0);h-- >0;)r+="a";for(;o-- >0;)r=a+r}else"J"===n?r+="H":r+=n}return r}(t,this.locale));let h={type:C.dateTime,pattern:o,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?(i={},o.replace(d,e=>{let t=e.length;switch(e[0]){case"G":i.era=4===t?"long":5===t?"narrow":"short";break;case"y":i.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":i.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":i.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":i.weekday=4===t?"long":5===t?"narrow":"short";break;case"e":if(t<4)throw RangeError("`e..eee` (weekday) patterns are not supported");i.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");i.weekday=["short","long","narrow","short"][t-4];break;case"a":i.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":i.hourCycle="h12",i.hour=["numeric","2-digit"][t-1];break;case"H":i.hourCycle="h23",i.hour=["numeric","2-digit"][t-1];break;case"K":i.hourCycle="h11",i.hour=["numeric","2-digit"][t-1];break;case"k":i.hourCycle="h24",i.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":i.minute=["numeric","2-digit"][t-1];break;case"s":i.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":i.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),i):{}};return{val:{type:"date"===s?R.date:R.time,value:r,location:n,style:h},err:null}}}return{val:{type:"number"===s?R.number:"date"===s?R.date:R.time,value:r,location:n,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{let n=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(M.EXPECT_SELECT_ARGUMENT_OPTIONS,Y(n,{...n}));this.bumpSpace();let o=this.parseIdentifierIfPossible(),h=0;if("select"!==s&&"offset"===o.value){if(!this.bumpIf(":"))return this.error(M.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Y(this.clonePosition(),this.clonePosition()));this.bumpSpace();let e=this.tryParseDecimalInteger(M.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),o=this.parseIdentifierIfPossible(),h=e.val}let a=this.tryParsePluralOrSelectOptions(e,s,t,o);if(a.err)return a;let l=this.tryParseArgumentClose(i);if(l.err)return l;let u=Y(i,this.clonePosition());if("select"===s)return{val:{type:R.select,value:r,options:z(a.val),location:u},err:null};return{val:{type:R.plural,value:r,options:z(a.val),offset:h,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(M.INVALID_ARGUMENT_TYPE,Y(n,o))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0,t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(M.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Y(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw Error("Number skeleton cannot be empty");let t=e.split(A).filter(e=>e.length>0),r=[];for(let e of t){let t=e.split("/");if(0===t.length)throw Error("Invalid number skeleton");let[i,...n]=t;for(let e of n)if(0===e.length)throw Error("Invalid number skeleton");r.push({stem:i,options:n})}return r}(e)}catch{return this.error(M.INVALID_NUMBER_SKELETON,t)}return{val:{type:C.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?function(e){let t={};for(let r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=r.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...P(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...P(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw RangeError("integer-width stems only accept a single optional option");r.options[0].replace(N,function(e,r,i,n,s,o){if(r)t.minimumIntegerDigits=i.length;else if(n&&s)throw Error("We currently do not support maximum integer digits");else if(o)throw Error("We currently do not support exact integer digits");return""});continue}if(S.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(_.test(r.stem)){if(r.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(_,function(e,r,i,n,s,o){return"*"===i?t.minimumFractionDigits=r.length:n&&"#"===n[0]?t.maximumFractionDigits=n.length:s&&o?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+o.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});let e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...I(e)});continue}if(y.test(r.stem)){t={...t,...I(r.stem)};continue}let e=L(r.stem);e&&(t={...t,...e});let i=function(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){let r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!S.test(e))throw Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}(r.stem);i&&(t={...t,...i})}return t}(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,i){let n=!1,s=[],o=new Set,{value:h,location:a}=i;for(;;){if(0===h.length){let e=this.clonePosition();if("select"!==t&&this.bumpIf("=")){let t=this.tryParseDecimalInteger(M.EXPECT_PLURAL_ARGUMENT_SELECTOR,M.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;a=Y(e,this.clonePosition()),h=this.message.slice(e.offset,this.offset())}else break}if(o.has(h))return this.error("select"===t?M.DUPLICATE_SELECT_ARGUMENT_SELECTOR:M.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,a);"other"===h&&(n=!0),this.bumpSpace();let i=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?M.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:M.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Y(this.clonePosition(),this.clonePosition()));let l=this.parseMessage(e+1,t,r);if(l.err)return l;let u=this.tryParseArgumentClose(i);if(u.err)return u;s.push([h,{value:l.val,location:Y(i,this.clonePosition())}]),o.add(h),this.bumpSpace(),{value:h,location:a}=this.parseIdentifierIfPossible()}return 0===s.length?this.error("select"===t?M.EXPECT_SELECT_ARGUMENT_SELECTOR:M.EXPECT_PLURAL_ARGUMENT_SELECTOR,Y(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!n?this.error(M.MISSING_OTHER_CLAUSE,Y(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let n=!1,s=0;for(;!this.isEOF();){let e=this.char();if(e>=48&&e<=57)n=!0,s=10*s+(e-48),this.bump();else break}let o=Y(i,this.clonePosition());return n?Number.isSafeInteger(s*=r)?{val:s,err:null}:this.error(t,o):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");let t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;let e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){let t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){let t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(var e;!this.isEOF()&&((e=this.char())>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e);)this.bump()}peek(){if(this.isEOF())return null;let e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function et(e){return e>=97&&e<=122||e>=65&&e<=90}function er(e,t={}){let r=new ee(e,t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t}).parse();if(r.err){let e=SyntaxError(M[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||function e(t){t.forEach(t=>{if(delete t.location,F(t)||w(t))for(let r in t.options)delete t.options[r].location,e(t.options[r].value);else G(t)&&k(t.style)||(v(t)||U(t))&&V(t.style)?delete t.style.location:D(t)&&e(t.children)})}(r.val),r.val}let ei=((s={}).MISSING_VALUE="MISSING_VALUE",s.INVALID_VALUE="INVALID_VALUE",s.MISSING_INTL_API="MISSING_INTL_API",s);var en=class extends Error{constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},es=class extends en{constructor(e,t,r,i){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,ei.INVALID_VALUE,i)}},eo=class extends en{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,ei.INVALID_VALUE,r)}},eh=class extends en{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,ei.MISSING_VALUE,t)}};let ea=((o={})[o.literal=0]="literal",o[o.object=1]="object",o);function el(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}var eu=class e{constructor(t,r=e.defaultLocale,i,n){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=e=>{let t=this.formatToParts(e);if(1===t.length)return t[0].value;let r=t.reduce((e,t)=>(e.length&&t.type===ea.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r},this.formatToParts=e=>(function e(t,r,i,n,s,o,h){if(1===t.length&&O(t[0]))return[{type:ea.literal,value:t[0].value}];let a=[];for(let l of t){if(O(l)){a.push({type:ea.literal,value:l.value});continue}if(l.type===R.pound){"number"==typeof o&&a.push({type:ea.literal,value:i.getNumberFormat(r).format(o)});continue}let{value:t}=l;if(!(s&&t in s))throw new eh(t,h);let u=s[t];if(l.type===R.argument){u&&"string"!=typeof u&&"number"!=typeof u&&"bigint"!=typeof u||(u="string"==typeof u||"number"==typeof u||"bigint"==typeof u?String(u):""),a.push({type:"string"==typeof u?ea.literal:ea.object,value:u});continue}if(v(l)){let e="string"==typeof l.style?n.date[l.style]:V(l.style)?l.style.parsedOptions:void 0;a.push({type:ea.literal,value:i.getDateTimeFormat(r,e).format(u)});continue}if(U(l)){let e="string"==typeof l.style?n.time[l.style]:V(l.style)?l.style.parsedOptions:n.time.medium;a.push({type:ea.literal,value:i.getDateTimeFormat(r,e).format(u)});continue}if(G(l)){let e="string"==typeof l.style?n.number[l.style]:k(l.style)?l.style.parsedOptions:void 0;if(e&&e.scale){let t=e.scale||1;if("bigint"==typeof u){if(!Number.isInteger(t))throw TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);u*=BigInt(t)}else u*=t}a.push({type:ea.literal,value:i.getNumberFormat(r,e).format(u)});continue}if(D(l)){let{children:t,value:u}=l,c=s[u];if("function"!=typeof c)throw new eo(u,"function",h);let m=c(e(t,r,i,n,s,o).map(e=>e.value));Array.isArray(m)||(m=[m]),a.push(...m.map(e=>({type:"string"==typeof e?ea.literal:ea.object,value:e})))}if(F(l)){let t=u,o=(Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0)||l.options.other;if(!o)throw new es(l.value,u,Object.keys(l.options),h);a.push(...e(o.value,r,i,n,s));continue}if(w(l)){let t=`=${u}`,o=Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0;if(!o){if(!Intl.PluralRules)throw new en(`Intl.PluralRules is not available in this environment.
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,167559,e=>{"use strict";var t,r,i,n,s,o,h=e.i(191788);function a(e,t){let r=t&&t.cache?t.cache:f,i=t&&t.serializer?t.serializer:c;return(t&&t.strategy?t.strategy:function(e,t){var r,i;let n=1===e.length?l:u;return r=t.cache.create(),i=t.serializer,n.bind(this,e,r,i)})(e,{cache:r,serializer:i})}function l(e,t,r,i){let n=null==i||"number"==typeof i||"boolean"==typeof i?i:r(i),s=t.get(n);return void 0===s&&(s=e.call(this,i),t.set(n,s)),s}function u(e,t,r){let i=Array.prototype.slice.call(arguments,3),n=r(i),s=t.get(n);return void 0===s&&(s=e.apply(this,i),t.set(n,s)),s}let c=function(){return JSON.stringify(arguments)};var m=class{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}};let f={create:function(){return new m}},E={variadic:function(e,t){var r,i;return r=t.cache.create(),i=t.serializer,u.bind(this,e,r,i)},monadic:function(e,t){var r,i;return r=t.cache.create(),i=t.serializer,l.bind(this,e,r,i)}};class p extends Error{constructor(e,t){let r=e;t&&(r+=": "+t),super(r),this.code=e,t&&(this.originalMessage=t)}}var g=((t=g||{}).MISSING_MESSAGE="MISSING_MESSAGE",t.MISSING_FORMAT="MISSING_FORMAT",t.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",t.INSUFFICIENT_PATH="INSUFFICIENT_PATH",t.INVALID_MESSAGE="INVALID_MESSAGE",t.INVALID_KEY="INVALID_KEY",t.FORMATTING_ERROR="FORMATTING_ERROR",t);function b(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function T(e,t){return a(e,{cache:{create:()=>({get:e=>t[e],set(e,r){t[e]=r}})},strategy:E.variadic})}function H(e,t){return T((...t)=>new e(...t),t)}function B(e){return{getDateTimeFormat:H(Intl.DateTimeFormat,e.dateTime),getNumberFormat:H(Intl.NumberFormat,e.number),getPluralRules:H(Intl.PluralRules,e.pluralRules),getRelativeTimeFormat:H(Intl.RelativeTimeFormat,e.relativeTime),getListFormat:H(Intl.ListFormat,e.list),getDisplayNames:H(Intl.DisplayNames,e.displayNames)}}let d=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g,A=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,y=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,_=/^(@+)?(\+|#+)?[rs]?$/g,N=/(\*)(0+)|(#+)(0+)|(0+)/g,S=/^(0+)$/;function I(e){let t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(_,function(e,r,i){return"string"!=typeof i?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===i?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof i?i.length:0)),""}),t}function L(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function P(e){let t=L(e);return t||{}}let M=((r={})[r.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",r[r.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",r[r.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",r[r.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",r[r.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",r[r.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",r[r.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",r[r.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",r[r.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",r[r.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",r[r.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",r[r.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",r[r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",r[r.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",r[r.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",r[r.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",r[r.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",r[r.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",r[r.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",r[r.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",r[r.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",r[r.INVALID_TAG=23]="INVALID_TAG",r[r.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",r[r.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",r[r.UNCLOSED_TAG=27]="UNCLOSED_TAG",r),R=((i={})[i.literal=0]="literal",i[i.argument=1]="argument",i[i.number=2]="number",i[i.date=3]="date",i[i.time=4]="time",i[i.select=5]="select",i[i.plural=6]="plural",i[i.pound=7]="pound",i[i.tag=8]="tag",i),C=((n={})[n.number=0]="number",n[n.dateTime=1]="dateTime",n);function O(e){return e.type===R.literal}function G(e){return e.type===R.number}function v(e){return e.type===R.date}function U(e){return e.type===R.time}function F(e){return e.type===R.select}function w(e){return e.type===R.plural}function D(e){return e.type===R.tag}function k(e){return!!(e&&"object"==typeof e&&e.type===C.number)}function V(e){return!!(e&&"object"==typeof e&&e.type===C.dateTime)}let K=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,X={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]},x=RegExp(`^${K.source}*`),Z=RegExp(`${K.source}*$`);function Y(e,t){return{start:e,end:t}}let j=!!Object.fromEntries,$=!!String.prototype.trimStart,W=!!String.prototype.trimEnd,z=j?Object.fromEntries:function(e){let t={};for(let[r,i]of e)t[r]=i;return t},Q=$?function(e){return e.trimStart()}:function(e){return e.replace(x,"")},q=W?function(e){return e.trimEnd()}:function(e){return e.replace(Z,"")},J=RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");var ee=class{constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let i=[];for(;!this.isEOF();){let n=this.char();if(123===n){let t=this.parseArgument(e,r);if(t.err)return t;i.push(t.val)}else if(125===n&&e>0)break;else if(35===n&&("plural"===t||"selectordinal"===t)){let e=this.clonePosition();this.bump(),i.push({type:R.pound,location:Y(e,this.clonePosition())})}else if(60!==n||this.ignoreTag||47!==this.peek())if(60===n&&!this.ignoreTag&&et(this.peek()||0)){let r=this.parseTag(e,t);if(r.err)return r;i.push(r.val)}else{let r=this.parseLiteral(e,t);if(r.err)return r;i.push(r.val)}else if(!r)return this.error(M.UNMATCHED_CLOSING_TAG,Y(this.clonePosition(),this.clonePosition()));else break}return{val:i,err:null}}parseTag(e,t){let r=this.clonePosition();this.bump();let i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:R.literal,value:`<${i}/>`,location:Y(r,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(M.INVALID_TAG,Y(r,this.clonePosition()));{let n=this.parseMessage(e+1,t,!0);if(n.err)return n;let s=n.val,o=this.clonePosition();if(!this.bumpIf("</"))return this.error(M.UNCLOSED_TAG,Y(r,this.clonePosition()));{if(this.isEOF()||!et(this.char()))return this.error(M.INVALID_TAG,Y(o,this.clonePosition()));let e=this.clonePosition();return i!==this.parseTagName()?this.error(M.UNMATCHED_CLOSING_TAG,Y(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">"))?{val:{type:R.tag,value:i,children:s,location:Y(r,this.clonePosition())},err:null}:this.error(M.INVALID_TAG,Y(o,this.clonePosition()))}}}parseTagName(){var e;let t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())}parseLiteral(e,t){let r=this.clonePosition(),i="";for(;;){let r=this.tryParseQuote(t);if(r){i+=r;continue}let n=this.tryParseUnquoted(e,t);if(n){i+=n;continue}let s=this.tryParseLeftAngleBracket();if(s){i+=s;continue}break}let n=Y(r,this.clonePosition());return{val:{type:R.literal,value:i,location:n},err:null}}tryParseLeftAngleBracket(){var e;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(et(e=this.peek()||0)||47===e)?null:(this.bump(),"<")}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();let t=[this.char()];for(this.bump();!this.isEOF();){let e=this.char();if(39===e)if(39===this.peek())t.push(39),this.bump();else{this.bump();break}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;let r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){let r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(M.EMPTY_ARGUMENT,Y(r,this.clonePosition()));let i=this.parseIdentifierIfPossible().value;if(!i)return this.error(M.MALFORMED_ARGUMENT,Y(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:R.argument,value:i,location:Y(r,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(r,this.clonePosition()));return this.parseArgumentOptions(e,t,i,r);default:return this.error(M.MALFORMED_ARGUMENT,Y(r,this.clonePosition()))}}parseIdentifierIfPossible(){var e;let t=this.clonePosition(),r=this.offset(),i=(e=this.message,J.lastIndex=r,J.exec(e)[1]??""),n=r+i.length;return this.bumpTo(n),{value:i,location:Y(t,this.clonePosition())}}parseArgumentOptions(e,t,r,i){let n=this.clonePosition(),s=this.parseIdentifierIfPossible().value,o=this.clonePosition();switch(s){case"":return this.error(M.EXPECT_ARGUMENT_TYPE,Y(n,o));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();let t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;let i=q(r.val);if(0===i.length)return this.error(M.EXPECT_ARGUMENT_STYLE,Y(this.clonePosition(),this.clonePosition()));e={style:i,styleLocation:Y(t,this.clonePosition())}}let t=this.tryParseArgumentClose(i);if(t.err)return t;let n=Y(i,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Q(e.style.slice(2));if("number"===s){let i=this.parseNumberSkeletonFromString(t,e.styleLocation);if(i.err)return i;return{val:{type:R.number,value:r,location:n,style:i.val},err:null}}{let i;if(0===t.length)return this.error(M.EXPECT_DATE_TIME_SKELETON,n);let o=t;this.locale&&(o=function(e,t){let r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);if("j"===n){let s=0;for(;i+1<e.length&&e.charAt(i+1)===n;)s++,i++;let o=1+(1&s),h=s<2?1:3+(s>>1),a=function(e){let t,r=e.hourCycle;if(void 0===r&&e.hourCycles&&e.hourCycles.length&&(r=e.hourCycles[0]),r)switch(r){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}let i=e.language;return"root"!==i&&(t=e.maximize().region),(X[t||""]||X[i||""]||X[`${i}-001`]||X["001"])[0]}(t);for(("H"==a||"k"==a)&&(h=0);h-- >0;)r+="a";for(;o-- >0;)r=a+r}else"J"===n?r+="H":r+=n}return r}(t,this.locale));let h={type:C.dateTime,pattern:o,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?(i={},o.replace(d,e=>{let t=e.length;switch(e[0]){case"G":i.era=4===t?"long":5===t?"narrow":"short";break;case"y":i.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":i.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":i.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":i.weekday=4===t?"long":5===t?"narrow":"short";break;case"e":if(t<4)throw RangeError("`e..eee` (weekday) patterns are not supported");i.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");i.weekday=["short","long","narrow","short"][t-4];break;case"a":i.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":i.hourCycle="h12",i.hour=["numeric","2-digit"][t-1];break;case"H":i.hourCycle="h23",i.hour=["numeric","2-digit"][t-1];break;case"K":i.hourCycle="h11",i.hour=["numeric","2-digit"][t-1];break;case"k":i.hourCycle="h24",i.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":i.minute=["numeric","2-digit"][t-1];break;case"s":i.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":i.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),i):{}};return{val:{type:"date"===s?R.date:R.time,value:r,location:n,style:h},err:null}}}return{val:{type:"number"===s?R.number:"date"===s?R.date:R.time,value:r,location:n,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{let n=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(M.EXPECT_SELECT_ARGUMENT_OPTIONS,Y(n,{...n}));this.bumpSpace();let o=this.parseIdentifierIfPossible(),h=0;if("select"!==s&&"offset"===o.value){if(!this.bumpIf(":"))return this.error(M.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Y(this.clonePosition(),this.clonePosition()));this.bumpSpace();let e=this.tryParseDecimalInteger(M.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),o=this.parseIdentifierIfPossible(),h=e.val}let a=this.tryParsePluralOrSelectOptions(e,s,t,o);if(a.err)return a;let l=this.tryParseArgumentClose(i);if(l.err)return l;let u=Y(i,this.clonePosition());if("select"===s)return{val:{type:R.select,value:r,options:z(a.val),location:u},err:null};return{val:{type:R.plural,value:r,options:z(a.val),offset:h,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(M.INVALID_ARGUMENT_TYPE,Y(n,o))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(M.EXPECT_ARGUMENT_CLOSING_BRACE,Y(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0,t=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(M.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Y(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw Error("Number skeleton cannot be empty");let t=e.split(A).filter(e=>e.length>0),r=[];for(let e of t){let t=e.split("/");if(0===t.length)throw Error("Invalid number skeleton");let[i,...n]=t;for(let e of n)if(0===e.length)throw Error("Invalid number skeleton");r.push({stem:i,options:n})}return r}(e)}catch{return this.error(M.INVALID_NUMBER_SKELETON,t)}return{val:{type:C.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?function(e){let t={};for(let r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=r.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...P(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...P(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw RangeError("integer-width stems only accept a single optional option");r.options[0].replace(N,function(e,r,i,n,s,o){if(r)t.minimumIntegerDigits=i.length;else if(n&&s)throw Error("We currently do not support maximum integer digits");else if(o)throw Error("We currently do not support exact integer digits");return""});continue}if(S.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(y.test(r.stem)){if(r.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(y,function(e,r,i,n,s,o){return"*"===i?t.minimumFractionDigits=r.length:n&&"#"===n[0]?t.maximumFractionDigits=n.length:s&&o?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+o.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});let e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...I(e)});continue}if(_.test(r.stem)){t={...t,...I(r.stem)};continue}let e=L(r.stem);e&&(t={...t,...e});let i=function(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){let r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!S.test(e))throw Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}(r.stem);i&&(t={...t,...i})}return t}(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,i){let n=!1,s=[],o=new Set,{value:h,location:a}=i;for(;;){if(0===h.length){let e=this.clonePosition();if("select"!==t&&this.bumpIf("=")){let t=this.tryParseDecimalInteger(M.EXPECT_PLURAL_ARGUMENT_SELECTOR,M.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;a=Y(e,this.clonePosition()),h=this.message.slice(e.offset,this.offset())}else break}if(o.has(h))return this.error("select"===t?M.DUPLICATE_SELECT_ARGUMENT_SELECTOR:M.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,a);"other"===h&&(n=!0),this.bumpSpace();let i=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?M.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:M.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Y(this.clonePosition(),this.clonePosition()));let l=this.parseMessage(e+1,t,r);if(l.err)return l;let u=this.tryParseArgumentClose(i);if(u.err)return u;s.push([h,{value:l.val,location:Y(i,this.clonePosition())}]),o.add(h),this.bumpSpace(),{value:h,location:a}=this.parseIdentifierIfPossible()}return 0===s.length?this.error("select"===t?M.EXPECT_SELECT_ARGUMENT_SELECTOR:M.EXPECT_PLURAL_ARGUMENT_SELECTOR,Y(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!n?this.error(M.MISSING_OTHER_CLAUSE,Y(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let n=!1,s=0;for(;!this.isEOF();){let e=this.char();if(e>=48&&e<=57)n=!0,s=10*s+(e-48),this.bump();else break}let o=Y(i,this.clonePosition());return n?Number.isSafeInteger(s*=r)?{val:s,err:null}:this.error(t,o):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");let t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;let e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){let t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){let t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(var e;!this.isEOF()&&((e=this.char())>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e);)this.bump()}peek(){if(this.isEOF())return null;let e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}};function et(e){return e>=97&&e<=122||e>=65&&e<=90}function er(e,t={}){let r=new ee(e,t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t}).parse();if(r.err){let e=SyntaxError(M[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||function e(t){t.forEach(t=>{if(delete t.location,F(t)||w(t))for(let r in t.options)delete t.options[r].location,e(t.options[r].value);else G(t)&&k(t.style)||(v(t)||U(t))&&V(t.style)?delete t.style.location:D(t)&&e(t.children)})}(r.val),r.val}let ei=((s={}).MISSING_VALUE="MISSING_VALUE",s.INVALID_VALUE="INVALID_VALUE",s.MISSING_INTL_API="MISSING_INTL_API",s);var en=class extends Error{constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}},es=class extends en{constructor(e,t,r,i){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,ei.INVALID_VALUE,i)}},eo=class extends en{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,ei.INVALID_VALUE,r)}},eh=class extends en{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,ei.MISSING_VALUE,t)}};let ea=((o={})[o.literal=0]="literal",o[o.object=1]="object",o);function el(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}var eu=class e{constructor(t,r=e.defaultLocale,i,n){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=e=>{let t=this.formatToParts(e);if(1===t.length)return t[0].value;let r=t.reduce((e,t)=>(e.length&&t.type===ea.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r},this.formatToParts=e=>(function e(t,r,i,n,s,o,h){if(1===t.length&&O(t[0]))return[{type:ea.literal,value:t[0].value}];let a=[];for(let l of t){if(O(l)){a.push({type:ea.literal,value:l.value});continue}if(l.type===R.pound){"number"==typeof o&&a.push({type:ea.literal,value:i.getNumberFormat(r).format(o)});continue}let{value:t}=l;if(!(s&&t in s))throw new eh(t,h);let u=s[t];if(l.type===R.argument){u&&"string"!=typeof u&&"number"!=typeof u&&"bigint"!=typeof u||(u="string"==typeof u||"number"==typeof u||"bigint"==typeof u?String(u):""),a.push({type:"string"==typeof u?ea.literal:ea.object,value:u});continue}if(v(l)){let e="string"==typeof l.style?n.date[l.style]:V(l.style)?l.style.parsedOptions:void 0;a.push({type:ea.literal,value:i.getDateTimeFormat(r,e).format(u)});continue}if(U(l)){let e="string"==typeof l.style?n.time[l.style]:V(l.style)?l.style.parsedOptions:n.time.medium;a.push({type:ea.literal,value:i.getDateTimeFormat(r,e).format(u)});continue}if(G(l)){let e="string"==typeof l.style?n.number[l.style]:k(l.style)?l.style.parsedOptions:void 0;if(e&&e.scale){let t=e.scale||1;if("bigint"==typeof u){if(!Number.isInteger(t))throw TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);u*=BigInt(t)}else u*=t}a.push({type:ea.literal,value:i.getNumberFormat(r,e).format(u)});continue}if(D(l)){let{children:t,value:u}=l,c=s[u];if("function"!=typeof c)throw new eo(u,"function",h);let m=c(e(t,r,i,n,s,o).map(e=>e.value));Array.isArray(m)||(m=[m]),a.push(...m.map(e=>({type:"string"==typeof e?ea.literal:ea.object,value:e})))}if(F(l)){let t=u,o=(Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0)||l.options.other;if(!o)throw new es(l.value,u,Object.keys(l.options),h);a.push(...e(o.value,r,i,n,s));continue}if(w(l)){let t=`=${u}`,o=Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0;if(!o){if(!Intl.PluralRules)throw new en(`Intl.PluralRules is not available in this environment.
|
|
2
2
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3
|
-
`,ei.MISSING_INTL_API,h);let e="bigint"==typeof u?Number(u):u,t=i.getPluralRules(r,{type:l.pluralType}).select(e-(l.offset||0));o=(Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0)||l.options.other}if(!o)throw new es(l.value,u,Object.keys(l.options),h);let c="bigint"==typeof u?Number(u):u;a.push(...e(o.value,r,i,n,s,c-(l.offset||0)));continue}}return a.length<2?a:a.reduce((e,t)=>{let r=e[e.length-1];return r&&r.type===ea.literal&&t.type===ea.literal?r.value+=t.value:e.push(t),e},[])})(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message),this.resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}),this.getAst=()=>this.ast,this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...r}=n||{};this.ast=e.__parse(t,{...r,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((r,i)=>{var n,s;return r[i]=(n=e[i],(s=t[i])?{...n,...s,...Object.keys(n).reduce((e,t)=>(e[t]={...n[t],...s[t]},e),{})}:n),r},{...e}):e}(e.formats,i),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:a((...e)=>new Intl.NumberFormat(...e),{cache:el(e.number),strategy:E.variadic}),getDateTimeFormat:a((...e)=>new Intl.DateTimeFormat(...e),{cache:el(e.dateTime),strategy:E.variadic}),getPluralRules:a((...e)=>new Intl.PluralRules(...e),{cache:el(e.pluralRules),strategy:E.variadic})}}(this.formatterCache)}static{this.memoizedDefaultLocale=null}static get defaultLocale(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale}static{this.resolveLocale=e=>{if(void 0===Intl.Locale)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return new Intl.Locale(t.length>0?t[0]:"string"==typeof e?e:e[0])}}static{this.__parse=er}static{this.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}};function ec(...[e,t,r,i]){let n;if(Array.isArray(t))throw new p(g.INVALID_MESSAGE,void 0);if("object"==typeof t)throw new p(g.INSUFFICIENT_PATH,void 0);if("string"==typeof t){let e=r||/'[{}]/.test(t)?void 0:t;if(e)return e}let{cache:s,formats:o,formatters:a,globalFormats:l,locale:u,timeZone:c}=i;a.getMessageFormat||(a.getMessageFormat=T((...e)=>new eu(e[0],e[1],e[2],{formatters:a,...e[3]}),s.message));try{let e,r,i,s;n=a.getMessageFormat(t,u,(e=eu.formats.date,r=eu.formats.time,i={...l?.dateTime,...o?.dateTime},s={date:{...e,...i},time:{...r,...i},number:{...l?.number,...o?.number}},c&&["date","time"].forEach(e=>{let t=s[e];for(let[e,r]of Object.entries(t))t[e]={timeZone:c,...r}}),s),{formatters:{...a,getDateTimeFormat:(e,t)=>a.getDateTimeFormat(e,{...t,timeZone:t?.timeZone??c})}})}catch(e){throw new p(g.INVALID_MESSAGE,void 0)}let m=n.format(r);return(0,h.isValidElement)(m)||Array.isArray(m)||"string"==typeof m?m:String(m)}function em(...e){return e.filter(Boolean).join(".")}function ef(e){return em(e.namespace,e.key)}function eE(e){console.error(e)}function ep(e,t,r,i){let n=em(i,r);if(!t)throw Error(n);let s=t;return r.split(".").forEach(t=>{let r=s[t];if(null==t||null==r)throw Error(n+` (${e})`);s=r}),s}ec.raw=!0;let eg={second:1,seconds:1,minute:60,minutes:60,hour:3600,hours:3600,day:86400,days:86400,week:604800,weeks:604800,month:2628e3,months:2628e3,quarter:7884e3,quarters:7884e3,year:31536e3,years:31536e3};var eb=e.i(391398);let eT=(0,h.createContext)(void 0);function eH(){let e=(0,h.useContext)(eT);if(!e)throw Error(void 0);return e}let eB=!1,ed="u"<typeof window;e.s(["IntlProvider",0,function({children:e,formats:t,getMessageFallback:r,locale:i,messages:n,now:s,onError:o,timeZone:a}){let l=(0,h.useContext)(eT),u=(0,h.useMemo)(()=>l?.cache||b(),[i,l?.cache]),c=(0,h.useMemo)(()=>l?.formatters||B(u),[u,l?.formatters]),m=(0,h.useMemo)(()=>({...function({formats:e,getMessageFallback:t,messages:r,onError:i,...n}){return{...n,formats:e||void 0,messages:r||void 0,onError:i||eE,getMessageFallback:t||ef}}({locale:i,formats:void 0===t?l?.formats:t,getMessageFallback:r||l?.getMessageFallback,messages:void 0===n?l?.messages:n,now:s||l?.now,onError:o||l?.onError,timeZone:a||l?.timeZone}),formatters:c,cache:u}),[u,t,c,r,i,n,s,o,l,a]);return(0,eb.jsx)(eT.Provider,{value:m,children:e})},"useFormatter",0,function(){let{formats:e,formatters:t,locale:r,now:i,onError:n,timeZone:s}=eH();return(0,h.useMemo)(()=>(function(e){let{_cache:t=b(),_formatters:r=B(t),formats:i,locale:n,onError:s=eE,timeZone:o}=e;function h(e){return e?.timeZone||(o?e={...e,timeZone:o}:s(new p(g.ENVIRONMENT_FALLBACK,void 0))),e}function a(e,t,r,i,n){let o;try{o=function(e,t,r){let i;if("string"==typeof t){if(!(i=e?.[t])){let e=new p(g.MISSING_FORMAT,void 0);throw s(e),e}}else i=t;return r&&(i={...i,...r}),i}(r,e,t)}catch{return n()}try{return i(o)}catch(e){return s(new p(g.FORMATTING_ERROR,e.message)),n()}}function l(e,t,s){return a(t,s,i?.dateTime,t=>(t=h(t),r.getDateTimeFormat(n,t).format(e)),()=>String(e))}function u(){return e.now?e.now:(s(new p(g.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:l,number:function(e,t,s){return a(t,s,i?.number,t=>r.getNumberFormat(n,t).format(e),()=>String(e))},relativeTime:function(e,t){try{var i;let s,o,h,a={};t instanceof Date||"number"==typeof t?s=new Date(t):t&&(s=null!=t.now?new Date(t.now):u(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),s||(s=u());let l=(new Date(e).getTime()-s.getTime())/1e3;o||(o=(h=Math.abs(l))<60?"second":h<3600?"minute":h<86400?"hour":h<604800?"day":h<2628e3?"week":h<31536e3?"month":"year"),a.numeric="second"===o?"auto":"always";let c=(i=o,Math.round(l/eg[i]));return r.getRelativeTimeFormat(n,a).format(c,o)}catch(t){return s(new p(g.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,s){let o=[],h=new Map,l=0;for(let t of e){let e;"object"==typeof t?(e=String(l),h.set(e,t)):e=String(t),o.push(e),l++}return a(t,s,i?.list,e=>{let t=r.getListFormat(n,e).formatToParts(o).map(e=>"literal"===e.type?e.value:h.get(e.value)||e.value);return h.size>0?t:t.join("")},()=>String(e))},dateTimeRange:function(e,t,s,o){return a(s,o,i?.dateTime,i=>(i=h(i),r.getDateTimeFormat(n,i).formatRange(e,t)),()=>[l(e),l(t)].join(" – "))}}})({formats:e,locale:r,now:i,onError:n,timeZone:s,_formatters:t}),[e,t,i,r,n,s])},"useTranslations",0,function(e){return function(e,t){let{cache:r,formats:i,formatters:n,getMessageFallback:s,locale:o,onError:a,timeZone:l}=eH(),u=e["!"],c="!"===t?void 0:t.slice(2);return l||eB||!ed||(eB=!0,a(new p(g.ENVIRONMENT_FALLBACK,void 0))),(0,h.useMemo)(()=>{var e;let t;return t=function(e,t,r){try{if(!t)throw Error(void 0);let i=r?ep(e,t,r):t;if(!i)throw Error(r);return i}catch(e){return new p(g.MISSING_MESSAGE,e.message)}}((e={cache:r,formatters:n,getMessageFallback:s,messages:u,namespace:c,onError:a,formats:i,locale:o,timeZone:l}).locale,e.messages,e.namespace),function({cache:e,formats:t,formatters:r,getMessageFallback:i=ef,locale:n,messagesOrError:s,namespace:o,onError:a,timeZone:l}){let u=s instanceof p;function c(e,t,r,n){let s=new p(t,r);return a(s),n??i({error:s,key:e,namespace:o})}function m(m,f,E,b){let T;if(u){if(!b)return a(s),i({error:s,key:m,namespace:o});T=b}else try{T=ep(n,s,m,o)}catch(e){if(!b)return c(m,g.MISSING_MESSAGE,e.message,b);T=b}try{let i,s=em(o,m);return ec(s,T,f?(i={},Object.keys(f).forEach(e=>{let t,r=0,n=f[e];t="function"==typeof n?t=>{let i=n(t);return(0,h.isValidElement)(i)?(0,h.cloneElement)(i,{key:e+r++}):i}:n,i[e]=t}),i):f,{cache:e,formatters:r,globalFormats:t,formats:E,locale:n,timeZone:l})}catch(r){let e,t;return r instanceof p?(e=r.code,t=r.originalMessage):(e=g.FORMATTING_ERROR,t=r.message),c(m,e,t,b)}}function f(e,t,r,i){let n=m(e,t,r,i);return"string"!=typeof n?c(e,g.INVALID_MESSAGE,void 0):n}return f.rich=m,f.markup=(e,t,r,i)=>m(e,t,r,i),f.raw=e=>{if(u)return a(s),i({error:s,key:e,namespace:o});try{return ep(n,s,e,o)}catch(t){return c(e,g.MISSING_MESSAGE,t.message)}},f.has=e=>{if(u)return!1;try{return ep(n,s,e,o),!0}catch{return!1}},f}({...e,messagesOrError:t})},[r,n,s,u,c,a,i,o,l])}({"!":eH().messages},e?`!.${e}`:"!")}],167559)}]);
|
|
3
|
+
`,ei.MISSING_INTL_API,h);let e="bigint"==typeof u?Number(u):u,t=i.getPluralRules(r,{type:l.pluralType}).select(e-(l.offset||0));o=(Object.prototype.hasOwnProperty.call(l.options,t)?l.options[t]:void 0)||l.options.other}if(!o)throw new es(l.value,u,Object.keys(l.options),h);let c="bigint"==typeof u?Number(u):u;a.push(...e(o.value,r,i,n,s,c-(l.offset||0)));continue}}return a.length<2?a:a.reduce((e,t)=>{let r=e[e.length-1];return r&&r.type===ea.literal&&t.type===ea.literal?r.value+=t.value:e.push(t),e},[])})(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message),this.resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}),this.getAst=()=>this.ast,this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...r}=n||{};this.ast=e.__parse(t,{...r,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((r,i)=>{var n,s;return r[i]=(n=e[i],(s=t[i])?{...n,...s,...Object.keys(n).reduce((e,t)=>(e[t]={...n[t],...s[t]},e),{})}:n),r},{...e}):e}(e.formats,i),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:a((...e)=>new Intl.NumberFormat(...e),{cache:el(e.number),strategy:E.variadic}),getDateTimeFormat:a((...e)=>new Intl.DateTimeFormat(...e),{cache:el(e.dateTime),strategy:E.variadic}),getPluralRules:a((...e)=>new Intl.PluralRules(...e),{cache:el(e.pluralRules),strategy:E.variadic})}}(this.formatterCache)}static{this.memoizedDefaultLocale=null}static get defaultLocale(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale}static{this.resolveLocale=e=>{if(void 0===Intl.Locale)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return new Intl.Locale(t.length>0?t[0]:"string"==typeof e?e:e[0])}}static{this.__parse=er}static{this.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}};function ec(...[e,t,r,i]){let n;if(Array.isArray(t))throw new p(g.INVALID_MESSAGE,void 0);if("object"==typeof t)throw new p(g.INSUFFICIENT_PATH,void 0);if("string"==typeof t){let e=r||/'[{}]/.test(t)?void 0:t;if(e)return e}let{cache:s,formats:o,formatters:a,globalFormats:l,locale:u,timeZone:c}=i;a.getMessageFormat||(a.getMessageFormat=T((...e)=>new eu(e[0],e[1],e[2],{formatters:a,...e[3]}),s.message));try{let e,r,i,s;n=a.getMessageFormat(t,u,(e=eu.formats.date,r=eu.formats.time,i={...l?.dateTime,...o?.dateTime},s={date:{...e,...i},time:{...r,...i},number:{...l?.number,...o?.number}},c&&["date","time"].forEach(e=>{let t=s[e];for(let[e,r]of Object.entries(t))t[e]={timeZone:c,...r}}),s),{formatters:{...a,getDateTimeFormat:(e,t)=>a.getDateTimeFormat(e,{...t,timeZone:t?.timeZone??c})}})}catch(e){throw new p(g.INVALID_MESSAGE,void 0)}let m=n.format(r);return(0,h.isValidElement)(m)||Array.isArray(m)||"string"==typeof m?m:String(m)}function em(...e){return e.filter(Boolean).join(".")}function ef(e){return em(e.namespace,e.key)}function eE(e){console.error(e)}function ep(e,t,r,i){let n=em(i,r);if(!t)throw Error(n);let s=t;return r.split(".").forEach(t=>{let r=s[t];if(null==t||null==r)throw Error(n+` (${e})`);s=r}),s}ec.raw=!0;let eg={second:1,seconds:1,minute:60,minutes:60,hour:3600,hours:3600,day:86400,days:86400,week:604800,weeks:604800,month:2628e3,months:2628e3,quarter:7884e3,quarters:7884e3,year:31536e3,years:31536e3};var eb=e.i(391398);let eT=(0,h.createContext)(void 0);function eH(){let e=(0,h.useContext)(eT);if(!e)throw Error(void 0);return e}let eB=!1,ed="u"<typeof window;e.s(["IntlProvider",0,function({children:e,formats:t,getMessageFallback:r,locale:i,messages:n,now:s,onError:o,timeZone:a}){let l=(0,h.useContext)(eT),u=(0,h.useMemo)(()=>l?.cache||b(),[i,l?.cache]),c=(0,h.useMemo)(()=>l?.formatters||B(u),[u,l?.formatters]),m=(0,h.useMemo)(()=>({...function({formats:e,getMessageFallback:t,messages:r,onError:i,...n}){return{...n,formats:e||void 0,messages:r||void 0,onError:i||eE,getMessageFallback:t||ef}}({locale:i,formats:void 0===t?l?.formats:t,getMessageFallback:r||l?.getMessageFallback,messages:void 0===n?l?.messages:n,now:s||l?.now,onError:o||l?.onError,timeZone:a||l?.timeZone}),formatters:c,cache:u}),[u,t,c,r,i,n,s,o,l,a]);return(0,eb.jsx)(eT.Provider,{value:m,children:e})},"useFormatter",0,function(){let{formats:e,formatters:t,locale:r,now:i,onError:n,timeZone:s}=eH();return(0,h.useMemo)(()=>(function(e){let{_cache:t=b(),_formatters:r=B(t),formats:i,locale:n,onError:s=eE,timeZone:o}=e;function h(e){return e?.timeZone||(o?e={...e,timeZone:o}:s(new p(g.ENVIRONMENT_FALLBACK,void 0))),e}function a(e,t,r,i,n){let o;try{o=function(e,t,r){let i;if("string"==typeof t){if(!(i=e?.[t])){let e=new p(g.MISSING_FORMAT,void 0);throw s(e),e}}else i=t;return r&&(i={...i,...r}),i}(r,e,t)}catch{return n()}try{return i(o)}catch(e){return s(new p(g.FORMATTING_ERROR,e.message)),n()}}function l(e,t,s){return a(t,s,i?.dateTime,t=>(t=h(t),r.getDateTimeFormat(n,t).format(e)),()=>String(e))}function u(){return e.now?e.now:(s(new p(g.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:l,number:function(e,t,s){return a(t,s,i?.number,t=>r.getNumberFormat(n,t).format(e),()=>String(e))},relativeTime:function(e,t){try{var i;let s,o,h,a={};t instanceof Date||"number"==typeof t?s=new Date(t):t&&(s=null!=t.now?new Date(t.now):u(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),s||(s=u());let l=(new Date(e).getTime()-s.getTime())/1e3;o||(o=(h=Math.abs(l))<60?"second":h<3600?"minute":h<86400?"hour":h<604800?"day":h<2628e3?"week":h<31536e3?"month":"year"),a.numeric="second"===o?"auto":"always";let c=(i=o,Math.round(l/eg[i]));return r.getRelativeTimeFormat(n,a).format(c,o)}catch(t){return s(new p(g.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,s){let o=[],h=new Map,l=0;for(let t of e){let e;"object"==typeof t?(e=String(l),h.set(e,t)):e=String(t),o.push(e),l++}return a(t,s,i?.list,e=>{let t=r.getListFormat(n,e).formatToParts(o).map(e=>"literal"===e.type?e.value:h.get(e.value)||e.value);return h.size>0?t:t.join("")},()=>String(e))},dateTimeRange:function(e,t,s,o){return a(s,o,i?.dateTime,i=>(i=h(i),r.getDateTimeFormat(n,i).formatRange(e,t)),()=>[l(e),l(t)].join(" – "))},displayName:function(e,t,s){return a(t,s,i?.displayName,t=>r.getDisplayNames(n,t).of(e),()=>e)}}})({formats:e,locale:r,now:i,onError:n,timeZone:s,_formatters:t}),[e,t,i,r,n,s])},"useTranslations",0,function(e){return function(e,t){let{cache:r,formats:i,formatters:n,getMessageFallback:s,locale:o,onError:a,timeZone:l}=eH(),u=e["!"],c="!"===t?void 0:t.slice(2);return l||eB||!ed||(eB=!0,a(new p(g.ENVIRONMENT_FALLBACK,void 0))),(0,h.useMemo)(()=>{var e;let t;return t=function(e,t,r){try{if(!t)throw Error(void 0);let i=r?ep(e,t,r):t;if(!i)throw Error(r);return i}catch(e){return new p(g.MISSING_MESSAGE,e.message)}}((e={cache:r,formatters:n,getMessageFallback:s,messages:u,namespace:c,onError:a,formats:i,locale:o,timeZone:l}).locale,e.messages,e.namespace),function({cache:e,formats:t,formatters:r,getMessageFallback:i=ef,locale:n,messagesOrError:s,namespace:o,onError:a,timeZone:l}){let u=s instanceof p;function c(e,t,r,n){let s=new p(t,r);return a(s),n??i({error:s,key:e,namespace:o})}function m(m,f,E,b){let T;if(u){if(!b)return a(s),i({error:s,key:m,namespace:o});T=b}else try{T=ep(n,s,m,o)}catch(e){if(!b)return c(m,g.MISSING_MESSAGE,e.message,b);T=b}try{let i,s=em(o,m);return ec(s,T,f?(i={},Object.keys(f).forEach(e=>{let t,r=0,n=f[e];t="function"==typeof n?t=>{let i=n(t);return(0,h.isValidElement)(i)?(0,h.cloneElement)(i,{key:e+r++}):i}:n,i[e]=t}),i):f,{cache:e,formatters:r,globalFormats:t,formats:E,locale:n,timeZone:l})}catch(r){let e,t;return r instanceof p?(e=r.code,t=r.originalMessage):(e=g.FORMATTING_ERROR,t=r.message),c(m,e,t,b)}}function f(e,t,r,i){let n=m(e,t,r,i);return"string"!=typeof n?c(e,g.INVALID_MESSAGE,void 0):n}return f.rich=m,f.markup=(e,t,r,i)=>m(e,t,r,i),f.raw=e=>{if(u)return a(s),i({error:s,key:e,namespace:o});try{return ep(n,s,e,o)}catch(t){return c(e,g.MISSING_MESSAGE,t.message)}},f.has=e=>{if(u)return!1;try{return ep(n,s,e,o),!0}catch{return!1}},f}({...e,messagesOrError:t})},[r,n,s,u,c,a,i,o,l])}({"!":eH().messages},e?`!.${e}`:"!")}],167559)}]);
|
|
@@ -2,11 +2,11 @@ __turbopack_load_page_chunks__("/tools-required", [
|
|
|
2
2
|
"static/chunks/0_7~rgbkmfo_p.js",
|
|
3
3
|
"static/chunks/15aj3kd.p7zw6.js",
|
|
4
4
|
"static/chunks/094_-.5.ue3p4.js",
|
|
5
|
-
"static/chunks/
|
|
6
|
-
"static/chunks/
|
|
5
|
+
"static/chunks/0984g4~der6-4.js",
|
|
6
|
+
"static/chunks/0n7jmg60eqx1a.js",
|
|
7
7
|
"static/chunks/0f73mm-~6n8dq.js",
|
|
8
|
-
"static/chunks/
|
|
8
|
+
"static/chunks/0wu-q.gmu-64d.js",
|
|
9
9
|
"static/chunks/0dwxj97xm70gv.js",
|
|
10
10
|
"static/chunks/0zkmymf6bhpsj.js",
|
|
11
|
-
"static/chunks/turbopack-
|
|
11
|
+
"static/chunks/turbopack-0heaqdupr4xj6.js"
|
|
12
12
|
])
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
__turbopack_load_page_chunks__("/reports", [
|
|
2
2
|
"static/chunks/0-0~b1fbfsoe~.js",
|
|
3
3
|
"static/chunks/0do_uad33n8hv.js",
|
|
4
|
-
"static/chunks/
|
|
4
|
+
"static/chunks/0xfp8sfehtui9.js",
|
|
5
5
|
"static/chunks/0pojknlc_-2a2.js",
|
|
6
6
|
"static/chunks/0.p~i94j58w8~.js",
|
|
7
|
-
"static/chunks/
|
|
8
|
-
"static/chunks/
|
|
7
|
+
"static/chunks/0984g4~der6-4.js",
|
|
8
|
+
"static/chunks/0wu-q.gmu-64d.js",
|
|
9
9
|
"static/chunks/0lrjdru2bjp.x.js",
|
|
10
10
|
"static/chunks/14kx686__yikg.js",
|
|
11
11
|
"static/chunks/15aj3kd.p7zw6.js",
|
|
@@ -14,12 +14,12 @@ __turbopack_load_page_chunks__("/reports", [
|
|
|
14
14
|
"static/chunks/0szl_dovu0hgw.js",
|
|
15
15
|
"static/chunks/031unywm42_xs.js",
|
|
16
16
|
"static/chunks/051z~faikiw.t.js",
|
|
17
|
-
"static/chunks/
|
|
17
|
+
"static/chunks/0euxle0n3zjm3.js",
|
|
18
18
|
"static/chunks/0ddh4qmi2awdq.js",
|
|
19
19
|
"static/chunks/0t5w4x7owhfbe.js",
|
|
20
20
|
"static/chunks/0-wv6sqgkc5wn.js",
|
|
21
21
|
"static/chunks/04kxxll_g8~ja.js",
|
|
22
22
|
"static/chunks/0o24wzcc3lhqj.js",
|
|
23
|
-
"static/chunks/
|
|
24
|
-
"static/chunks/turbopack-
|
|
23
|
+
"static/chunks/0n7jmg60eqx1a.js",
|
|
24
|
+
"static/chunks/turbopack-0jcfxeuy1ge85.js"
|
|
25
25
|
])
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
__turbopack_load_page_chunks__("/reset", [
|
|
2
|
+
"static/chunks/0hrsfwzxhrdg9.js",
|
|
3
|
+
"static/chunks/15aj3kd.p7zw6.js",
|
|
4
|
+
"static/chunks/0wu-q.gmu-64d.js",
|
|
5
|
+
"static/chunks/0n7jmg60eqx1a.js",
|
|
6
|
+
"static/chunks/0984g4~der6-4.js",
|
|
7
|
+
"static/chunks/turbopack-0g2bivvnd2gyd.js"
|
|
8
|
+
])
|